public static VersionOneSettings GetV1Settings() { return(new VersionOneSettings { Path = RegistryProcessor.GetString(RegistryProcessor.V1UrlParameter, string.Empty), Username = RegistryProcessor.GetString(RegistryProcessor.V1UsernameParameter, string.Empty), Password = RegistryProcessor.GetPassword(RegistryProcessor.V1PasswordParameter, string.Empty), Integrated = RegistryProcessor.GetBool(RegistryProcessor.V1WindowsAuthParameter, false), ProxySettings = GetProxySettings() }); }
public ConfigForm() { InitializeComponent(); btnTestV1Connection.Click += btnTestV1Connection_Click; btnSaveVersionOneSettings.Click += btnSaveVersionOneSettings_Click; TFSConnectB.Click += TFSConnectB_Click; TFSUpdateB.Click += TFSUpdateB_Click; UnsubscribeB.Click += UnsubscribeB_Click; SaveSettingsB.Click += SaveSettingsB_Click; chkUseProxy.CheckedChanged += chkUseProxy_CheckedChanged; //Advanced setup RegExTB.Text = RegistryProcessor.GetString(RegistryProcessor.V1RegexParameter, "[A-Z]{1,2}-[0-9]+"); txtDebugDescription.Text = string.Format("Debug information is written to {0}", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)); //V1 setup V1URLTB.Text = RegistryProcessor.GetString(RegistryProcessor.V1UrlParameter, "http://localhost/VersionOne/"); var username = WindowsIdentity.GetCurrent().Name; var pos = username.IndexOf("\\"); if (pos >= 0) { username = username.Substring(pos + 1); } V1UsernameTB.Text = RegistryProcessor.GetString(RegistryProcessor.V1UsernameParameter, username); V1PasswordTB.Text = RegistryProcessor.GetPassword(RegistryProcessor.V1PasswordParameter, string.Empty); UseIntegratedAuthenticationCB.Checked = RegistryProcessor.GetBool(RegistryProcessor.V1WindowsAuthParameter, false); chkUseProxy.Checked = RegistryProcessor.GetBool(RegistryProcessor.V1UseProxyParameter, false); txtProxyUrl.Text = RegistryProcessor.GetString(RegistryProcessor.V1ProxyUrlParameter, string.Empty); txtProxyUsername.Text = RegistryProcessor.GetString(RegistryProcessor.V1ProxyUsernameParameter, string.Empty); txtProxyPassword.Text = RegistryProcessor.GetString(RegistryProcessor.V1ProxyPasswordParameter, string.Empty); txtProxyDomain.Text = RegistryProcessor.GetString(RegistryProcessor.V1ProxyDomainParameter, string.Empty); SetProxyRelatedFieldsEnabled(chkUseProxy.Checked); //TFS setup TFSURLTB.Text = RegistryProcessor.GetString(RegistryProcessor.TfsUrlParameter, "http://localhost:8080"); TFSUsernameTB.Text = RegistryProcessor.GetString(RegistryProcessor.TfsUsernameParameter, WindowsIdentity.GetCurrent().Name); TFSPasswordTB.Text = RegistryProcessor.GetPassword(RegistryProcessor.TfsPasswordParameter, string.Empty); var port = RegistryProcessor.GetString(RegistryProcessor.ListenerPortParameter, "9090"); var folder = RegistryProcessor.GetString(RegistryProcessor.ListenerNameParameter, "VersionOne TFS Listener"); var host = Dns.GetHostName(); ListenerURLTB.Text = RegistryProcessor.GetString(RegistryProcessor.ListenerUrlParameter, "http://" + host + ":" + port + "/Service.svc"); // Debug Mode chkDebugMode.Checked = RegistryProcessor.GetBool(RegistryProcessor.DebugEnabledParameter, false); UpdateStatus(); }
private static ProxyConnectionSettings GetProxySettings() { if (!RegistryProcessor.GetBool(RegistryProcessor.V1UseProxyParameter, false)) { return(null); } return(new ProxyConnectionSettings { UseProxy = RegistryProcessor.GetBool(RegistryProcessor.V1UseProxyParameter, false), Url = RegistryProcessor.GetString(RegistryProcessor.V1ProxyUrlParameter, string.Empty), Username = RegistryProcessor.GetString(RegistryProcessor.V1ProxyUsernameParameter, string.Empty), Password = RegistryProcessor.GetString(RegistryProcessor.V1ProxyPasswordParameter, string.Empty), Domain = RegistryProcessor.GetString(RegistryProcessor.V1ProxyDomainParameter, string.Empty) }); }