Ejemplo n.º 1
0
 public AutoRunForm(SyncSharpLogic logic)
 {
     InitializeComponent();
     this.logic = logic;
     countDownTimer = new System.Windows.Forms.Timer();
     plugSyncList = new List<SyncTask>();
 }
Ejemplo n.º 2
0
		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);
		}
Ejemplo n.º 3
0
 public MainForm(SyncSharpLogic logic)
 {
     InitializeComponent();
     logicController = logic;
     logicController.updateRemovableRoot();
     logicController.checkAutorun();
     updateListView();
 }
Ejemplo n.º 4
0
 public CreateTaskForm(SyncSharpLogic logic, string source, 
     string target)
     : this(logic)
 {
     txtSource.Text =  source;
     txtTarget.Text =  target;
     AutoGenerateTaskName();
 }
Ejemplo n.º 5
0
        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>();
        }
Ejemplo n.º 6
0
        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));
        }
Ejemplo n.º 7
0
        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();
        }
Ejemplo n.º 8
0
        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();
        }
Ejemplo n.º 9
0
        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);
            }
        }
Ejemplo n.º 10
0
 public TaskWizardForm(SyncSharpLogic o)
 {
     logic = o;
     InitializeComponent();
 }
Ejemplo n.º 11
0
 public CreateTaskForm(SyncSharpLogic logic)
 {
     InitializeComponent();
     this._logic = logic;
 }
Ejemplo n.º 12
0
 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++;
 }
Ejemplo n.º 13
0
 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++;
 }
Ejemplo n.º 14
0
 public void TestLoadProfile(TestCase t, SyncSharpLogic curLogic)
 {
     curLogic.LoadProfile();
     curLogic.SaveProfile();
     TestCheckProfileExists(t, curLogic);
 }
Ejemplo n.º 15
0
 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);
     }
 }