Beispiel #1
0
 private VideoFile(SerializationInfo info, DeserializeInfo di)
     : this(di.Server, di.Info, di.Type)
 {
     actors = info.GetValue("a", typeof(string[])) as string[];
       description = info.GetString("de");
       director = info.GetString("di");
       genre = info.GetString("g");
       title = info.GetString("t");
       try {
     width = info.GetInt32("w");
     height = info.GetInt32("h");
       }
       catch (Exception) {
       }
       var ts = info.GetInt64("du");
       if (ts > 0) {
     duration = new TimeSpan(ts);
       }
       try {
     bookmark = info.GetInt64("b");
       }
       catch (Exception) {
     bookmark = 0;
       }
       try {
     subTitle = info.GetValue("st", typeof(Subtitle)) as Subtitle;
       }
       catch (Exception) {
     subTitle = null;
       }
       initialized = true;
 }
 protected ParameterBindingException(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     this.parameterName = string.Empty;
     this.line = -9223372036854775808L;
     this.offset = -9223372036854775808L;
     this.args = new object[0];
     this.message = info.GetString("ParameterBindingException_Message");
     this.parameterName = info.GetString("ParameterName");
     this.line = info.GetInt64("Line");
     this.offset = info.GetInt64("Offset");
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="TransferProgressTracker"/> class.
        /// </summary>
        /// <param name="info">Serialization information.</param>
        /// <param name="context">Streaming context.</param>
        protected TransferProgressTracker(SerializationInfo info, StreamingContext context)
        {
            if (info == null)
            {
                throw new System.ArgumentNullException("info");
            }

            this.bytesTransferred = info.GetInt64(BytesTransferredName);
            this.numberOfFilesTransferred = info.GetInt64(FilesTransferredName);
            this.numberOfFilesSkipped = info.GetInt64(FilesSkippedName);
            this.numberOfFilesFailed = info.GetInt64(FilesFailedName);
        }
Beispiel #4
0
 //
 protected StoreWorldDetail(SerializationInfo info, StreamingContext context)
 {
     _storeid = info.GetInt64("sid");
     _storeworldid = info.GetInt64 ("swid");
     _year = info.GetInt16("y");
     _available_work_time_hours = (decimal?)info.GetValue("_1", typeof(decimal?));
     _available_buffer_hours = (double?)info.GetValue("_2", typeof(double?));
     _business_volume_hours = (decimal?)info.GetValue("_3", typeof(decimal?));
     _targetedbusinessvolume = (decimal?)info.GetValue("_4", typeof(decimal?));
     _netbusinessvolume1 = (decimal?)info.GetValue("_5", typeof(decimal?));
     _netbusinessvolume2 = (decimal?)info.GetValue("_6", typeof(decimal?));
     _benchmark_perfomance = (double?)info.GetValue("_7", typeof(double?));
 }
		public WindowInfo( SerializationInfo info, StreamingContext context )
		{
			long pointer = info.GetInt64( "Handle" );

			// The pointer is serialized as a 64 bit integer, but the system might be 32 bit.
			Handle = IntPtr.Size == 8 ? new IntPtr( pointer ) : new IntPtr( (int)pointer );
		}
 protected FileWebResponse(SerializationInfo serializationInfo, StreamingContext streamingContext) : base(serializationInfo, streamingContext)
 {
     this.m_headers = (WebHeaderCollection) serializationInfo.GetValue("headers", typeof(WebHeaderCollection));
     this.m_uri = (Uri) serializationInfo.GetValue("uri", typeof(Uri));
     this.m_contentLength = serializationInfo.GetInt64("contentLength");
     this.m_fileAccess = (FileAccess) serializationInfo.GetInt32("fileAccess");
 }
        /// <summary>
        /// Deserialization constructor.
        /// </summary>
        public NewsManager(SerializationInfo info, StreamingContext context)
        {
            _updateTimer.Interval = info.GetInt64("timerInterval");
            _updateTimer.Enabled = info.GetBoolean("timerEnabled");

            _updateTimer.Elapsed += new ElapsedEventHandler(_updateTimer_Elapsed);
        }
Beispiel #8
0
 private DeleteStatement(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     TableName = (ObjectName) info.GetValue("TableName", typeof (ObjectName));
     WhereExpression = (SqlExpression) info.GetValue("Where", typeof (SqlExpression));
     Limit = info.GetInt64("Limit");
 }
Beispiel #9
0
 protected NetworkEnvelope(SerializationInfo info, StreamingContext context)
 {
     DispatchId = info.GetInt32(NetworkEnvelopeMetadataKeys.DispatchId);
     IssueDate = new DateTime(info.GetInt64(NetworkEnvelopeMetadataKeys.IssueDate));
     Error = (ServerError) info.GetValue("Error", typeof (ServerError));
     Message = (IMessage) info.GetValue("Message", typeof (IMessage));
 }
Beispiel #10
0
 protected EmployeeDayTimeResult(SerializationInfo info, StreamingContext context)
 {
     _contractBegin = info.GetDateTime("cb");
     _contractEnd = info.GetDateTime("ce");
     _coefficient = info.GetDecimal("dt");
     _employeeID = info.GetInt64("em");
 }
Beispiel #11
0
 protected HttpWebResponse(SerializationInfo serializationInfo, StreamingContext streamingContext) : base(serializationInfo, streamingContext)
 {
     _webHeaderCollection = (WebHeaderCollection)serializationInfo.GetValue("_HttpResponseHeaders", typeof(WebHeaderCollection));
     _requestUri = (Uri)serializationInfo.GetValue("_Uri", typeof(Uri));
     Version version = (Version)serializationInfo.GetValue("_Version", typeof(Version));
     _isVersionHttp11 = version.Equals(HttpVersion.Version11);            
     ContentLength = serializationInfo.GetInt64("_ContentLength");                        
 }
        protected UnsupportedBencodeException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            if (info == null)
                return;

            StreamPosition = info.GetInt64("StreamPosition");
        }
Beispiel #13
0
 /// <summary>
 /// Creates a new <see cref="ConnectionParameters"/> from serialization parameters.
 /// </summary>
 /// <param name="info">The <see cref="SerializationInfo"/> with populated with data.</param>
 /// <param name="context">The source <see cref="StreamingContext"/> for this deserialization.</param>
 protected ConnectionParameters(SerializationInfo info, StreamingContext context)
 {
     // Deserialize connection parameters
     m_timeOffset = info.GetInt64("timeOffset");
     m_frameRate = info.GetUInt16("frameRate");
     m_nominalFrequency = (LineFrequency)info.GetValue("nominalFrequency", typeof(LineFrequency));
     m_stationName = info.GetString("stationName");
 }
        protected RateLimit(SerializationInfo info, StreamingContext context)
        {
            Ensure.ArgumentNotNull(info, "info");

            Limit = info.GetInt32("Limit");
            Remaining = info.GetInt32("Remaining");
            ResetAsUtcEpochSeconds = info.GetInt64("ResetAsUtcEpochSeconds");
        }
Beispiel #15
0
        protected RateLimit(SerializationInfo info, StreamingContext context)
        {
            Ensure.ArgumentNotNull(info, "info");

            Limit = info.GetInt32("Limit");
            Remaining = info.GetInt32("Remaining");
            Reset = new DateTimeOffset(info.GetInt64("Reset"), TimeSpan.Zero);
        }
		//Creates a new element from the supplied XML.
		protected internal Animation(SerializationInfo info, StreamingContext context)
		{
			mTotalFrames = info.GetInt32("TotalFrames");
			mCurrentFrame = info.GetInt32("CurrentFrame");
			mFramesPerSecond = info.GetSingle("FramesPerSecond");
			mNextTick = info.GetInt64("NextTick");
			mEnabled = info.GetBoolean("Enabled");
		}
		private IntPtr(SerializationInfo info, StreamingContext context)
		{
			long @int = info.GetInt64("value");
			if (IntPtr.Size == 4 && (@int > 2147483647L || @int < -2147483648L))
			{
				throw new ArgumentException(Environment.GetResourceString("Serialization_InvalidPtrValue"));
			}
			this.m_value = @int;
		}
Beispiel #18
0
 /// <summary>
 /// Creates a new <see cref="ConfigurationCell"/> from serialization parameters.
 /// </summary>
 /// <param name="info">The <see cref="SerializationInfo"/> with populated with data.</param>
 /// <param name="context">The source <see cref="StreamingContext"/> for this deserialization.</param>
 protected ConfigurationCell(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     // Deserialize configuration cell
     m_timeOffset = info.GetInt64("timeOffset");
     m_longitude = info.GetDouble("longitude");
     m_latitude = info.GetDouble("latitude");
     m_numberOfSatellites = info.GetInt32("numberOfSatellites");
 }
Beispiel #19
0
 protected Face(SerializationInfo info, StreamingContext context)
 {
     ID = info.GetInt64("ID");
     Colour = Color.FromArgb(info.GetInt32("Colour"));
     Plane = (Plane) info.GetValue("Plane", typeof (Plane));
     Texture = (TextureReference) info.GetValue("Texture", typeof (TextureReference));
     Vertices = ((Vertex[]) info.GetValue("Vertices", typeof (Vertex[]))).ToList();
     Vertices.ForEach(x => x.Parent = this);
 }
Beispiel #20
0
 private unsafe IntPtr(SerializationInfo info, StreamingContext context)
 {
     long num = info.GetInt64("value");
     if ((Size == 4) && ((num > 0x7fffffffL) || (num < -2147483648L)))
     {
         throw new ArgumentException(Environment.GetResourceString("Serialization_InvalidPtrValue"));
     }
     this.m_value = (void*) num;
 }
Beispiel #21
0
        [System.Security.SecurityCritical]  // auto-generated
        private unsafe IntPtr(SerializationInfo info, StreamingContext context) {
            long l = info.GetInt64("value");

            if (Size==4 && (l>Int32.MaxValue || l<Int32.MinValue)) {
                throw new ArgumentException(Environment.GetResourceString("Serialization_InvalidPtrValue"));
            }

            m_value = (void *)l;
        }
        protected MalformedCsvException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            _message = info.GetString("MyMessage");

            _rawData = info.GetString("RawData");
            _currentPosition = info.GetInt32("CurrentPosition");
            _currentRecordIndex = info.GetInt64("CurrentRecordIndex");
            _currentFieldIndex = info.GetInt32("CurrentFieldIndex");
        }
Beispiel #23
0
 protected Simulation(SerializationInfo info, StreamingContext context)
 {
     _EntityID = info.GetInt64("EntityID");
     for (Int32 i = 0; i < info.GetInt32("EntityCount"); ++i)
     {
         string EntityName = "Entity[" + i.ToString() + "]";
         // _entities is a polymorphic collection, so need to read the run-time type of each element
         Add(EntityFactory.GetEntity(info.GetString(EntityName + ".Type"), info, context));
     }
 }
Beispiel #24
0
 protected JournalEntry(SerializationInfo info, StreamingContext context)
 {
     Created = info.GetDateTime("Created");
     if (!_unsignedIdsInJournal.HasValue)
     {
         try
         {
             Id = info.GetUInt64("Id");
             _unsignedIdsInJournal = true;
         }
         catch (Exception)
         {
             Id = (ulong) info.GetInt64("Id");
             _unsignedIdsInJournal = false;
         }
     }
     else if (_unsignedIdsInJournal.Value) Id = info.GetUInt64("Id");
     else Id = (ulong) info.GetInt64("Id");
 }
Beispiel #25
0
 protected FileWebRequest(SerializationInfo serializationInfo, StreamingContext streamingContext):base(serializationInfo, streamingContext) {
     m_headers               = (WebHeaderCollection)serializationInfo.GetValue("headers", typeof(WebHeaderCollection));
     m_proxy                 = (IWebProxy)serializationInfo.GetValue("proxy", typeof(IWebProxy));
     m_uri                   = (Uri)serializationInfo.GetValue("uri", typeof(Uri));
     m_connectionGroupName   = serializationInfo.GetString("connectionGroupName");
     m_method                = serializationInfo.GetString("method");
     m_contentLength         = serializationInfo.GetInt64("contentLength");
     m_timeout               = serializationInfo.GetInt32("timeout");
     m_fileAccess            = (FileAccess )serializationInfo.GetInt32("fileAccess");
 }
 protected HttpWebResponse(SerializationInfo serializationInfo, StreamingContext streamingContext) : base(serializationInfo, streamingContext)
 {
     this.m_HttpResponseHeaders = (WebHeaderCollection) serializationInfo.GetValue("m_HttpResponseHeaders", typeof(WebHeaderCollection));
     this.m_Uri = (Uri) serializationInfo.GetValue("m_Uri", typeof(Uri));
     this.m_Certificate = (X509Certificate) serializationInfo.GetValue("m_Certificate", typeof(X509Certificate));
     this.m_IsVersionHttp11 = ((Version) serializationInfo.GetValue("m_Version", typeof(Version))).Equals(HttpVersion.Version11);
     this.m_StatusCode = (HttpStatusCode) serializationInfo.GetInt32("m_StatusCode");
     this.m_ContentLength = serializationInfo.GetInt64("m_ContentLength");
     this.m_Verb = KnownHttpVerb.Parse(serializationInfo.GetString("m_Verb"));
     this.m_StatusDescription = serializationInfo.GetString("m_StatusDescription");
     this.m_MediaType = serializationInfo.GetString("m_MediaType");
 }
        Object ISerializationSurrogate.SetObjectData(Object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
        {
            ImageFrame _imageFrame = (ImageFrame)obj;
            _imageFrame.FrameNumber = info.GetInt32("FrameNumber");
            _imageFrame.Image = (PlanarImage)info.GetValue("Image", typeof(PlanarImage));
            _imageFrame.Resolution = (ImageResolution)info.GetValue("Resolution", typeof(ImageResolution));
            _imageFrame.Timestamp = info.GetInt64("Timestamp");
            _imageFrame.Type = (ImageType)info.GetValue("Type", typeof(ImageType));
            _imageFrame.ViewArea = (ImageViewArea)info.GetValue("ViewArea", typeof(ImageViewArea));

            return _imageFrame;
        }
Beispiel #28
0
        protected MapObject(SerializationInfo info, StreamingContext context)
        {
            ID = info.GetInt64("ID");
            ClassName = info.GetString("ClassName");
            Visgroups = info.GetString("Visgroups").Split(',').Select(x => int.Parse(x, CultureInfo.InvariantCulture)).ToList();
            AutoVisgroups = info.GetString("AutoVisgroups").Split(',').Select(x => int.Parse(x, CultureInfo.InvariantCulture)).ToList();
            Colour = Color.FromArgb(info.GetInt32("Colour"));

            var children = (MapObject[]) info.GetValue("Children", typeof (MapObject[]));
            foreach (var child in children)
            {
                child.SetParent(this);
            }
        }
        private WorkspaceUnitData(SerializationInfo info, StreamingContext context)
        {
            long ver = info.GetInt64("Version");

            if (ver == CurrentVersion)
            {
                ReadCurrentVersion(info);
            }
            else if (ver == 1)
            {
                ReadVersion1(info);
            }
            else
            {
                throw new InvalidOperationException();
            }
        }
Beispiel #30
0
 private AudioFile(SerializationInfo info, DeserializeInfo di)
     : this(di.Server, di.Info, di.Type)
 {
     album = info.GetString("al");
       artist = info.GetString("ar");
       genre = info.GetString("g");
       performer = info.GetString("p");
       title = info.GetString("ti");
       try {
     track = info.GetInt32("tr");
       }
       catch (Exception) {
     // no op
       }
       var ts = info.GetInt64("d");
       if (ts > 0) {
     duration = new TimeSpan(ts);
       }
       initialized = true;
 }