Esempio n. 1
0
	// Serialization funciton.
	public void GetObjectData(SerializationInfo info, StreamingContext ctxt)
	{
		// You can use any name/value pair, as long as you read them with the same names
		
		info.AddValue("Health", health);
		info.AddValue("Name", name);
	}
 //Serializatoin counstructor. call when Deserialize function called.
 public CBahram_SALContainer(SerializationInfo info, StreamingContext context)
 {
     var1 = (int)info.GetValue("var1",typeof(int));
     var2 = (int)info.GetValue("var2",typeof(int));
     var3 = (int)info.GetValue("var3",typeof(int));
     var4 = (int)info.GetValue("var4",typeof(int));
 }
Esempio n. 3
0
 void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
 {
     info.AddValue ("SourceID", SourceID, typeof(int));
     info.AddValue ("DestID", DestID, typeof(int));
     info.AddValue ("MessageType", Type, typeof(MessageType));
     info.AddValue ("SerializedContent", SerializedContent, typeof(byte[]));
 }
Esempio n. 4
0
 // Required by the ISerializable class to be properly serialized. This is called automatically
 public void GetObjectData(SerializationInfo info, StreamingContext ctxt)
 {
     // Repeat this for each var defined in the Values section
     info.AddValue("boardWidth", (boardWidth));
     info.AddValue("boardHeight", boardHeight);
     info.AddValue("tiles", tiles);
 }
Esempio n. 5
0
 public Resource(SerializationInfo info, StreamingContext context)
     : base(1,(string) info.GetValue("type", typeof(string)), null, (string) info.GetValue("description", typeof(string)), null)
 {
     // Reset the property value using the GetValue method.
     tier = (int) info.GetValue("tier", typeof(int));
     use = (int) info.GetValue ("use", typeof(int));
 }
		public ILink DeserializeLink(IConnection connection, SerializationInfo info)
		{
			Link link = new Link();
			string sourceEmployeeId = string.Empty;
			string targeteEmployeeId = string.Empty;
			if (info["SourceEmployeeId"] != null)
				sourceEmployeeId = info["SourceEmployeeId"].ToString();
			if (info["TargetEmployeeId"] != null)
				targeteEmployeeId = info["TargetEmployeeId"].ToString();
			if (info["IsVisible"] != null)
				link.IsVisible = bool.Parse(info["IsVisible"].ToString());
			if (info["Text"] != null)
				link.Text = info["Text"].ToString();
			if (info["MainColor"] != null)
				link.MainColor = info["MainColor"].ToString();

			var sourceModel = this.deserializedEmployees.FirstOrDefault(x => x.GetId().Equals(sourceEmployeeId));
			if (sourceModel != null)
			{
				link.Source = sourceModel;
			}

			var targetModel = this.deserializedEmployees.FirstOrDefault(x => x.GetId().Equals(targeteEmployeeId));
			if (targetModel != null)
			{
				link.Target = targetModel;
			}

			return link;
		}
Esempio n. 7
0
 public Message(SerializationInfo info, StreamingContext context)
 {
     SourceID = info.GetInt32 ("SourceID");
     DestID = info.GetInt32 ("DestID");
     Type = (MessageType)info.GetByte ("MessageType");
     SerializedContent = (byte[])info.GetValue ("SerializedContent", typeof(byte[]));
 }
        public void op_GetObjectData_SerializationInfo_StreamingContext()
        {
            var info = new SerializationInfo(typeof(StreamWriterDictionary), new FormatterConverter());
            var context = new StreamingContext(StreamingContextStates.All);

            new StreamWriterDictionary().GetObjectData(info, context);
        }
Esempio n. 9
0
 public SaveData(SerializationInfo info, StreamingContext ctxt)
 {
     mapName = (string)info.GetValue ("mapName", typeof(string));
     playerLocation = (float[])info.GetValue ("playerLocation", typeof(float[]));
     activeQuests = (List<Quest>)info.GetValue ("activeQuests", typeof(List<Quest>));
     completedQuests = (List<Quest>)info.GetValue ("completedQuests", typeof(List<Quest>));
 }
Esempio n. 10
0
 //serialization constructor
 protected SerQuaternion(SerializationInfo info,StreamingContext context)
 {
     x = (float)info.GetValue("x",typeof(float));
     y = (float)info.GetValue("y",typeof(float));
     z = (float)info.GetValue("z",typeof(float));
     w = (float)info.GetValue("w",typeof(float));
 }
Esempio n. 11
0
 /*[SecurityPermissionAttribute(
             SecurityAction.Demand,
             SerializationFormatter = true)]		*/
 public void GetObjectData(SerializationInfo info, StreamingContext ctxt)
 {
     info.AddValue("x", this.x);
     info.AddValue("y", this.y);
     info.AddValue("z", this.z);
     info.AddValue("w", this.w);
 }
Esempio n. 12
0
	protected p4HelperConfig(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["skipDirs"] != null)) {
				this.Tables.Add(new skipDirsDataTable(ds.Tables["skipDirs"]));
			}
			if ((ds.Tables["dir"] != null)) {
				this.Tables.Add(new dirDataTable(ds.Tables["dir"]));
			}
			if ((ds.Tables["skipNameParts"] != null)) {
				this.Tables.Add(new skipNamePartsDataTable(ds.Tables["skipNameParts"]));
			}
			if ((ds.Tables["part"] != null)) {
				this.Tables.Add(new partDataTable(ds.Tables["part"]));
			}
			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;
	}
Esempio n. 13
0
		public void GetObjectData (SerializationInfo info, StreamingContext context) {
			info.AddValue ("a", a);
			if (s1 != null)
				info.AddValue ("s1", s1);
			else
				info.AddValue ("s1", "(null)");
		}
Esempio n. 14
0
	public void GetObjectData(SerializationInfo info, StreamingContext context) {
		info.AddValue ("count", count);
		info.AddValue ("weaponCount", weapons.Count);
		for (int i = 0; i < weapons.Count; i++) {
			info.AddValue ("weaponCD_" + i, weapons [i].GetCooldown ());
		}
	}
Esempio n. 15
0
 public ProfileSaveData(SerializationInfo aInfo, StreamingContext aContext)
     : base()
 {
     m_Name = (string)aInfo.GetValue("Name", typeof(string));
     m_ProfileName = (string)aInfo.GetValue("ProfileName", typeof(string));
     m_ProgressionLevel = (int)aInfo.GetValue("ProgressionLevel", typeof(int));
 }
Esempio n. 16
0
 public User(SerializationInfo info, StreamingContext ctxt)
 {
     this.id = (int)info.GetValue("id", typeof(int));
     this.loginname = (string)info.GetValue("loginname", typeof(string));
     this.password = (string)info.GetValue("password", typeof(string));
     this.name = (string)info.GetValue("name", typeof(string));
 }
Esempio n. 17
0
 void IMobileObject.SetState(SerializationInfo info)
 {
   foreach (string key in info.Values.Keys)
   {
     Add(key, info.Values[key].Value);
   }
 }
		public override void Deserialize(SerializationInfo info)
		{
			base.Deserialize(info);
			if (info[LocationTag] != null) this.Location = (ImageLocation)Enum.Parse(typeof(ImageLocation), info[LocationTag].ToString(), true);
			if (info[AddressTag] != null) this.Address = info[AddressTag].ToString();
			if (info[NavigationTag] != null) this.NavigateUri = new Uri(info[NavigationTag].ToString());
		}
 public SampledStroke(SerializationInfo info, StreamingContext ctxt)
 {
     beginning = info.GetInt32("beginning");
     str = (List<Dot>)info.GetValue("str", typeof(List<Dot>));
     positionX = 0;
     positionY = 0;
 }
Esempio n. 20
0
 // Required by the ISerializable class to be properly serialized. This is called automatically
 public void GetObjectData(SerializationInfo info, StreamingContext ctxt)
 {
     // Repeat this for each var defined in the Values section
     info.AddValue("foundGem1", (foundGem1));
     info.AddValue("score", score);
     info.AddValue("levelReached", levelReached);
 }
 public void GetObjectData(SerializationInfo info, StreamingContext ctxt)
 {
     info.AddValue("object2PropertiesMappings", this.object2PropertiesMappings);
     info.AddValue("EZR_VERSION", EZR_VERSION);
     info.AddValue("recordingInterval", this.recordingInterval);
     //base.GetObjectData(info, context);
 }
 //Serializatoin counstructor. call when Deserialize function called.
 private CChair_SALContainer(SerializationInfo info, StreamingContext context)
     : base(info,context)
 {
     var1 = info.GetInt32("var1");
     var2 = info.GetInt32("var2");
     str1 = (string[])info.GetValue("str1",typeof(string[]));
 }
 // Method called to serialize a Vector3 object
 public void GetObjectData(System.Object obj, SerializationInfo info, StreamingContext context)
 {
     Color c = (Color) obj;
     info.AddValue("r", c.r);
     info.AddValue("g", c.g);
     info.AddValue("b", c.b);
 }
Esempio n. 24
0
 /// <summary>
 /// Initializes a new instance of the PSArgumentException class
 /// using data serialized via
 /// <see cref="System.Runtime.Serialization.ISerializable"/>
 /// </summary>
 /// <param name="info"> serialization information </param>
 /// <param name="context"> streaming context </param>
 /// <returns> constructed object </returns>
 protected PSArgumentException(SerializationInfo info,
                    StreamingContext context)
         : base(info, context)
 {
     _errorId = info.GetString("ErrorId");
     _message = info.GetString("PSArgumentException_MessageOverride");
 }
        /// <summary>
        /// Deserializing contructor.
        /// </summary>
        public AdapterManagementComponent(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            _adapters = new GenericContainer<IIntegrationAdapter>();

            _adapters.ItemAddedEvent += new GenericContainer<IIntegrationAdapter>.ItemUpdateDelegate(Adapters_ItemAddedEvent);
            _adapters.ItemRemovedEvent += new GenericContainer<IIntegrationAdapter>.ItemUpdateDelegate(Adapters_ItemRemovedEvent);

            _startedAdaptersIds = (List<ComponentId>)info.GetValue("startedAdaptersIds", _startedAdaptersIds.GetType());

            // Adapters are serialized one by one, to add safety when deserializing (one adapter will
            // otherwise block the entire deserialization for the manager).
            int adaptersCount = (int)info.GetValue("adapterCount", typeof(int));
            for (int i = 0; i < adaptersCount; i++)
            {
                try
                {
                    IIntegrationAdapter adapter = (IIntegrationAdapter)info.GetValue("adapter_" + i, typeof(IIntegrationAdapter));
                    _adapters.Add(adapter);
                }
                catch (SerializationException ex)
                {
                    SystemMonitor.OperationError("Failed to deserialize integration adapter [" + ex.Message + "].");
                }
                catch (InvalidCastException ex)
                {
                    SystemMonitor.OperationError("Failed to deserialize integration adapter [" + ex.Message + "].");
                }
            }

            ChangeOperationalState(OperationalStateEnum.Constructed);
        }
Esempio n. 26
0
 public GameplayMessage(SerializationInfo info, StreamingContext context)
 {
     Message = (MessageValue)info.GetByte ("Message");
     PlayerID = info.GetInt32 ("PlayerID");
     MoveDelta = new Vector2((float)info.GetValue("x",typeof(float)),(float)info.GetValue("y",typeof(float)));
     OldPosition = new Vector3((float)info.GetValue("xloc", typeof(float)), (float)info.GetValue("yloc", typeof(float)), (float)info.GetValue("zloc", typeof(float)));
 }
Esempio n. 27
0
 // Required by the ISerializable class to be properly serialized. This is called automatically
 public void GetObjectData(SerializationInfo info, StreamingContext ctxt)
 {
     // Repeat this for each var defined in the Values section
     info.AddValue("ConeUnlocked", (ConeUnlocked));
     info.AddValue("HiScore", HiScore);
     info.AddValue("ExplosivesLeft", ExplosivesLeft);
 }
	// Get serialization data.
	public override void GetObjectData(SerializationInfo info,
									   StreamingContext context)
			{
				base.GetObjectData(info, context);
				info.AddValue("filename", filename);
				info.AddValue("line", line);
			}
Esempio n. 29
0
 /// <summary>
 /// Initializes a new instance of the RuntimeException class
 /// using data serialized via
 /// <see cref="ISerializable"/>
 /// </summary>
 /// <param name="info"> serialization information </param>
 /// <param name="context"> streaming context </param>
 /// <returns> constructed object </returns>
 protected RuntimeException(SerializationInfo info,
                    StreamingContext context)
         : base(info, context)
 {
     _errorId = info.GetString("ErrorId");
     _errorCategory = (ErrorCategory)info.GetInt32("ErrorCategory");
 }
 public void GetObjectData(System.Object obj, SerializationInfo info, StreamingContext context)
 {
     Vector3 v3 = (Vector3)obj;
     info.AddValue("x", v3.x);
     info.AddValue("y", v3.y);
     info.AddValue("z", v3.z);
 }
 protected HttpParameterDictionary(SerializationInfo info,
                                   StreamingContext context)
     : base(info, context)
 {
 }
Esempio n. 32
0
 protected SchemaException(
     SerializationInfo info,
     StreamingContext context)
     : base(info, context)
 {
 }
Esempio n. 33
0
 protected JsonCastException(
     SerializationInfo info,
     StreamingContext context) : base(info, context)
 {
 }
Esempio n. 34
0
 protected SqlUpdateException(SerializationInfo info, StreamingContext context) : base(info, context)
 {
 }
Esempio n. 35
0
 protected RuntimeBuilderException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
 }
 /// <summary>
 /// Serialization constructor.
 /// </summary>
 /// <param name="info"></param>
 /// <param name="context"></param>
 protected SchedulerContext(SerializationInfo info, StreamingContext context) : base(info, context)
 {
 }
Esempio n. 37
0
 /// <summary>Private CTor for deserialization</summary>
 /// <param name="info"></param>
 /// <param name="context"></param>
 protected ThreadStatisticsEntity(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
     // __LLBLGENPRO_USER_CODE_REGION_END
 }
Esempio n. 38
0
 protected WetScrubberControl(SerializationInfo info, StreamingContext context) : base(info, context)
 {
 }
Esempio n. 39
0
        //
        // Implementation of ISerializable
        //

        public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            throw new NotSupportedException();
        }
Esempio n. 40
0
 /// <summary>
 /// Recupera os dados para a serialização da instancia.
 /// </summary>
 /// <param name="info"></param>
 /// <param name="context"></param>
 void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
 {
     info.AddValue("Expression", Expression);
     info.AddValue("Parameters", Parameters);
 }
Esempio n. 41
0
 public override void GetObjectData(SerializationInfo info, StreamingContext context)
 {
     base.GetObjectData(info, context);
     info.AddValue("ClassPersistenceVersionWetScrubberControl", WetScrubberControl.CLASS_PERSISTENCE_VERSION, typeof(int));
 }
Esempio n. 42
0
 /// <summary>
 /// Construtor usado na deserialização dos dados.
 /// </summary>
 /// <param name="info"></param>
 /// <param name="context"></param>
 private ExpressionParameter(SerializationInfo info, StreamingContext context)
 {
     Expression  = info.GetString("Expression");
     _parameters = (PersistenceParameterCollection)info.GetValue("Parameters", typeof(PersistenceParameterCollection));
 }
Esempio n. 43
0
 protected Adjust(SerializationInfo info, StreamingContext context) : base(info, context)
 {
 }