コード例 #1
0
        static void Main(string[] args)
        {
            Cfg m_Cfg = Cfg.ReadConfig();

            if (m_Cfg == null)
            {
                return;
            }
            // Thread.Sleep(2000);
            List <object[]> res = DataBase.SelectQuery("select * from update_operator order by id desc;", m_Cfg.DbConnectionString);

            if (res.Count > 0)
            {
                UFiles uf = (UFiles)DataBase.ArrayToObject((byte[])res[0][1]);

                for (int i = 0; i < uf.FilesList.Count; i++)
                {
                    Console.WriteLine("Нажмите любую кнопку для продолжения....");
                    Console.ReadLine();
                    uf.FilesList[i].Update(FileToUpdate.StartupPath + @"\" + uf.FilesList[i].FileName);
                }

                Process.Start("TaskControlOperator.exe");
            }
        }
コード例 #2
0
 public MainUpdateForm()
 {
     InitializeComponent();
     m_Cfg = Cfg.ReadConfig();
     if (m_Cfg == null)
     {
         this.Close();
     }
     m_Files = new UFiles();
 }
コード例 #3
0
        //tree is the directory tree without the file
        public void SetUncommonFile(string relDir, string fileName, SlynchyDirectoryTree tree)
        {
            var FoundFile = false;

            foreach (var UFile in UFiles)
            {
                if (UFile.RelDir.Equals(relDir) && UFile.FileName.Equals(fileName))
                {
                    FoundFile = true;
                    if (!UFile.NotInTrees.Contains(tree))
                    {
                        UFile.NotInTrees.Add(tree);
                    }
                }
            }
            if (!FoundFile)
            {
                var UFile = new UncommonFile();
                UFile.RelDir   = relDir;
                UFile.FileName = fileName;
                UFiles.Add(UFile);
                UFile.NotInTrees.Add(tree);
            }
        }