コード例 #1
0
        protected override void Deserialize(XML.Reader reader)
        {
            this.CamFiles = new List <string>();

            try
            {
                while (reader.Read())
                {
                    if (reader.NodeType == XmlNodeType.Element)
                    {
                        switch (reader.Name)
                        {
                        case "CommPort":
                            CommPort = reader.GetValueString();
                            break;

                        case "CamFile":
                            CamFiles.Add(reader.GetValueString());
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Log(ex);
            }
        }
コード例 #2
0
ファイル: HttpServer.cs プロジェクト: hchiam/sar-tool
        private void Deserialize(XML.Reader reader)
        {
            try
            {
                string elementName = reader.Name;
                while (reader.Read() && (reader.NodeType != XmlNodeType.EndElement || reader.Name != elementName))
                {
                    if (reader.NodeType == XmlNodeType.Element)
                    {
                        switch (reader.Name)
                        {
                        case "port":
                            this.port = (int)reader.GetValueLong();
                            break;

                        case "wwwroot":
                            this.root = reader.GetValueString();
                            this.root = Path.GetFullPath(this.root);
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Log(ex);
            }
        }