Solved

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

Posted on 2011-09-27
2
415 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to reference a column by name when iterating through a GridView ? 1 50
ASP.NET data base connection 35 95
async questions 5 49
How do I "share" on social sites? 2 39
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

751 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