// // invokeFileSyncHandlerDirectlyButton_Click // // Perform a file synchronization directly. // // Parameters: // sender - The source Button object for this event. // e - The EventArgs object that contains the event data. // private void invokeFileSyncHandlerDirectlyButton_Click(object sender, System.EventArgs e) { hresultLabel.Text = ""; try { SynrcSync fileSync = new SynrcSync(); //fileSync.InvokeDirectly = true; fileSync.syncStatus += new SynrcSync.SyncStatusDelegate(OnFileSyncStatus); fileSync.syncError += new SynrcSync.SyncErrorDelegate(OnSyncError); progressForm = new ProgressForm(); progressForm.Show(); int retval = 0;// fileSync.Sync(); hresultLabel.Text = "HRESULT is 0x" + retval.ToString("x"); } catch (Exception ex) { MessageBox.Show("Exception from invocation: " + ex.Message); if (progressForm != null) { progressForm.Close(); } } }
// // propertiesButton_Click // // Display the FileSync Properties dialog. // // Parameters: // sender - The source Button object for this event. // e - The EventArgs object that contains the event data. // private void propertiesButton_Click(object sender, System.EventArgs e) { try { GooglePropertiesForm propertiesForm = new GooglePropertiesForm(); SynrcSync fileSync = new SynrcSync(); //propertiesForm.ClientFolder = fileSync.ClientFolder; //propertiesForm.ServerFolder = fileSync.ServerFolder; //propertiesForm.SyncHandlerName = fileSync.SyncHandlerName; //propertiesForm.SyncItemName = fileSync.SyncItemName; //propertiesForm.RegistryComment = fileSync.RegistryComment; if (DialogResult.OK == propertiesForm.ShowDialog(this)) { //fileSync.ClientFolder = propertiesForm.ClientFolder; //fileSync.ServerFolder = propertiesForm.ServerFolder; //fileSync.SyncHandlerName = propertiesForm.SyncHandlerName; //fileSync.SyncItemName = propertiesForm.SyncItemName; //fileSync.RegistryComment = propertiesForm.RegistryComment; } } catch (Exception ex) { MessageBox.Show("Exception from properties dialog: " + ex.Message); } }
// // invokeFileSyncHandlerFromComButton_Click // // Perform a file synchronization using Synchronization Manager. // // Parameters: // sender - The source Button object for this event. // e - The EventArgs object that contains the event data. // private void invokeFileSyncHandlerFromComButton_Click(object sender, System.EventArgs e) { try { SynrcSync fileSync = new SynrcSync(); fileSync.SyncThroughSyncMgr(); //fileSync.InvokeDirectly = false; //fileSync.Sync(); } catch (Exception ex) { MessageBox.Show("Exception from invocation: " + ex.Message); } }