Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-09-27
2
Medium Priority
?
418 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 2000 total points
ID: 36716418
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

660 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