コード例 #1
0
        public static DialogResult GetInputAndCboValue(string title, string promptText, string textLabel, string cboLabel, List <ComboboxNameValuePairs> dropdownValues, ref string result, out ComboboxNameValuePairs comboboxValue)
        {
            DialogResult res;

            comboboxValue = null;
            using (var dlg = new SuperInputDialogue())
            {
                dlg.PromptText = promptText;
                dlg.Title      = title;
                dlg.UseCombobox(new DropDownData
                {
                    DropdownValues = dropdownValues,
                    LabelText      = cboLabel,
                    InputBox       = new ControlData
                    {
                        LabelText           = textLabel,
                        ControlDefaultValue = result
                    }
                });
                dlg.ShowDialog();
                res = dlg.DialogResult;
                if (dlg.DialogResult == DialogResult.OK)
                {
                    result        = dlg.InputTextValue;
                    comboboxValue = dlg.ComboBoxValue;
                }
            }
            return(res);
        }
コード例 #2
0
        public static DialogResult GetInputBoxValue(string title, string promptText, out string result)
        {
            DialogResult res;

            result = string.Empty;
            using (var dlg = new SuperInputDialogue())
            {
                dlg.PromptText = "this is my promt text";
                dlg.Title      = "Select host name";
                dlg.ShowDialog();
                res = dlg.DialogResult;
                if (dlg.DialogResult == DialogResult.OK)
                {
                    result = dlg.InputTextValue;
                }
            }
            return(res);
        }
コード例 #3
0
        //todo: Fix for QlikView connection
        private QlikViewConnectDto ShowLogFolderDialogue(QlikViewConnectDto dto)
        {
            string       pathToFolder = string.Empty;
            string       previousPath = @"C:\ProgramData\QlikTech";
            DialogResult dlgRes       = DialogResult.OK;

            while (string.IsNullOrEmpty(pathToFolder) && dlgRes == DialogResult.OK)
            {
                string invalidPathString = string.Empty;


                _owner.Invoke(new Action(() =>
                {
                    var a = new SuperInputDialogue(
                        title: "Path to QlikView Log Folder",
                        text: invalidPathString + "Please write the correct path to the QlikView logs.",
                        defaultValue: previousPath
                        )
                    {
                        StartPosition = FormStartPosition.CenterParent
                    };
                    a.ShowDialog(_owner);
                    previousPath = a.InputTextValue;
                    dlgRes       = a.DialogResult;
                    if (dlgRes == DialogResult.OK)
                    {
                        if (Directory.Exists(a.InputTextValue))
                        {
                            pathToFolder = a.InputTextValue;
                        }
                    }
                    else
                    {
                        dto.AbortAndExit = true;
                    }
                    invalidPathString = "Invalid Path. ";
                }));
            }
            dto.PathToLocalLogFolder = pathToFolder;
            return(dto);
        }