static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); MainForm mf = new MainForm(); Application.Run(mf); }
/// <summary> /// create SyncDetailInfoForm1 that displays all details of a synchronisation process /// </summary> /// <param name="l">link that contains the synchronisation information</param> public SyncDetailInfoForm1(SyncLink l, MainForm mainForm) { _l = l; _mainForm = mainForm; InitializeComponent(); label_title.Text = _l.Title; label_folder1.Text = _l.Path1; label_folder2.Text = _l.Path2; label_direction.Text = _l.Direction.ToString(); if (_l.SyncInfo != null) { //build tree (pause sync while building) bool running = _l.IsRunning; if (running) _l.PauseSync(); int ct = 0; int i = 0; while (_l.SyncTask != null && _l.SyncTask.TasksRunning() > 0 && i < 5) { if (ct == _l.SyncTask.TasksRunning()) i++; else { ct = _l.SyncTask.TasksRunning(); i = 0; } Thread.Sleep(300); } if(_l.SyncTask != null) { BuildTreeRecursively(treeView1.Nodes, _l.SyncInfo.DirTree); _l.SyncInfo.SetListener(this); if (running) _l.ResumeSync(); } } StartUpdateRoutine(); }