/// <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);
        }
Example #2
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[]));
 }
Example #3
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));
 }
Example #4
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);
 }
Example #5
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>));
 }
Example #6
0
 void IMobileObject.SetState(SerializationInfo info)
 {
   foreach (string key in info.Values.Keys)
   {
     Add(key, info.Values[key].Value);
   }
 }
Example #7
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");
 }
 // 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);
 }
Example #9
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.
 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[]));
 }
 public SampledStroke(SerializationInfo info, StreamingContext ctxt)
 {
     beginning = info.GetInt32("beginning");
     str = (List<Dot>)info.GetValue("str", typeof(List<Dot>));
     positionX = 0;
     positionY = 0;
 }
 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);
 }
 // 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);
 }
Example #14
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");
 }
Example #15
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);
 }
Example #16
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);
 }
 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);
 }
Example #18
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));
 }
Example #19
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;
	}
Example #20
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));
 }
Example #21
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));
 }
Example #22
0
		public void GetObjectData (SerializationInfo info, StreamingContext context) {
			info.AddValue ("a", a);
			if (s1 != null)
				info.AddValue ("s1", s1);
			else
				info.AddValue ("s1", "(null)");
		}
        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);
        }
Example #24
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 ());
		}
	}
		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;
		}
Example #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)));
 }
Example #27
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[]));
 }
	// Get serialization data.
	public override void GetObjectData(SerializationInfo info,
									   StreamingContext context)
			{
				base.GetObjectData(info, context);
				info.AddValue("filename", filename);
				info.AddValue("line", line);
			}
 //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));
 }
		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());
		}