System.Runtime.Serialization.Formatters.Soap.WriteObjectInfo.InitSerialize C# (CSharp) Метод

InitSerialize() приватный Метод

private InitSerialize ( Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, SoapAttributeInfo attributeInfo, System.Runtime.Serialization.Formatters.Soap.ObjectWriter objectWriter ) : void
obj Object
surrogateSelector ISurrogateSelector
context System.Runtime.Serialization.StreamingContext
serObjectInfoInit SerObjectInfoInit
converter IFormatterConverter
attributeInfo SoapAttributeInfo
objectWriter System.Runtime.Serialization.Formatters.Soap.ObjectWriter
Результат void
        internal void InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, SoapAttributeInfo attributeInfo, ObjectWriter objectWriter)
        {
            InternalST.Soap( this, objectInfoId," Constructor 1 ",obj);        
            this.context = context;
            this.obj = obj;
            this.serObjectInfoInit = serObjectInfoInit;
            this.parentMemberAttributeInfo = attributeInfo;
            this.surrogateSelector = surrogateSelector;
            this.converter = converter;
            ISurrogateSelector surrogateSelectorTemp;

            if (RemotingServices.IsTransparentProxy(obj))
                objectType = Converter.typeofMarshalByRefObject;
            else
                objectType = obj.GetType();

            if (objectType.IsArray)
            {
                arrayElemObjectInfo = Serialize(objectType.GetElementType(), surrogateSelector, context, serObjectInfoInit, converter, null);
                typeAttributeInfo = GetTypeAttributeInfo();
                isArray = true;
                InitNoMembers();
                return;
            }

            InternalST.Soap( this, objectInfoId," Constructor 1 trace 2");

            typeAttributeInfo = GetTypeAttributeInfo();

            objectWriter.ObjectManager.RegisterObject(obj);
            if (surrogateSelector != null && (serializationSurrogate = surrogateSelector.GetSurrogate(objectType, context, out surrogateSelectorTemp)) != null)
            {
                InternalST.Soap( this, objectInfoId," Constructor 1 trace 3");         
                si = new SerializationInfo(objectType, converter);
                if (!objectType.IsPrimitive)
                    serializationSurrogate.GetObjectData(obj, si, context);
                InitSiWrite(objectWriter);
            }
            else if (obj is ISerializable)
            {
                if (!objectType.IsSerializable)
                {
                    throw new SerializationException(String.Format(CultureInfo.CurrentCulture, SoapUtil.GetResourceString("Serialization_NonSerType"), 
                                                                   objectType.FullName, objectType.Module.Assembly.FullName));
                }
                si = new SerializationInfo(objectType, converter);
                ((ISerializable)obj).GetObjectData(si, context);
                InternalST.Soap( this, objectInfoId," Constructor 1 trace 4 ISerializable "+objectType);                       
                InitSiWrite(objectWriter);
            }
            else
            {
                InternalST.Soap(this, objectInfoId," Constructor 1 trace 5");
                InitMemberInfo();
            }
        }

Same methods

WriteObjectInfo::InitSerialize ( Type objectType, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, SoapAttributeInfo attributeInfo ) : void

Usage Example

Пример #1
0
        internal static WriteObjectInfo Serialize(Type objectType, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, SoapAttributeInfo attributeInfo)
        {
            WriteObjectInfo soi = GetObjectInfo(serObjectInfoInit);

            soi.InitSerialize(objectType, surrogateSelector, context, serObjectInfoInit, converter, attributeInfo);
            return(soi);
        }
All Usage Examples Of System.Runtime.Serialization.Formatters.Soap.WriteObjectInfo::InitSerialize