private void Collect() { if (String.IsNullOrEmpty(this.ConfigurationTextStorageAccount.Text) || String.IsNullOrEmpty(this.ConfigurationTextStorageAccountKey.Text)) { MessageBox.Show("Invalid storage account information supplied for image source. Check the setting and try again.", "Invalid Storage Account", MessageBoxButton.OK); } else if (String.IsNullOrEmpty(this.ConfigurationTextStorageContainer.Text)) { MessageBox.Show("Invalid storage account container supplied. Check the setting and try again.", "Invalid Storage Account Container", MessageBoxButton.OK); } else if (String.IsNullOrEmpty(this.ConfigurationTextFileExtension.Text)) { MessageBox.Show("Supply one file extension to filter storage account information.", "Invalid File Extension", MessageBoxButton.OK); } else if (MessageBox.Show("Saving configuration will delete the information saved by this source, do you want to continue?", "Save Configuration", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { this.Configuration.Classifications = new List <string>(this.ConfigurationTabTextAnnotationTags.Text.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)); this.Configuration.StorageAccount = this.ConfigurationTextStorageAccount.Text.Trim(); this.Configuration.StorageAccountKey = this.ConfigurationTextStorageAccountKey.Text.Trim(); this.Configuration.StorageContainer = this.ConfigurationTextStorageContainer.Text.Trim(); this.Configuration.BlobPrefix = this.ConfigurationTextBlobPrefix.Text.Trim(); this.Configuration.FileType = this.ConfigurationTextFileExtension.Text.Trim(); this.Configuration.RecordLocation = this.ConfigurationTextLocalDirectory.Text.Trim(); this.Configuration.MultiClass = !this.Negative.IsChecked.Value; OnConfigurationSaved?.Invoke(this.Provider); this.ModifyChangeButtons(); } else { this.Seed(); } }
public void Save(Editable editable, bool suspendFileWatcher = true) { if (editable != null) { try { if (suspendFileWatcher) { SuspendFileWatcher(); } editable.Save(); } finally { if (suspendFileWatcher) { ResumeFileWatcher(); } } OnConfigurationSaved?.Invoke(this, EventArgs.Empty); } }
public void DoConfigurationSaved() { OnConfigurationSaved?.Invoke(this, new EventArgs()); }