Solved

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

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

Independent Software Vendors: 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

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

624 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