Antmicro.Migrant.ObjectWriter.ObjectWriter C# (CSharp) Méthode

ObjectWriter() public méthode

public ObjectWriter ( Stream stream, Serializer writeMethods, Action preSerializationCallback = null, Action postSerializationCallback = null, SwapList surrogatesForObjects = null, SwapList objectsForSurrogates = null, bool treatCollectionAsUserObject = false, bool useBuffering = true, bool disableStamping = false, ReferencePreservation referencePreservation = ReferencePreservation.Preserve ) : System
stream Stream
writeMethods Serializer
preSerializationCallback Action
postSerializationCallback Action
surrogatesForObjects Antmicro.Migrant.Utilities.SwapList
objectsForSurrogates Antmicro.Migrant.Utilities.SwapList
treatCollectionAsUserObject bool
useBuffering bool
disableStamping bool
referencePreservation ReferencePreservation
Résultat System
        public ObjectWriter(Stream stream, Serializer.WriteMethods writeMethods, Action<object> preSerializationCallback = null,
                            Action<object> postSerializationCallback = null, SwapList surrogatesForObjects = null, SwapList objectsForSurrogates = null, 
                            bool treatCollectionAsUserObject = false, bool useBuffering = true, bool disableStamping = false, 
                            ReferencePreservation referencePreservation = ReferencePreservation.Preserve)
        {
            this.treatCollectionAsUserObject = treatCollectionAsUserObject;
            this.objectsForSurrogates = objectsForSurrogates;
            this.referencePreservation = referencePreservation;
            this.preSerializationCallback = preSerializationCallback;
            this.postSerializationCallback = postSerializationCallback;
            this.writeMethods = writeMethods;
            this.surrogatesForObjects = surrogatesForObjects ?? new SwapList();

            parentObjects = new Dictionary<object, object>();
            postSerializationHooks = new List<Action>();
            types = new IdentifiedElementsDictionary<TypeDescriptor>(this);
            Methods = new IdentifiedElementsDictionary<MethodDescriptor>(this);
            Assemblies = new IdentifiedElementsDictionary<AssemblyDescriptor>(this);
            Modules = new IdentifiedElementsDictionary<ModuleDescriptor>(this);
            writer = new PrimitiveWriter(stream, useBuffering);
            if(referencePreservation == ReferencePreservation.Preserve)
            {
                identifier = new ObjectIdentifier();
            }
            touchTypeMethod = disableStamping ? (Func<Type, int>)TouchAndWriteTypeIdWithSimpleStamp : TouchAndWriteTypeIdWithFullStamp;
            objectsWrittenInline = new HashSet<int>();
        }