private void InternalInit() { InternalST.Soap(this, objectInfoId, " objectType ", objectType, " InternalInit"); obj = null; objectType = null; count = 0; isSi = false; isNamed = false; isTyped = false; si = null; wireMemberNames = null; wireMemberTypes = null; cache = null; lastPosition = 0; numberMembersSeen = 0; bfake = false; bSoapFault = false; majorVersion = 0; minorVersion = 0; typeAttributeInfo = null; arrayElemObjectInfo = null; // Si Read if (memberTypesList != null) { memberTypesList.Clear(); } }
private void InitMemberInfo() { InternalST.Soap(this, objectInfoId, " ", objectType, " InitMemberInfo Entry"); cache = (SerObjectInfoCache)serObjectInfoInit.seenBeforeTable[objectType]; if (cache == null) { InternalST.Soap(this, objectInfoId, " ", objectType, " InitMemberInfo new cache"); cache = new SerObjectInfoCache(); cache.memberInfos = FormatterServices.GetSerializableMembers(objectType, context); count = cache.memberInfos.Length; cache.memberNames = new String[count]; cache.memberTypes = new Type[count]; cache.memberAttributeInfos = new SoapAttributeInfo[count]; // Calculate new arrays for (int i = 0; i < count; i++) { cache.memberNames[i] = cache.memberInfos[i].Name; cache.memberTypes[i] = GetMemberType(cache.memberInfos[i]); cache.memberAttributeInfos[i] = Attr.GetMemberAttributeInfo(cache.memberInfos[i], cache.memberNames[i], cache.memberTypes[i]); InternalST.Soap(this, objectInfoId, " InitMemberInfo name ", cache.memberNames[i], ", type ", cache.memberTypes[i], ", memberInfoType ", cache.memberInfos[i].GetType()); } cache.fullTypeName = objectType.FullName; cache.assemblyString = objectType.Module.Assembly.FullName; serObjectInfoInit.seenBeforeTable.Add(objectType, cache); } memberData = new Object[cache.memberNames.Length]; memberNames = new String[cache.memberNames.Length]; isTyped = true; isNamed = true; InternalST.Soap(this, objectInfoId, " ", objectType, " InitMemberInfo Exit"); }
private void InitSiRead(String assemblyName) { InternalST.Soap(this, objectInfoId, " ", objectType, " InitMemberInfo new cache"); if (assemblyName != null) { // Need to set to assembly name from the wire. This assembly name could contain version information // not in the default assembly name which was returned from fusion si.AssemblyName = assemblyName; } cache = new SerObjectInfoCache(); cache.fullTypeName = si.FullTypeName; cache.assemblyString = si.AssemblyName; // Input from IFieldInfo cache.memberNames = wireMemberNames; cache.memberTypes = wireMemberTypes; if (memberTypesList != null) { memberTypesList = new ArrayList(20); } if (wireMemberNames != null && wireMemberTypes != null) { isTyped = true; } }
private void InternalInit() { this.obj = null; this.objectType = null; this.count = 0; this.isSi = false; this.isNamed = false; this.isTyped = false; this.si = null; this.wireMemberNames = null; this.wireMemberTypes = null; this.cache = null; this.lastPosition = 0; this.numberMembersSeen = 0; this.bfake = false; this.bSoapFault = false; this.majorVersion = 0; this.minorVersion = 0; this.typeAttributeInfo = null; this.arrayElemObjectInfo = null; if (this.memberTypesList != null) { this.memberTypesList.Clear(); } }
private void InitMemberInfo() { this.cache = (SerObjectInfoCache)this.serObjectInfoInit.seenBeforeTable[this.objectType]; if (this.cache == null) { this.cache = new SerObjectInfoCache(); this.cache.memberInfos = FormatterServices.GetSerializableMembers(this.objectType, this.context); this.count = this.cache.memberInfos.Length; this.cache.memberNames = new string[this.count]; this.cache.memberTypes = new Type[this.count]; this.cache.memberAttributeInfos = new SoapAttributeInfo[this.count]; for (int i = 0; i < this.count; i++) { this.cache.memberNames[i] = this.cache.memberInfos[i].Name; this.cache.memberTypes[i] = this.GetMemberType(this.cache.memberInfos[i]); this.cache.memberAttributeInfos[i] = Attr.GetMemberAttributeInfo(this.cache.memberInfos[i], this.cache.memberNames[i], this.cache.memberTypes[i]); } this.cache.fullTypeName = this.objectType.FullName; this.cache.assemblyString = this.objectType.Module.Assembly.FullName; this.serObjectInfoInit.seenBeforeTable.Add(this.objectType, this.cache); } this.memberData = new object[this.cache.memberNames.Length]; this.memberNames = new string[this.cache.memberNames.Length]; this.isTyped = true; this.isNamed = true; }
private void InitSiWrite(ObjectWriter objectWriter) { if (this.si.FullTypeName.Equals("FormatterWrapper")) { this.obj = this.si.GetValue("__WrappedObject", Converter.typeofObject); this.InitSerialize(this.obj, this.surrogateSelector, this.context, this.serObjectInfoInit, this.converter, null, objectWriter); } else { SerializationInfoEnumerator enumerator = null; this.isSi = true; enumerator = this.si.GetEnumerator(); int memberCount = this.si.MemberCount; this.cache = new SerObjectInfoCache(); this.cache.memberNames = new string[memberCount]; this.cache.memberTypes = new Type[memberCount]; this.memberData = new object[memberCount]; this.cache.fullTypeName = this.si.FullTypeName; this.cache.assemblyString = this.si.AssemblyName; enumerator = this.si.GetEnumerator(); for (int i = 0; enumerator.MoveNext(); i++) { this.cache.memberNames[i] = enumerator.Name; this.cache.memberTypes[i] = enumerator.ObjectType; this.memberData[i] = enumerator.Value; } this.isNamed = true; this.isTyped = false; } }
private void InitNoMembers() { this.cache = (SerObjectInfoCache)this.serObjectInfoInit.seenBeforeTable[this.objectType]; if (this.cache == null) { this.cache = new SerObjectInfoCache(); this.cache.fullTypeName = this.objectType.FullName; this.cache.assemblyString = this.objectType.Module.Assembly.FullName; this.serObjectInfoInit.seenBeforeTable.Add(this.objectType, this.cache); } }
// Write Constructor used for array types or null members internal void InitSerialize(Type objectType, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, SoapAttributeInfo attributeInfo) { InternalST.Soap(this, objectInfoId, " Constructor 2 ", objectType); this.objectType = objectType; this.context = context; this.serObjectInfoInit = serObjectInfoInit; this.parentMemberAttributeInfo = attributeInfo; this.surrogateSelector = surrogateSelector; this.converter = converter; if (objectType.IsArray) { arrayElemObjectInfo = Serialize(objectType.GetElementType(), surrogateSelector, context, serObjectInfoInit, converter, null); typeAttributeInfo = GetTypeAttributeInfo(); InitNoMembers(); return; } typeAttributeInfo = GetTypeAttributeInfo(); ISurrogateSelector surrogateSelectorTemp = null; if (surrogateSelector != null) { serializationSurrogate = surrogateSelector.GetSurrogate(objectType, context, out surrogateSelectorTemp); } if (serializationSurrogate != null) { isSi = true; } else if (objectType == Converter.typeofObject) { } else if (Converter.typeofISerializable.IsAssignableFrom(objectType)) { isSi = true; } if (isSi) { si = new SerializationInfo(objectType, converter); cache = new SerObjectInfoCache(); cache.fullTypeName = si.FullTypeName; cache.assemblyString = si.AssemblyName; } else { InitMemberInfo(); } InternalST.Soap(this, objectInfoId, " ", objectType, " InitSerialize Exit ", isSi); }
private void InitNoMembers() { cache = (SerObjectInfoCache)serObjectInfoInit.seenBeforeTable[objectType]; if (cache == null) { InternalST.Soap(this, objectInfoId, " ", objectType, " InitMemberInfo new cache"); cache = new SerObjectInfoCache(); cache.fullTypeName = objectType.FullName; cache.assemblyString = objectType.Module.Assembly.FullName; serObjectInfoInit.seenBeforeTable.Add(objectType, cache); } }
private void InitSiWrite(ObjectWriter objectWriter) { InternalST.Soap(this, objectInfoId, " InitSiWrite Entry "); // FormatterWrapper instructs the Formatters to use the // __WrappedObject has the real object. This is a way // to get Surrogates to return a real object. if (si.FullTypeName.Equals("FormatterWrapper")) { obj = si.GetValue("__WrappedObject", Converter.typeofObject); InitSerialize(obj, surrogateSelector, context, serObjectInfoInit, converter, null, objectWriter); } else { SerializationInfoEnumerator siEnum = null; isSi = true; siEnum = si.GetEnumerator(); int infoLength = 0; infoLength = si.MemberCount; int count = infoLength; // For ISerializable cache cannot be saved because each object instance can have different values // BinaryWriter only puts the map on the wire if the ISerializable map cannot be reused. cache = new SerObjectInfoCache(); cache.memberNames = new String[count]; cache.memberTypes = new Type[count]; memberData = new Object[count]; cache.fullTypeName = si.FullTypeName; cache.assemblyString = si.AssemblyName; siEnum = si.GetEnumerator(); for (int i = 0; siEnum.MoveNext(); i++) { cache.memberNames[i] = siEnum.Name; cache.memberTypes[i] = siEnum.ObjectType; memberData[i] = siEnum.Value; InternalST.Soap(this, objectInfoId + " ", objectType, " InitSiWrite ", cache.memberNames[i], " Type ", cache.memberTypes[i], " data ", memberData[i]); } isNamed = true; isTyped = false; } InternalST.Soap(this, objectInfoId, " InitSiWrite Exit "); }
private void InternalInit() { this.obj = null; this.objectType = null; this.isSi = false; this.isNamed = false; this.isTyped = false; this.si = null; this.cache = null; this.memberData = null; this.isArray = false; this.objectId = 0L; this.assemId = 0L; this.lastPosition = 0; this.typeAttributeInfo = null; this.parentMemberAttributeInfo = null; this.arrayElemObjectInfo = null; }
internal void InitSerialize(Type objectType, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, SoapAttributeInfo attributeInfo) { this.objectType = objectType; this.context = context; this.serObjectInfoInit = serObjectInfoInit; this.parentMemberAttributeInfo = attributeInfo; this.surrogateSelector = surrogateSelector; this.converter = converter; if (objectType.IsArray) { this.arrayElemObjectInfo = Serialize(objectType.GetElementType(), surrogateSelector, context, serObjectInfoInit, converter, null); this.typeAttributeInfo = this.GetTypeAttributeInfo(); this.InitNoMembers(); } else { this.typeAttributeInfo = this.GetTypeAttributeInfo(); ISurrogateSelector selector = null; if (surrogateSelector != null) { this.serializationSurrogate = surrogateSelector.GetSurrogate(objectType, context, out selector); } if (this.serializationSurrogate != null) { this.isSi = true; } else if (!(objectType == Converter.typeofObject) && Converter.typeofISerializable.IsAssignableFrom(objectType)) { this.isSi = true; } if (this.isSi) { this.si = new SerializationInfo(objectType, converter); this.cache = new SerObjectInfoCache(); this.cache.fullTypeName = this.si.FullTypeName; this.cache.assemblyString = this.si.AssemblyName; } else { this.InitMemberInfo(); } } }
private void InitSiRead(string assemblyName) { if (assemblyName != null) { this.si.AssemblyName = assemblyName; } this.cache = new SerObjectInfoCache(); this.cache.fullTypeName = this.si.FullTypeName; this.cache.assemblyString = this.si.AssemblyName; this.cache.memberNames = this.wireMemberNames; this.cache.memberTypes = this.wireMemberTypes; if (this.memberTypesList != null) { this.memberTypesList = new ArrayList(20); } if ((this.wireMemberNames != null) && (this.wireMemberTypes != null)) { this.isTyped = true; } }
private void InternalInit() { InternalST.Soap(this, objectInfoId, " InternalInit"); obj = null; objectType = null; isSi = false; isNamed = false; isTyped = false; si = null; cache = null; memberData = null; isArray = false; // Writing and Parsing information objectId = 0; assemId = 0; // Added for Soap lastPosition = 0; typeAttributeInfo = null; parentMemberAttributeInfo = null; arrayElemObjectInfo = null; }
private void InternalInit() { InternalST.Soap( this, objectInfoId," InternalInit"); obj = null; objectType = null; isSi = false; isNamed = false; isTyped = false; si = null; cache = null; memberData = null; isArray = false; // Writing and Parsing information objectId = 0; assemId = 0; // Added for Soap lastPosition = 0; typeAttributeInfo = null; parentMemberAttributeInfo = null; arrayElemObjectInfo = null; }
private void InitMemberInfo() { InternalST.Soap( this,objectInfoId," ", objectType," InitMemberInfo Entry"); cache = (SerObjectInfoCache)serObjectInfoInit.seenBeforeTable[objectType]; if (cache == null) { InternalST.Soap( this,objectInfoId," ", objectType," InitMemberInfo new cache"); cache = new SerObjectInfoCache(); cache.memberInfos = FormatterServices.GetSerializableMembers(objectType, context); count = cache.memberInfos.Length; cache.memberNames = new String[count]; cache.memberTypes = new Type[count]; cache.memberAttributeInfos = new SoapAttributeInfo[count]; // Calculate new arrays for (int i=0; i<count; i++) { cache.memberNames[i] = cache.memberInfos[i].Name; cache.memberTypes[i] = GetMemberType(cache.memberInfos[i]); cache.memberAttributeInfos[i] = Attr.GetMemberAttributeInfo(cache.memberInfos[i], cache.memberNames[i], cache.memberTypes[i]); InternalST.Soap( this, objectInfoId," InitMemberInfo name ",cache.memberNames[i],", type ",cache.memberTypes[i],", memberInfoType ",cache.memberInfos[i].GetType()); } cache.fullTypeName = objectType.FullName; cache.assemblyString = objectType.Module.Assembly.FullName; serObjectInfoInit.seenBeforeTable.Add(objectType, cache); } memberData = new Object[cache.memberNames.Length]; isTyped = true; isNamed = true; InternalST.Soap( this,objectInfoId," ", objectType," InitMemberInfo Exit"); }
private void InitNoMembers() { cache = (SerObjectInfoCache)serObjectInfoInit.seenBeforeTable[objectType]; if (cache == null) { InternalST.Soap( this,objectInfoId," ", objectType," InitMemberInfo new cache"); cache = new SerObjectInfoCache(); cache.fullTypeName = objectType.FullName; cache.assemblyString = objectType.Module.Assembly.FullName; serObjectInfoInit.seenBeforeTable.Add(objectType, cache); } }
private void InitSiRead(String assemblyName) { InternalST.Soap( this,objectInfoId," ", objectType," InitMemberInfo new cache"); if (assemblyName != null) { // Need to set to assembly name from the wire. This assembly name could contain version information // not in the default assembly name which was returned from fusion si.AssemblyName = assemblyName; } cache = new SerObjectInfoCache(); cache.fullTypeName = si.FullTypeName; cache.assemblyString = si.AssemblyName; // Input from IFieldInfo cache.memberNames = wireMemberNames; cache.memberTypes = wireMemberTypes; if (memberTypesList != null) { memberTypesList = new ArrayList(20); } if (wireMemberNames != null && wireMemberTypes != null) isTyped = true; }
private void InternalInit() { InternalST.Soap( this, objectInfoId," objectType ",objectType," InternalInit"); obj = null; objectType = null; count = 0; isSi = false; isNamed = false; isTyped = false; si = null; wireMemberNames = null; wireMemberTypes = null; cache = null; lastPosition = 0; numberMembersSeen = 0; bfake = false; bSoapFault = false; majorVersion = 0; minorVersion = 0; typeAttributeInfo = null; arrayElemObjectInfo = null; // Si Read if (memberTypesList != null) { memberTypesList.Clear(); } }
private void InitSiWrite() { InternalST.Soap( this, objectInfoId," InitSiWrite Entry "); // FormatterWrapper instructs the Formatters to use the // __WrappedObject has the real object. This is a way // to get Surrogates to return a real object. if (si.FullTypeName.Equals("FormatterWrapper")) { obj = si.GetValue("__WrappedObject", Converter.typeofObject); InitSerialize(obj, surrogateSelector, context, serObjectInfoInit, converter, null); } else { SerializationInfoEnumerator siEnum = null; isSi = true; siEnum = si.GetEnumerator(); int infoLength = 0; infoLength = si.MemberCount; int count = infoLength; // For ISerializable cache cannot be saved because each object instance can have different values // BinaryWriter only puts the map on the wire if the ISerializable map cannot be reused. cache = new SerObjectInfoCache(); cache.memberNames = new String[count]; cache.memberTypes = new Type[count]; memberData = new Object[count]; cache.fullTypeName = si.FullTypeName; cache.assemblyString = si.AssemblyName; siEnum = si.GetEnumerator(); for (int i=0; siEnum.MoveNext(); i++) { cache.memberNames[i] = siEnum.Name; cache.memberTypes[i] = siEnum.ObjectType; memberData[i] = siEnum.Value; InternalST.Soap( this,objectInfoId+" ",objectType," InitSiWrite ",cache.memberNames[i]," Type ",cache.memberTypes[i]," data ",memberData[i]); } isNamed = true; isTyped = false; } InternalST.Soap(this, objectInfoId," InitSiWrite Exit "); }
// Write Constructor used for array types or null members internal void InitSerialize(Type objectType, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, SoapAttributeInfo attributeInfo) { InternalST.Soap( this, objectInfoId," Constructor 2 ",objectType); this.objectType = objectType; this.context = context; this.serObjectInfoInit = serObjectInfoInit; this.parentMemberAttributeInfo = attributeInfo; this.surrogateSelector = surrogateSelector; this.converter = converter; if (objectType.IsArray) { arrayElemObjectInfo = Serialize(objectType.GetElementType(), surrogateSelector, context, serObjectInfoInit, converter, null); typeAttributeInfo = GetTypeAttributeInfo(); InitNoMembers(); return; } typeAttributeInfo = GetTypeAttributeInfo(); ISurrogateSelector surrogateSelectorTemp = null; if (surrogateSelector!=null) serializationSurrogate = surrogateSelector.GetSurrogate(objectType, context, out surrogateSelectorTemp); if (serializationSurrogate != null) { isSi = true; } else if (objectType == Converter.typeofObject) { } else if (Converter.typeofISerializable.IsAssignableFrom(objectType)) isSi = true; if (isSi) { si = new SerializationInfo(objectType, converter); cache = new SerObjectInfoCache(); cache.fullTypeName = si.FullTypeName; cache.assemblyString = si.AssemblyName; } else { InitMemberInfo(); } InternalST.Soap( this,objectInfoId," ", objectType," InitSerialize Exit ",isSi); }
private void InitMemberInfo() { this.cache = (SerObjectInfoCache) this.serObjectInfoInit.seenBeforeTable[this.objectType]; if (this.cache == null) { this.cache = new SerObjectInfoCache(); int length = 0; if (!this.objectType.IsByRef) { this.cache.memberInfos = FormatterServices.GetSerializableMembers(this.objectType, this.context); length = this.cache.memberInfos.Length; } this.cache.memberNames = new string[length]; this.cache.memberTypes = new Type[length]; this.cache.memberAttributeInfos = new SoapAttributeInfo[length]; for (int i = 0; i < length; i++) { this.cache.memberNames[i] = this.cache.memberInfos[i].Name; this.cache.memberTypes[i] = this.GetMemberType(this.cache.memberInfos[i]); this.cache.memberAttributeInfos[i] = Attr.GetMemberAttributeInfo(this.cache.memberInfos[i], this.cache.memberNames[i], this.cache.memberTypes[i]); } this.cache.fullTypeName = this.objectType.FullName; this.cache.assemblyString = this.objectType.Module.Assembly.FullName; this.serObjectInfoInit.seenBeforeTable.Add(this.objectType, this.cache); } if (this.obj != null) { this.memberData = FormatterServices.GetObjectData(this.obj, this.cache.memberInfos); } this.isTyped = true; this.isNamed = true; }
private void InitNoMembers() { this.cache = (SerObjectInfoCache) this.serObjectInfoInit.seenBeforeTable[this.objectType]; if (this.cache == null) { this.cache = new SerObjectInfoCache(); this.cache.fullTypeName = this.objectType.FullName; this.cache.assemblyString = this.objectType.Module.Assembly.FullName; this.serObjectInfoInit.seenBeforeTable.Add(this.objectType, this.cache); } }