public bool Configure(IWin32Window owner)
 {
     using (var form = ConfigurationFormFactory.Create())
     {
         if (form.ShowDialog(owner) == DialogResult.OK)
         {
             var server = form.GetServer();
             Configuration = new BuildServer(server);
             var settings = new Settings()
                                 {
                                     Project = String.Empty,
                                     Server = server,
                                     Username = form.GetUsername(),
                                     Password = form.GetPassword()
                                 };
             Settings = settings.ToString();
             //We will need to initialize the server manager again if their information has changed
             JenkinsServerManagerFactory.IsServerManagerInitialized = false;
             return true;
         }
         return false;
     }
 }
 public bool Configure(IWin32Window owner)
 {
     if (JenkinsServerManagerFactory.IsServerManagerInitialized)
     {
         DialogService.Show(
             "Monitoring jobs from multiple jenkins servers is unsupported due to the CCTray interface.\n" +
             "If you have previously removed a jenkins server, restart CCTray first.");
         return false;
     }
     else
     {
         using (var form = ConfigurationFormFactory.Create())
         {
             if (form.ShowDialog(owner) == DialogResult.OK)
             {
                 var server = form.GetServer();
                 Configuration = new BuildServer(server);
                 var settings = new Settings()
                 {
                     Project = String.Empty,
                     Server = server,
                     Username = form.GetUsername(),
                     Password = form.GetPassword()
                 };
                 Settings = settings.ToString();
                 //We will need to initialize the server manager again if their information has changed
                 JenkinsServerManagerFactory.IsServerManagerInitialized = false;
                 return true;
             }
             return false;
         }
     }
 }
        /// <summary>
        /// Initializes this instance with the appropriate information
        /// </summary>
        /// <param name="server">the BuildServer</param>
        /// <param name="session">the SessionToken</param>
        /// <param name="settings">the Settings</param>
        public void Initialize(BuildServer server, string session, Settings settings)
        {
            Configuration = server;
            SessionToken = session;
            Settings = settings;
            Login();
            Api = _apiFactory.Create(Configuration.Url, AuthorizationInformation, _webRequestFactory);

            ProjectsAndCurrentStatus = new Dictionary<string, ProjectStatus>();
        }
        /// <summary>
        /// Sets the Configuration for this server manager
        /// </summary>
        /// <param name="server">the BuildServer configuration</param>
        /// <param name="projectName">the project name</param>
        /// <param name="settings">the Settings</param>
        public void Initialize(BuildServer server, string projectName, Settings settings)
        {
            Configuration = server;
            ProjectName = projectName;
            Settings = settings;
            AuthorizationInformation = Settings.AuthorizationInformation;

            Api = _jenkinsApiFactory.Create(Settings.Server, AuthorizationInformation, _webRequestFactory);
        }