コード例 #1
0
        public override void WriteObject(XmlWriter writer, object graph)
        {
            ArrayOfFileInfo ArrayOfFileInfoField = ((ArrayOfFileInfo)(graph));

            if (WriteParentElement(writer, true, true, graph))
            {
                FileInfoDataContractSerializer FileInfoDCS = new FileInfoDataContractSerializer("FileInfo", "http://schemas.datacontract.org/2004/07/WcfMtomService", "http://schemas.datacontract.org/2004/07/WcfMtomService");
                for (int i = 0; (i < ArrayOfFileInfoField.FileInfo.Length); i = (i + 1))
                {
                    FileInfoDCS.WriteObject(writer, ArrayOfFileInfoField.FileInfo[i]);
                }
                writer.WriteEndElement();
            }
            return;
        }
コード例 #2
0
        public override object ReadObject(XmlReader reader)
        {
            ArrayOfFileInfo ArrayOfFileInfoField = null;

            if (IsParentStartElement(reader, false, true))
            {
                ArrayOfFileInfoField = new ArrayOfFileInfo();
                reader.Read();
                FileInfoDataContractSerializer FileInfoDCS   = new FileInfoDataContractSerializer("FileInfo", "http://schemas.datacontract.org/2004/07/WcfMtomService", "http://schemas.datacontract.org/2004/07/WcfMtomService");
                System.Collections.ArrayList   FileInfo_List = new System.Collections.ArrayList();
                for (int i = 0; (i > -1); i = (i + 1))
                {
                    if (!IsChildStartElement(reader, "FileInfo", false, false))
                    {
                        ArrayOfFileInfoField.FileInfo = new FileInfo[FileInfo_List.Count];
                        FileInfo_List.CopyTo(ArrayOfFileInfoField.FileInfo);
                        break;
                    }
                    FileInfo_List.Add(((FileInfo)(FileInfoDCS.ReadObject(reader))));
                }
                reader.ReadEndElement();
            }
            return(ArrayOfFileInfoField);
        }
コード例 #3
0
ファイル: Service1.cs プロジェクト: koson/.NETMF_for_LPC17xx
        public override object ReadObject(XmlReader reader)
        {
            ArrayOfFileInfo ArrayOfFileInfoField = null;
            if (IsParentStartElement(reader, false, true))
            {
                ArrayOfFileInfoField = new ArrayOfFileInfo();
                reader.Read();
                FileInfoDataContractSerializer FileInfoDCS = new FileInfoDataContractSerializer("FileInfo", "http://schemas.datacontract.org/2004/07/WcfMtomService", "http://schemas.datacontract.org/2004/07/WcfMtomService");
                System.Collections.ArrayList FileInfo_List = new System.Collections.ArrayList();
                for (int i = 0; (i > -1); i = (i + 1))
                {
                    if (!IsChildStartElement(reader, "FileInfo", false, false))
                    {
                        ArrayOfFileInfoField.FileInfo = new FileInfo[FileInfo_List.Count];
                        FileInfo_List.CopyTo(ArrayOfFileInfoField.FileInfo);
						break;
                    }
                    FileInfo_List.Add(((FileInfo)(FileInfoDCS.ReadObject(reader))));
                }
                reader.ReadEndElement();
            }
            return ArrayOfFileInfoField;
        }