Solved

How to convert this c# class to work with Phone 7

Posted on 2011-09-27
2
411 Views
Last Modified: 2012-06-27
The below class contains serializationinfo in it's class definition which does not appear to be supported in Phone 7 development.  What would be an appropriate substitute?

Thanks for your help

Daniel

    [Serializable()]
    class SubDocumentData : ISerializable
    {
        private int _DocumentFileID = 0;
        public int DocumentFileID
        {
            get { return _DocumentFileID; }
            set { _DocumentFileID = value; }
        }

        private string _FileType = string.Empty;
        public string FileType
        {
            get { return _FileType; }
            set { _FileType = value; }
        }

        private int _FileSize = 0;
        public int FileSize
        {
            get { return _FileSize; }
            set { _FileSize = value; }
        }

        private int _DocumentID = 0;
        public int DocumentID
        {
            get { return _DocumentID; }
            set { _DocumentID = value; }
        }

        private DateTime _FileCreatedDate = DateTime.MinValue;
        public DateTime FileCreatedDate
        {
            get { return _FileCreatedDate; }
            set { _FileCreatedDate = value; }
        }

        private string _FileCaption = string.Empty;
        public string FileCaption
        {
            get { return _FileCaption; }
            set { _FileCaption = value; }
        }

        private string _SendFile = string.Empty;
        public string SendFile
        {
            get { return _SendFile; }
            set { _SendFile = value; }
        }

        private byte[] _DocumentImage = null;
        public byte[] DocumentImage
        {
            get { return _DocumentImage; }
            set { _DocumentImage = value; }
        }

        private int _DocumentSizeOnDisk = 0;
        public int DocumentSizeOnDisk
        {
            get { return _DocumentSizeOnDisk; }
            set { _DocumentSizeOnDisk = value; }
        }

        public SubDocumentData()
        {
        }

        public SubDocumentData([b]SerializationInfo[/b] info, StreamingContext ctxt)
        {
            this._DocumentFileID = (int)info.GetValue("DocumentFileID", typeof(int));
            this._FileType = (string)info.GetValue("FileType", typeof(string));
            this._FileSize = (int)info.GetValue("FileSize", typeof(int));
            this._DocumentID = (int)info.GetValue("DocumentID", typeof(int));
            this._FileCreatedDate = (DateTime)info.GetValue("FileCreatedDate", typeof(DateTime));
            this._FileCaption = (string)info.GetValue("FileCaption", typeof(string));
            this._SendFile = (string)info.GetValue("SendFile", typeof(string));
            this._DocumentImage = (byte[])info.GetValue("DocumentImage", typeof(byte[]));
            this._DocumentSizeOnDisk = (int)info.GetValue("DocumentSizeOnDisk", typeof(int));
        }

    
    }
}

Open in new window

0
Comment
Question by:DanielManchester
2 Comments
 
LVL 27

Expert Comment

by:MikeToole
ID: 36716211
0
 
LVL 18

Accepted Solution

by:
dj_alik earned 500 total points
ID: 36716418
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question