Exemplo n.º 1
0
        public void InitializeForm()
        {
            directorylist = new List<DDirectory>();

            XElement xe = XElement.Load(@"..\..\Lookup.xml");
            if (xe != null)
            {
                IEnumerable<XElement> directories = xe.Descendants("directory");
                foreach (XElement d in directories)
                {
                    DDirectory newdir = new DDirectory(d.Attribute("name").Value);
                    DirectoryComboBox.Items.Add(newdir.dir);
                    filelist = new List<string>();

                    IEnumerable<XElement> files = d.Descendants("filename");
                    foreach(XElement f in files)
                        filelist.Add(f.Value);

                    newdir.file = filelist;
                    directorylist.Add(newdir);

                }
            }

            Redraw();
        }
Exemplo n.º 2
0
        public GenerateStatus()
        {
            directorylist = new List<DDirectory>();
            statusfiles = new List<string>();

            statustable = new DataTable();
            statustable.Columns.Add("Files", Type.GetType("System.String"));
            statustable.Columns.Add("Status", Type.GetType("System.String"));

            XElement xe = XElement.Load(@"..\..\Lookup.xml");
            if (xe != null)
            {
                IEnumerable<XElement> directories = xe.Descendants("directory");
                foreach (XElement d in directories)
                {
                    DDirectory newdir = new DDirectory(d.Attribute("name").Value);
                    filelist = new List<string>();

                    IEnumerable<XElement> files = d.Descendants("filename");
                    foreach (XElement f in files)
                    {
                        filelist.Add(f.Value);
                        statusfiles.Add(newdir.dir + "\\" + f.Value);
                    }

                    newdir.file = filelist;
                    directorylist.Add(newdir);

                }
            }
        }
Exemplo n.º 3
0
 private void DirectoryAddButton_Click(object sender, EventArgs e)
 {
     DDirectory dnew = new DDirectory(DirectoryTextBox.Text);
     directorylist.Add(dnew);
     Redraw();
     DirectoryComboBox.Items.Add(DirectoryTextBox.Text);
 }