Пример #1
1
        public Tile(SerializationInfo info, StreamingContext ctx)
            : base(info, ctx)
        {
            m_strName = null;
            try {
                m_strName = info.GetString("Name");
            } catch {
                m_strName = info.GetInt32("Cookie").ToString();
            }

            m_afVisible = (bool[,])info.GetValue("Visibility", typeof(bool[,]));

            try {
                m_afOccupancy = (bool[,])info.GetValue("Occupancy", typeof(bool[,]));
            } catch {
                TemplateDoc tmpd = (TemplateDoc)DocManager.GetActiveDocument(typeof(TemplateDoc));
                Template tmpl = tmpd.FindTemplate(m_strName);
                if (tmpl != null) {
                    m_afOccupancy = tmpl.OccupancyMap;
                } else {
                    m_afOccupancy = new bool[1, 1];
                }
            }

            InitCommon();
        }
Пример #2
1
 public void GetObjectData(SerializationInfo info, StreamingContext ctxt)
 {
     info.AddValue("Uid", this.Uid);
     info.AddValue("Name", this.Name);
     info.AddValue("Products", this.Products);
     info.AddValue("Orders", this.Orders);
 }
Пример #3
1
 //deserialize method
 public UserClient(SerializationInfo info, StreamingContext ctxt)
 {
     username = (string)info.GetValue("username", typeof(string));
     password = (string)info.GetValue("password", typeof(string));
     try
     {
         isOnline = (bool)info.GetValue("isOnline", typeof(bool));
     }
     catch(Exception e )
     {
         isOnline = false;
     }
     try {
         physician = (string)info.GetValue("physician", typeof(string));
     }
     catch(Exception e)
     {
         physician = "jaap";
     }
     try {
         sessions = (List<Session>)info.GetValue("sessions", typeof(List<Session>));
     }
     catch(Exception e)
     {
        sessions = new List<Session>();
     }
     try
     {
         tests = (List<Session>)info.GetValue("tests", typeof(List<Session>));
     }
     catch(Exception e) {
         tests = new List<Session>();
     }
 }
Пример #4
1
		public override void GetObjectData (SerializationInfo info, StreamingContext context)
		{
			if (info == null)
				throw new ArgumentNullException ("info");

			base.GetObjectData (info, context);
		}
Пример #5
1
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            base.GetObjectData(info, context);

            info.AddValue("DataServiceException.FaultMessage", Fault.Message);
            info.AddValue("DataServiceException.FaultMessage", Fault.Detail);
        }
 /// <summary>
 ///     Initializes a new, empty instance of the <see cref="T:System.Collections.Hashtable"></see> class that is
 ///     serializable using the specified <see cref="T:System.Runtime.Serialization.SerializationInfo"></see> and
 ///     <see cref="T:System.Runtime.Serialization.StreamingContext"></see> objects.
 /// </summary>
 /// <param name="context">
 ///     A <see cref="T:System.Runtime.Serialization.StreamingContext"></see> object containing the source
 ///     and destination of the serialized stream associated with the <see cref="T:System.Collections.Hashtable"></see>.
 /// </param>
 /// <param name="info">
 ///     A <see cref="T:System.Runtime.Serialization.SerializationInfo"></see> object containing the
 ///     information required to serialize the <see cref="T:System.Collections.Hashtable"></see> object.
 /// </param>
 /// <exception cref="T:System.ArgumentNullException">info is null. </exception>
 protected CaseInsensitiveHashtable(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     var cultureName = info.GetString("_cultureName");
     _culture = new CultureInfo(cultureName);
     AssertUtils.ArgumentNotNull(_culture, "Culture");
 }
 private UnresolvableObjectException(
     SerializationInfo info,
     StreamingContext context)
     : base(info, context)
 {
     ObjectName = info.GetString("ObjectName");
 }
Пример #8
1
 public void GetObjectData(SerializationInfo info, StreamingContext context)
 {
     info.AddValue(nameof(Name), Name);
     info.AddValue(nameof(ProviderName), ProviderName);
     info.AddValue(nameof(ProviderParameters), ProviderParameters);
     info.AddValue(nameof(VaultParameters), VaultParameters);
 }
Пример #9
1
 public void GetObjectData(object obj, SerializationInfo info, StreamingContext context) {
     var color = (Color)obj;
     info.AddValue("r", color.r);
     info.AddValue("g", color.g);
     info.AddValue("b", color.b);
     info.AddValue("a", color.a);
 }
Пример #10
1
 protected ClaimsPrincipal(SerializationInfo info, StreamingContext context)
 {
     if (null == info)
     {
         throw new ArgumentNullException(nameof(info));
     }
 }
        protected UpdateException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            this.Errors = (IList<UpdateError>)info.GetValue(ERRORSKEY, typeof(IList<UpdateError>));

            this.ErrorDetail = info.GetString(ERRORDETAILKEY);
        }
Пример #12
1
 protected DatasetPatrols(SerializationInfo info, StreamingContext context) {
     string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
     if ((strSchema != null)) {
         DataSet ds = new DataSet();
         ds.ReadXmlSchema(new XmlTextReader(new System.IO.StringReader(strSchema)));
         if ((ds.Tables["Patrols"] != null)) {
             this.Tables.Add(new PatrolsDataTable(ds.Tables["Patrols"]));
         }
         this.DataSetName = ds.DataSetName;
         this.Prefix = ds.Prefix;
         this.Namespace = ds.Namespace;
         this.Locale = ds.Locale;
         this.CaseSensitive = ds.CaseSensitive;
         this.EnforceConstraints = ds.EnforceConstraints;
         this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
         this.InitVars();
     }
     else {
         this.InitClass();
     }
     this.GetSerializationData(info, context);
     System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
     this.Tables.CollectionChanged += schemaChangedHandler;
     this.Relations.CollectionChanged += schemaChangedHandler;
 }
 protected TimeOfDayChangedAction(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     v3dLayer = EditorManager.Project.Scene.MainLayer as V3DLayer;
       oldConfig = (TimeOfDay)info.GetValue("oldConfig", typeof(TimeOfDay));
       newConfig = (TimeOfDay)info.GetValue("newConfig", typeof(TimeOfDay));
 }
        public object Restore()
        {
            var type = Type.GetType(assemblyQualifiedName);

            var ctor = type.GetConstructor(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance, null, new [] {
                typeof(SerializationInfo),
                typeof(StreamingContext)
            }, null);

            var serializationInfo = new SerializationInfo(type, new FormatterConverter());
            serializationInfo.SetType(type);
            for(var i = 0; i < keys.Length; i++)
            {
                serializationInfo.AddValue(keys[i], values[i]);
            }
            var streamingContext = new StreamingContext(StreamingContextStates.Clone);
            var result = ctor.Invoke(new object[] { serializationInfo, streamingContext });
            var onDeserialization = result as IDeserializationCallback;
            if(onDeserialization != null)
            {
                onDeserialization.OnDeserialization(this);
            }

            return result;
        }
Пример #15
1
        /// <exclude/>
        public Lookup(SerializationInfo serializationInfo, StreamingContext streamingContext)
        {
            int version = 0;

            if (SerializationVersionExists)
            {
                try
                {
                    version = serializationInfo.GetInt32("SerializationVersion");
                }
                catch (SerializationException)
                {
                    // ignore
                    SerializationVersionExists = false;
                }
            }
            _alias = serializationInfo.GetString("Alias");
            _aliasPlural = serializationInfo.GetString("AliasPlural");
            _enabled = serializationInfo.GetBoolean("Enabled");
            _isUserDefined = serializationInfo.GetBoolean("IsUserDefined");
            _name = serializationInfo.GetString("Name");
            _userOptions = (List<IUserOption>)serializationInfo.GetValue("UserOptions", ModelTypes.UserOptionList);
            _description = serializationInfo.GetString("Description");
            _backingObject = (ScriptObject)serializationInfo.GetValue("BackingObject", ModelTypes.ScriptObject);
            _idColumn = (Column)serializationInfo.GetValue("IdColumn", ModelTypes.Column);
            _nameColumn = (Column)serializationInfo.GetValue("NameColumn", ModelTypes.Column);
            _LookupValues = (List<LookupValue>)serializationInfo.GetValue("LookupValues", ModelTypes.LookupValueList);
        }
Пример #16
1
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            info.AddValue("ClipboardOwnerProcessName", processName);
            info.AddValue("ClipboardOwnerProcessId", processId);

            base.GetObjectData(info, context);
        }
Пример #17
1
 protected DocumentException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     Line = info.GetInt32(nameof(Line));
     Column = info.GetInt32(nameof(Column));
     File = info.GetString(nameof(File));
 }
Пример #18
1
 private Spheroid(SerializationInfo info, StreamingContext context)
 {
     this.Axis = info.GetDouble("Axis");
     this.Flatten = info.GetDouble("Flatten");
     this.Name = info.GetString("Name");
     this.Type = (SpheroidType)info.GetValue("Type", typeof(SpheroidType));
 }
Пример #19
1
 void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
 {
     info.AddValue("Axis", this.Axis);
     info.AddValue("Flatten", this.Flatten);
     info.AddValue("Name", this.Name);
     info.AddValue("Type", this.Type);
 }
 /// <summary>
 /// Required constructor for deserialization.
 /// </summary>
 protected SolutionFolderWSPReference(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     if (this.AssetName == "PageLayout")
       {
       }
 }
		protected ProxyObjectReference(SerializationInfo info, StreamingContext context)
		{
			// Deserialize the base type using its assembly qualified name
			string qualifiedName = info.GetString("__baseType");
			_baseType = System.Type.GetType(qualifiedName, true, false);

			// Rebuild the list of interfaces
			var interfaceList = new List<System.Type>();
			int interfaceCount = info.GetInt32("__baseInterfaceCount");
			for (int i = 0; i < interfaceCount; i++)
			{
				string keyName = string.Format("__baseInterface{0}", i);
				string currentQualifiedName = info.GetString(keyName);
				System.Type interfaceType = System.Type.GetType(currentQualifiedName, true, false);

				interfaceList.Add(interfaceType);
			}

			// Reconstruct the proxy
			var factory = new ProxyFactory();
			System.Type proxyType = factory.CreateProxyType(_baseType, interfaceList.ToArray());

			// Initialize the proxy with the deserialized data
			var args = new object[] {info, context};
			_proxy = (IProxy) Activator.CreateInstance(proxyType, args);
		}
 /// <summary>
 /// Populates a <see cref="T:System.Runtime.Serialization.SerializationInfo"></see> with the data needed to serialize the target object.
 /// </summary>
 /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"></see> to populate with data.</param>
 /// <param name="context">The destination (see <see cref="T:System.Runtime.Serialization.StreamingContext"></see>) for this serialization.</param>
 /// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
 public override void GetObjectData(SerializationInfo info, StreamingContext context)
 {
     if(Tracing.BinarySerializationSwitch.Enabled)
         Trace.WriteLine("Serializing the fields of 'SwitchIconMaterial'.");
     base.GetObjectData(info, context);
     info.AddValue("SwitchType", this.mSwitchType.ToString());
 }
Пример #23
1
 // ISerializable implementation. called during serialization.
 void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
 {
     SerializeEncoder(info);
     info.AddValue("encoding", this.m_encoding);
     info.AddValue("charLeftOver", this.charLeftOver);
     info.SetType(typeof(Encoding.DefaultEncoder));
 }
Пример #24
1
		protected override void Deserialize (SerializationInfo info, StreamingContext context)
		{
			text = (string) info.GetValue ("AssemblyName", typeof (AssemblyName));
			base.Filter = (ICollection)info.GetValue ("Filter", typeof (ICollection));
			base.DisplayName = info.GetString ("DisplayName");
			if (info.GetBoolean ("Locked")) base.Lock ();
		}
Пример #25
1
 // Constructor called by serialization. called during deserialization.
 internal EncoderNLS(SerializationInfo info, StreamingContext context)
 {
     throw new NotSupportedException(
                 String.Format(
                     System.Globalization.CultureInfo.CurrentCulture, 
                     Environment.GetResourceString("NotSupported_TypeCannotDeserialized"), this.GetType()));
 }
Пример #26
1
		public SO_NWS_Highlight(
			SerializationInfo info_in,
			StreamingContext context_in
		) {
			haschanges_ = false;

			idhighlight_ = (long)info_in.GetValue("IDHighlight", typeof(long));
			ifapplication_ 
				= (info_in.GetValue("IFApplication", typeof(int)) == null)
					? 0
					: (int)info_in.GetValue("IFApplication", typeof(int));
			IFApplication_isNull = (bool)info_in.GetValue("IFApplication_isNull", typeof(bool));
			ifhighlight__parent_ 
				= (info_in.GetValue("IFHighlight__parent", typeof(long)) == null)
					? 0L
					: (long)info_in.GetValue("IFHighlight__parent", typeof(long));
			IFHighlight__parent_isNull = (bool)info_in.GetValue("IFHighlight__parent_isNull", typeof(bool));
			name_ = (string)info_in.GetValue("Name", typeof(string));
			ifuser__approved_ 
				= (info_in.GetValue("IFUser__Approved", typeof(long)) == null)
					? 0L
					: (long)info_in.GetValue("IFUser__Approved", typeof(long));
			IFUser__Approved_isNull = (bool)info_in.GetValue("IFUser__Approved_isNull", typeof(bool));
			approved_date_ 
				= (info_in.GetValue("Approved_date", typeof(DateTime)) == null)
					? new DateTime(1900, 1, 1)
					: (DateTime)info_in.GetValue("Approved_date", typeof(DateTime));
			Approved_date_isNull = (bool)info_in.GetValue("Approved_date_isNull", typeof(bool));
		}
Пример #27
1
        protected XmlException(SerializationInfo info, StreamingContext context) : base(info, context) {
            res                 = (string)  info.GetValue("res"  , typeof(string));
            args                = (string[])info.GetValue("args", typeof(string[]));
            lineNumber          = (int)     info.GetValue("lineNumber", typeof(int));
            linePosition        = (int)     info.GetValue("linePosition", typeof(int));

            // deserialize optional members
            sourceUri = string.Empty;
            string version = null;
            foreach ( SerializationEntry e in info ) {
                switch ( e.Name ) {
                    case "sourceUri":
                        sourceUri = (string)e.Value;
                        break;
                    case "version":
                        version = (string)e.Value;
                        break;
                }
            }

            if ( version == null ) {
                // deserializing V1 exception
                message = CreateMessage( res, args, lineNumber, linePosition );
            }
            else {
                // deserializing V2 or higher exception -> exception message is serialized by the base class (Exception._message)
                message = null;
            }
        }
Пример #28
1
        internal SoapFault(SerializationInfo info, StreamingContext context)
        {
            SerializationInfoEnumerator siEnum = info.GetEnumerator();        

            while(siEnum.MoveNext())
            {
                String name = siEnum.Name;
                Object value = siEnum.Value;
                SerTrace.Log(this, "SetObjectData enum ",name," value ",value);
                if (String.Compare(name, "faultCode", true, CultureInfo.InvariantCulture) == 0)
                {
                    int index = ((String)value).IndexOf(':');
                    if (index > -1)
                        faultCode = ((String)value).Substring(++index);
                    else
                        faultCode = (String)value;
                }
                else if (String.Compare(name, "faultString", true, CultureInfo.InvariantCulture) == 0)
                    faultString = (String)value;
                else if (String.Compare(name, "faultActor", true, CultureInfo.InvariantCulture) == 0)
                    faultActor = (String)value;
                else if (String.Compare(name, "detail", true, CultureInfo.InvariantCulture) == 0)
                    detail = value;
            }
        }
Пример #29
1
 public void GetObjectData(SerializationInfo info, StreamingContext context)
 {
     if (info == null)
     {
         throw new ArgumentNullException(nameof(info));
     }
 }
        public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            var binarySerializer = SerializationFactory.GetBinarySerializer();
            var binarySerializationContext = new BinarySerializationContextInfo(info);

            binarySerializer.Serialize(this, binarySerializationContext);
        }
Пример #31
0
        /// <summary>
        /// When overridden in a derived class, sets the <see cref="T:SerializationInfo"/> with information about the exception.
        /// </summary>
        /// <param name="info">The <see cref="T:SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
        /// <param name="context">The <see cref="T:StreamingContext"/> that contains contextual information about the source or destination.</param>
        public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
        {
            base.GetObjectData(info, context);

            info.AddValue("MyMessage", _message);
            info.AddValue("ColumnName", this.ColumnName);
        }
Пример #32
0
 public ColumnExpression(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
 {
     try
     {
         _ColumnName = info.GetString("_ColumnName");
     }
     catch
     {
         _ColumnName = string.Empty;
     }
     try
     {
         _SQLStatement = info.GetString("_SQLStatement");
     }
     catch
     {
         _SQLStatement = string.Empty;
     }
     try
     {
         _IsExpression = info.GetBoolean("_IsExpression");
     }
     catch
     {
         _IsExpression = false;
     }
 }
Пример #33
0
 public ReElement(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
 {
     try
     {
         _Value = info.GetString("_Value");
     }
     catch
     {
         _Value = string.Empty;
     }
     try
     {
         _Frequence = info.GetInt32("_Frequence");
     }
     catch
     {
         _Frequence = 0;
     }
     try
     {
         _FilterType = (Webb.Data.FilterTypes)info.GetValue("_FilterType", typeof(Webb.Data.FilterTypes));
     }
     catch
     {
         _FilterType = FilterTypes.NumGreaterOrEqual;
     }
     try
     {
         _FollowedOperand = (Webb.Data.FilterOperands)info.GetValue("_FollowedOperand", typeof(Webb.Data.FilterOperands));
     }
     catch
     {
         _FollowedOperand = FilterOperands.Or;
     }
 }
Пример #34
0
 //Implement ISerializable
 public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
 {
     info.AddValue("Left", Left);
     info.AddValue("Top", Top);
     info.AddValue("Right", Right);
     info.AddValue("Bottom", Bottom);
 }
Пример #35
0
 protected MyCustomException(
     System.Runtime.Serialization.SerializationInfo info,
     System.Runtime.Serialization.StreamingContext context) : base(info, context)
 {
     Value1 = info.GetInt32("v1");
     Value2 = info.GetString("v2");
 }
Пример #36
0
 public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
 {
     if (info != null)
     {
         info.AddValue("bits", _DaysofWeek);
     }
 }
Пример #37
0
        public HitChartField(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
        {
            try
            {
                name = (string)info.GetValue("name", typeof(string));
            }
            catch
            {
                name = string.Empty;
            }
            try
            {
                text = (string)info.GetValue("text", typeof(string));
            }
            catch
            {
                text = string.Empty;
            }
            try
            {
                position = (System.Drawing.PointF)info.GetValue("position", typeof(System.Drawing.PointF));
            }
            catch
            {
                position = PointF.Empty;
            }
            try
            {
                size = (System.Drawing.SizeF)info.GetValue("size", typeof(System.Drawing.SizeF));
            }
            catch
            {
                size = SizeF.Empty;
            }
            try
            {
                filter = (Webb.Data.DBFilter)info.GetValue("filter", typeof(Webb.Data.DBFilter));

                filter = AdvFilterConvertor.GetAdvFilter(DataProvider.VideoPlayBackManager.AdvReportFilters, this.filter);    //2009-4-29 11:37:37@Simon Add UpdateAdvFilter
            }
            catch
            {
                filter = new DBFilter();
            }
            try
            {
                tag = (object)info.GetValue("tag", typeof(object));
            }
            catch
            {
            }
            try
            {
                exControlViews = (Webb.Reports.ExControls.Views.ExControlViewCollection)info.GetValue("exControlViews", typeof(Webb.Reports.ExControls.Views.ExControlViewCollection));
            }
            catch
            {
                exControlViews = new ExControlViewCollection();
            }
        }
Пример #38
0
 public APIError(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
     : base(info, context)
 {
     Error          = (string)info.GetValue("error", typeof(string));
     HttpStatusCode = (int)info.GetValue("@http_status_code", typeof(int));
     Warnings       = (List <string>)info.GetValue("warnings", typeof(List <string>));
 }
Пример #39
0
 protected DogApiErrorException(
     System.Runtime.Serialization.SerializationInfo info,
     System.Runtime.Serialization.StreamingContext context) : base(info, context)
 {
     HttpStatusCode = (System.Net.HttpStatusCode)info.GetValue(nameof(HttpStatusCode), typeof(System.Net.HttpStatusCode));
     ErrorMessages  = (string[])info.GetValue(nameof(ErrorMessages), typeof(string[]));
 }
Пример #40
0
        /// <summary>
        /// Called when serializing
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
        {
            base.GetObjectData(info, context);

            info.AddValue("_filename", _filename);
            info.AddValue("_b3D", _b3D);
            info.AddValue("_bLooped", _bLooped);
            info.AddValue("_fVolume", _fVolume);
            info.AddValue("_fPitch", _fPitch);
            info.AddValue("_bStreaming", _bStreaming);
            info.AddValue("_fPan", _fPan);
            info.AddValue("_fDopplerLevel", _fDopplerLevel);
            info.AddValue("_fTimeOfs", _fTimeOfs);
            info.AddValue("_fFadeMin", _fFadeMin);
            info.AddValue("_fFadeMax", _fFadeMax);
            info.AddValue("_iPriority", _iPriority);
            info.AddValue("_bDirectional", _bDirectional);
            info.AddValue("_fConeOutside", _fConeOutside);
            info.AddValue("_fConeInside", _fConeInside);
            info.AddValue("_bStartPaused", _bStartPaused);
            info.AddValue("_bCompressedData", _bCompressedData);
            info.AddValue("_bDisposeWhenFinished", _bDisposeWhenFinished);
            info.AddValue("_bMusic", _bMusic);
            info.AddValue("_bLogAttenuation", _bLogAttenuation);
        }
Пример #41
0
        void WriteISerializable(ReflectType ots, object o)
        {
            if (o is Missing)
            {
                var m = (Missing)o;
                Writer.WriteVInt(m.Collection.Count);
                foreach (var item in m.Collection)
                {
                    Write(ReflectType.RString, (string)item.Item1);
                    Write(ReflectType.RObject, item.Item2);
                }
            }
            else
            {
#if __NETCORE__
                throw new PlatformNotSupportedException(".NETCore + ISerializable");
#elif !__PCL__
                var serial = (SRS.ISerializable)o;
                var info   = new SRS.SerializationInfo(typeof(object), new SRS.FormatterConverter());
                var ctx    = new SRS.StreamingContext(SRS.StreamingContextStates.Persistence);
                serial.GetObjectData(info, ctx);
                Writer.WriteVInt(info.MemberCount);
                foreach (var item in info)
                {
                    Write(ReflectType.RString, item.Name);
                    Write(ReflectType.RObject, item.Value);
                }
#endif
            }
        }
Пример #42
0
 protected SimplifiedInteroperabilityException(
     System.Runtime.Serialization.SerializationInfo info,
     System.Runtime.Serialization.StreamingContext context)
     : base(info, context)
 {
     this.Requests = new List <SingleRequest>();
 }
Пример #43
0
        public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
        {
            Object[] values = new Object[base.Count];

            base.InnerList.CopyTo(values, 0);
            info.AddValue("Values", values);
        }
        public void GetObjectData(object obj, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
        {
            _unitySerialInfo.StartContext(info, context);

            var tp = obj.GetType();

            if (obj is IUnitySerializable)
            {
                (obj as IUnitySerializable).GetObjectData(_unitySerialInfo);
            }
            else
            {
                foreach (var fi in GetAllSerializableFields(tp))
                {
                    try
                    {
                        _unitySerialInfo.AddValue(fi.Name, fi.GetValue(obj), fi.FieldType);
                    } catch (SerializationException ex)
                    {
                        UnityEngine.Debug.LogWarning("Spacepuppy Unity Serialization: " + ex.Message);
                    }
                }
            }
            _unitySerialInfo.EndContext();
        }
Пример #45
0
        public override void SaveToStream(System.Runtime.Serialization.SerializationInfo info, int orderNumber)
        {
            base.SaveToStream(info, orderNumber);

            info.AddValue(
                String.Format(CultureInfo.InvariantCulture,
                              "{0}{1}",
                              entryToolTipMode, orderNumber),
                property.ToolTipMode);
            info.AddValue(
                String.Format(CultureInfo.InvariantCulture,
                              "{0}{1}",
                              entryImageFile, orderNumber),
                property.ImageFile);

            try
            {
                info.AddValue(
                    String.Format(CultureInfo.InvariantCulture,
                                  "{0}{1}",
                                  MarkerType, orderNumber),
                    property.MarkerType);
            }
            catch (Exception ex)
            { }
        }
Пример #46
0
        protected BuildUsageTagSet(System.Runtime.Serialization.SerializationInfo info, StreamingContext context)
        {
            this.m_Ptr = BuildUsageTagSet.Internal_Create();
            string data = (string)info.GetValue("tags", typeof(string));

            this.DeserializeNativeFromString(data);
        }
        public object SetObjectData(object obj, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context, System.Runtime.Serialization.ISurrogateSelector selector)
        {
            _unitySerialInfo.StartContext(info, context);

            if (obj is IUnitySerializable)
            {
                (obj as IUnitySerializable).SetObjectData(_unitySerialInfo);
            }
            else
            {
                var tp = obj.GetType();
                foreach (var fi in GetAllSerializableFields(tp))
                {
                    try
                    {
                        var value = _unitySerialInfo.GetValue(fi.Name, fi.FieldType);
                        fi.SetValue(obj, value);
                    }
                    catch
                    {
                        //do nothing
                    }
                }
            }
            _unitySerialInfo.EndContext();

            return(obj);
        }
Пример #48
0
        public override void SaveToStream(System.Runtime.Serialization.SerializationInfo info, int orderNumber)
        {
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrysttinstanceid, orderNumber), stt_instanceid);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrysttbitposition, orderNumber), stt_bitposition);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrysttenterprise, orderNumber), stt_enterprise);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrysttengineid, orderNumber), stt_engine_id);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrysttsupplychainid, orderNumber), stt_supplychainid);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrysttorganizationid, orderNumber), stt_organizationid);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrysttworkcentername, orderNumber), stt_workcenter);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrysttplanid, orderNumber), stt_planid);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrysttplanstartdate, orderNumber), stt_planstartdate);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrysttplanenddate, orderNumber), stt_planenddate);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrysttplancurrentdate, orderNumber), stt_plancurrentdate);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrysttbucketname, orderNumber), stt_bucketname);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrysttboundaryid, orderNumber), stt_boundaryid);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrysttfirstdayofweek, orderNumber), stt_firstdayofweek);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrystteffstartdate, orderNumber), stt_effstartdate);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrysttpatternsequence, orderNumber), stt_patternsequence);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrysttbucketsize, orderNumber), stt_bucketsize);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrysttbucketsizeuom, orderNumber), stt_bucketsizeuom);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrysttnumberofbuckets, orderNumber), stt_numberofbuckets);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrysttkeeporbetter, orderNumber), stt_keep_or_better);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrysttexportunpeggedmaterial, orderNumber), stt_export_unpegged_material);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrysttexportunpeggedcapacity, orderNumber), stt_export_unpegged_capacity);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrysttexportdaterange, orderNumber), stt_export_date_range);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrysttexportsourcepeggings, orderNumber), stt_export_source_peggings);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrysttmpasolver, orderNumber), stt_mpa_solver);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrysttusetransportcapacity, orderNumber), stt_use_transport_capacity);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrystt_lplayers, orderNumber), stt_lplayers);
            info.AddValue(String.Format(CultureInfo.InvariantCulture, "{0}{1}", entrystt_oblevels, orderNumber), stt_oblevels);

            base.SaveToStream(info, orderNumber);
        }
Пример #49
0
        public HorizontalGridColumn(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
        {
            try
            {
                _Filter = info.GetValue("_Filter", typeof(DBFilter)) as DBFilter;

                this._Filter = AdvFilterConvertor.GetAdvFilter(DataProvider.VideoPlayBackManager.AdvReportFilters, this._Filter);
            }
            catch
            {
                _Filter = new DBFilter();
            }

            try
            {
                _TitleField = info.GetString("_TitleField");
            }
            catch
            {
                _TitleField = string.Empty;
            }

            try
            {
                _Title = info.GetString("_Title");
            }
            catch
            {
                _Title = string.Empty;
            }


            _RowIndicator = -1;
        }
Пример #50
0
        protected BuildUsageTagSet(System.Runtime.Serialization.SerializationInfo info, StreamingContext context)
        {
            m_Ptr = Internal_Create();
            string serializedBuildUsageTagSetString = (string)info.GetValue("tags", typeof(string));

            DeserializeNativeFromString(serializedBuildUsageTagSetString);
        }
        public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
        {
            Slyce.Common.Utility.CheckForNulls(new object[] { info, context }, new string[] { "info", "context" });

            base.GetObjectData(info, context);
            info.AddValue("extension", extension);
        }
Пример #52
0
 /// <summary>
 /// Serialization constructor.
 /// </summary>
 /// <param name="info"></param>
 /// <param name="context"></param>
 protected DebugMonitorException(
     System.Runtime.Serialization.SerializationInfo info,
     System.Runtime.Serialization.StreamingContext context)
     : base(info, context)
 {
     ActionName = info.GetString("ActionName");
 }
Пример #53
0
 protected DomainRelationshipSerializationInfo(System.Runtime.Serialization.SerializationInfo info, StreamingContext context)
 {
     childrenOrder                 = (System.Collections.ArrayList)info.GetValue("childrenOrder", typeof(System.Collections.ArrayList));
     attributesOrder               = (System.Collections.ArrayList)info.GetValue("attributesOrder", typeof(System.Collections.ArrayList));
     this.IsInFullSerialization    = (bool)info.GetValue("isInFullSerialization", typeof(bool));
     this.IsTargetIncludedSubmodel = (bool)info.GetValue("isTargetIncludedSubmodel", typeof(bool));
 }
Пример #54
0
 public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
 {
     info.AddValue("_Value", _Value);
     info.AddValue("_Frequence", _Frequence);
     info.AddValue("_FilterType", _FilterType, typeof(Webb.Data.FilterTypes));
     info.AddValue("_FollowedOperand", _FollowedOperand, typeof(Webb.Data.FilterOperands));
 }
Пример #55
0
            public object SetObjectData(object obj, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context, System.Runtime.Serialization.ISurrogateSelector selector)
            {
                FieldInfo[] fieldInfos = obj.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
                foreach (var fi in fieldInfos)
                {
                    if (IsKnownType(fi.FieldType))
                    {
                        if (IsNullableType(fi.FieldType))
                        {
                            // Nullable<argumentValue>
                            Type argumentValueForTheNullableType = GetFirstArgumentOfGenericType(fi.FieldType);
                            fi.SetValue(obj, info.GetValue(fi.Name, argumentValueForTheNullableType));
                        }
                        else
                        {
                            fi.SetValue(obj, info.GetValue(fi.Name, fi.FieldType));
                        }
                    }
                    else
                    if (fi.FieldType.IsClass)
                    {
                        fi.SetValue(obj, info.GetValue(fi.Name, fi.FieldType));
                    }
                }

                return(obj);
            }
Пример #56
0
 /// <summary>
 /// Supports the serialization infrastructure.
 /// </summary>
 /// <param name="info">Serialization information.</param>
 /// <param name="context">Streaming context.</param>
 protected MockException(
     System.Runtime.Serialization.SerializationInfo info,
     System.Runtime.Serialization.StreamingContext context)
     : base(info, context)
 {
     this.reason = (MockExceptionReason)info.GetValue("reason", typeof(MockExceptionReason));
 }
Пример #57
0
 public HeaderCell(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
 {
     try
     {
         _Row = info.GetInt32("_Row");
     }
     catch
     {
         _Row = 0;
     }
     try
     {
         _Col = info.GetInt32("_Col");
     }
     catch
     {
         _Col = 0;
     }
     try
     {
         _Text = info.GetString("_Text");
     }
     catch
     {
         _Text = string.Empty;
     }
     try
     {
         _MergerdIndex = info.GetInt32("_MergerdIndex");
     }
     catch
     {
         _MergerdIndex = 0;
     }
     try
     {
         _MergerdCount = info.GetInt32("_MergerdCount");
     }
     catch
     {
         _MergerdCount = 0;
     }
     try
     {
         _ChangeStyle = info.GetBoolean("_ChangeStyle");
     }
     catch
     {
         _ChangeStyle = false;
     }
     try
     {
         _CellStyle = (Webb.Reports.ExControls.IBasicStyle)info.GetValue("_CellStyle", typeof(Webb.Reports.ExControls.IBasicStyle));
     }
     catch
     {
         _CellStyle = new BasicStyle();
     }
 }
Пример #58
0
            public void GetObjectData(object obj, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
            {
                AltaxoDocument s = (AltaxoDocument)obj;

                info.AddValue("DataTableCollection", s.m_DataSet);
                //info.AddValue("Worksheets",s.m_Worksheets);
                //  info.AddValue("GraphForms",s.m_GraphForms);
            }
Пример #59
0
        /// <summary>
        /// Called when serializing
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
        {
            base.GetObjectData(info, context);

            info.AddValue("ResolutionX", _resolutionX);
            info.AddValue("ResolutionY", _resolutionY);
            info.AddValue("ContextClass", m_contextClass);
        }
Пример #60
0
 /// <summary>
 /// Initializes a new instance of the Exception class with serialized data.
 /// </summary>
 /// <param name="info">The SerializationInfo that holds the serialized object data about the exception being thrown.</param>
 /// <param name="context">The StreamingContext that contains contextual information about the source or destination.</param>
 protected IS24Exception(
     System.Runtime.Serialization.SerializationInfo info,
     System.Runtime.Serialization.StreamingContext context)
     : base(info, context)
 {
     Messages   = (Messages)info.GetValue("Messages", typeof(Messages));
     StatusCode = (HttpStatusCode)info.GetValue("StatusCode", typeof(HttpStatusCode));
 }