private void RemoveAgentEventHandler(FileSyncAgent agent) { if (agent == null) return; agent.ProgressChanged -= new SyncProgressChangedHandler(currAgent_ProgressChanged); agent.SyncFileChanged -= new SyncFileChangedHandler(currAgent_FileChanged); agent.StatusChanged -= new SyncStatusChangedHandler(syncAgent_SyncStatusChanged); }
protected virtual void OnPropertyChanged(string PropertyName) { this._agent = new FileSyncAgent(SyncJob); if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(PropertyName)); }
public UISyncJobEntry(SyncJob job) { this._syncJob = job; this._agent = new FileSyncAgent(job); }
void previewWorker_DoWork(object sender, DoWorkEventArgs e) { if (_job == null) return; FileSyncAgent agent = new FileSyncAgent(_job); try { _job.SyncPreviewResult = agent.GenerateSyncPreview(updateStatusMessage); } catch (DirectoryNotFoundException ex) { showErrorMsgInvoke(String.Format(m_ResourceManager.GetString("err_directoryNotFound"), ex.Message)); } catch(UnauthorizedAccessException) { showErrorMsgInvoke(m_ResourceManager.GetString("err_directoryInaccessible")); } catch (Exception) { showErrorMsgInvoke(m_ResourceManager.GetString("err_cannotPreview")); } }