Пример #1
0
        protected override void CreateChildControls()
        {
            this.ddlConfigurations = new ResourcePicker
            {
                ID          = "ddlConfigurations",
                AjaxHandler = Ajax.GetConfigurations,
                Configurer  = (SkytapExtensionConfigurer)this.GetExtensionConfigurer()
            };

            this.ddlTargetRunstate = new DropDownList
            {
                ID    = "ddlTargetRunstate",
                Items =
                {
                    new ListItem("Suspend",   ((int)StopConfigurationMode.Suspend).ToString()),
                    new ListItem("Shut down", ((int)StopConfigurationMode.ShutDown).ToString()),
                    new ListItem("Power off", ((int)StopConfigurationMode.PowerOff).ToString())
                }
            };

            this.chkWaitForStop = new CheckBox
            {
                Text    = "Wait for environment to enter target state",
                Checked = true
            };

            this.Controls.Add(
                new SlimFormField("Environment:", this.ddlConfigurations),
                new SlimFormField("Stop mode:", this.ddlTargetRunstate),
                new SlimFormField("Options:", this.chkWaitForStop)
                );
        }
Пример #2
0
        protected override void CreateChildControls()
        {
            this.ddlConfiguration = new ResourcePicker
            {
                ID          = "ddlConfiguration",
                AjaxHandler = Ajax.GetConfigurations,
                Configurer  = (SkytapExtensionConfigurer)this.GetExtensionConfigurer()
            };

            this.Controls.Add(
                new SlimFormField("Environment:", this.ddlConfiguration)
                );
        }
Пример #3
0
        protected override void CreateChildControls()
        {
            this.ddlConfigurations = new ResourcePicker
            {
                ID          = "ddlConfigurations",
                AjaxHandler = Ajax.GetConfigurations,
                Configurer  = (SkytapExtensionConfigurer)this.GetExtensionConfigurer()
            };

            this.chkWaitForStart = new CheckBox
            {
                Text    = "Wait for environment to enter running state",
                Checked = true
            };

            this.Controls.Add(
                new SlimFormField("Environment:", this.ddlConfigurations),
                new SlimFormField("Options:", this.chkWaitForStart)
                );
        }
Пример #4
0
        protected override void CreateChildControls()
        {
            this.ddlConfiguration = new ResourcePicker
            {
                ID          = "ddlConfiguration",
                AjaxHandler = Ajax.GetConfigurations,
                Configurer  = (SkytapExtensionConfigurer)this.GetExtensionConfigurer()
            };

            this.txtNewConfigurationName = new ValidatingTextBox {
                MaxLength = 1000
            };

            this.chkExportVariables = new CheckBox {
                Text = "Save ID to ${Skytap-EnvironmentId}", Checked = true
            };

            this.Controls.Add(
                new SlimFormField("Environment to copy:", this.ddlConfiguration),
                new SlimFormField("New environment name:", this.txtNewConfigurationName),
                new SlimFormField("Options:", this.chkExportVariables)
                );
        }
Пример #5
0
        protected override void CreateChildControls()
        {
            this.ddlConfiguration = new ResourcePicker
            {
                ID          = "ddlConfiguration",
                AjaxHandler = Ajax.GetConfigurations,
                Configurer  = (SkytapExtensionConfigurer)this.GetExtensionConfigurer()
            };

            this.txtPublishedSetName = new ValidatingTextBox {
                DefaultText = "untitled"
            };

            this.ctlVmAccess = new HiddenField {
                ID = "ctlVmAccess"
            };

            this.chkOneUrlPerVm = new CheckBox {
                Text = "Generate a separate URL for each virtual machine"
            };

            this.txtPassword = new PasswordTextBox {
                DefaultText = "not required"
            };

            this.txtRuntimeLimit = new ValidatingTextBox {
                DefaultText = "no limit"
            };

            this.txtExpiration = new ValidatingTextBox {
                DefaultText = "never expires"
            };

            this.txtDailyAccessStart = new TimePicker();

            this.txtDailyAccessEnd = new TimePicker();

            this.chkExportVariables = new CheckBox {
                Text = "Save URLs to ${Skytap-DesktopsUrl}", Checked = true
            };

            Div ctlVmContainer;

            using (var templateStream = typeof(PublishResourceLinksActionEditor).Assembly.GetManifestResourceStream(typeof(PublishResourceLinksActionEditor).FullName + ".html"))
                using (var reader = new StreamReader(templateStream))
                {
                    ctlVmContainer = new Div(
                        new LiteralControl(reader.ReadToEnd())
                        )
                    {
                        ID = "ctlVmContainer"
                    };
                }

            this.Controls.Add(
                new SlimFormField("Environment:", this.ddlConfiguration),
                new SlimFormField("Published set name:", this.txtPublishedSetName),
                new SlimFormField("Virtual machines:", this.ctlVmAccess, ctlVmContainer),
                new SlimFormField("Password:"******"Runtime limit:", this.txtRuntimeLimit),
                new SlimFormField("URL expiration:", this.txtExpiration),
                new SlimFormField("Daily access window:", this.txtDailyAccessStart, " to ", this.txtDailyAccessEnd),
                new SlimFormField("Options:", new Div(this.chkOneUrlPerVm), new Div(this.chkExportVariables)),
                new RenderJQueryDocReadyDelegator(
                    w =>
            {
                w.Write("BmPublishResourceLinksActionEditor(");
                InedoLib.Util.JavaScript.WriteJson(
                    w,
                    new
                {
                    vmDataSelector    = "#" + this.ctlVmAccess.ClientID,
                    containerSelector = "#" + ctlVmContainer.ClientID
                }
                    );
                w.Write(");");
            }
                    )
                );
        }