public JobPoller(VaultSync sync, VaultContext context, Func<bool> keepRunning, bool startActive) { Sync = sync; Context = context; KeepRunning = keepRunning; active = startActive; }
public CustomAppContext() { InitializeComponents(true); sync = new VaultSync(TimeSpan.MaxValue); sync.SynchronizingWithServer = false; sync.start(); }
public CustomAppContext(TimeSpan duration, bool synchronizingWithServer, bool startPollerInactive) { InitializeComponents(false); sync = new VaultSync(duration); sync.RunCompleted += sync_RunCompleted; sync.SynchronizingWithServer = synchronizingWithServer; sync.StartPollerInactive = startPollerInactive; sync.start(); }
void startSync_Click(object sender, EventArgs e) { bool starting = startSync.Text.EndsWith("Start"); sync.stop(); sync = new VaultSync(TimeSpan.MaxValue); sync.SynchronizingWithServer = starting; sync.StartPollerInactive = !listening; sync.start(); listJobs.Enabled = starting; pauseResume.Enabled = starting; }