Exemple #1
0
 /// <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>
 /// 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;
 }