public AutoRunForm(SyncSharpLogic logic) { InitializeComponent(); this.logic = logic; countDownTimer = new System.Windows.Forms.Timer(); plugSyncList = new List<SyncTask>(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); SyncSharpLogic logic = new SyncSharpLogic(); logic.loadProfile(); logic.UpdateRemovableRoot(); bool runAutoForm = false; if (logic.Profile.TaskCollection != null) { foreach (SyncTask task in logic.Profile.TaskCollection) { runAutoForm = task.Settings.PlugSync; if (runAutoForm) break; } } if (runAutoForm) { AutoRunForm autoRunFrm = new AutoRunForm(logic); logic.AddUI(autoRunFrm); Application.Run(autoRunFrm); } MainForm mainFrm = new MainForm(logic); logic.RemoveAllUIs(); logic.AddUI(mainFrm); Application.Run(mainFrm); }
public MainForm(SyncSharpLogic logic) { InitializeComponent(); logicController = logic; logicController.updateRemovableRoot(); logicController.checkAutorun(); updateListView(); }
public CreateTaskForm(SyncSharpLogic logic, string source, string target) : this(logic) { txtSource.Text = source; txtTarget.Text = target; AutoGenerateTaskName(); }
public AutoRunForm(SyncSharpLogic logic) { InitializeComponent(); this._logic = logic; _counter = logic.Profile.CountDown; _listViewCallback = new UpdateListViewDelegate(UpdateListView); _startSyncCallback = new StartSyncDelegate(StartSync); _syncCaller = new SyncDelegate(logic.SyncFolderPair); _plugSyncList = new List<SyncTask>(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); SyncSharpLogic logic = new SyncSharpLogic(); logic.loadProfile(); if (logic.Profile.TaskCollection.Count > 0) Application.Run(new AutoRunForm(logic)); Application.Run(new MainForm(logic)); }
public MainForm(SyncSharpLogic logic) { InitializeComponent(); Form.CheckForIllegalCrossThreadCalls = false; _logicController = logic; _syncCaller = new SyncDelegate(_logicController.SyncFolderPair); _analyzeCaller = new AnalyzeDelegate(_logicController.AnalyzeFolderPair); _restoreCaller = new RestoreDelegate(_logicController.RestoreSource); _syncAllCaller = new SyncAllFolderPair(_logicController.SyncAllFolderPairs); _syncAfterAnalyzeCaller = new SyncAfterAnalyzeDelegate(_logicController.SyncAfterAnalyze); _openFolderCaller = new OpenFolderDelegate(OpenFolder); _sourceDir = ""; UpdateListView(); }
public MainForm(SyncSharpLogic logic) { InitializeComponent(); Form.CheckForIllegalCrossThreadCalls = false; _logicController = logic; if (!Directory.Exists(_logicController.MetaDataDir + @"\")) _logicController.SaveProfile(); _syncCaller = new SyncDelegate(_logicController.SyncFolderPair); //_analyzeCaller = new AnalyzeDelegate(_logicController.AnalyzeFolderPair); _restoreCaller = new RestoreDelegate(_logicController.RestoreSource); _listViewCallback = new UpdateListViewDelegate(UpdateListView); _syncAllCaller = new SyncAllFolderPair(_logicController.SyncAllFolderPairs); _syncAfterAnalyzeCaller = new SyncAfterAnalyzeDelegate(_logicController.SyncAfterAnalyze); _sourceDir = ""; UpdateListView(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { SyncSharpLogic logic = new SyncSharpLogic(); logic.LoadProfile(); if (!logic.SaveProfile()) return; logic.UpdateRemovableRoot(); bool runAutoForm = false; if (logic.Profile.TaskCollection != null) { foreach (SyncTask task in logic.Profile.TaskCollection) { runAutoForm = task.Settings.PlugSync; if (runAutoForm) break; } } if (runAutoForm) { AutoRunForm autoRunFrm = new AutoRunForm(logic); logic.AddUI(autoRunFrm); Application.Run(autoRunFrm); } MainForm mainFrm = new MainForm(logic); logic.RemoveAllUIs(); logic.AddUI(mainFrm); Application.Run(mainFrm); } catch (Exception e) { Logger.WriteSystemErrorLog(e.StackTrace); } }
public TaskWizardForm(SyncSharpLogic o) { logic = o; InitializeComponent(); }
public CreateTaskForm(SyncSharpLogic logic) { InitializeComponent(); this._logic = logic; }
private void TestCheckProfileExists(TestCase t, SyncSharpLogic curLogic) { t.Actual = (curLogic.CheckProfileExists(curLogic.GetMachineID())) ? "True" : "False"; t.Passed = (t.Actual.Equals(t.Param1)) ? true : false; if (t.Passed) _totalPassed++; else _totalFailed++; }
private void TestCheckAutoRun(TestCase t, SyncSharpLogic curLogic) { char[] delimiters = new char[] { ',' }; String parameters = t.Param1; String[] inputParameters = parameters.Split(delimiters, StringSplitOptions.RemoveEmptyEntries); bool autoRun = (inputParameters[0].Equals("True")) ? true : false; curLogic.CheckAutorun(autoRun); t.Actual = File.Exists(@".\Autorun.inf") ? "True" : "False"; t.Passed = t.Actual.Equals(t.Param2) ? true : false; if (t.Passed) _totalPassed++; else _totalFailed++; }
public void TestLoadProfile(TestCase t, SyncSharpLogic curLogic) { curLogic.LoadProfile(); curLogic.SaveProfile(); TestCheckProfileExists(t, curLogic); }
public void ExecuteTests(SyncTask curTask, SyncProfile curProfile, SyncSharpLogic curLogic) { foreach (TestCase t in _cases) { if (t.Method.Equals("CompareFolders")) { Console.WriteLine("Performing CompareFolders Test for ID: " + t.ID); Console.WriteLine(""); TestCompareFolders(t, curTask); } else if (t.Method.Equals("Sync")) { Console.WriteLine("Performing Sync Test for ID: " + t.ID); Console.WriteLine(""); TestSync(t, curTask); } else if (t.Method.Equals("AddTask")) { Console.WriteLine("Performing AddTask Test for ID: " + t.ID); Console.WriteLine(""); TestAddTask(t, curProfile); } else if (t.Method.Equals("TaskExists")) { Console.WriteLine("Performing TaskExists check for ID: " + t.ID); Console.WriteLine(""); TestTaskExists(t, curProfile); } else if (t.Method.Equals("GetTask")) { Console.WriteLine("Performing GetTask check for ID: " + t.ID); Console.WriteLine(""); TestGetTask(t, curProfile); } else if (t.Method.Equals("RemoveTask")) { Console.WriteLine("Performing RemoveTask check for ID: " + t.ID); Console.WriteLine(""); TestRemoveTask(t, curProfile); } else if (t.Method.Equals("CheckProfileExists")) { Console.WriteLine("Performing CheckProfileExist check for ID: " + t.ID); Console.WriteLine(""); TestCheckProfileExists(t, curLogic); } else if (t.Method.Equals("LoadProfile")) { Console.WriteLine("Performing LoadProfile test for ID: " + t.ID); Console.WriteLine(""); TestLoadProfile(t, curLogic); } else if (t.Method.Equals("CheckAutorun")) { Console.WriteLine("Performing CheckAutoRun test for ID: " + t.ID); Console.WriteLine(""); TestCheckAutoRun(t, curLogic); } else throw new Exception("unsupported method " + t.Method); } }