protected override void CreateChildControls()
        {
            this.txtOrganizationName = new ValidatingTextBox { Required = false, DefaultText = "Optional", Width = 300 };
            this.txtUserName = new ValidatingTextBox { Required = true, Width = 300 };
            this.txtPassword = new PasswordTextBox { Required = true, Width = 300 };

            this.Controls.Add(
                new FormFieldGroup(
                    "Organization",
                    "Optionally provide the organization name which owns the repositories.",
                    false,
                    new StandardFormField(
                        "Organization:",
                        this.txtOrganizationName
                    )
                ),
                new FormFieldGroup(
                    "Authentication",
                    "Provide the user name and password of a GitHub user which has access to the desired repositories.",
                    false,
                    new StandardFormField(
                        "User Name:",
                        this.txtUserName
                    ),
                    new StandardFormField(
                        "Password:",
                        this.txtPassword
                    )
                )
            );
        }
        protected override void CreateChildControls()
        {
            this.chkUseCustomProfileXml = new CheckBox() { Text = "Use custom publish settings..." };
            var ctlProjectPublishProfileXmlContainer = new Div() { ID = "ctlProjectPublishProfileXmlContainer" };

            this.txtProjectPath = new SourceControlFileFolderPicker();
            this.txtProjectPublishProfileName = new ValidatingTextBox();
            this.txtProjectPublishProfileXml = new ValidatingTextBox() { TextMode = TextBoxMode.MultiLine, Rows = 7 };
            ctlProjectPublishProfileXmlContainer.Controls.Add(new Div("Enter custom publish profile XML:"), this.txtProjectPublishProfileXml);

            this.txtProjectBuildConfiguration = new ValidatingTextBox() { Required = true };
            this.txtVisualStudioVersion = new ValidatingTextBox() { DefaultText = "12.0" };
            this.txtAdditionalArguments = new ValidatingTextBox();
            this.txtUserName = new ValidatingTextBox() { DefaultText = "Inherit credentials from extension configuration" };
            this.txtPassword = new PasswordTextBox();

            this.Controls.Add(
                new SlimFormField("Project/Solution file:", this.txtProjectPath),
                new SlimFormField("Publish profile:", new Div("Profile Name:"), this.txtProjectPublishProfileName, this.chkUseCustomProfileXml, ctlProjectPublishProfileXmlContainer),
                new SlimFormField("Build configuration:", this.txtProjectBuildConfiguration),
                new SlimFormField("Visual Studio version:", this.txtVisualStudioVersion)
                {
                    HelpText = "Visual Studio must be installed in order to publish directly from the command line. Choose " 
                    + "the version of Visual Studio that is installed on the selected server in order for Web Deploy to use the "
                    + "appropriate build targets for the installed version. The default is 12.0 (Visual Studio 2013)."
                },
                new SlimFormField("Credentials:", new Div(new Div("Username:"******"Password:"******"Additional MSBuild arguments:", this.txtAdditionalArguments)
            );

            this.Controls.BindVisibility(chkUseCustomProfileXml, ctlProjectPublishProfileXmlContainer);
        }
        protected override void CreateChildControls()
        {
            this.txtBaseUrl = new ValidatingTextBox { Width = 300 };

            this.txtUserName = new ValidatingTextBox { Width = 300 };

            this.txtDomain = new ValidatingTextBox { Width = 300 };

            this.txtPassword = new PasswordTextBox { Width = 270 };

            ddlAuthentication = new DropDownList();
            ddlAuthentication.Items.Add(new ListItem("System", "system"));
            ddlAuthentication.Items.Add(new ListItem("Specify account...", "specify"));

            var ffgAuthentication = new FormFieldGroup("Authentication",
                    "The method used for authenticating a connection to Team Foundation Server",
                    false,
                    new StandardFormField("Authentication:", ddlAuthentication)
                );

            var ffgCredentials = new FormFieldGroup("Credentials",
                    "Specify the credentials of the account you would like to use to connect to Team Foundation Server",
                    false,
                    new StandardFormField("Username:"******"Password:"******"Domain:", txtDomain)
                );

            CUtil.Add(this,
                new FormFieldGroup("TFS Server Name",
                    "The name of the Team Foundation Server to connect to, e.g. http://tfsserver:8080/tfs",
                    false,
                    new StandardFormField(
                        "Server Name:",
                        txtBaseUrl,
                        new RenderClientScriptDelegator(w =>
                        {
                            w.WriteLine(
                                // jQuery code used to hide the Credentials section if the "System" account is to be used
@"$().ready(function(){
    var onAuthorizationChange = function(){
        if($('#" + ddlAuthentication.ClientID + @" option:selected').val() == 'system') {
            $('#" + ffgCredentials.ClientID + @"').hide();
        }
        else {
            $('#" + ffgCredentials.ClientID + @"').show();
        }
    };
    onAuthorizationChange();
    $('#" + ddlAuthentication.ClientID + @"').change(onAuthorizationChange);
});");
                        })
                    )
                ),
                ffgAuthentication,
                ffgCredentials
              );

            base.CreateChildControls();
        }
        protected override void CreateChildControls()
        {
            this.txtServerUrl = new ValidatingTextBox()
            {
                Required = true,
                Width = 300
            };

            this.txtUsername = new ValidatingTextBox()
            {
                Width = 300
            };

            this.txtPassword = new PasswordTextBox()
            {
                Width = 270
            };

            CUtil.Add(this,
                new FormFieldGroup(
                    "TeamCity Server URL",
                    "Enter the URL of the TeamCity server, typically: http://teamcityserver",
                    false,
                    new StandardFormField("Server URL:", this.txtServerUrl)
                ),
                new FormFieldGroup(
                    "Authentication",
                    "If you wish to connect to the TeamCity server with HTTP Authentication, please enter the credentials. Leaving the username field blank will connect using guest authentication.",
                    true,
                    new StandardFormField("Username:"******"Password:", this.txtPassword)
                )
            );
        }
 // Put placeholder text into password textbox
 private void SetPlaceholder()
 {
     PasswordTextBox.UseSystemPasswordChar = false;
     PasswordTextBox.Text      = PLACEHOLDER_TEXT;
     PasswordTextBox.Font      = new Font("Microsoft Tai Le", 21.00f);
     PasswordTextBox.ForeColor = SystemColors.ControlLight;
     PasswordTextBox.Select(0, 0);
 }
 private void LoginTextBox_KeyUp(object sender,
                                 KeyEventArgs e)
 {
     if (e.Key == Key.Enter || e.Key == Key.Down)
     {
         PasswordTextBox.Focus();
     }
 }
Beispiel #7
0
        protected override void CreateChildControls()
        {
            this.txtBaseUrl = new ValidatingTextBox {
                DefaultText = "ex: http://tfsserver:80/tfs", Required = true
            };

            this.txtUserName = new ValidatingTextBox();

            this.txtDomain = new ValidatingTextBox();

            this.txtPassword = new PasswordTextBox();

            this.txtCustomWorkspacePath = new ValidatingTextBox {
                DefaultText = "BuildMaster managed"
            };
            this.txtCustomWorkspaceName = new ValidatingTextBox {
                DefaultText = "Default"
            };

            ddlAuthentication = new DropDownList {
                ID = "ddlAuthentication"
            };
            ddlAuthentication.Items.Add(new ListItem("System", "system"));
            ddlAuthentication.Items.Add(new ListItem("Specify account...", "specify"));

            var ffgAuthentication = new SlimFormField("Authentication:", ddlAuthentication);

            var ffgCredentials = new Div(
                new SlimFormField("User name:", this.txtUserName),
                new SlimFormField("Password:"******"Domain:", this.txtDomain)
                );

            this.Controls.Add(
                new SlimFormField("TFS URL:", this.txtBaseUrl),
                ffgAuthentication,
                ffgCredentials,
                new SlimFormField("Workspace path:", this.txtCustomWorkspacePath)
            {
                HelpText = "The directory on disk where the TFS workspace will be mapped. By default, BuildMaster will use "
                           + @"_SVCTEMP\SrcRepos\{workspace-name}"
            },
                new SlimFormField("Workspace name:", this.txtCustomWorkspaceName)
            {
                HelpText = "The name of the TFS workspace to use. This value should be unique per credentials and machine. "
                           + "By default, BuildMaster will use the deepest subdirectory of the workspace path to generate the name."
            },
                new RenderJQueryDocReadyDelegator(
                    w =>
            {
                w.Write("$('#{0}').change(function(){{", this.ddlAuthentication.ClientID);
                w.Write("if($(this).val() == 'system') $('#{0}').hide(); else $('#{0}').show();", ffgCredentials.ClientID);
                w.Write("});");
                w.Write("$('#{0}').change();", this.ddlAuthentication.ClientID);
            }
                    )
                );
        }
Beispiel #8
0
 public void Limpiar()
 {
     NombreTextBox.Clear();
     NombreUsTextBox.Clear();
     PasswordTextBox.Clear();
     TelefonomaskedTextBox.Clear();
     DireccionTextBox.Clear();
     UsuarioIdNumericUpDown.Value = 0;
 }
Beispiel #9
0
        public string LogintoN11(string username, string password)
        {
            EmailTextBox.SendKeys(username);
            PasswordTextBox.SendKeys(password);
            string LoginPageTitle = webdriver.Title;

            LoginButton.Click();
            return(LoginPageTitle);
        }
Beispiel #10
0
 public void Login(string login, string password)
 {
     Activate();
     DetailsButton.Click();
     UserNameTextBox.TextValue = login;
     PasswordTextBox.Click();
     PasswordTextBox.PressKeys(password);
     LoginButton.Click();
 }
Beispiel #11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     PasswordTextBox.Attributes.Add("value", PasswordTextBox.Text);
     PasswordNuevaTextBox.Attributes.Add("value", PasswordNuevaTextBox.Text);
     ConfirmacionPasswordNuevaTextBox.Attributes.Add("value", ConfirmacionPasswordNuevaTextBox.Text);
     if (!IsPostBack)
     {
         PasswordTextBox.Focus();
     }
 }
Beispiel #12
0
        public bool Validate()
        {
            ServernameTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();
            ServerAddressTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();
            PortTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();
            PasswordTextBox.GetBindingExpression(PasswordHelper.PasswordProperty).UpdateSource();
            DescriptionTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();

            return(IsValid());
        }
 private void ViewModelOnFocusRequested(object sender, FocusRequestedEventArgs e)
 {
     switch (e.PropertyName)
     {
     case "Password":
         PasswordTextBox.Focus();
         PasswordTextBox.SelectAll();
         break;
     }
 }
 private void NhapLaiLuonNeBanOi()
 {
     TaiKhoanTextBox.Text = "";
     PasswordTextBox.Clear();
     RepasswordTextBox.Clear();
     HoTenTextBox.Text  = "";
     DiaChiTextBox.Text = "";
     SDTTextBox.Text    = "";
     EmailTextBox.Text  = "";
 }
        // Put placeholder text into password textbox
        private void SetPlaceholder()
        {
            PasswordTextBox.UseSystemPasswordChar = false;
            PasswordTextBox.Text      = Language.PlaceholderText;
            PasswordTextBox.ForeColor = LoginButton.FlatAppearance.BorderColor;
            PasswordTextBox.Select(0, 0);

            ShowPasswordButton.Visible = false;
            PasswordTextBox.Width     += ShowPasswordButton.Width;
        }
Beispiel #16
0
        private void ValidateButton_Click(object sender, RoutedEventArgs e)
        {
            // Only adds if the label is unique and required fields are filled
            if (MyGlobals.Lista.Exists(x => x.DirectKey == LabelTextBox.Text))
            {
                Thread thread = new Thread(ShowRectangleLabelExists);
                thread.Start();

                LabelTextBox.Focus();
            }
            else
            {
                if (LoginTextBox.Text == String.Empty || LoginTextBox.Text == (String)LoginTextBox.Tag)
                {
                    Thread thread = new Thread(ShowRequiredFieldWarning);
                    thread.Start(ErrorFieldEmpty2);

                    LoginTextBox.Focus();
                }
                else
                {
                    if (LabelTextBox.Text == String.Empty || LabelTextBox.Text == (String)LabelTextBox.Tag)
                    {
                        Thread thread = new Thread(ShowRequiredFieldWarning);
                        thread.Start(ErrorFieldEmpty);

                        LabelTextBox.Focus();
                    }
                    else
                    {
                        if (PasswordTextBox.Text == String.Empty || PasswordTextBox.Text == (String)PasswordTextBox.Tag)
                        {
                            Thread thread = new Thread(ShowRequiredFieldWarning);
                            thread.Start(ErrorFieldEmpty3);

                            PasswordTextBox.Focus();
                        }
                        else
                        {
                            // Add entry to local list and database
                            AddEntry();

                            // Checks if temporary Item exists, if so clears it
                            if (MyGlobals.TemporaryItem.DirectKey != String.Empty)
                            {
                                MyGlobals.TemporaryItem = Items.Empty();
                            }

                            nav.Navigate(new System.Uri("InitialPage.xaml", UriKind.RelativeOrAbsolute));
                        }
                    }
                }
            }
        }
 private void Reset()
 {
     UserNameTextBox.Clear();
     PasswordTextBox.Clear();
     NameTextBox.Clear();
     SecondNameTextBox.Clear();
     SurnameTextBox.Clear();
     BirthDayDatePicker.ClearValue(DatePicker.SelectedDateProperty);
     SexComboBox.ClearValue(ComboBox.SelectedItemProperty);
     PositionComboBox.ClearValue(ComboBox.SelectedItemProperty);
 }
Beispiel #18
0
        public LockScreenForm()
        {
            InitializeComponent();
            Taskbar.Hide();
            Console.WriteLine(welcome);
            FormBorderStyle = FormBorderStyle.None;
            WindowState     = FormWindowState.Normal;
            StartPosition   = FormStartPosition.Manual;
            Location        = new Point(0, 0);
            Size            = new Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);

            Image myimage = new Bitmap(getSpotlightImage());

            BackgroundImage = myimage;

            BackgroundImageLayout = ImageLayout.Stretch;
            TopMost = true;

            string userName = Environment.UserName;

            UserNameLabel.Text      = userName;
            UserNameLabel.BackColor = Color.Transparent;

            int usernameloch = (Convert.ToInt32(Screen.PrimaryScreen.Bounds.Height) / 100) * 64;
            int usericonh    = (Convert.ToInt32(Screen.PrimaryScreen.Bounds.Height) / 100) * 29;
            int buttonh      = (Convert.ToInt32(Screen.PrimaryScreen.Bounds.Height) / 100) * 64;
            int usernameh    = (Convert.ToInt32(Screen.PrimaryScreen.Bounds.Height) / 100) * 50;
            int locked       = (Convert.ToInt32(Screen.PrimaryScreen.Bounds.Height) / 100) * 57;

            if (!PasswordTextBox.Focus())
            {
                PasswordTextBox.Focus();
            }

            ActiveControl = PasswordTextBox;

            if (CanFocus)
            {
                Focus();
            }

            PasswordTextBox.Top = usernameloch;
            PasswordTextBox.UseSystemPasswordChar = true;
            ProfileIcon.Top          = usericonh;
            SubmitPasswordButton.Top = buttonh;
            UserNameLabel.Top        = usernameh;
            LockedLabel.Top          = locked;

            foreach (var screen in Screen.AllScreens)
            {
                Thread thread = new Thread(() => WorkThreadFunction(screen));
                thread.Start();
            }
        }
Beispiel #19
0
 public TextInputDialog()
 {
     InitializeComponent();
     PasswordTextBox.KeyDown += (s, e) => { if (e.Key == Key.Enter)
                                            {
                                                Close();
                                            }
     };
     SubmitButton.Click += (s, e) => Close();
     PasswordTextBox.Focus();
 }
Beispiel #20
0
        public DashboardPage LoginAsAdmin(TestContext context)
        {
            driver.Navigate().GoToUrl(context.Properties["SFURL"].ToString());
            LoginRegisterLink.Click();

            UsernameTextBox.SendKeys(context.Properties["SFUN"].ToString());
            PasswordTextBox.SendKeys(context.Properties["SFPW"].ToString());
            LoginButton.Click();

            return(NOCSPageHelper.DashboardPage);
        }
Beispiel #21
0
        private void exitApp()
        {
            ThreadStart myThreadStart = new ThreadStart(MyThreadRoutine);
            Thread      myThread      = new Thread(myThreadStart);

            myThread.Start();
            PasswordTextBox.Hide();
            SubmitPasswordButton.Hide();
            Taskbar.Show();
            System.Windows.Forms.Application.Exit();
        }
Beispiel #22
0
        public ChangePasswordView(User user)
        {
            InitializeComponent();

            DataContext = new ChangePasswordViewModel(user)
            {
                Close = () => Close()
            };

            PasswordTextBox.Focus();
        }
        private void OnFocusRequested(object sender, FocusRequestedEventArgs e)
        {
            var viewModel = (MainWindowViewModel)DataContext;

            switch (e.PropertyName)
            {
            case nameof(viewModel.Password):
                PasswordTextBox.Focus();
                PasswordTextBox.SelectAll();
                break;
            }
        }
        protected override void CreateChildControls()
        {
            this.chkUseStandardGitClient = new CheckBox
            {
                Text = "Use Standard Git Client"
            };

            this.txtGitExecutablePath = new SourceControlFileFolderPicker
            {
                ServerId = this.EditorContext.ServerId,
                Required = false
            };

            this.txtOrganizationName = new ValidatingTextBox { Required = false, DefaultText = "Optional", Width = 300 };
            this.txtUserName = new ValidatingTextBox { Required = true, Width = 300 };
            this.txtPassword = new PasswordTextBox { Required = true, Width = 300 };

            var ctlExePathField = new StandardFormField("Git Executable Path:", this.txtGitExecutablePath);

            this.Controls.Add(
                new FormFieldGroup(
                    "Organization",
                    "Optionally provide the organization name which owns the repositories.",
                    false,
                    new StandardFormField(
                        "Organization:",
                        this.txtOrganizationName
                    )
                ),
                new FormFieldGroup(
                    "Authentication",
                    "Provide the user name and password of a GitHub user which has access to the desired repositories.",
                    false,
                    new StandardFormField(
                        "User Name:",
                        this.txtUserName
                    ),
                    new StandardFormField(
                        "Password:"******"Git Client",
                    "This extension includes a lightweight Git client for Windows. To use an alternate Git client, check the box and provide the path of the other client.",
                    false,
                    new StandardFormField(string.Empty, this.chkUseStandardGitClient),
                    ctlExePathField
                )
            );

            this.Controls.BindVisibility(this.chkUseStandardGitClient, ctlExePathField);
        }
Beispiel #25
0
 private void PasswordCueText_Click(object sender, EventArgs e)
 {
     if (PasswordTextBox.Text.Trim() == "")
     {
         PasswordCueText.Hide();
     }
     else if (PasswordTextBox.Text.Trim() != "" && PasswordCueText.Visible == false)
     {
         PasswordCueText.Hide();
     }
     PasswordTextBox.Focus();
 }
Beispiel #26
0
 public void Registration(string login, bool isPhone)
 {
     Driver.Browser.Url = TestDataResource.MainPageURL + "/register/";
     if (isPhone)
     {
         PhoneTab.Click();
     }
     RegistrationEmailTextBox.SendKeys(login);
     PasswordTextBox.SendKeys(TestDataResource.Password);
     AgreeCheckBox.Click();
     RegistrationButton.Click();
 }
        private void AuthorizationButton_Click(object sender, EventArgs e)
        {
            if (LoginTextBox.Text.Length == 0 || PasswordTextBox.Text.Length == 0)
            {
                MessageBox.Show("Не заполнено поле логига или пароля!", "Авторизация");
                return;
            }
            string     fullName   = "";
            List <int> accessesId = new List <int>();

            using (SqlConnection cn = new SqlConnection(SQLRequestsData.conStr))
            {
                try
                {
                    cn.Open();
                    string        strSQL    = "SELECT * FROM AuthorizationData WHERE login = '******' and password = '******'";
                    SqlCommand    myCommand = new SqlCommand(strSQL, cn);
                    SqlDataReader dr        = myCommand.ExecuteReader();
                    if (dr.Read())
                    {
                        fullName = (dr["name"]).ToString();
                    }
                    else
                    {
                        MessageBox.Show("Неправильно введён логин или пароль!", "Авторизация");
                        PasswordTextBox.Clear();
                        return;
                    }
                    dr.Close();
                    strSQL    = "SELECT accessId FROM UserAccess WHERE login = '******'";
                    myCommand = new SqlCommand(strSQL, cn);
                    dr        = myCommand.ExecuteReader();
                    while (dr.Read())
                    {
                        accessesId.Add(Convert.ToInt32(dr[0].ToString()));
                    }
                }
                catch (SqlException ex)
                {
                    MessageBox.Show(ex.Message);
                }
                finally
                {
                    cn.Close();
                }
            }
            MainForm obj = new MainForm(accessesId, fullName, LoginTextBox.Text);

            this.Hide();
            obj.ShowDialog();
            this.Close();
        }
Beispiel #28
0
 private void FailedAttempt()
 {
     CustomMessageBox.Show("Usuario no encontrado. Por favor verifique que sus datos sean correctos.");
     UserTextBox.Clear();
     PasswordTextBox.Clear();
     _attempts++;
     if (_attempts == ALLOWEDATTEMTPS)
     {
         _lockedLogin          = true;
         LoginButton.IsEnabled = false;
         CustomMessageBox.Show("Ah sobre pasado el numero de intentos disponibles, intente mas tarde");
     }
 }
        public bool validar()
        {
            bool paso = true;

            if (string.IsNullOrWhiteSpace(NombresTextBox.Text))
            {
                SuperErrorProvider.SetError(NombresTextBox, "Este campo no puede estar vacio");
                NombresTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(CorreoTextBox.Text))
            {
                SuperErrorProvider.SetError(CorreoTextBox, "Este campo no puede estar vacio");
                CorreoTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(UsuarioTextBox.Text))
            {
                SuperErrorProvider.SetError(UsuarioTextBox, "Este campo no puede estar vacio");
                UsuarioTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(ConfirmPasswordTextBox.Text))
            {
                SuperErrorProvider.SetError(ConfirmPasswordTextBox, "Este campo no puede estar vacio");
                ConfirmPasswordTextBox.Focus();
                paso = false;
            }

            if (!ConfirmPasswordTextBox.Text.Equals(PasswordTextBox.Text))
            {
                SuperErrorProvider.SetError(ConfirmPasswordTextBox, "Ambos campos deben coincidir");
                ConfirmPasswordTextBox.Focus();
                SuperErrorProvider.SetError(PasswordTextBox, "Ambos campos deben coincidir");
                PasswordTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(PasswordTextBox.Text))
            {
                SuperErrorProvider.SetError(PasswordTextBox, "Este campo no puede estar vacio");
                PasswordTextBox.Focus();
                paso = false;
            }


            return(paso);
        }
Beispiel #30
0
        // PasswordTextBox Events
        private void PasswordTextBox_Enter(object sender, EventArgs e)
        {
            PasswordTextBox.ForeColor    = Color.FromArgb(78, 184, 206);
            PasswordPictureBox.Image     = Properties.Resources.password_icon_colored;
            PasswordFieldPanel.BackColor = Color.FromArgb(78, 184, 206);

            LoginStatusLabel.Text = "";

            if (PasswordTextBox.Text == "Пароль")
            {
                PasswordTextBox.Clear();
                PasswordTextBox.PasswordChar = '•';
            }
        }
Beispiel #31
0
 private void ConfirmPasswordTextBox_Validating(object sender, CancelEventArgs e)
 {
     if (this.ConfirmPasswordTextBox.Text != this.PasswordTextBox.Text)
     {
         this.errorProvider1.SetError(this.ConfirmPasswordTextBox, "Password and Confirm must be the same");
         e.Cancel = true;
         PasswordTextBox.Clear();
         ConfirmPasswordTextBox.Clear();
     }
     else
     {
         this.errorProvider1.SetError(this.ConfirmPasswordTextBox, "");
     }
 }
Beispiel #32
0
        protected override void CreateChildControls()
        {
            this.chkUseCustomProfileXml = new CheckBox()
            {
                Text = "Use custom publish settings..."
            };
            var ctlProjectPublishProfileXmlContainer = new Div()
            {
                ID = "ctlProjectPublishProfileXmlContainer"
            };

            this.txtProjectPath = new FileBrowserTextBox();
            this.txtProjectPublishProfileName = new ValidatingTextBox();
            this.txtProjectPublishProfileXml  = new ValidatingTextBox()
            {
                TextMode = TextBoxMode.MultiLine, Rows = 7
            };
            ctlProjectPublishProfileXmlContainer.Controls.Add(new Div("Enter custom publish profile XML:"), this.txtProjectPublishProfileXml);

            this.txtProjectBuildConfiguration = new ValidatingTextBox()
            {
                Required = true
            };
            this.txtVisualStudioVersion = new ValidatingTextBox()
            {
                DefaultText = "12.0"
            };
            this.txtAdditionalArguments = new ValidatingTextBox();
            this.txtUserName            = new ValidatingTextBox()
            {
                DefaultText = "Inherit credentials from extension configuration"
            };
            this.txtPassword = new PasswordTextBox();

            this.Controls.Add(
                new SlimFormField("Project/Solution file:", this.txtProjectPath),
                new SlimFormField("Publish profile:", new Div("Profile Name:"), this.txtProjectPublishProfileName, this.chkUseCustomProfileXml, ctlProjectPublishProfileXmlContainer),
                new SlimFormField("Build configuration:", this.txtProjectBuildConfiguration),
                new SlimFormField("Visual Studio version:", this.txtVisualStudioVersion)
            {
                HelpText = "Visual Studio must be installed in order to publish directly from the command line. Choose "
                           + "the version of Visual Studio that is installed on the selected server in order for Web Deploy to use the "
                           + "appropriate build targets for the installed version. The default is 12.0 (Visual Studio 2013)."
            },
                new SlimFormField("Credentials:", new Div(new Div("Username:"******"Password:"******"Additional MSBuild arguments:", this.txtAdditionalArguments)
                );

            this.Controls.BindVisibility(chkUseCustomProfileXml, ctlProjectPublishProfileXmlContainer);
        }
Beispiel #33
0
        protected override void CreateChildControls()
        {
            this.txtUserName = new ValidatingTextBox {
                Required = true
            };
            this.txtPassword = new PasswordTextBox {
                Required = true
            };

            this.Controls.Add(
                new SlimFormField("User name:", this.txtUserName),
                new SlimFormField("API key:", this.txtPassword)
                );
        }
        private bool CheckPassword(IS2G10_DBSSSDataSet.USERPROFILERow userProfile, string sPass)
        {
            var check = _passwordBuilder.CheckPassword(sPass, userProfile.password_hash, userProfile.password_salt);

            //check if password is right
            if (!check)
            {
                _dialogService.CallMessageModal(this, "", SSS_Library.Properties.Resources.IncorrectLoginDetailsMessage);
                PasswordTextBox.Clear();
                UsernameTextBox.Clear();
                UsernameTextBox.Focus();
            }
            return(check);
        }
Beispiel #35
0
 /// <summary>
 /// 退出
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Button1_Click(object sender, System.EventArgs e)
 {
     if (PasswordTextBox.Text.Trim() == Exit_Password || PasswordTextBox.Text.Trim() == "#")
     {
         PasswordAction?.Invoke(true);
         Close();
     }
     else
     {
         MessageBox.Show("密码错误,请重新输入!");
         PasswordTextBox.Focus();
         //PasswordAction?.Invoke(false);
     }
 }
Beispiel #36
0
        protected override void CreateChildControls()
        {
            this.ctlServerPicker = new ActionServerPicker { ServerId = 1, ID = "ctlServerPicker" };

            this.txtBaseUrl = new ValidatingTextBox();

            this.txtUserName = new ValidatingTextBox();

            this.txtDomain = new ValidatingTextBox();

            this.txtPassword = new PasswordTextBox();

            this.ddlAuthentication = new DropDownList { ID = "ddlAuthentication" };
            this.ddlAuthentication.Items.Add(new ListItem("System", "system"));
            this.ddlAuthentication.Items.Add(new ListItem("Specify account...", "specify"));

            var sffAuthentication = new SlimFormField("Authentication:", this.ddlAuthentication) { ID = "sffAuthentication" };

            var sffCredentials = new SlimFormField("Credentials:",
                new Div(new Div("Username:"******"Password:"******"Domain:"), new Div(this.txtDomain))
                ) { ID = "sffCredentials" };

            this.Controls.Add(
                new SlimFormField("TFS client:", this.ctlServerPicker){ HelpText = "The server where the TFS Client (Visual Studio or Team Explorer) is installed." },
                new SlimFormField("TFS collection url:", this.txtBaseUrl){ HelpText = "The is the api of the TFS Collection to use, e.g. http://tfsserver:8080/tfs" },
                sffAuthentication,
                sffCredentials,
                new RenderJQueryDocReadyDelegator(w =>
                        {
                            w.WriteLine(
@"  var onAuthorizationChange = function(){
        if($('#" + ddlAuthentication.ClientID + @" option:selected').val() == 'system') {
            $('#" + sffCredentials.ClientID + @"').hide();
        }
        else {
            $('#" + sffCredentials.ClientID + @"').show();
        }
    };
    onAuthorizationChange();
    $('#" + this.ddlAuthentication.ClientID + @"').change(onAuthorizationChange);
");
                        })
              );
        }
        protected override void CreateChildControls()
        {
            this.txtApiUrl = new ValidatingTextBox { DefaultText = GitHub.GitHubComUrl };
            this.txtOrganizationName = new ValidatingTextBox { DefaultText = "none" };

            this.txtUserName = new ValidatingTextBox { Required = true };

            this.txtPassword = new PasswordTextBox { Required = true };

            this.Controls.Add(
                new SlimFormField("API base URL:", this.txtApiUrl)
                {
                    HelpText = "This provider connects to github.com by default. If connecting to GitHub Enterprise on a local network, specify the hostname of the API here."
                },
                new SlimFormField("Organization:", this.txtOrganizationName),
                new SlimFormField("User name:", this.txtUserName),
                new SlimFormField("Password:", this.txtPassword)
            );
        }
        protected override void CreateChildControls()
        {
            this.txtApiUrl = new ValidatingTextBox() { DefaultText = GitHub.GitHubComUrl };

            this.chkUseStandardGitClient = new CheckBox
            {
                Text = "Use Standard Git Client"
            };

            this.txtGitExecutablePath = new SourceControlFileFolderPicker
            {
                ServerId = this.EditorContext.ServerId,
                Required = false
            };

            this.txtOrganizationName = new ValidatingTextBox { Required = false, DefaultText = "Optional" };
            this.txtUserName = new ValidatingTextBox { Required = true };
            this.txtPassword = new PasswordTextBox { Required = true };

            var ctlExePathField = new SlimFormField("Git executable path:", this.txtGitExecutablePath);

            this.Controls.Add(
                new SlimFormField("API base URL:", this.txtApiUrl)
                {
                    HelpText = "This provider connects to github.com by default. If connecting to GitHub Enterprise on a local network, specify the hostname of the API here."
                },
                new SlimFormField("Organization name:", this.txtOrganizationName),
                new SlimFormField("GitHub username:"******"GitHub password:"******"Git client:", this.chkUseStandardGitClient)
                {
                    HelpText = "This extension includes a lightweight Git client for Windows. To use an alternate Git client, check the box and provide the path of the other client."
                },
                ctlExePathField
            );

            this.Controls.BindVisibility(this.chkUseStandardGitClient, ctlExePathField);
        }
        protected override void CreateChildControls()
        {
            this.txtBaseUrl = new ValidatingTextBox { DefaultText = "ex: http://tfsserver:80/tfs", Required = true };

            this.txtUserName = new ValidatingTextBox();

            this.txtDomain = new ValidatingTextBox();

            this.txtPassword = new PasswordTextBox();

            ddlAuthentication = new DropDownList() { ID = "ddlAuthentication" };
            ddlAuthentication.Items.Add(new ListItem("System", "system"));
            ddlAuthentication.Items.Add(new ListItem("Specify account...", "specify"));

            var ffgAuthentication = new SlimFormField("Authentication:", ddlAuthentication);

            var ffgCredentials = new Div(
                new SlimFormField("User name:", this.txtUserName),
                new SlimFormField("Password:"******"Domain:", this.txtDomain)
            );

            this.Controls.Add(
                new SlimFormField("TFS URL:", this.txtBaseUrl),
                ffgAuthentication,
                ffgCredentials,
                new RenderJQueryDocReadyDelegator(
                    w =>
                    {
                        w.Write("$('#{0}').change(function(){{", this.ddlAuthentication.ClientID);
                        w.Write("if($(this).val() == 'system') $('#{0}').hide(); else $('#{0}').show();", ffgCredentials.ClientID);
                        w.Write("});");
                        w.Write("$('#{0}').change();", this.ddlAuthentication.ClientID);
                    }
                )
            );
        }
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based
        /// implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            this.txtUrl = new ValidatingTextBox()
            {
                Required = true,
                Width = 300
            };

            this.txtUser = new TextBox()
            {
                Width = 300
            };

            this.txtPassword = new PasswordTextBox()
            {
                Width = 270
            };

            CUtil.Add(this,
                new FormFieldGroup(
                    "Trac Project URL",
                    "The address of the Trac project. For example: http://tracserv/trac/Project",
                    false,
                    new StandardFormField("URL:", this.txtUrl)
                ),
                new FormFieldGroup(
                    "Authentication",
                    "The credentials used to log in to the Trac server. For anonymous access, leave these fields blank.",
                    false,
                    new StandardFormField("User Name:", this.txtUser),
                    new StandardFormField("Password:", this.txtPassword)
                )
            );
        }
        protected override void CreateChildControls()
        {
            this.txtBaseUrl = new ValidatingTextBox { Width = 300, Required = true };
            this.txtUserName = new ValidatingTextBox { Width = 300, Required = true };
            this.txtPassword = new PasswordTextBox { Width = 270, Required = true };
            this.chkBasicAuthentication = new CheckBox { Text = "Use Basic Authentication", Checked = true };

            this.Controls.Add(
                new FormFieldGroup(
                    "Collection URL",
                    "The URL of the collection to connect to. For example, https://contoso.visualstudio.com/defaultcollection",
                    false,
                    new StandardFormField("Collection URL:", this.txtBaseUrl)
                ),
                new FormFieldGroup(
                    "Credentials",
                    "Specify the service account credentials to use to connect to the server. See <a href=\"http://blogs.msdn.com/b/buckh/archive/2013/01/07/how-to-connect-to-tf-service-without-a-prompt-for-liveid-credentials.aspx\">this article</a> for how to configure TFS to allow basic authentication.",
                    false,
                    new StandardFormField("User Name:", this.txtUserName),
                    new StandardFormField("Password:", this.txtPassword),
                    new StandardFormField(string.Empty, this.chkBasicAuthentication)
                )
            );
        }
 public void PasswordCharDelayRejectsAZeroValue()
 {
     PasswordTextBox.NewTimer = OriginalTimerConstructor;
     PasswordTextBox = new PasswordTextBox();
     try
     {
         PasswordTextBox.PasswordCharDelay = 0;
     }
     catch (ArgumentOutOfRangeException e)
     {
         Assert.AreEqual(0, e.ActualValue);
         StringAssert.StartsWith(e.Message,
                                 "Must be greater than zero.");
         Assert.IsNull(e.ParamName);
         throw;
     }
 }
        public void TestInitialize()
        {
            OriginalGraphicsConstructor = PasswordTextBox.NewGraphics;
            CallsToNewGraphics = new List<Control>();
            GraphicsObjects = new List<MockGraphics>();
            PasswordTextBox.NewGraphics = delegate(Control control)
            {
                CallsToNewGraphics.Add(control);
                var graphics = new MockGraphics();
                GraphicsObjects.Add(graphics);
                return graphics;
            };

            OriginalSolidBrushConstructor = PasswordTextBox.NewSolidBrush;
            CallsToNewSolidBrush = new List<Color>();
            SolidBrushes = new List<MockSolidBrush>();
            PasswordTextBox.NewSolidBrush = delegate(Color color)
            {
                CallsToNewSolidBrush.Add(color);
                var solidBrush = new MockSolidBrush();
                SolidBrushes.Add(solidBrush);
                return solidBrush;
            };

            OriginalTimerConstructor = PasswordTextBox.NewTimer;
            CallsToNewTimer = new List<CallToInjectTimer>();
            Timers = new List<MockTimer>();
            PasswordTextBox.NewTimer = delegate(bool autoReset,
                                                double interval,
                                                ISynchronizeInvoke synchronizingObject)
            {
                CallsToNewTimer.Add(new CallToInjectTimer
                {
                    AutoReset = autoReset,
                    Interval = interval,
                    SynchronizingObject = synchronizingObject
                });
                var timer = new MockTimer();
                Timers.Add(timer);
                return timer;
            };

            PasswordTextBox = new PasswordTextBox();
        }
        protected override void CreateChildControls()
        {
            //Inedo.Web.Controls.

            this.txtApplicationName = new ValidatingTextBox { Required = true, Width = 300 };
            this.txtProviderUrl = new ValidatingTextBox { Required = true, Width = 300 };
            this.txtCertificatePath = new SourceControlFileFolderPicker { ServerId = this.ServerId };
            this.txtCertificatePassword = new PasswordTextBox { Width = 250 };
            this.txtCertificateHash = new ValidatingTextBox { Width = 300 };
            this.txtVersion = new ValidatingTextBox { Required = true, Width = 300 };
            this.txtMinVersion = new ValidatingTextBox { Required = false, Width = 300 };
            this.chkMapFileExtensions = new CheckBox { Text = "Rename files to .deploy" };
            this.chkInstallApplication = new CheckBox { Text = "Install application onto local machine" };
            this.chkCreateDesktopIcon = new CheckBox { Text = "Create desktop icon" };
            this.chkStartupCheckForUpdate = new CheckBox { Text = "Check for update at startup" };
            this.txtEntryPointFile = new ValidatingTextBox { Width = 300 };
            this.txtFilesExcludedFromManifest = new ValidatingTextBox { Width = 300, TextMode = TextBoxMode.MultiLine };
            this.txtIconFile = new ValidatingTextBox { Required = false, Width = 300 };
            this.txtAppCodeBaseDirectory = new ValidatingTextBox { Width = 300 };
            this.chkTrustUrlParameters = new CheckBox { Text = "Trust URL Parameters" };

            this.txtFileAssociationDefaultIcon1 = new ValidatingTextBox { Width = 300 };
            this.txtFileAssociationDescription1 = new ValidatingTextBox { Width = 300 };
            this.txtFileAssociationExtension1 = new ValidatingTextBox { Width = 300 };
            this.txtFileAssociationProgId1 = new ValidatingTextBox { Width = 300 };

            this.txtFileAssociationDefaultIcon2 = new ValidatingTextBox { Width = 300 };
            this.txtFileAssociationDescription2 = new ValidatingTextBox { Width = 300 };
            this.txtFileAssociationExtension2 = new ValidatingTextBox { Width = 300 };
            this.txtFileAssociationProgId2 = new ValidatingTextBox { Width = 300 };

            this.Controls.Add(
                new FormFieldGroup(
                    "Application Settings",
                    "Configuration for the application. Note that the version number and minimum version number "
                    + "must be of the form 0.0.0.0. The minimum version can be used to force an update preventing the user from skipping it."
                    + " The provider URL should be where the application is deployed to (e.g. http://example.com/MyApp/)",
                    false,
                    new StandardFormField(
                        "Application Name:",
                        this.txtApplicationName),
                    new StandardFormField(
                        "Version Number:",
                        this.txtVersion),
                        new StandardFormField(
                        "Minimum Version Number:",
                        this.txtMinVersion),
                    new StandardFormField(
                        "Provider URL:",
                        this.txtProviderUrl),
                    new StandardFormField("Icon File:", this.txtIconFile),
                    new StandardFormField("Application Code Base Directory:", this.txtAppCodeBaseDirectory),
                    new StandardFormField(
                        "Entry Point File:",
                        this.txtEntryPointFile),
                    new StandardFormField("Files to exclude from manifest:",
                        this.txtFilesExcludedFromManifest),
                    new StandardFormField(String.Empty, this.chkTrustUrlParameters),
                    new StandardFormField("File Association 1:",
                        new StandardFormField("Default Icon:", this.txtFileAssociationDefaultIcon1),
                        new StandardFormField("Description:", this.txtFileAssociationDescription1),
                        new StandardFormField("Extension:", this.txtFileAssociationExtension1),
                        new StandardFormField("Prog Id:", this.txtFileAssociationProgId1)),
                    new StandardFormField("File Association 2:",
                        new StandardFormField("Default Icon:", this.txtFileAssociationDefaultIcon2),
                        new StandardFormField("Description:", this.txtFileAssociationDescription2),
                        new StandardFormField("Extension:", this.txtFileAssociationExtension2),
                        new StandardFormField("Prog Id:", this.txtFileAssociationProgId2))
                    ),
                new FormFieldGroup(
                    "File Extension Mapping",
                    "Determines whether files in the deployment will have a .deploy extension. "
                    + "ClickOnce will strip this extension off these files as soon as it downloads them "
                    + "from the Web server. This parameter allows all the files within a ClickOnce deployment "
                    + "to be downloaded from a Web server that blocks transmission of files ending in \"unsafe\" "
                    + "extensions such as .exe. ",
                    false,
                    new StandardFormField(string.Empty, this.chkMapFileExtensions)),
                new FormFieldGroup(
                    "Installation Settings",
                    "Indicates whether or not the ClickOnce application should install onto the local machine, "
                    + "or whether it should run from the Web. Installing an application gives that application a "
                    + "presence in the Windows Start menu.",
                    false,
                    new StandardFormField(string.Empty, this.chkInstallApplication),
                    new StandardFormField(string.Empty, this.chkCreateDesktopIcon),
                    new StandardFormField(string.Empty, this.chkStartupCheckForUpdate)),
                new FormFieldGroup(
                    "Certificate Settings",
                    "ClickOnce applications must be signed with an X509 certificate, "
                    + "which may be stored on disk or in the local cert store. "
                    + "<br /><br />Note that either a Certificate Path or Certificate Hash "
                    + "must be selected, but not both",
                    true,
                    new StandardFormField(
                        "Certificate Path:",
                        this.txtCertificatePath),
                    new StandardFormField(
                        "Certificate Hash:",
                        this.txtCertificateHash),
                    new StandardFormField(
                        "Certificate Password:",
                        this.txtCertificatePassword)));
        }
        protected override void CreateChildControls()
        {
            txtName = new ValidatingTextBox {Required = true};
            ddlUser = new DropDownList
            {
                Items =
                {
                    new ListItem("Local System", "LocalSystem"),
                    new ListItem("Local Service", "LocalService"),
                    new ListItem("Network Service", "NetworkService"),
                    new ListItem("Application Pool Identity", "ApplicationPoolIdentity"),
                    new ListItem("Custom...", "custom")
                }
            };

            txtUser = new ValidatingTextBox();
            txtPassword = new PasswordTextBox();

            divUser = new Div
            {
                Controls =
                {
                    new LiteralControl("<br />"),
                    new StandardFormField("User Name:", txtUser),
                    new StandardFormField("Password:"******"Integrated Mode", "true"),
                    new ListItem("Classic Mode", "false")
                }
            };

            ddlManagedRuntimeVersion = new DropDownList
            {
                Items =
                {
                    new ListItem("v4.0"),
                    new ListItem("v2.0")
                }
            };

            chkBoxlistOmitAction = new CheckBoxList
            {
                Items =
                {
                    new ListItem("if App Pool already exist.","true"),
                }
            };


            Controls.Add(
                new SlimFormField(
                    "Application pool name:",
                    txtName
                    ),
                new SlimFormField(
                    "User identity:",
                    ddlUser,
                    divUser
                    ),
                new SlimFormField(
                    "Managed pipeline mode:",
                    rblIntegrated
                    ),
                new SlimFormField(
                    "Managed runtime version:",
                    ddlManagedRuntimeVersion
                    ),
                new SlimFormField(
                    "Omit action:",
                    chkBoxlistOmitAction
                    )
                );
        }
        private void CreateTfsConnectionControls()
        {
            var defaultCfg = (TfsConfigurer)this.GetExtensionConfigurer();
            var ctlError = new InfoBox { BoxType = InfoBox.InfoBoxTypes.Error, Visible = false };

            var txtBaseUrl = new ValidatingTextBox
            {
                Required = true,
                Text = defaultCfg.BaseUrl,
                DefaultText = "ex. http://tfsserver:8080/tfs"
            };

            var txtUserName = new ValidatingTextBox
            {
                DefaultText = "use system credentials",
                Text = defaultCfg.UserName
            };
            var txtPassword = new PasswordTextBox
            {
                Text = defaultCfg.Password
            };
            var txtDomain = new ValidatingTextBox
            {
                Text = defaultCfg.Domain
            };

            txtBaseUrl.ServerValidate +=
                (s, e) =>
                {
                    var configurer = new TfsConfigurer
                    {
                        BaseUrl = txtBaseUrl.Text,
                        UserName = txtUserName.Text,
                        Password = txtPassword.Text,
                        UseSystemCredentials = string.IsNullOrWhiteSpace(txtUserName.Text)
                    };

                    var errorMessage = configurer.TestConnection();
                    if (!string.IsNullOrEmpty(errorMessage))
                    {
                        e.IsValid = false;
                        ctlError.Visible = true;
                        ctlError.Controls.Add(new P("An error occurred while attempting to connect: " + errorMessage));
                    }
                };

            this.wizardSteps.TfsConnection.Controls.Add(
                ctlError,
                new SlimFormField("TFS collection URL:", txtBaseUrl
                )
                {
                    HelpText = "To use a specific collection, use http://tfsserver:8080/tfs/CollectionName as an example URL. The collection name may be omitted if the TFS server is configured to use the DefaultCollection at /tfs."
                },
                new SlimFormField("Username:"******"Password:"******"Domain:", txtDomain)
            );

            this.WizardStepChange += (s, e) =>
            {
                if (e.CurrentStep != this.wizardSteps.TfsConnection)
                    return;

                defaultCfg.BaseUrl = txtBaseUrl.Text;
                defaultCfg.UserName = txtUserName.Text;
                defaultCfg.Password = txtPassword.Text;
                var defaultProfile = StoredProcs
                        .ExtensionConfiguration_GetConfigurations(TfsConfigurer.TypeQualifiedName)
                        .Execute()
                        .Where(p => p.Default_Indicator == Domains.YN.Yes)
                        .FirstOrDefault() ?? new Tables.ExtensionConfigurations();

                StoredProcs
                    .ExtensionConfiguration_SaveConfiguration(
                        Util.NullIf(defaultProfile.ExtensionConfiguration_Id, 0),
                        TfsConfigurer.TypeQualifiedName,
                        defaultProfile.Profile_Name ?? "Default",
                        Util.Persistence.SerializeToPersistedObjectXml(defaultCfg),
                        Domains.YN.Yes)
                    .Execute();
            };
        }
        private void CreateTfsConnectionControls()
        {
            var defaultCfg = (TfsConfigurer)this.GetExtensionConfigurer();
            var ctlError = new InfoBox { BoxType = InfoBox.InfoBoxTypes.Error, Visible = false };

            var txtBaseUrl = new ValidatingTextBox
            {
                Required = true,
                Text = defaultCfg.BaseUrl,
                Width = 350
            };

            var txtUserName = new ValidatingTextBox
            {
                DefaultText = "System credentials",
                Text = defaultCfg.UserName,
                Width = 350
            };
            var txtPassword = new PasswordTextBox
            {
                Text = defaultCfg.Password,
                Width = 350
            };
            var txtDomain = new ValidatingTextBox
            {
                Text = defaultCfg.Domain,
                Width = 350
            };

            txtBaseUrl.ServerValidate +=
                (s, e) =>
                {
                    var configurer = new TfsConfigurer
                    {
                        BaseUrl = txtBaseUrl.Text,
                        UserName = txtUserName.Text,
                        Password = txtPassword.Text,
                        UseSystemCredentials = string.IsNullOrWhiteSpace(txtUserName.Text)
                    };

                    var errorMessage = configurer.TestConnection();
                    if (!string.IsNullOrEmpty(errorMessage))
                    {
                        e.IsValid = false;
                        ctlError.Visible = true;
                        ctlError.Controls.Add(new P("An error occurred while attempting to connect: " + errorMessage));
                    }
                };

            this.wizardSteps.TfsConnection.Controls.Add(
                ctlError,
                new FormFieldGroup("TFS Server Name",
                    "The name of the Team Foundation Server to connect to, e.g. http://tfsserver:8080/tfs",
                    false,
                    new StandardFormField("Server Name:", txtBaseUrl)
                ),
                new FormFieldGroup("Credentials",
                    "Specify the credentials of the account you would like to use to connect to Team Foundation Server",
                    false,
                    new StandardFormField("Username:"******"Password:"******"Domain:", txtDomain)
                )
            );

            this.WizardStepChange += (s, e) =>
            {
                if (e.CurrentStep != this.wizardSteps.TfsConnection)
                    return;

                defaultCfg.BaseUrl = txtBaseUrl.Text;
                defaultCfg.UserName = txtUserName.Text;
                defaultCfg.Password = txtPassword.Text;
                var defaultProfile = StoredProcs
                        .ExtensionConfiguration_GetConfigurations(TfsConfigurer.TypeQualifiedName)
                        .Execute()
                        .Where(p => p.Default_Indicator == Domains.YN.Yes)
                        .FirstOrDefault() ?? new Tables.ExtensionConfigurations();

                StoredProcs
                    .ExtensionConfiguration_SaveConfiguration(
                        Util.NullIf(defaultProfile.ExtensionConfiguration_Id, 0),
                        TfsConfigurer.TypeQualifiedName,
                        defaultProfile.Profile_Name ?? "Default",
                        Util.Persistence.SerializeToPersistedObjectXml(defaultCfg),
                        Domains.YN.Yes)
                    .Execute();
            };
        }
        private void CreateTeamCityConnectionControls()
        {
            var defaultCfg = TeamCityConfigurer.GetConfigurer(null) ?? new TeamCityConfigurer();
            var ctlError = new InfoBox { BoxType = InfoBox.InfoBoxTypes.Error, Visible = false };

            var txtServerUrl = new ValidatingTextBox
            {
                Required = true,
                Text = defaultCfg.ServerUrl,
                Width = 350
            };

            var txtUsername = new ValidatingTextBox
            {
                Text = defaultCfg.Username,
                Width = 350
            };
            var txtPassword = new PasswordTextBox
            {
                Text = defaultCfg.Password,
                Width = 350
            };

            txtServerUrl.ServerValidate += (s, e) =>
                {
                    var configurer = new TeamCityConfigurer
                    {
                        ServerUrl = txtServerUrl.Text,
                        Username = txtUsername.Text,
                        Password = txtPassword.Text
                    };
                    try
                    {
                        using (var client = new WebClient())
                        {
                            client.BaseAddress = configurer.BaseUrl;
                            if (!string.IsNullOrEmpty(configurer.Username))
                                client.Credentials = new NetworkCredential(configurer.Username, configurer.Password);

                            client.DownloadString("app/rest/buildTypes");
                        }
                    }
                    catch (Exception _e)
                    {
                        e.IsValid = false;
                        ctlError.Visible = true;
                        ctlError.Controls.Add(new P("An error occurred while attempting to connect: " + _e.Message));
                    }
                };

            this.wizardSteps.TeamCityConnection.Controls.Add(
                ctlError,
                new FormFieldGroup(
                    "TeamCity Server URL",
                    "Enter the URL of the TeamCity server, typically: http://teamcityserver",
                    false,
                    new StandardFormField("Server URL:", txtServerUrl)
                ),
                new FormFieldGroup(
                    "Authentication",
                    "If you wish to connect to the TeamCity server with HTTP Authentication, please enter the credentials. Leaving the username field blank will connect using guest authentication.",
                    true,
                    new StandardFormField("Username:"******"Password:"******"Default",
                        Util.Persistence.SerializeToPersistedObjectXml(defaultCfg),
                        Domains.YN.Yes)
                    .Execute();
            };
        }
        protected override void CreateChildControls()
        {
            this.txtBaseUrl = new ValidatingTextBox
            {
                DefaultText = "ex: http://tfsserver:80/tfs",
                Required = true
            };

            this.txtCustomReleaseNumberFieldName = new ValidatingTextBox { DefaultText = "iteration" };

            this.txtUserName = new ValidatingTextBox();

            this.txtDomain = new ValidatingTextBox();

            this.txtPassword = new PasswordTextBox();

            this.chkAllowHtml = new CheckBox { Text = "Allow HTML in issue descriptions" };

            this.txtCustomClosedStates = new ValidatingTextBox()
            {
                TextMode = TextBoxMode.MultiLine,
                Rows = 3,
                DefaultText = "Closed\r\nResolved"
            };

            ddlAuthentication = new DropDownList
            {
                ID = "ddlAuthentication",
                Items =
                {
                    new ListItem("System", "system"),
                    new ListItem("Specify account...", "specify")
                }
            };

            this.ddlUseWiql = new DropDownList
            {
                ID = "ddlUseWiql",
                Items =
                {
                    new ListItem("Not using a custom query", "False"),
                    new ListItem("Custom WIQL query", "True")
                }
            };

            var ffgAuthentication = new SlimFormField("Authentication:", ddlAuthentication);

            var ffgCredentials = new Div(
                new SlimFormField("User name:", this.txtUserName),
                new SlimFormField("Password:"******"Domain:", this.txtDomain)
            );

            this.txtWiql = new ValidatingTextBox
            {
                TextMode = TextBoxMode.MultiLine,
                Rows = 5
            };

            var ctlWiql = new SlimFormField("WIQL query:", this.txtWiql)
            {
                HelpText = "This will be sent to TFS directly, after BuildMaster variables have been replaced. This WIQL query should return all issues "
                         + "for the current BuildMaster release. Any release-level or higher BuildMaster variables may be used in this query."
            };

            var ctlNoWiql = new SlimFormField("Release number field:", this.txtCustomReleaseNumberFieldName)
            {
                HelpText = HelpText.FromHtml("If you store your TFS work item release numbers in a custom field, enter the full field \"refname\" of the custom field here - otherwise leave this field blank and \"Iteration\" will be used to retrieve them.<br /><br />For more information on custom work item types, visit <a href=\"http://msdn.microsoft.com/en-us/library/ms400654.aspx\" target=\"_blank\">http://msdn.microsoft.com/en-us/library/ms400654.aspx</a>")
            };

            this.Controls.Add(
                new SlimFormField("TFS URL:", this.txtBaseUrl),
                ffgAuthentication,
                ffgCredentials,
                new SlimFormField("Query mode:", this.ddlUseWiql),
                ctlNoWiql,
                ctlWiql,
                new SlimFormField("Options:", this.chkAllowHtml),
                new RenderJQueryDocReadyDelegator(
                    w =>
                    {
                        w.Write("$('#{0}').change(function(){{", this.ddlAuthentication.ClientID);
                        w.Write("if($(this).val() == 'system') $('#{0}').hide(); else $('#{0}').show();", ffgCredentials.ClientID);
                        w.Write("});");
                        w.Write("$('#{0}').change();", this.ddlAuthentication.ClientID);

                        w.Write("$('#{0}').change(function(){{", this.ddlUseWiql.ClientID);
                        w.Write("if($(this).val() == 'False') {{ $('#{0}').hide(); $('#{1}').show(); }} else {{ $('#{0}').show(); $('#{1}').hide(); }}", ctlWiql.ClientID, ctlNoWiql.ClientID);
                        w.Write("});");
                        w.Write("$('#{0}').change();", this.ddlUseWiql.ClientID);
                    }
                ),
                new SlimFormField("Closed statuses:", this.txtCustomClosedStates)
                {
                    HelpText = "The newline-separated list of issue states in TFS that BuildMaster will use to determine if a synchronized issue is closed."
                }
            );
        }
        protected override void CreateChildControls()
        {
            txtBaseUrl = new ValidatingTextBox()
            {
                Width = Unit.Pixel(300)
            };
            
            txtCustomReleaseNumberFieldName = new ValidatingTextBox()
            {
                Width = Unit.Pixel(300)
            };
            
            txtUserName = new ValidatingTextBox()
            {
                Width= Unit.Pixel(300)
            };
            
            txtDomain = new ValidatingTextBox()
            {
                Width = Unit.Pixel(300)
            };
            
            txtPassword = new PasswordTextBox()
            {
                Width = Unit.Pixel(270)
            };

            this.chkAllowHtml = new CheckBox { Text = "Allow HTML in issue descriptions" };
            
            ddlAuthentication = new DropDownList();
            ddlAuthentication.Items.Add(new ListItem("System", "system"));
            ddlAuthentication.Items.Add(new ListItem("Specify account...", "specify"));

            // ffgAuthentication
            FormFieldGroup ffgAuthentication = new FormFieldGroup("Authentication",
                    "The method used for authenticating a connection to Team Foundation Server.",
                    false,
                    new StandardFormField("Authentication:", ddlAuthentication)
                );

            // ffgCredentials
            FormFieldGroup ffgCredentials = new FormFieldGroup("Credentials",
                    "Specify the credentials of the account you would like to use to connect to the Team Foundation Server.",
                    false,
                    new StandardFormField("Username:"******"Password:"******"Domain:", txtDomain)
                );

            this.Controls.Add(
                new FormFieldGroup(
                    "Team Foundation Server URL",
                    "The base URL of the Team Foundation Server, for example: http://tfsserver:port/vdir",
                    false,
                    new StandardFormField(
                        "Base Server URL:",
                        txtBaseUrl,
                        new RenderJQueryDocReadyDelegator(w =>
                        {
                            w.WriteLine(
                                // jQuery code used to hide the Credentials section if the "System" account is to be used
@"var onAuthorizationChange = function(){
        if($('#" + ddlAuthentication.ClientID + @" option:selected').val() == 'system') {
            $('#" + ffgCredentials.ClientID + @"').hide();
        }
        else {
            $('#" + ffgCredentials.ClientID + @"').show();
        }
    };
    onAuthorizationChange();
    $('#" + ddlAuthentication.ClientID + @"').change(onAuthorizationChange);");
                        })
                    )
                ),
                ffgAuthentication,
                ffgCredentials,
                new FormFieldGroup(
                    "Custom Release Number Field",
                    "If you store your TFS work item release numbers in a custom field, enter the full field \"refname\" of the custom field here - otherwise leave this field blank and \"Iteration\" will be used to retrieve them.<br /><br />For more information on custom work item types, visit <a href=\"http://msdn.microsoft.com/en-us/library/ms400654.aspx\" target=\"_blank\">http://msdn.microsoft.com/en-us/library/ms400654.aspx</a>",
                    false,
                    new StandardFormField(
                        "Custom Field:",
                        txtCustomReleaseNumberFieldName
                    )
                ),
                new FormFieldGroup(
                    "Options",
                    "Specify additional options.",
                    false,
                    new StandardFormField(string.Empty, this.chkAllowHtml)
                )
            );

            base.CreateChildControls();
        }
        protected override void CreateChildControls()
        {
            this.txtExePath = new SourceControlFileFolderPicker
            {
                Required = true,
                DefaultText = @"ex: C:\Program Files\Example\MyExampleService.exe"
            };

            this.txtArguments = new ValidatingTextBox { DefaultText = "none" };

            this.txtServiceName = new ValidatingTextBox { Required = true };

            this.txtDisplayName = new ValidatingTextBox { Required = true };

            this.txtDescription = new ValidatingTextBox { DefaultText = "none" };

            this.txtUserAccount = new ValidatingTextBox { DefaultText = "NT AUTHORITY\\LocalSystem" };

            this.txtPassword = new PasswordTextBox();

            this.chkRecreate = new CheckBox
            {
                Text = "Reinstall if a service with the same name is already installed"
            };

            var ctlRecreateContainer = new Div(this.chkRecreate) { ID = "ctlRecreateContainer" };

            this.chkErrorIfAlreadyInstalled = new CheckBox
            {
                ID = "chkErrorIfAlreadyInstalled",
                Text = "Log error if service with same name is already installed"
            };

            this.Controls.Add(
                new SlimFormField("Service executable:", this.txtExePath),
                new SlimFormField("Executable arguments:", this.txtArguments),
                new SlimFormField("Service name:", this.txtServiceName),
                new SlimFormField("Service display name:", this.txtDisplayName),
                new SlimFormField("Service description:", this.txtDescription),
                new SlimFormField("User account:", this.txtUserAccount)
                {
                    HelpText = HelpText.FromHtml("Supply a user account which the service will run as. <i>NT AUTHORITY\\LocalSystem</i> is used if an account is not supplied. " +
                        "To use Network Service, enter <i>NT AUTHORITY\\NetworkService</i>.<br/><br/>" +
                        "If a built in service account is used, leave the password field blank.")
                },
                new SlimFormField("User account password:"******"Options:",
                    new Div(this.chkErrorIfAlreadyInstalled),
                    ctlRecreateContainer
                ),
                new RenderJQueryDocReadyDelegator(
                    w =>
                    {
                        w.Write(
                            "$('#{0}').change(function(){{if($(this).attr('checked')) $('#{1}').hide(); else $('#{1}').show();}});",
                            this.chkErrorIfAlreadyInstalled.ClientID,
                            ctlRecreateContainer.ClientID
                        );

                        w.Write("$('#{0}').change();", this.chkErrorIfAlreadyInstalled.ClientID);
                    }
                )
            );
        }