Exemplo n.º 1
0
 private static void LoadFromXml(MacroFolder MF, XmlElement FolderNode)
 {
     if (FolderNode.Attributes["name"] != null)
     {
         MF.Name = FolderNode.Attributes["name"].InnerText;
     }
     {
         // Load contained macros
         XmlNodeList Macros = FolderNode.SelectNodes("macro");
         foreach (XmlNode MacroNode in Macros)
         {
             if (MacroNode is XmlElement)
             {
                 MF.Macros.Add(Macro.LoadFromXml(MacroNode as XmlElement));
             }
         }
     }
     {
         // Load contained folders
         XmlNodeList SubFolders = FolderNode.SelectNodes("folder");
         foreach (XmlNode SubFolderNode in SubFolders)
         {
             if (SubFolderNode is XmlElement)
             {
                 MacroFolder SubFolder = new MacroFolder();
                 MacroLibrary.LoadFromXml(SubFolder, SubFolderNode as XmlElement);
                 MF.Folders.Add(SubFolder);
             }
         }
     }
 }
Exemplo n.º 2
0
 private void WriteToDATFile(MacroFolder MF, BinaryWriter BW, Encoding E)
 {
     foreach (MacroFolder SubFolder in MF.Folders)
     {
         this.WriteToDATFile(SubFolder, BW, E);
     }
     foreach (Macro M in MF.Macros)
     {
         M.WriteToDATFile(BW, E);
     }
 }
Exemplo n.º 3
0
 private bool IsEmpty(MacroFolder folder) {
   foreach (Macro M in folder.Macros) {
     if (!M.Empty)
       return false;
   }
   foreach (MacroFolder MF in folder.Folders) {
     if (!this.IsEmpty(MF))
       return false;
   }
   return true;
 }
Exemplo n.º 4
0
 public MacroFolder Clone()
 {
     MacroFolder MF = new MacroFolder(this.Name_);
     foreach (MacroFolder SubFolder in this.Folders_)
     {
         MF.Folders_.Add(SubFolder.Clone());
     }
     foreach (Macro M in this.Macros_)
     {
         MF.Macros_.Add(M.Clone());
     }
     return MF;
 }
Exemplo n.º 5
0
        public MacroFolder Clone()
        {
            MacroFolder MF = new MacroFolder(this.Name_);

            foreach (MacroFolder SubFolder in this.Folders_)
            {
                MF.Folders_.Add(SubFolder.Clone());
            }
            foreach (Macro M in this.Macros_)
            {
                MF.Macros_.Add(M.Clone());
            }
            return(MF);
        }
Exemplo n.º 6
0
 private bool IsEmpty(MacroFolder folder)
 {
     foreach (Macro M in folder.Macros)
     {
         if (!M.Empty)
         {
             return(false);
         }
     }
     foreach (MacroFolder MF in folder.Folders)
     {
         if (!this.IsEmpty(MF))
         {
             return(false);
         }
     }
     return(true);
 }
Exemplo n.º 7
0
        private static void WriteToXml(MacroFolder MF, XmlDocument XDoc, XmlNode Parent)
        {
            XmlElement XFolder = XDoc.CreateElement("folder");

            if (MF.Name != null && MF.Name != String.Empty)
            {
                XmlAttribute XName = XDoc.CreateAttribute("name");
                XName.InnerText = MF.Name;
                XFolder.Attributes.Append(XName);
            }
            foreach (MacroFolder SubFolder in MF.Folders)
            {
                MacroLibrary.WriteToXml(SubFolder, XDoc, XFolder);
            }
            foreach (Macro M in MF.Macros)
            {
                M.WriteToXml(XDoc, XFolder);
            }
            Parent.AppendChild(XFolder);
        }
Exemplo n.º 8
0
 public void Add(MacroFolder   MF)
 {
     this.InnerList.Add     (MF);
 }
Exemplo n.º 9
0
 private void WriteToDATFile(MacroFolder MF, BinaryWriter BW, Encoding E) {
   foreach (MacroFolder SubFolder in MF.Folders)
     this.WriteToDATFile(SubFolder, BW, E);
   foreach (Macro M in MF.Macros)
     M.WriteToDATFile(BW, E);
 }
Exemplo n.º 10
0
 public void Remove(MacroFolder MF)
 {
     this.InnerList.Remove(MF);
 }
Exemplo n.º 11
0
 public int  IndexOf(MacroFolder MF)
 {
     return(this.InnerList.IndexOf(MF));
 }
Exemplo n.º 12
0
 public bool Contains(MacroFolder MF)
 {
     return(this.InnerList.Contains(MF));
 }
Exemplo n.º 13
0
 public void Add(MacroFolder MF)
 {
     this.InnerList.Add(MF);
 }
Exemplo n.º 14
0
 public void Remove(MacroFolder   MF)
 {
     this.InnerList.Remove  (MF);
 }
Exemplo n.º 15
0
 public int IndexOf(MacroFolder   MF)
 {
     return this.InnerList.IndexOf (MF);
 }
Exemplo n.º 16
0
 public bool Contains(MacroFolder   MF)
 {
     return this.InnerList.Contains(MF);
 }
Exemplo n.º 17
0
 public void AddRange(MacroFolder[] MF)
 {
     this.InnerList.AddRange(MF);
 }