protected override void CreateChildControls()
        {
            this.ddlSourceServer = new ActionServerPicker
            {
                ID            = "ddlSourceServer",
                ShowGroups    = false,
                EnvironmentId = this.EnvironmentId
            };

            this.ddlTargetServer = new ActionServerPicker
            {
                ID            = "ddlTargetServer",
                EnvironmentId = this.EnvironmentId
            };

            this.ctlSourcePath = new Inedo.Web.FileBrowserTextBox
            {
                IncludeFiles    = false,
                BindToControlId = this.ddlSourceServer.ID,
                DefaultText     = "$CurrentDirectory"
            };

            this.ctlTargetPath = new Inedo.Web.FileBrowserTextBox
            {
                IncludeFiles    = false,
                BindToControlId = this.ddlTargetServer.ID,
                DefaultText     = "$CurrentDirectory"
            };

            this.chkDelete = new CheckBox
            {
                ID      = "chkDelete",
                Checked = true,
                Text    = "Delete files/directories not present in source"
            };

            this.txtIncludeFileMasks = new ValidatingTextBox
            {
                TextMode = TextBoxMode.MultiLine,
                Rows     = 4,
                Text     = "*"
            };

            this.Controls.Add(
                new SlimFormField("From server:", this.ddlSourceServer),
                new SlimFormField("From directory:", this.ctlSourcePath),
                new SlimFormField("To server:", this.ddlTargetServer),
                new SlimFormField("To directory:", this.ctlTargetPath),
                new SlimFormField("File/directory mask:", this.txtIncludeFileMasks)
            {
                HelpText = "Files and folders matching the specified masks (entered one per line) will be transferred. "
                           + "For example, if you want to transfer all files except *.src files, enter the following lines "
                           + "(without quotes): \"*\" and \"!*.src\""
            },
                new SlimFormField("Additional options:", this.chkDelete)
                );
        }
Ejemplo n.º 2
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);
");
                        })
              );
        }
Ejemplo n.º 3
0
        protected override void CreateChildControls()
        {
            this.txtTo = new ValidatingTextBox
            {
                Required = true,
                TextMode = TextBoxMode.MultiLine,
                Rows     = 5
            };

            this.txtSubject = new ValidatingTextBox
            {
                MaxLength = 255,
                Required  = true
            };

            this.txtBody = new TextBox
            {
                TextMode = TextBoxMode.MultiLine,
                Rows     = 10
            };

            this.txtAttachment = new Inedo.Web.FileBrowserTextBox
            {
                IncludeFiles = true,
                DefaultText  = "no attachment"
            };

            this.ddlServer = new ActionServerPicker
            {
                ID            = "bm-action-server-id",
                ClientIDMode  = ClientIDMode.Static,
                EnvironmentId = this.EnvironmentId,
                ServerId      = this.ServerId
            };

            this.chkAttachFile = new CheckBox {
                Text = "Attach file..."
            };

            this.chkIsBodyHtml = new CheckBox {
                Text = "Send as HTML"
            };

            var ctlAttachmentContainer = new Div(
                new Div("From server:"),
                this.ddlServer,
                new Div("From file:"),
                this.txtAttachment
                );

            this.Controls.Add(
                new SlimFormField("To address(es):", this.txtTo)
            {
                HelpText = "Multiple recipients should be separated with a semicolon or newline."
            },
                new SlimFormField("Subject:", this.txtSubject),
                new SlimFormField("Body text:", new Div(this.txtBody), new Div(this.chkIsBodyHtml)),
                new SlimFormField("Attachment:", chkAttachFile, ctlAttachmentContainer)
                );

            this.Controls.BindVisibility(chkAttachFile, ctlAttachmentContainer);
        }
Ejemplo n.º 4
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 / access token:"), new Div(this.txtPassword)),
                                                   new Div(new Div("Domain:"), new Div(this.txtDomain))
                                                   )
            {
                ID       = "sffCredentials",
                HelpText = new LiteralHtml("For Visual Studio Online, either <a href=\"https://www.visualstudio.com/en-us/integrate/get-started/auth/overview\" target=\"_blank\">Alternate Credentials or Personal Access Tokens</a> must be used in the password field.", false)
            };

            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);
");
            })
                );
        }