public void CreateProfile(Guid uniqueId, string friendlyName, Size tableSize, Corner origin, double maxFeedRate) { Profile profile = new Profile(uniqueId, friendlyName, tableSize, origin, maxFeedRate); profiles.Add(profile); profile.Modified += Profile_Modified; ProfileAdded?.Invoke(this, profile); }
private void saveNew(string name, string accessKeyId, string secretKey) { // Warn the user if they are about to overwrite an existing profile try { ProfileSettingsBase existing = ProfileManager.GetProfile(name); string msg = string.Format(DuplicateProfileText, name); DialogResult result = MessageBox.Show(msg, DuplicateProfileCaption, MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2); if (result == DialogResult.No) { this.DialogResult = DialogResult.None; return; } } catch (AmazonClientException) { } // Raise an Added event with the new values ProfileEventArgs args = new ProfileEventArgs(name, accessKeyId, secretKey); ProfileAdded?.Invoke(this, args); }
protected void OnProfileAdded(WindowProfile newProfile) { ProfileAdded?.Invoke(this, new WindowProfileEventArgs(newProfile)); }