Exemplo n.º 1
0
        // 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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        ///
        /// <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);
        }
Exemplo n.º 4
0
        ///
        /// <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);
        }