public static AcSmDatabase LoadXML(string fname)
        {
            XmlDocument xDoc = new XmlDocument();

            xDoc.Load(fname);
            return((AcSmDatabase)AcSmClass.FromXML(xDoc.DocumentElement));
        }
        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));
        }
 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));
         }
     }
 }
Example #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;
         }
     }
     ;
 }