Inheritance: ICloneable
Exemplo n.º 1
0
        public SyncState Clone()
        {
            SyncState syncState = new SyncState();

            //syncState.CurrentStep = this.CurrentStep;
            syncState.ErrorMsg = this.ErrorMsg;
            syncState.Messages = this.Messages;
            //syncState.StepsToRun = this.StepsToRun;
            return(syncState);
        }
        // Running on the UI thread. Here we report the current sync state.
        private void bw_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
        {
            lock (reportLock)
            {
                SyncState syncState = e.UserState as SyncState;
                if (null != syncState)
                {
                    for (int i = _nextSyncStateMessageIndex; _nextSyncStateMessageIndex < syncState.Messages.Count; _nextSyncStateMessageIndex++)
                    {
                        this.WriteTraceLine(syncState.Messages[_nextSyncStateMessageIndex]);
                    }
                }

                this.progressBar1.Value = e.ProgressPercentage;
            }
        }
        // gets and reports the current sync state
        private void timer_Tick(object sender, EventArgs e)
        {
            FifoStackLogger logger = _syncEngine.Logger as FifoStackLogger;

            if (null == logger)
            {
                this.WriteTraceLine("Invalid Logger instance!");
            }

            SyncState syncState = logger.SyncState;

            if (null != syncState)
            {
                if (_step < 100)
                {
                    _step++;
                }

                // invoke progress changed event at background worker.
                bw.ReportProgress(_step, syncState);
            }
        }
Exemplo n.º 4
0
 public FifoStackLogger()
 {
     _syncState = new SyncState();
     this.SeverityFilter = Severity.Info;
 }
Exemplo n.º 5
0
 public SyncState Clone()
 {
     SyncState syncState = new SyncState();
     //syncState.CurrentStep = this.CurrentStep;
     syncState.ErrorMsg = this.ErrorMsg;
     syncState.Messages = this.Messages;
     //syncState.StepsToRun = this.StepsToRun;
     return syncState;
 }
Exemplo n.º 6
0
 public FifoStackLogger()
 {
     _syncState          = new SyncState();
     this.SeverityFilter = Severity.Info;
 }