System.Runtime.Serialization.SerializationInfo.AddValue(string, System.DateTime)

Here are the examples of the csharp api System.Runtime.Serialization.SerializationInfo.AddValue(string, System.DateTime) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

519 Examples 7

19 View Source File : ListViewGroupEx.cs
License : MIT License
Project Creator : dahall

[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)]
		void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
		{
			info.AddValue("BaseGroup", BaseGroup, BaseGroup.GetType());
			if (descBottom != null)
				info.AddValue("DescriptionBottom", descBottom);
			if (descTop != null)
				info.AddValue("DescriptionTop", descTop);
			if (footer != null)
				info.AddValue("Footer", footer);
			if (footerAlign != 0)
				info.AddValue("FooterAlignment", footerAlign);
			if (subreplacedle != null)
				info.AddValue("Subreplacedle", subreplacedle);
			if (task != null)
				info.AddValue("Task", task);
			if (replacedleImageIndexer.ActualIndex > -1)
				info.AddValue("replacedleImageIndex", replacedleImageIndexer.ActualIndex);
			if (ExtendedImageIndexer.ActualIndex > -1)
				info.AddValue("ExtendedImageIndex", ExtendedImageIndexer.ActualIndex);
			info.AddValue("GroupState", ListView.GetGroupState(this));
		}

19 View Source File : SerializableConditionalExpression.cs
License : MIT License
Project Creator : DataObjects-NET

[SecurityCritical]
    public override void GetObjectData(SerializationInfo info, StreamingContext context)
    {
      base.GetObjectData(info, context);
      info.AddValue("Test", Test);
      info.AddValue("IfTrue", IfTrue);
      info.AddValue("IfFalse", IfFalse);
    }

19 View Source File : AwaitableAttachment.cs
License : MIT License
Project Creator : BotBuilderCommunity

public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            // constructor arguments
            info.AddValue(nameof(this.attachment), JsonConvert.SerializeObject(this.attachment));
        }

19 View Source File : Serialization.cs
License : MIT License
Project Creator : CXuesong

void ISerializationSurrogate.GetObjectData(object obj, SerializationInfo info, StreamingContext context)
            {
                var instance = (JObject)obj;
                info.AddValue(typeof(JObject).Name, instance.ToString(Newtonsoft.Json.Formatting.None));
            }

19 View Source File : Directive.cs
License : MIT License
Project Creator : ChilliCream

private bool TryDeserialize<T>(
        DirectiveNode directiveNode,
        out T directive)
    {
        ConstructorInfo? constructor = typeof(T).GetTypeInfo()
            .DeclaredConstructors.FirstOrDefault(t =>
            {
                ParameterInfo[] parameters = t.GetParameters();
                return parameters.Length == 2
                    && parameters[0].ParameterType ==
                        typeof(SerializationInfo)
                    && parameters[1].ParameterType ==
                        typeof(StreamingContext);
            });

        if (constructor is null)
        {
            directive = default!;
            return false;
        }

        var info = new SerializationInfo(
            typeof(T), new FormatterConverter());
        info.AddValue(nameof(DirectiveNode), directiveNode);

        var context = new StreamingContext(
            StreamingContextStates.Other,
            this);

        directive = (T)constructor.Invoke(new object[] { info, context });
        return true;
    }

19 View Source File : MessagingException.cs
License : MIT License
Project Creator : Azure

public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            base.GetObjectData(info, context);

            info.AddValue("Detail", this.Detail);
            info.AddValue("IsTransient", this.IsTransient);
            info.AddValue("Timestamp", this.Timestamp.ToString());
        }

19 View Source File : AggregateException.cs
License : MIT License
Project Creator : DataObjects-NET

[SecurityCritical]
    public override void GetObjectData(SerializationInfo info, StreamingContext context)
    {
      base.GetObjectData(info, context);
      info.AddValue("Exceptions", exceptions);
    }

19 View Source File : ModularityException.Desktop.cs
License : MIT License
Project Creator : AvaloniaCommunity

[SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.SerializationFormatter)]
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            base.GetObjectData(info, context);
            info.AddValue("ModuleName", this.ModuleName);
        }

19 View Source File : SerializableLambdaExpression.cs
License : MIT License
Project Creator : DataObjects-NET

[SecurityCritical]
    public override void GetObjectData(SerializationInfo info, StreamingContext context)
    {
      base.GetObjectData(info, context);
      info.AddValue("Body", Body);
      info.AddArray("Parameters", Parameters);
    }

19 View Source File : Exceptions.cs
License : MIT License
Project Creator : azist

public override void GetObjectData(SerializationInfo info, StreamingContext context)
    {
      if (info == null)
        throw new AzosException(StringConsts.ARGUMENT_ERROR + GetType().Name + ".GetObjectData(info=null)");
      info.AddValue(STATUS_FLD_NAME, Status);
      base.GetObjectData(info, context);
    }

19 View Source File : Exceptions.cs
License : MIT License
Project Creator : CXuesong

public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            base.GetObjectData(info, context);
            info.AddValue(nameof(this.need), this.need);
            info.AddValue(nameof(this.have), this.have);
        }

19 View Source File : EntitySet.cs
License : Apache License 2.0
Project Creator : codexguy

public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            // We do not rely on CEF json serialization since that ties back to service scope context which we may not have (e.g. visualizer)
            // We create json that is much more lean and a direct representation of the underlying collection
            // We also use System.Text.Json to avoid replacedumption that caller is using Newtonsoft
            var json = System.Text.Json.JsonSerializer.Serialize(this.ToList());
            info.AddValue("jsonrep", json);
        }

19 View Source File : FeedException.cs
License : MIT License
Project Creator : Azure

public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            base.GetObjectData(info, context);
            info.AddValue("LastContinuation", this.LastContinuation);
        }

19 View Source File : AxisAlignedBox.cs
License : GNU General Public License v3.0
Project Creator : CypherCore

public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            info.AddValue("Max", _hi, typeof(Vector3));
            info.AddValue("Min", _lo, typeof(Vector3));
        }

19 View Source File : BV64Algebra.cs
License : MIT License
Project Creator : AutomataDotNet

public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            info.AddValue("d", dtree);
            info.AddValue("p", SerializeParreplacedion());
        }

19 View Source File : WrappingComparer{T,TBase}.cs
License : MIT License
Project Creator : DataObjects-NET

[SecurityCritical]
    public override void GetObjectData(SerializationInfo info, StreamingContext context)
    {
      base.GetObjectData(info, context);
      info.AddValue(nameof(BaseComparer), BaseComparer, BaseComparer.GetType());
    }

19 View Source File : Color.cs
License : MIT License
Project Creator : b-editor

public readonly void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            info.AddValue(nameof(A), A);
            info.AddValue(nameof(R), R);
            info.AddValue(nameof(G), G);
            info.AddValue(nameof(B), B);
        }

19 View Source File : AdvancedComparerBase.cs
License : MIT License
Project Creator : DataObjects-NET

[SecurityCritical]
    public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
    {
      info.AddValue(nameof(provider), provider, provider.GetType());
      info.AddValue(nameof(valueRangeInfo), valueRangeInfo, valueRangeInfo.GetType());
      info.AddValue(nameof(ComparisonRules), ComparisonRules, ComparisonRules.GetType());
      info.AddValue(nameof(DefaultDirectionMultiplier), DefaultDirectionMultiplier);
    }

19 View Source File : ResourceRef.cs
License : GNU General Public License v3.0
Project Creator : Amebis

[SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            info.AddValue(nameof(Uri), Uri);
            info.AddValue(nameof(PublicKeys), PublicKeys);
        }

19 View Source File : SerializableInvocationExpression.cs
License : MIT License
Project Creator : DataObjects-NET

[SecurityCritical]
    public override void GetObjectData(SerializationInfo info, StreamingContext context)
    {
      base.GetObjectData(info, context);
      info.AddValue("Expression", Expression);
      info.AddArray("Arguments", Arguments);
    }

19 View Source File : AuthorizeDirective.cs
License : MIT License
Project Creator : ChilliCream

public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            info.AddValue(nameof(Policy), Policy);
            info.AddValue(nameof(Roles), Roles?.ToList());
            info.AddValue(nameof(Apply), (int)Apply);
        }

19 View Source File : CostDirective.cs
License : MIT License
Project Creator : ChilliCream

public void GetObjectData(
        SerializationInfo info,
        StreamingContext context)
    {
        info.AddValue(nameof(Complexity), Complexity);
        info.AddValue(nameof(Multipliers), Multipliers);
        info.AddValue(nameof(DefaultMultiplier), DefaultMultiplier);
    }

19 View Source File : WebHeaderCollection.cs
License : MIT License
Project Creator : andruzzzhka

[SecurityPermission (
      SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)]
    public override void GetObjectData (
      SerializationInfo serializationInfo, StreamingContext streamingContext)
    {
      if (serializationInfo == null)
        throw new ArgumentNullException ("serializationInfo");

      serializationInfo.AddValue ("InternallyUsed", _internallyUsed);
      serializationInfo.AddValue ("State", (int) _state);

      var cnt = Count;
      serializationInfo.AddValue ("Count", cnt);
      cnt.Times (
        i => {
          serializationInfo.AddValue (i.ToString (), GetKey (i));
          serializationInfo.AddValue ((cnt + i).ToString (), Get (i));
        });
    }

19 View Source File : DateOnlyType.cs
License : Apache License 2.0
Project Creator : codexguy

void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
        {
            info.AddValue("v", GetAsInt());
        }

19 View Source File : Exceptions.cs
License : MIT License
Project Creator : azist

public override void GetObjectData(SerializationInfo info, StreamingContext context)
    {
      if (info == null)
        throw new AzosException(StringConsts.ARGUMENT_ERROR + GetType().Name + ".GetObjectData(info=null)");
      info.AddValue(REMOTE_FLD_NAME, m_Remote);
      base.GetObjectData(info, context);
    }

19 View Source File : Exceptions.cs
License : MIT License
Project Creator : CXuesong

public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            base.GetObjectData(info, context);
            info.AddValue(nameof(this.wait), wait);
        }

19 View Source File : FaultException.cs
License : MIT License
Project Creator : CoreWCF

public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            base.GetObjectData(info, context);
            AddFaultCodeObjectData(info, "code", _code);
            AddFaultReasonObjectData(info, "reason", _reason);
            info.AddValue("messageFault", _fault);
            info.AddValue("action", _action);
        }

19 View Source File : ReadingStrategy.cs
License : MIT License
Project Creator : azist

protected virtual SerializationInfo DeserializeSerializationInfo(Type objType, CompositeCustomData data, StreamingContext context)
        {
            var info = new SerializationInfo(objType, new FormatterConverter());

            foreach(var pair in data.CustomData)
            {
                var name = pair.Key;
                var type = ResolveType(  data.Doreplacedent.GetMetaTypeFromIndex( pair.Value.TypeIndex )  );
                var obj = data.Doreplacedent.PortableDataToNativeData(this, pair.Value.Data);

                info.AddValue(name, obj, type);
            }

            return info;
        }

19 View Source File : NetStandardSerialization.cs
License : MIT License
Project Creator : CXuesong

public static void GetObjectData(MemberInfo member, SerializationInfo info, StreamingContext context)
                {
                    info.SetType(typeof(MemberInfoReference));
                    info.AddValue(nameof(DeclaringType), new TypeSerializationSurrogate.TypeReference(member.DeclaringType));
                    info.AddValue(nameof(Name), member.Name);
                    info.AddValue(nameof(MemberType), member.MemberType);
                    info.AddValue(nameof(BindingAttr), GetBindingAttr(member));
                    if (member is MethodBase method)
                    {
                        info.AddValue(nameof(GenericParameters),
                            method.GetGenericArguments().ToArray());
                        info.AddValue(nameof(Parameters),
                            method.GetParameters().Select(p => p.ParameterType).ToArray());
                    }
                }

19 View Source File : ErrorObject.cs
License : MIT License
Project Creator : Archomeda

public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            if (info == null)
                throw new ArgumentNullException(nameof(info));

            info.AddValue(nameof(this.Text), this.Text, typeof(string));
            info.AddValue(nameof(this.Error), this.Error, typeof(string));
        }

19 View Source File : SerializableReaderWriter.cs
License : MIT License
Project Creator : CyAScott

public static async Task<object> ReadSerializable(this BinaryReader reader, IResolveProxyIds resolver, Type type = null)
        {
            type = type ?? reader.ReadType();

            var useCustomSerializer = reader.ReadBoolean();

            if (useCustomSerializer)
            {
                var context = new StreamingContext(StreamingContextStates.All, resolver);
                var info = new SerializationInfo(type, new DefaultFormatterConverter());
                var length = reader.ReadInt32();

                for (var index = 0; index < length; index++)
                {
                    var itemName = reader.ReadString();
                    var itemType = reader.ReadType();
                    var item = await reader.ReadObject(resolver).ConfigureAwait(false);

                    info.AddValue(itemName, item, itemType);
                }

                var ctor = type.getCtor();

                return ctor.Invoke(new object[]
                {
                    info, context
                });
            }

            var returnValue = FormatterServices.GetUninitializedObject(type);

            foreach (var field in type.getFields())
            {
                field.SetValue(returnValue, await reader.ReadObject(resolver).ConfigureAwait(false));
            }

            return returnValue;
        }

19 View Source File : LeaseLostException.cs
License : MIT License
Project Creator : Azure

public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            base.GetObjectData(info, context);
            info.AddValue("Lease", this.Lease);
            info.AddValue("IsGone", this.IsGone);
        }

19 View Source File : ValidationRuleException.cs
License : MIT License
Project Creator : daenetCorporation

public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            if (info == null)
            {
                throw new ArgumentNullException("info");
            }

            info.AddValue("ValidatingInstance", this.ValidatingInstance);
            info.AddValue("ValidationResult", this.ValidationResult);

            base.GetObjectData(info, context);
        }

19 View Source File : JsonSerializerInternalReader.cs
License : MIT License
Project Creator : akaskela

private object CreateISerializable(JsonReader reader, JsonISerializableContract contract, JsonProperty member, string id)
        {
            Type objectType = contract.UnderlyingType;

            if (!JsonTypeReflector.FullyTrusted)
            {
                string message = @"Type '{0}' implements ISerializable but cannot be deserialized using the ISerializable interface because the current application is not fully trusted and ISerializable can expose secure data." + Environment.NewLine +
                                 @"To fix this error either change the environment to be fully trusted, change the application to not deserialize the type, add JsonObjectAttribute to the type or change the JsonSerializer setting ContractResolver to use a new DefaultContractResolver with IgnoreSerializableInterface set to true." + Environment.NewLine;
                message = message.FormatWith(CultureInfo.InvariantCulture, objectType);

                throw JsonSerializationException.Create(reader, message);
            }

            if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Info)
            {
                TraceWriter.Trace(TraceLevel.Info, JsonPosition.FormatMessage(reader as IJsonLineInfo, reader.Path, "Deserializing {0} using ISerializable constructor.".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType)), null);
            }

            SerializationInfo serializationInfo = new SerializationInfo(contract.UnderlyingType, new JsonFormatterConverter(this, contract, member));

            bool finished = false;
            do
            {
                switch (reader.TokenType)
                {
                    case JsonToken.PropertyName:
                        string memberName = reader.Value.ToString();
                        if (!reader.Read())
                        {
                            throw JsonSerializationException.Create(reader, "Unexpected end when setting {0}'s value.".FormatWith(CultureInfo.InvariantCulture, memberName));
                        }
                        serializationInfo.AddValue(memberName, JToken.ReadFrom(reader));
                        break;
                    case JsonToken.Comment:
                        break;
                    case JsonToken.EndObject:
                        finished = true;
                        break;
                    default:
                        throw JsonSerializationException.Create(reader, "Unexpected token when deserializing object: " + reader.TokenType);
                }
            } while (!finished && reader.Read());

            if (!finished)
            {
                ThrowUnexpectedEndException(reader, contract, serializationInfo, "Unexpected end when deserializing object.");
            }

            if (contract.ISerializableCreator == null)
            {
                throw JsonSerializationException.Create(reader, "ISerializable type '{0}' does not have a valid constructor. To correctly implement ISerializable a constructor that takes SerializationInfo and StreamingContext parameters should be present.".FormatWith(CultureInfo.InvariantCulture, objectType));
            }

            object createdObject = contract.ISerializableCreator(serializationInfo, Serializer._context);

            if (id != null)
            {
                AddReference(reader, id, createdObject);
            }

            // these are together because OnDeserializing takes an object but for an ISerializable the object is fully created in the constructor
            OnDeserializing(reader, contract, createdObject);
            OnDeserialized(reader, contract, createdObject);

            return createdObject;
        }

19 View Source File : WrappingComparer{T,TBase1,TBase2}.cs
License : MIT License
Project Creator : DataObjects-NET

[SecurityCritical]
    public override void GetObjectData(SerializationInfo info, StreamingContext context)
    {
      base.GetObjectData(info, context);
      info.AddValue(nameof(BaseComparer1), BaseComparer1, BaseComparer1.GetType());
      info.AddValue(nameof(BaseComparer2), BaseComparer2, BaseComparer2.GetType());
    }

19 View Source File : failedhttpclientrequestexception.cs
License : MIT License
Project Creator : Azure-Samples

public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            if (info != null)
            {
                info.AddValue(nameof(this.StatusCode), this.StatusCode);
                base.GetObjectData(info, context);
            }
        }

19 View Source File : AdvancedConverterStruct.cs
License : MIT License
Project Creator : DataObjects-NET

[SecurityCritical]
    public void GetObjectData(SerializationInfo info, StreamingContext context)
    {
      info.AddValue("AdvancedConverter", AdvancedConverter);
    }

19 View Source File : BooleanDecisionTree.cs
License : MIT License
Project Creator : AutomataDotNet

public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            info.AddValue("p", SerializePrecomputed());
            info.AddValue("b", bst.Serialize());
        }

19 View Source File : FlagCollection.cs
License : MIT License
Project Creator : DataObjects-NET

[SecurityCritical]
    public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
    {
      info.AddValue("IsLocked", IsLocked);
      info.AddValue("AdvancedConverter", converter);
      info.AddValue("Keys", keys);
      info.AddValue("Flags", flags.Data);
    }

19 View Source File : WebHeaderCollection.cs
License : MIT License
Project Creator : bonzaiferroni

public override void GetObjectData (
      SerializationInfo serializationInfo, StreamingContext streamingContext)
    {
      if (serializationInfo == null)
        throw new ArgumentNullException ("serializationInfo");

      serializationInfo.AddValue ("InternallyCreated", _internallyCreated);
      serializationInfo.AddValue ("State", (int) _state);

      var count = Count;
      serializationInfo.AddValue ("Count", count);
      count.Times (
        i => {
          serializationInfo.AddValue (i.ToString (), GetKey (i));
          serializationInfo.AddValue ((count + i).ToString (), Get (i));
        });
    }

19 View Source File : AssociateProvider.cs
License : MIT License
Project Creator : DataObjects-NET

[SecurityCritical]
    public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
    {
      object[] constructorParamsExceptThis = null;
      // need to exclude this form parameters to prevent loop
      if (constructorParams.Length == 1) {
        constructorParamsExceptThis = Array.Empty<object>();
      }
      else {
        constructorParamsExceptThis = new object[constructorParams.Length - 1];
        Array.Copy(constructorParams, 1, constructorParamsExceptThis, 0, constructorParamsExceptThis.Length);
      }
      info.AddValue(nameof(constructorParams), constructorParamsExceptThis, constructorParams.GetType());
      info.AddValue(nameof(typeSuffixes), typeSuffixes, typeSuffixes.GetType());

      var highPriorityLocationsSerializable = highPriorityLocations.SelectToList(l => new Pair<string, string>(l.First.FullName, l.Second));
      info.AddValue(nameof(highPriorityLocations), highPriorityLocationsSerializable, highPriorityLocationsSerializable.GetType());
    }

19 View Source File : HighlightingBrush.cs
License : MIT License
Project Creator : Abdesol

void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
		{
			info.AddValue("color", brush.Color.ToString(CultureInfo.InvariantCulture));
		}

19 View Source File : SerializableExpression.cs
License : MIT License
Project Creator : DataObjects-NET

[SecurityCritical]
    public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
    {
      info.AddValue("NodeType", NodeType.ToString());
      info.AddValue("Type", Type.ToSerializableForm());
    }

19 View Source File : FormDialog.cs
License : MIT License
Project Creator : BotBuilderCommunity

void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
        {
            // constructor arguments
            info.AddValue(nameof(this._state), this._state);
            info.AddValue(nameof(this._buildForm), this._buildForm);
            info.AddValue(nameof(this._enreplacedies), this._enreplacedies);
            info.AddValue(nameof(this._options), this._options);

            // instantiated in constructor, saved when serialized
            info.AddValue(nameof(this._formState), this._formState);
        }

19 View Source File : Degree.cs
License : GNU Lesser General Public License v2.1
Project Creator : axiom3d

[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)]
#endif
        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            info.AddValue("value", this._value);
        }

19 View Source File : XshdColor.cs
License : MIT License
Project Creator : Abdesol

[System.Security.SecurityCritical]
		public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
		{
			if (info == null)
				throw new ArgumentNullException("info");
			info.AddValue("Name", this.Name);
			info.AddValue("Foreground", this.Foreground);
			info.AddValue("Background", this.Background);
			info.AddValue("HasUnderline", this.Underline.HasValue);
			if (this.Underline.HasValue)
				info.AddValue("Underline", this.Underline.Value);
			info.AddValue("Hreplacedtrikethrough", this.Strikethrough.HasValue);
			if (this.Strikethrough.HasValue)
				info.AddValue("Strikethrough", this.Strikethrough.Value);
			info.AddValue("HasWeight", this.FontWeight.HasValue);
			info.AddValue("HasWeight", this.FontWeight.HasValue);
			if (this.FontWeight.HasValue)
				info.AddValue("Weight", this.FontWeight.Value.ToOpenTypeWeight());
			info.AddValue("Hreplacedtyle", this.FontStyle.HasValue);
			if (this.FontStyle.HasValue)
				info.AddValue("Style", this.FontStyle.Value.ToString());
			info.AddValue("ExampleText", this.ExampleText);
			info.AddValue("HasFamily", this.FontFamily != null);
			if (this.FontFamily != null)
				info.AddValue("Family", this.FontFamily.FamilyNames.FirstOrDefault());
			info.AddValue("Hreplacedize", this.FontSize.HasValue);
			if (this.FontSize.HasValue)
				info.AddValue("Size", this.FontSize.Value.ToString());
		}

19 View Source File : HighlightingColor.cs
License : MIT License
Project Creator : Abdesol

[System.Security.SecurityCritical]
		public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
		{
			if (info == null)
				throw new ArgumentNullException("info");
			info.AddValue("Name", this.Name);
			info.AddValue("HasWeight", this.FontWeight.HasValue);
			if (this.FontWeight.HasValue)
				info.AddValue("Weight", this.FontWeight.Value.ToOpenTypeWeight());
			info.AddValue("Hreplacedtyle", this.FontStyle.HasValue);
			if (this.FontStyle.HasValue)
				info.AddValue("Style", this.FontStyle.Value.ToString());
			info.AddValue("HasUnderline", this.Underline.HasValue);
			if (this.Underline.HasValue)
				info.AddValue("Underline", this.Underline.Value);
			info.AddValue("Hreplacedtrikethrough", this.Strikethrough.HasValue);
			if (this.Strikethrough.HasValue)
				info.AddValue("Strikethrough", this.Strikethrough.Value);
			info.AddValue("Foreground", this.Foreground);
			info.AddValue("Background", this.Background);
			info.AddValue("HasFamily", this.FontFamily != null);
			if (this.FontFamily != null)
				info.AddValue("Family", this.FontFamily.FamilyNames.FirstOrDefault());
			info.AddValue("Hreplacedize", this.FontSize.HasValue);
			if (this.FontSize.HasValue)
				info.AddValue("Size", this.FontSize.Value.ToString());
		}

19 View Source File : DatabaseLoadingException.cs
License : MIT License
Project Creator : Aptiv-WLL

[SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            base.GetObjectData(info, context);
            info.AddValue("Partial Database", partialDatabase);
        }

19 View Source File : TypeSchema.cs
License : MIT License
Project Creator : azist

private SerializationInfo deserializeInfo(SlimReader reader, TypeRegistry registry, RefPool refs, StreamingContext streamingContext)
      {
          //20171223 DKh
          var visInfo = reader.ReadVarIntStr();
          var tInfo = registry[ visInfo ];
          var info = new SerializationInfo(tInfo, new FormatterConverter());

          //20171223 DKh
          //var info = new SerializationInfo(Type, new FormatterConverter());

          var cnt = reader.ReadInt();

          for(int i=0; i<cnt; i++)
          {
            var name = reader.ReadString();

            var vis = reader.ReadVarIntStr();
            var type = registry[ vis ];
            var obj = Schema.Deserialize(reader, registry, refs, streamingContext);

            info.AddValue(name, obj, type);
          }

          return info;
      }

19 View Source File : JsonSerializerInternalReader.cs
License : MIT License
Project Creator : CragonGame

private object CreateISerializable(JsonReader reader, JsonISerializableContract contract, string id)
		{
			Type objectType = contract.UnderlyingType;

			SerializationInfo serializationInfo = new SerializationInfo(contract.UnderlyingType, GetFormatterConverter());

			bool exit = false;
			do
			{
				switch (reader.TokenType)
				{
					case JsonToken.PropertyName:
						string memberName = reader.Value.ToString();
						if (!reader.Read())
							throw new JsonSerializationException("Unexpected end when setting {0}'s value.".FormatWith(CultureInfo.InvariantCulture, memberName));

						serializationInfo.AddValue(memberName, JToken.ReadFrom(reader));
						break;
					case JsonToken.Comment:
						break;
					case JsonToken.EndObject:
						exit = true;
						break;
					default:
						throw new JsonSerializationException("Unexpected token when deserializing object: " + reader.TokenType);
				}
			} while (!exit && reader.Read());

			if (contract.ISerializableCreator == null)
				throw new JsonSerializationException("ISerializable type '{0}' does not have a valid constructor. To correctly implement ISerializable a constructor that takes SerializationInfo and StreamingContext parameters should be present.".FormatWith(CultureInfo.InvariantCulture, objectType));

			object createdObject = contract.ISerializableCreator(serializationInfo, Serializer.Context);

			if (id != null)
				Serializer.ReferenceResolver.AddReference(this, id, createdObject);

			// these are together because OnDeserializing takes an object but for an ISerializable the object is full created in the constructor
			contract.InvokeOnDeserializing(createdObject, Serializer.Context);
			contract.InvokeOnDeserialized(createdObject, Serializer.Context);

			return createdObject;
		}

See More Examples