// Read a "ISerializable" item with name "name". public override ISerializable Inout(string name, ISerializable v) { nodeStack.Push(currentNode); currentNode = GetNode(name); string type = currentNode.Attributes.GetNamedItem("type").Value; ISerializable newElem = compositeFactory.Create(type); newElem.Serialize(this); currentNode = nodeStack.Pop(); return(newElem); }
public override ISerializable Inout <T>(string name, ISerializable v) { string typeName = compositeFactory.Create(v); if (typeName == null) { typeName = v.GetType().Name; } string typeAdd = TYPE_ADD_CLASS + "\"" + typeName + "\""; string nodeString = Tab(currentTabDepth) + "<" + name + typeAdd + ">" + LINE_CHANGE; bw.Write(encoding.GetBytes(nodeString)); currentTabDepth++; v.Serialize(this); currentTabDepth--; nodeString = Tab(currentTabDepth) + "</" + name + ">" + LINE_CHANGE; bw.Write(encoding.GetBytes(nodeString)); return(v); }
/// /// <param name="name"></param> /// <param name="v"></param> public override ISerializable Inout(string name, ISerializable v) { string types = readBuf.ReadString(); ISerializable newSer = compositeFactory.Create(types); if (newSer != null) { //Do this to preserve type information even if slicing has occured. (newSer as OPSObject).SetTypesString(types); newSer.Serialize(this); } return(newSer); }
/// /// <param name="name"></param> /// <param name="v"></param> public override ISerializable Inout(string name, ISerializable v) { int verMask = 0; string types = readBuf.ReadString(); if ((types.Length > 0) && (types[0] == '0')) { verMask = 1; types = types.Substring(2); } ISerializable newSer = compositeFactory.Create(types); if (newSer != null) { //Do this to preserve type information even if slicing has occured. (newSer as OPSObject).SetTypesString(types); (newSer as OPSObject).IdlVersionMask = verMask; newSer.Serialize(this); } return(newSer); }