Exemplo n.º 1
0
        private void GetAutomatismo()
        {
            List <string> Folders = SearchFolder.GetDirectories(setts.MainFolder);

            AutoStruture = new AutomatismosClass();
            AutoStruture.Automatismos = new List <AutomatismosClass.Automatismo>();
            foreach (var Folder in Folders)
            {
                try
                {
                    string[] ck = Folder.Split('\\');
                    ck = ck[ck.Length - 1].Split('.');
                    if (ck[0].Length < 5 && typeof(int) == Int32.Parse(ck[0]).GetType())
                    {
                        AutomatismosClass.Automatismo tempAuto = GetFilesForStruct(Folder);
                        if (tempAuto.Ficheiros.Count > 0)
                        {
                            AutoStruture.Automatismos.Add(GetFilesForStruct(Folder));
                        }
                    }
                }
                catch (Exception)
                {
                    //throw;
                }
            }
        }
Exemplo n.º 2
0
 private void RefreshListTB()
 {
     autos = ser.Deserialize <AutomatismosClass>((string)File.ReadAllText(@"Automatismo.xml"));
     fileList.DataSource    = null;
     fileList.DataSource    = autos.Automatismos;
     fileList.DisplayMember = "Nome";
     fileList.ValueMember   = "Path";
 }