Solved

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

Posted on 2011-09-27
2
408 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

706 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now