Antmicro.Migrant.Customization.Settings.With C# (CSharp) Method

With() public method

Initializes a new instance of the Antmicro.Migrant.Customization.Settings class.
public With ( Method serializationMethod = null, Method deserializationMethod = null, VersionToleranceLevel versionTolerance = null, bool supportForISerializable = null, bool treatCollectionAsUserObject = null, bool useBuffering = null, bool disableTypeStamping = null, ReferencePreservation referencePreservation = null ) : Settings
serializationMethod Method /// Method used for serialization. ///
deserializationMethod Method /// Method used for deserialization. ///
versionTolerance VersionToleranceLevel /// Specifies the possible level of difference between class layout when it was serialized and in the /// moment of deserialization. ///
supportForISerializable bool /// Specifies whether Migrant should use GetObjectData approach for serialization. ///
treatCollectionAsUserObject bool /// Specifies if collection objects are to be deserialized without optimization (treated as normal user objects). ///
useBuffering bool /// True if buffering should be used, false if writes should directly go to the stream and reads should never read /// data in advance. Disabling buffering also disables padding. ///
disableTypeStamping bool /// Specifies if type stamping should be disabled in order to improve performance and limit output stream size. ///
referencePreservation ReferencePreservation /// Tells serializer how to treat references between sessions of open stream serialization. ///
return Settings
        public Settings With(Method? serializationMethod = null, Method? deserializationMethod = null, VersionToleranceLevel? versionTolerance = null,
                             bool? supportForISerializable = null, bool? treatCollectionAsUserObject = null, bool? useBuffering = null, bool? disableTypeStamping = null,
                             ReferencePreservation? referencePreservation = null)
        {
            var result = new Settings {
                SerializationMethod = serializationMethod ?? SerializationMethod,
                DeserializationMethod = deserializationMethod ?? DeserializationMethod,
                VersionTolerance = versionTolerance ?? VersionTolerance,
                SupportForISerializable = supportForISerializable ?? SupportForISerializable,
                TreatCollectionAsUserObject = treatCollectionAsUserObject ?? TreatCollectionAsUserObject,
                UseBuffering = useBuffering ?? UseBuffering,
                DisableTypeStamping = disableTypeStamping ?? DisableTypeStamping,
                ReferencePreservation = referencePreservation ?? ReferencePreservation
            };
            return result;
        }