コード例 #1
0
        public static AcSmDatabase LoadXML(string fname)
        {
            XmlDocument xDoc = new XmlDocument();

            xDoc.Load(fname);
            return((AcSmDatabase)AcSmClass.FromXML(xDoc.DocumentElement));
        }
コード例 #2
0
        public static AcSmDatabase LoadDst(string fname)
        {
            if (!File.Exists(fname))
            {
                throw new FileNotFoundException();
            }
            //
            byte[]       xmlSource = File.ReadAllBytes(Environment.ExpandEnvironmentVariables(fname));
            MemoryStream ms        = new MemoryStream(DecryptFile(xmlSource));
            XmlDocument  xDoc      = new XmlDocument();

            xDoc.Load(ms);
            return((AcSmDatabase)AcSmClass.FromXML(xDoc.DocumentElement));
        }
コード例 #3
0
 public AcSmDatabase(XmlElement wEl)
 {
     this.ClassName = wEl.Name;
     if (wEl.HasAttribute("clsid"))
     {
         this.clsid = wEl.GetAttribute("clsid");
     }
     ;
     if (wEl.HasAttribute("ID"))
     {
         this.ID = wEl.GetAttribute("ID");
     }
     ;
     if (wEl.HasChildNodes)
     {
         foreach (XmlElement ch in wEl.ChildNodes)
         {
             this.Child.Add(AcSmClass.FromXML(ch));
         }
     }
 }
コード例 #4
0
 protected AcSmClass(XmlElement wEl)
 {
     this.ClassName = wEl.Name;
     if (wEl.HasAttribute("clsid"))
     {
         this.clsid = wEl.GetAttribute("clsid");
     }
     ;
     if (wEl.HasAttribute("ID"))
     {
         this.ID = wEl.GetAttribute("ID");
     }
     ;
     if (wEl.HasAttribute("propname"))
     {
         this.propname = wEl.GetAttribute("propname");
     }
     ;
     if (wEl.HasAttribute("vt"))
     {
         this.vt = int.Parse(wEl.GetAttribute("vt"));
     }
     ;
     if (wEl.HasChildNodes)
     {
         if (wEl.FirstChild.NodeType == XmlNodeType.Element)
         {
             foreach (XmlElement ch in wEl.ChildNodes)
             {
                 this.Child.Add(AcSmClass.FromXML(ch));
             }
         }
         else
         {
             this.value = wEl.InnerText;
         }
     }
     ;
 }