Exemplo n.º 1
0
 public Engine(string runName, DateTime runStamp, SynchronisationDirection direction, SynchronisationInfo syncInfo)
     : this()
 {
     this.SyncInfo = syncInfo;
     this.Direction = direction;
     this.RunName = runName;
     this.RunStamp = runStamp;
 }
Exemplo n.º 2
0
 public Engine(string runName, DateTime runStamp, SynchronisationDirection direction, SynchronisationInfo syncInfo)
     : this()
 {
     this.SyncInfo  = syncInfo;
     this.Direction = direction;
     this.RunName   = runName;
     this.RunStamp  = runStamp;
 }
Exemplo n.º 3
0
        private void Synchronize(SynchronisationDirection direction)
        {
            try
            {
                if (!PersistFormToModel())
                {
                    return;
                }

                // Create a new instance of the sync engine
                // and add a Logger. The Logger of type FifoStackLogger appended here
                // will provide a stack of messages that can be polled.
                Engine          syncEngine = new Engine(this.toolStripRunName.Text, DateTime.Now, direction, _syncInfo);
                FifoStackLogger logger     = new FifoStackLogger();
                logger.SeverityFilter = Severity.Info;
                syncEngine.Logger     = logger;

                // Create and diaplay progress form that will start the syncEngine
                ProgressForm progressForm = new ProgressForm(syncEngine);
                progressForm.ShowDialog(this);
            }

            catch (Exception ex)
            {
                MessageBox.Show("An unexpected error occured: " + Environment.NewLine + ex.Message);
            }
            finally
            {
                try
                {
                    int runCounter = this.GetRunCounter();
                    runCounter++;
                    // Change the RunCounter and display new next run Name
                    this.SetRunCounter(runCounter);
                    this.toolStripRunName.Text = string.Format(RUNNAME_TEMPLATE, runCounter);
                }
                catch (Exception exception)
                {
                    MessageBox.Show("Failed to save config file: " + Environment.NewLine + exception.Message);
                }
            }
        }
Exemplo n.º 4
0
        private void Synchronize(SynchronisationDirection direction)
        {
            try
            {

                if (!PersistFormToModel())
                    return;

                // Create a new instance of the sync engine
                // and add a Logger. The Logger of type FifoStackLogger appended here
                // will provide a stack of messages that can be polled.
                Engine syncEngine = new Engine(this.toolStripRunName.Text, DateTime.Now, direction, _syncInfo);
                FifoStackLogger logger = new FifoStackLogger();
                logger.SeverityFilter = Severity.Info;
                syncEngine.Logger = logger;

                // Create and diaplay progress form that will start the syncEngine
                ProgressForm progressForm = new ProgressForm(syncEngine);
                progressForm.ShowDialog(this);
            }

            catch (Exception ex)
            {
                MessageBox.Show("An unexpected error occured: " + Environment.NewLine + ex.Message);
            }
            finally
            {
                try
                {
                    int runCounter = this.GetRunCounter();
                    runCounter++;
                    // Change the RunCounter and display new next run Name
                    this.SetRunCounter(runCounter);
                    this.toolStripRunName.Text = string.Format(RUNNAME_TEMPLATE, runCounter);
                }
                catch (Exception exception)
                {
                    MessageBox.Show("Failed to save config file: " + Environment.NewLine + exception.Message);
                }
            }
        }