Esempio n. 1
0
        private IEnumerable <PrimaryWorkitem> GetPrimaryWorkitemsInComment(string comment)
        {
            var re      = new Regex(RegistryProcessor.GetString(RegistryProcessor.V1RegexParameter, "[A-Z]{1,2}-[0-9]+"));
            var numbers = re.Matches(comment).Cast <Match>().Select(x => x.Value).ToList();

            return(v1Component.Value.GetRelatedPrimaryWorkitems(numbers));
        }
Esempio n. 2
0
 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()
     });
 }
Esempio n. 3
0
        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();
        }
Esempio n. 4
0
        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)
            });
        }
Esempio n. 5
0
        public static TfsTeamProjectCollection ConnectToTFS()
        {
            var url      = RegistryProcessor.GetString(RegistryProcessor.TfsUrlParameter, string.Empty);
            var user     = RegistryProcessor.GetString(RegistryProcessor.TfsUsernameParameter, string.Empty);
            var password = RegistryProcessor.GetPassword(RegistryProcessor.TfsPasswordParameter, string.Empty);

            var domain = string.Empty;
            var pos    = user.IndexOf('\\');

            if (pos >= 0)
            {
                domain = user.Substring(0, pos);
                user   = user.Substring(pos + 1);
            }

            var creds     = new NetworkCredential(user, password, domain);
            var tfsServer = new TfsTeamProjectCollection(new Uri(url), creds);

            tfsServer.Authenticate();
            return(tfsServer);
        }
Esempio n. 6
0
        public static void Install()
        {
            var w3svc = new DirectoryEntry("IIS://localhost/w3svc");

            var folder = RegistryProcessor.GetString("ListenerName", "VersionOne TFS Listener");

            foreach (DirectoryEntry e in w3svc.Children)
            {
                if (e.SchemaClassName == "IIsWebServer" && e.Properties["ServerComment"].Value.ToString() == folder)
                {
                    SetNetVersion(e, Environment.Version);

                    foreach (DirectoryEntry f in e.Children)
                    {
                        if (f.SchemaClassName == "IIsWebVirtualDir")
                        {
                            SetNetVersion(f, Environment.Version);
                        }
                    }
                }
            }
        }