public void GetObjectData(object obj, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
 {
     FieldInfo[] fieldInfos = obj.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
     foreach (var fi in fieldInfos)
     {
         if (IsKnownType(fi.FieldType)
                 )
         {
             info.AddValue(fi.Name, fi.GetValue(obj));
         }
         /*
         else if(fi.FieldType == typeof(Texture2D))
         {
             Texture2D tex = fi.GetValue(obj) as Texture2D;
             Debug.Log(tex.name);
             info.AddValue(fi.Name, tex.name);
         }
         */
         else
             if (fi.FieldType.IsClass)
             {
                 info.AddValue(fi.Name, fi.GetValue(obj));
             }
     }
 }
 public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
 {
     base.GetObjectData(info, context);
     info.AddValue("range1", this.range1);
     info.AddValue("range2", this.range2);
     info.AddValue("zero", this.zero);
 }
 public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
 {
     base.GetObjectData(info, context);
     info.AddValue("startDate",this.startDate);
     info.AddValue("endDate", this.endDate);
     info.AddValue("format", this.format);
 }
Example #4
0
 public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, 
                      System.Runtime.Serialization.StreamingContext context)
 {
     info.AddValue ("Key", this.Key);
     info.AddValue ("Count", this.Count);
     info.AddValue ("Salt", this.Salt);
 }
Example #5
0
 public void GetObjectData(object obj,System.Runtime.Serialization.SerializationInfo info,System.Runtime.Serialization.StreamingContext context  )
 {
   info.SetType(this.GetType());
   WorksheetView s = (WorksheetView)obj;
   info.AddValue("Location",s.Location);
   info.AddValue("Size",s.Size);
   info.AddValue("Controller",s.m_Ctrl);
 }
Example #6
0
 public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
 {
     info.AddValue("tidvist", tidVist);
     info.AddValue("tidfoerfortoning", tidFoerFortoning);
     info.AddValue("tidfortoning", tidFortoning);
     info.AddValue("tidvend", tidVend);
     info.AddValue("skaerm", screen);
 }
Example #7
0
 protected UnmatchingScenarioDeclarationException(
   System.Runtime.Serialization.SerializationInfo info,
   System.Runtime.Serialization.StreamingContext context)
     : base(info, context)
 {
     info.AddValue("FeatureFile", this.FeatureFile);
     info.AddValue("ScenarioName", this.ScenarioName);
 }
Example #8
0
 protected FeatureFileContentInvalidException(
   System.Runtime.Serialization.SerializationInfo info,
   System.Runtime.Serialization.StreamingContext context)
     : base(info, context)
 {
     info.AddValue("FileContent", this.FileContent);
     info.AddValue("FileInstruction", this.FileInstruction);
 }
Example #9
0
 protected UnmatchingScenarioStatementException(
   System.Runtime.Serialization.SerializationInfo info,
   System.Runtime.Serialization.StreamingContext context)
     : base(info, context)
 {
     info.AddValue("ScenarioStatements", this.ScenarioStatements);
     info.AddValue("StepsStatements", this.StepsStatements);
 }
        public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
        {
            if (info == null)
                throw new System.ArgumentNullException("info");

            info.AddValue("layoutInfo", this.LayoutInfoString, typeof(string));
            info.AddValue("elementId", this.ElementId, typeof(Guid));
            info.AddValue("domainClassId", this.DomainClassId, typeof(Guid));
            info.AddValue("shapeDomainClassId", this.ShapeDomainClassId, typeof(Guid));
            info.AddValue("relativeLocation", this.RelativeLocation, typeof(PointD));
        }
Example #11
0
 protected InvalidTestClassException(
   System.Runtime.Serialization.SerializationInfo info,
   System.Runtime.Serialization.StreamingContext context)
     : base(info, context)
 {
     info.AddValue("TestClass", this.TestClass);
 }
Example #12
0
 protected SpecificFeatureNodeNotFoundException(
   System.Runtime.Serialization.SerializationInfo info,
   System.Runtime.Serialization.StreamingContext context)
     : base(info, context)
 {
     info.AddValue("FeaturePath", this.FeaturePath);
 }
        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);
        }
Example #14
0
 protected NoStepsTypeAvailableInTestMethodBodyException(
   System.Runtime.Serialization.SerializationInfo info,
   System.Runtime.Serialization.StreamingContext context)
     : base(info, context)
 {
     info.AddValue("TestMethod", this.TestMethod);
 }
Example #15
0
        /// <summary>
        /// When overridden in a derived class, sets the <see cref="T:System.Runtime.Serialization.SerializationInfo"/> with information about the exception.
        /// </summary>
        /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
        /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
        /// <exception cref="T:System.ArgumentNullException">The <paramref name="info"/> parameter is a null reference (Nothing in Visual Basic). </exception>
        ///   
        /// <PermissionSet>
        ///   <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="*AllFiles*" PathDiscovery="*AllFiles*"/>
        ///   <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="SerializationFormatter"/>
        ///   </PermissionSet>
        /// <remarks></remarks>
        public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
        {
            base.GetObjectData(info, context);

            // Add a value to the Serialization information.
            info.AddValue(RETURN_VALUE_STRING_IDENTIFIER, this.ReturnValue);
        }
Example #16
0
 protected EOFBeforeComponentException(
   System.Runtime.Serialization.SerializationInfo info,
   System.Runtime.Serialization.StreamingContext context)
     : base(info, context)
 {
     info.AddValue("Component", this.Component);
 }
Example #17
0
 protected MatchingScenarioStepsClassNotFoundException(
   System.Runtime.Serialization.SerializationInfo info,
   System.Runtime.Serialization.StreamingContext context)
     : base(info, context)
 {
     info.AddValue("ExpectedClassName", this.ExpectedClassName);
 }
Example #18
0
 protected FeatureFileCouldNotBeLoadedException(
   System.Runtime.Serialization.SerializationInfo info,
   System.Runtime.Serialization.StreamingContext context)
     : base(info, context)
 {
     info.AddValue("FeatureFile", this.FeatureFile);
 }
Example #19
0
 protected MoreThanOneStatementOfAStatementTypeInScenarioStepsException(
   System.Runtime.Serialization.SerializationInfo info,
   System.Runtime.Serialization.StreamingContext context)
     : base(info, context)
 {
     info.AddValue("StepsClassName", this.StepsClassName);
 }
        public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info,
            System.Runtime.Serialization.StreamingContext context)
        {
            base.GetObjectData(info, context);

            if (info != null)
                info.AddValue("Token", this.Token);
        }
Example #21
0
		/// <summary>
		/// Serialises this object instance.
		/// </summary>
		/// <param name="info">A <see cref="System.Runtime.Serialization.SerializationInfo"/> instance used to serialise the object.</param>
		/// <param name="context">A <see cref="System.Runtime.Serialization.StreamingContext"/> instance used to serialise the object.</param>
		public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
		{
			if (info == null) throw new ArgumentNullException(nameof(info));

			info.AddValue("SocketErrorCode", _SocketErrorCode);

			base.GetObjectData(info, context);
		}
        /// <summary>
        /// Gets the object data for serialization purposes
        /// </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("Queue", Queue.ToString());
        }
Example #23
0
 protected SDLException(
     System.Runtime.Serialization.SerializationInfo info,
     System.Runtime.Serialization.StreamingContext context)
     : base(info, context)
 {
     base.GetObjectData(info, context);
     if (info != null)
         info.AddValue("SDL Error", SDL2.SDL.SDL_GetError());
 }
 public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
 {
     if (info == null)
     {
         throw new ArgumentNullException("info");
     }
     base.GetObjectData(info, context);
     info.AddValue("Url", this.Url, typeof(string));
 }
        public override void GetObjectData(
            System.Runtime.Serialization.SerializationInfo info,
            System.Runtime.Serialization.StreamingContext context)
        {
            base.GetObjectData(info, context);

            if (Errors != null)
            {
                info.AddValue(ErrorSummaryKey, Errors, typeof(ErrorSummary));
            }
        }
	void System.Runtime.Serialization.ISerializationSurrogate.GetObjectData(object obj, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
	{		
		Type objectType = obj.GetType();
		foreach (FieldInfo member in objectType.FindMembers(MemberTypes.Field, BindingFlags.Instance|BindingFlags.NonPublic|BindingFlags.Public, null, null))
		{
			if (member.IsDefined(typeof(NonSerializedAttribute), false))
			{
				continue;
			}
			
			info.AddValue(member.Name, member.GetValue(obj));
		}
		
		/* FIX: Rutger M. Dijkstra (rutger.dijkstra@hetnet.nl)
		* Add the private fields of ancestor classes
		* 
		* Note 1: The potentially ambiguous naming strategy below is the same
		* as used by the standard (non-surrogate) binary serialization.
		* 
		* Note 2: Even so, we are not compatible with the standard serialization
		* since the latter emits inherited *protected* fields multiple times.
		* Consequently, snapshots created with auto version-migration 'on'
		* need not correctly deserialize with version-migration 'off'
		* 
		* Afterthought:
		* Maybe, 'auto version-migration' should affect only the process of 
		* DEserialization, not the serialization as well. On the other hand,
		* we might not want tie ourselves too tightly to the details of the
		* standard implementation.
		*/
		for (objectType = objectType.BaseType; objectType != null; objectType = objectType.BaseType)
		{
		  foreach (FieldInfo member in objectType.FindMembers(MemberTypes.Field, BindingFlags.Instance|BindingFlags.NonPublic|BindingFlags.DeclaredOnly, null, null))
		  {
			  if (member.IsPrivate && !member.IsNotSerialized)
			  {
				  info.AddValue(objectType.Name + "+" + member.Name, member.GetValue(obj));
			  }
		  }
		}
	}
Example #27
0
      public void GetObjectData(object obj,System.Runtime.Serialization.SerializationInfo info,System.Runtime.Serialization.StreamingContext context  )
      {
        ColumnStyle s = (ColumnStyle)obj;
        info.AddValue("Size",(float)s.m_Size);
        info.AddValue("Pen",s.m_CellPen);
        info.AddValue("TextBrush",s.m_TextBrush);
        info.AddValue("BkgBrush",s.m_BackgroundBrush);
        info.AddValue("Alignment",s.m_TextFormat.Alignment);
        

        info.AddValue("Font",s.m_TextFont); // Serialization is possible in NET1SP2, but deserialization fails (Tested with SOAP formatter)
        
       

      }
Example #28
0
	public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
	{
		info.AddValue("AddressID", this.AddressID, typeof(int));
		info.AddValue("Street1", this.Street1, typeof(string));
		info.AddValue("Street2", this.Street2, typeof(string));
		info.AddValue("City", this.City, typeof(string));
		info.AddValue("State", this.State, typeof(string));
		info.AddValue("ZipCode", this.ZipCode, typeof(string));
		info.AddValue("PersonID", this.PersonID, typeof(int));
		info.AddValue("SortOrder", this.SortOrder, typeof(byte));
		info.AddValue("LastModifiedBy", this.LastModifiedBy, typeof(int));
		info.AddValue("LastModifiedAt", this.LastModifiedAt, typeof(DateTime));
		info.AddValue("Active", this.Active, typeof(bool));
		CustomizeSerializationProcess(info, context);
	}
	/// <summary>
	/// Sets the <see cref="System.Runtime.Serialization.SerializationInfo"/> with information about the exception.
	/// </summary>
	/// <param name="info">The <see cref="System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
	/// <param name="context">The <see cref="System.Runtime.Serialization.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(nameof(FileName), mFileName);
	}
Example #30
0
        /// <summary>
        /// Sets the SerializationInfo with information about the exception.
        /// </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>
        public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
        {
            // Save the base class state.
            base.GetObjectData(info, context);

            // Save the object state.
            info.AddValue("flags", this.Flags);
        }