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 ");
}