/// <summary> /// Construct new model by copying the contents of another model. /// </summary> /// <param name="other">The other model to copy from.</param> public JiraConnectionModel(JiraConnectionModel other) { this.server_name = other.ServerName; this.user = other.User; this.password = other.Password; this.selected_project = other.SelectedProject; }
/// <summary> /// Construct new model by copying the contents of another model. /// </summary> /// <param name="other">The other model to copy from.</param> public JiraConnectionModel(JiraConnectionModel other) { this.server_name = other.ServerName; this.user = other.User; this.password = other.Password; this.selected_project = other.SelectedProject; }
/// <summary> /// Optional. Called whenever user clicks Save in the UI to save the settings. /// Enables customizing the save click handling. /// We'll make the settings in the ViewModel the active settings for submitting bugs. /// </summary> public void OnSave() { this.activeJiraConnection = new JiraConnectionModel(); this.activeJiraConnection.ServerName = this.JiraSettings.ServerName; this.activeJiraConnection.User = this.JiraSettings.User; this.activeJiraConnection.Password = this.JiraSettings.Password; this.activeJiraConnection.SelectedProject = this.JiraSettings.SelectedProject; }
/// <summary> /// Applies the persistable settings upon loading the user settings from the XML file where persisted, or when Cancel is clicked. /// The settings are persisted so that the user can get the configured bug tracker on the next project load. /// </summary> /// <param name="settings">The deserialized settings to make active.</param> /// <returns>Returns 'true' if the settings are valid and the operation is successful.</returns> public bool ApplyPersistableSettings(BugTrackerPersistableSettings settings) { this.activeJiraConnection = settings as JiraConnectionModel; if (null != this.activeJiraConnection) { this.JiraSettings.ServerName = this.activeJiraConnection.ServerName; this.JiraSettings.User = this.activeJiraConnection.User; this.JiraSettings.Password = this.activeJiraConnection.Password; this.JiraSettings.ErrorMessage = string.Empty; // This will cause SelectedProject to be reset to null due to data binding. // Be sure to reselect SelectedProject afterward. this.JiraSettings.ProjectsList = new List <JiraProject>(); this.JiraSettings.ProjectsList.Add(this.activeJiraConnection.SelectedProject); this.JiraSettings.SelectedProject = this.activeJiraConnection.SelectedProject; return(true); } return(false); }
/// <summary> /// Optional. Called whenever user clicks Save in the UI to save the settings. /// Enables customizing the save click handling. /// We'll make the settings in the ViewModel the active settings for submitting bugs. /// </summary> public void OnSave() { this.activeJiraConnection = new JiraConnectionModel(); this.activeJiraConnection.ServerName = this.JiraSettings.ServerName; this.activeJiraConnection.User = this.JiraSettings.User; this.activeJiraConnection.Password = this.JiraSettings.Password; this.activeJiraConnection.SelectedProject = this.JiraSettings.SelectedProject; }
/// <summary> /// Resets bug tracker connection settings to default settings. /// Called when a project containg Jira settings is first opened, but before settings are loaded. /// Also called when the project is closed. /// Useful method to clean up the bug tracker data internally. /// </summary> public void ResetSettings() { this.JiraSettings = null; this.activeJiraConnection = null; this.settingsUiControl = null; }
/// <summary> /// Applies the persistable settings upon loading the user settings from the XML file where persisted, or when Cancel is clicked. /// The settings are persisted so that the user can get the configured bug tracker on the next project load. /// </summary> /// <param name="settings">The deserialized settings to make active.</param> /// <returns>Returns 'true' if the settings are valid and the operation is successful.</returns> public bool ApplyPersistableSettings(BugTrackerPersistableSettings settings) { this.activeJiraConnection = settings as JiraConnectionModel; if (null != this.activeJiraConnection) { this.JiraSettings.ServerName = this.activeJiraConnection.ServerName; this.JiraSettings.User = this.activeJiraConnection.User; this.JiraSettings.Password = this.activeJiraConnection.Password; this.JiraSettings.ErrorMessage = string.Empty; // This will cause SelectedProject to be reset to null due to data binding. // Be sure to reselect SelectedProject afterward. this.JiraSettings.ProjectsList = new List<JiraProject>(); this.JiraSettings.ProjectsList.Add(this.activeJiraConnection.SelectedProject); this.JiraSettings.SelectedProject = this.activeJiraConnection.SelectedProject; return true; } return false; }
/// <summary> /// Resets bug tracker connection settings to default settings. /// Called when a project containg Jira settings is first opened, but before settings are loaded. /// Also called when the project is closed. /// Useful method to clean up the bug tracker data internally. /// </summary> public void ResetSettings() { this.JiraSettings = null; this.activeJiraConnection = null; this.settingsUiControl = null; }