コード例 #1
0
        public static ZumoTest CreateYesNoTest(string question, bool expectedAnswer, int delayBeforeDialogMilliseconds = 0)
        {
            string testName = string.Format(CultureInfo.InvariantCulture, "Validation: {0} (expected {1})", question, expectedAnswer ? "Yes" : "No");
            return new ZumoTest(testName, async delegate(ZumoTest test)
            {
                if (delayBeforeDialogMilliseconds > 0)
                {
                    await Util.TaskDelay(delayBeforeDialogMilliseconds);
                }

#if !WINDOWS_PHONE
                InputDialog dialog = new InputDialog("Question", question, "No", "Yes");
                await dialog.Display();
                bool answerWasYes = !dialog.Cancelled;
#else
                bool answerWasYes = await InputDialog.DisplayYesNo(question);
#endif
                if (expectedAnswer != answerWasYes)
                {
                    test.AddLog("Test failed. The answer to <<{0}>> was {1}, it should have been {2}",
                        question, answerWasYes ? "Yes" : "No", expectedAnswer ? "Yes" : "No");
                    return false;
                }
                else
                {
                    return true;
                }
            });
        }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            InputDialog ind = new InputDialog("Дистрибьютор", "Введите код дистр.(Напр.:20440997)\nНе забудьте добавить РЕГИОН!", true);
            ind.ShowDialog();

            if (ind.DialogResult == DialogResult.Cancel)
                return;
            String code = globalData.input;

            ind = new InputDialog("Дата начала отчётов", "Введите год", true);
            ind.ShowDialog();

            if (ind.DialogResult == DialogResult.Cancel)
                return;
            String yearR = globalData.input;

            ind = new InputDialog("Дата начала отчётов", "Введите месяц в формате 1,2,3..", true);
            ind.ShowDialog();

            if (ind.DialogResult == DialogResult.Cancel)
                return;
            String monthR = globalData.input;

            sql sql1 = new sql();
            DataTable dt1 = sql1.GetRecords("exec InsRepDistRight @p1, @p2", code, yearR + "-" + monthR + "-01");
        }
コード例 #3
0
        public static ZumoTest CreateTestWithSingleAlert(string alert)
        {
#if !WINDOWS_PHONE
            return new ZumoTest("Simple alert", async delegate(ZumoTest test)
            {
                InputDialog dialog = new InputDialog("Information", alert, "OK");
                if (ZumoTestGlobals.ShowAlerts)
                {
                    await dialog.Display();
                }
                return true;
            })
            {
                CanRunUnattended = false
            };
#else
            return new ZumoTest("Alert: " + alert, delegate(ZumoTest test)
            {
                MessageBox.Show(alert);
                TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>();
                tcs.SetResult(true);
                return tcs.Task;
            })
            {
                CanRunUnattended = false
            };
#endif
        }
コード例 #4
0
 public override void Run()
 {
     string clipboardText = Clipboard.GetText();
       if (clipboardText == null)
       {
     clipboardText = String.Empty;
       }
       InputDialog dialog = new InputDialog("Enter text", clipboardText, "Enter the value to search");
       if (dialog.ShowDialog() == CustomDialogResult.Ok)
       {
     XmlEditor editor = this.Owner as XmlEditor;
     if (editor == null)
       return;
     SingleDirectionData currentData = editor.SingleDirectionData;
     currentData.ShowAttributes = true;
     currentData.ShowValues = true;
     string tempXPath = string.Format("//*[text() = \"{0}\"]", dialog.InputString);
     if (XmlUtils.IsXPathValid(tempXPath))
     {
       XPathData xpath = new XPathData();
       xpath.XPath = tempXPath;
       currentData.HighlightedXPath = xpath;
     }
       }
 }
コード例 #5
0
ファイル: frmDocEditor.cs プロジェクト: amoun00/Contributions
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            switch (ChosenPropStr())
            {
                case "Children":
                    frmDocChooser doc_chooser = new frmDocChooser();
                    doc_chooser.InitForDocSet(CurrentDoc.DocSet);
                    doc_chooser.ShowDialog();
                    if (doc_chooser.DialogResult == System.Windows.Forms.DialogResult.OK)
                    {
                        GlDoc doc_choice = doc_chooser.ChosenDoc();
                        if (doc_choice != null)
                        {
                            CurrentDoc.AppendDoc(ChosenPropStr(), doc_choice);
                            DisplayValues();
                        }
                    }
                    break;
                case "Favorite foods":
                    InputDialog new_name_dlg = new InputDialog();

                    new_name_dlg.SetInstr("Value ...");
                    new_name_dlg.ShowDialog();
                    if (new_name_dlg.DialogResult == System.Windows.Forms.DialogResult.OK)
                    {
                        string new_val = new_name_dlg.TextValue.Trim();
                        if (new_val != "")
                        {
                            CurrentDoc.AppendString(ChosenPropStr(), new_val);
                            DisplayValues();
                        }
                    }
                    break;
            }
        }
コード例 #6
0
ファイル: Program.cs プロジェクト: solson/DSAE
        static void Main()
        {
            Win32.AllocConsole();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            InputDialog d = new InputDialog("Connection details", "Which server:port ?", "localhost:9999");
            if (d.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            string[] parts = d.Input.Split(':');
            string host = parts[0];
            string port = parts.Length > 1 ? parts[1] : "9999";

            PolhemusController polhemus = null;
            PhidgetController phidget = null;
            if (isDebug == false)
            {
                polhemus = new PolhemusController(false);
                phidget = new PhidgetController(polhemus);
            }

            mainForm = new Form1(polhemus, phidget, host, port);
            Application.Run(mainForm);
        }
コード例 #7
0
ファイル: Main.cs プロジェクト: pafik13/PresentationCreator
 private void btnAddTheme_Click(object sender, EventArgs e)
 {
     InputDialog id = new InputDialog();
     id.Text = "Введите название тематики:";
     if (id.ShowDialog() == DialogResult.OK)
     {
         if (tvPresentations.SelectedNode == null)
         {
             MessageBox.Show("Перед добавлением тематики необхадимо выделить презентацию!");
         }
         else
         {
             int parentIdx = 0;
             if (tvPresentations.SelectedNode.Level == 0)
             {
                 parentIdx = tvPresentations.SelectedNode.Index;
             }
             else
             {
                 parentIdx = tvPresentations.SelectedNode.Parent.Index;
             }
             if (presentations[parentIdx].parts == null)
             {
                 presentations[parentIdx].parts = new List<Part>();
             }
             presentations[parentIdx].parts.Add(new Part() { name = id.tbInput.Text, imgIdx = 4 });
             tvPresentations.Nodes[parentIdx].Nodes.Add("part" + presentations[parentIdx].parts.Count.ToString(), id.tbInput.Text, 4);
         }
     }
     id.Dispose();
 }
コード例 #8
0
 private void AddButtonCommandExecute(object obj)
 {
     var inputDialog = new InputDialog();
     if (inputDialog.ShowDialog().GetValueOrDefault())
     {
         Attribute.AllowedValuesSet.Add(new StringWrapper(inputDialog.Value));
     }
 }
コード例 #9
0
 public static DialogResult InputDialogBox(string title, string description, ref string value)
 {
     InputDialog dialog = new InputDialog(title, description);
     dialog.textBoxValue.Text = value;
     DialogResult dialogResult = dialog.ShowDialog();
     value = dialog.textBoxValue.Text;
     return dialogResult;
 }
コード例 #10
0
ファイル: Form1.cs プロジェクト: idenx/Semestr2_TSD
 private void button5_Click(object sender, EventArgs e)
 {
     InputDialog InputDlg = new InputDialog();
     InputDlg.Text = "Ввод матрицы";
     InputDlg.label1.Text = "Введите матрицу в поле ниже и нажмите кнопу 'Отправить'";
     InputDlg.ShowDialog();
     matrix = new Matrix(InputDlg.richTextBox1.Text);
     this.richTextBox1.Text += "\n\nСоздана матрица:\n" + matrix.ToString();
 }
コード例 #11
0
        private async Task OnRenamePresetCommand(Preset preset)
        {
            var dialog = new InputDialog(Strings.ENTER_A_NEW_NAME, preset.Name);
            var result = await dialog.OpenAsync();

            if (result)
            {
                try
                {
                    // Rename preset
                    _logger.Info($"Renaming {preset.Name} to {dialog.Value}");
                    preset.FullPath = _presetManager.RenamePreset(preset, dialog.Value);

                    // Rename screenshot folder
                    if (Directory.Exists(Paths.GetPresetScreenshotsDirectory(_game.Module, preset.Name)))
                    {
                        _logger.Info("Renaming screenshot directory");
                        _screenshotManager.RenameScreenshotDirectory(Paths.GetPresetScreenshotsDirectory(_game.Module, preset.Name), dialog.Value);
                    }

                    preset.Name = dialog.Value;

                    if (preset.IsActive)
                    {
                        _game.Settings.ActivePreset = preset.Name;
                        new ConfigurationManager <GameSettings>(_game.Settings).SaveSettings();
                    }

                    preset.Files = (await _presetManager.GetPresetAsync(Paths.GetPresetsDirectory(_game.Module), preset.Name)).Files;
                }
                catch (ArgumentNullException ex)
                {
                    _logger.Warn(ex);
                    throw ex;
                }
                catch (DirectoryNotFoundException ex)
                {
                    _logger.Warn(ex);
                }
                catch (ArgumentException ex)
                {
                    _logger.Debug(ex);
                    return;
                }
                catch (IdenticalNameException ex)
                {
                    _logger.Debug(ex.Message);
                    await new MessageDialog(Strings.AN_ITEM_WITH_THIS_NAME_ALREADY_EXISTS).OpenAsync();
                }
                catch (IOException ex)
                {
                    _logger.Warn(ex);
                    await new MessageDialog(Strings.INVALID_NAME).OpenAsync();
                }
            }
        }
コード例 #12
0
        private void newServer_ToolStripButton_Click(object sender, EventArgs e)
        {
            bool result = false;

            // Prompt for the hostname
            string serverName = InputDialog.Show("Server Hostname:", "Add Server");

            if (string.IsNullOrEmpty(serverName))
            {
                // User cancelled
                return;
            }

            if (serverName.StartsWith(@"\", StringComparison.OrdinalIgnoreCase))
            {
                serverName = serverName.TrimStart(new char[] { '\\' });
            }

            try
            {
                Guid serverId = Guid.Empty;
                if (_controller.HostNameExists(serverName))
                {
                    FrameworkServer existingServer = _controller.Select(serverName);
                    serverId = existingServer.FrameworkServerId;
                    result   = UpdateServerProperties(existingServer);
                }
                else
                {
                    serverId = SequentialGuid.NewGuid();
                    result   = AddNewServer(serverName, serverId);
                }

                if (result)
                {
                    //Refesh The entire UI
                    RefreshServerDisplay();
                    int index = GetDataBoundItemIndex(serverId);
                    SetSelectedIndex(printServer_GridView, index);

                    if (_printServers.Count > 0)
                    {
                        RefreshQueueDisplay((FrameworkServer)printServer_GridView.CurrentRow.DataBoundItem);
                    }
                }
            }
            catch (SystemException ex)
            {
                MessageBox.Show(ex.Message, "Add Print Server", MessageBoxButtons.OK, MessageBoxIcon.Error);
                TraceFactory.Logger.Error("Error Adding Print Server with associated Queues", ex);
            }
            finally
            {
                SetDefaultCursor();
            }
        }
コード例 #13
0
        public static void InputDialog(this ICakeContext context, Action <DialogOptions> st)
        {
            var settings = new DialogOptions();

            st(settings);

            var dlg = new InputDialog(settings);

            dlg.ShowDialog();
        }
コード例 #14
0
        private void AddBtn_Click(object sender, EventArgs e)
        {
            string dep = InputDialog.Show("Add a dependency");

            if (!string.IsNullOrEmpty(dep))
            {
                Dependencies.Items.Add(dep);
            }
            UpdateDataDependencies();
        }
コード例 #15
0
 private void btnC_Click(object sender, EventArgs e)
 {
     auxiliar = "";
     //Guardamos en la variable el valor introducido por el usuario.
     auxiliar = InputDialog.mostrar("Introduzca algun dato del conjunto C");
     //Lo guardamos en nuestra lista correspondiente.
     mundoC.Add(auxiliar);
     //Lo imprimimos para ver el valor.
     label9.Text += auxiliar + "\n";
 }
コード例 #16
0
        public override void OnEntry(MethodExecutionEventArgs eventArgs)
        {
            InputDialog dlg = new InputDialog();
            if (dlg.ShowDialog() != System.Windows.Forms.DialogResult.OK) return;

            ElementEventArgs ea = new ElementEventArgs();
            ea.Element = dlg.Input;

            Controller.InvokeSomethingCreated(this, ea);
        }
コード例 #17
0
ファイル: Trim.cs プロジェクト: bobian818/WebMConverter
 private void ToolStripMenuGoToTime_Click(object sender, EventArgs e)
 {
     using (var dialog = new InputDialog <TimeSpan>("Time", Program.FrameToTimeSpan(trackVideoTimeline.Value)))
     {
         if (dialog.ShowDialog() == DialogResult.OK)
         {
             SetFrame(Program.TimeSpanToFrame(dialog.Value));
         }
     }
 }
コード例 #18
0
ファイル: Trim.cs プロジェクト: bobian818/WebMConverter
 private void toolStripMenuGoToFrame_Click(object sender, EventArgs e)
 {
     using (var dialog = new InputDialog <int>("Frame", trackVideoTimeline.Value))
     {
         if (dialog.ShowDialog() == DialogResult.OK)
         {
             SetFrame(dialog.Value);
         }
     }
 }
コード例 #19
0
        private void BtnEnterName_Click(object sender, RoutedEventArgs e)
        {
            InputDialog inputDialog = new InputDialog("Please enter your name:", "Johnny English");

            inputDialog.Owner = this;
            if (inputDialog.ShowDialog() == true)
            {
                LbName.Text = inputDialog.Answer;
            }
        }
コード例 #20
0
        private void NewListBtn_Click(object sender, EventArgs e)
        {
            string res = "";

            if (InputDialog.Show("List name", "Enter the list name", ref res) == DialogResult.OK && res != "")
            {
                LinksNode.Add(res, new List <dynamic>());
                UpdateTreeView();
            }
        }
コード例 #21
0
ファイル: FrmPubSub.cs プロジェクト: aile54/chatclient
        public static string InputBox(string prompt, string title, string defaultValue)
        {
            var inputDialog = new InputDialog {FormPrompt = prompt, FormCaption = title, DefaultValue = defaultValue};
            inputDialog.ShowDialog();

            string s = inputDialog.InputResponse;
            inputDialog.Close();

            return s;
        }
コード例 #22
0
ファイル: InputDialog.cs プロジェクト: JoeyEremondi/tikzedt
 public static DialogResult ShowInputDialog(Form Owner, string Title, string Message, out string Text)
 {
     InputDialog id = new InputDialog();
     id.Text = Title;
     id.lblText.Text = Message;
     var ret = id.ShowDialog(Owner);
     Text = id.txtText.Text;
     id.Dispose();
     return ret;
 }
コード例 #23
0
        public string ShowInputDialog(string question, string defaultAnswer = "", string title = "输入")
        {
            InputDialog inputDialog = new InputDialog(question, defaultAnswer, title);

            if (inputDialog.ShowDialog() == true)
            {
                return(inputDialog.Answer);
            }
            return(null);
        }
コード例 #24
0
 private void frameToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (var dialog = new InputDialog <int>("Frame", previewFrame.Frame))
     {
         if (dialog.ShowDialog() == DialogResult.OK)
         {
             previewFrame.Frame = Math.Max(0, Math.Min(Program.VideoSource.NumberOfFrames - 1, dialog.Value)); // Make sure we don't go out of bounds.
         }
     }
 }
コード例 #25
0
ファイル: PersonView.cs プロジェクト: FilipKovac1/US_Sem1_AVL
 private void btnChangeProperty_Click(object sender, EventArgs e)
 {
     if (form != null)
     {
         InputDialog caid = new InputDialog("Cadastral area id:");
         caid.onDispose += (caID) =>
         {
             if (Int32.TryParse(caID, out int caIDint))
             {
                 CadastralArea ca = new CadastralArea(caIDint);
                 ca = this.form.FindCadastralArea(new CadastralAreaByID(ca));
                 if (ca != null)
                 {
                     InputDialog pid = new InputDialog("Property id:");
                     pid.onDispose += (pID) =>
                     {
                         Property p = ca.FindProperty(pID);
                         if (p != null)
                         {
                             InputDialog ownerId = new InputDialog("New owner (person.id):");
                             ownerId.onDispose += (newOwnerID) =>
                             {
                                 Person per = new Person(newOwnerID);
                                 per = form.FindPerson(per);
                                 if (per != null)
                                 {
                                     p.ChangeOwner(this.Person, per);
                                 }
                                 else
                                 {
                                     MessageBox.Show("Could not find this person/owner");
                                 }
                             };
                             ownerId.ShowDialog();
                         }
                         else
                         {
                             MessageBox.Show("Could not find this property");
                         }
                     };
                     pid.ShowDialog();
                 }
                 else
                 {
                     MessageBox.Show("This cadastral area doesn't exist");
                 }
             }
             else
             {
                 MessageBox.Show("Input value has to be integer");
             }
         };
         caid.ShowDialog();
     }
 }
コード例 #26
0
        private void OnInvokedDynamicItem(object sender, EventArgs e)
        {
            DynamicCommand invokedCommand     = (DynamicCommand)sender;
            var            commandConfig      = this.configParser.Commands.Find(c => c.Title.Equals(invokedCommand.Text));
            var            currentProjectPath = VSHelpers.GetCurrentProjectPath();

            var extentionPath = Path.GetDirectoryName(this.GetType().Assembly.Location);
            var exePath       = Path.Combine(extentionPath, Constants.CLIFolderName, Constants.CLIName);
            var fileInfo      = new FileInfo(exePath);

            if (!fileInfo.Exists)
            {
                string message = "File 'sf.exe' does not exist!";
                VSHelpers.ShowErrorMessage(this, message, commandConfig.Title);
                return;
            }

            var args = String.Format("{0}", commandConfig.Name);

            // get arguments
            var dialog = new InputDialog(commandConfig);

            if (dialog.ShowDialog() == true)
            {
                for (int i = 0; i < dialog.ResponseText.Count; i++)
                {
                    var input = dialog.ResponseText[i];
                    if (string.IsNullOrEmpty(input) || input.IndexOfAny(Path.GetInvalidFileNameChars()) > 0)
                    {
                        string message = string.Format("Invalid argument: {0}!", commandConfig.Args[i]);
                        VSHelpers.ShowErrorMessage(this, message, commandConfig.Title);
                        return;
                    }

                    // response is argument, else - response is option
                    if (i < commandConfig.Args.Count)
                    {
                        args = String.Format("{0} \"{1}\"", args, input);
                    }
                    else
                    {
                        var optionIndex = i - commandConfig.Args.Count;
                        args = String.Format("{0} {1} \"{2}\"", args, commandConfig.Options[optionIndex].Name, input);
                    }
                }

                args = String.Format("{0} -r \"{1}\"", args, currentProjectPath);

                var process = new Process();
                process.StartInfo.FileName         = fileInfo.Name;
                process.StartInfo.WorkingDirectory = fileInfo.DirectoryName;
                process.StartInfo.Arguments        = args;
                process.Start();
            }
        }
コード例 #27
0
        void OpenStream()
        {
            var dialog = new InputDialog();

            RootGrid.Children.Add(dialog);
            Grid.SetRow(dialog, 1);
            // NOTE: Is this being used?
            dialog.Show("", "Open a file from network",
                        "Please enter an address (Ex: FTP, HTTP).", "Open",
                        Locator.MainPageVM.PlayNetworkMRL);
        }
コード例 #28
0
ファイル: MainForm.cs プロジェクト: joyjones/fire-terminator
        private void iRenameScene_ItemClick(object sender, ItemClickEventArgs e)
        {
            var scene = ProjectDoc.Instance.SelectedSceneInfo;
            var dlg   = new InputDialog("重命名场景", "场景名称:", scene.Name);

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                scene.Name = dlg.ResultText;
                m_EditViewOperater.RefreshProjectTree();
            }
        }
コード例 #29
0
        private void btnAddPosition_Click(object sender, EventArgs e)
        {
            InputDialog dialog = new InputDialog("Caption Here", "Default Textbox String");

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                string result_text = dialog.ResultText;
                this.positionsTableAdapter.Insert(result_text);
                this.positionsTableAdapter.Fill(this.apartmentDataSet.Positions);
            }
        }
コード例 #30
0
        private void NewPlaylist(object param)
        {
            int    idMax  = (this.Playlists.Count > 0) ? this.Playlists.OrderByDescending(item => item.Id).First().Id + 1 : 1;
            string stream = InputDialog.ShowDialog("New Playlist", "Playlist Name:", "playlist" + idMax.ToString());

            if (stream != "")
            {
                this.SelectedPlaylist = new Playlist(idMax, stream);
                this.Playlists.Add(this.SelectedPlaylist);
            }
        }
コード例 #31
0
ファイル: PreviewPage.cs プロジェクト: Adel-dz/Hub
        //private:
        void ModifyCountryName()
        {
            ListViewItem item = m_lvData.SelectedItems[0];
            var          ctry = item.Tag as Countries.Country;

            if (ctry != null)
            {
                using (var dlg = new InputDialog())
                {
                    dlg.Message = "Remplacer le nom du pays.";
                    dlg.Input   = ctry.Name;

                    Opts.StringTransform_t opt = AppContext.Settings.AppSettings.ImportTransform;
                    dlg.InputCasing = opt == Opts.StringTransform_t.LowerCase ? CharacterCasing.Lower :
                                      opt == Opts.StringTransform_t.UpperCase ? CharacterCasing.Upper :
                                      CharacterCasing.Normal;


                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        Predicate <IDataRow> compCountries = c => c == ctry;

                        var newCtry = new Countries.Country(ctry.ID, dlg.Input, ctry.InternalCode);

                        int ndxCtry = m_impData[TablesID.COUNTRY].FindIndex(compCountries);
                        m_impData[TablesID.COUNTRY][ndxCtry] = newCtry;

                        ndxCtry = m_modifiedCountries.FindIndex(compCountries);

                        if (ndxCtry > 0)
                        {
                            m_modifiedCountries[ndxCtry] = newCtry;
                        }
                        else
                        {
                            m_modifiedCountries.Add(newCtry);
                        }


                        const int NDX_COUNTRY_NAME_SUB_ITEM = 1;
                        item.SubItems[NDX_COUNTRY_NAME_SUB_ITEM].Text = newCtry.Name;
                        item.Tag        = newCtry;
                        item.ImageIndex = -1;

                        if (m_boldFont == null)
                        {
                            m_boldFont = new Font(item.Font, FontStyle.Bold);
                        }

                        item.Font = m_boldFont;
                    }
                }
            }
        }
コード例 #32
0
        private void BtnAddVariation_Click(object sender, EventArgs e)
        {
            InputDialog variationsInput = new InputDialog(ADD_VARIATION_DIALOG_TITLE, ADD_VARIATION_DIALOG_TEXT);

            if (variationsInput.ShowDialog() != DialogResult.Cancel && variationsInput.InputText != "")
            {
                presenter.AddVariation(variationsInput.InputText);
            }
            presenter.SelectVariation(presenter.SelectedGrade.Variations.Count - 1);
            RtxtPredefinedText.Focus();
        }
コード例 #33
0
 private void OnKeyDown(object sender, KeyEventArgs e)
 {
     if (e.Control && e.Alt && e.Shift && e.KeyCode == Keys.A)
     {
         using (InputDialog d = new InputDialog())
         {
             d.Done += DOnDone;
             d.ShowDialog();
         }
     }
 }
コード例 #34
0
ファイル: Main.cs プロジェクト: pafik13/PresentationCreator
 private void btnAddPresantation_Click(object sender, EventArgs e)
 {
     InputDialog id = new InputDialog();
     id.Text = "Введите название презинтации:";
     if (id.ShowDialog() == DialogResult.OK)
     {
         presentations.Add(new Presentation() {name = id.tbInput.Text, imgIdx = 3});
         tvPresentations.Nodes.Add("pres"+presentations.Count,id.tbInput.Text, 3);
     }
     id.Dispose();
 }
コード例 #35
0
        private void EditBtn_Click(object sender, EventArgs e)
        {
            int    index = Dependencies.SelectedIndex;
            string dep   = InputDialog.Show("Edit a dependency", "", Dependencies.Items[index] as string);

            if (!string.IsNullOrEmpty(dep))
            {
                Dependencies.Items[index] = dep;
            }
            UpdateDataDependencies();
        }
コード例 #36
0
        private void Export_OnClick(object sender, RoutedEventArgs e)
        {
            //maybe change
            string filename = "\\BIM360_Custom_Template.csv";

            //window for user to enter data
            var dialog = new InputDialog("Please enter the path for exporting the CSV:",
                                         Environment.GetFolderPath(Environment.SpecialFolder.Desktop));

            dialog.ResizeMode = ResizeMode.NoResize;
            dialog.ShowDialog();
            if (dialog.DialogResult != true)
            {
                return;
            }
            var exportpath = dialog.Answer;

            //move to conifg
            if (File.Exists(exportpath + filename))
            {
                statusbar.Text = "Export Failed! File already exists!";
                return;
            }

            if (!Directory.Exists((exportpath)))
            {
                try
                {
                    Directory.CreateDirectory(exportpath);
                }
                catch (Exception ex)
                {
                    statusbar.Text = ex.Message;
                    return;
                }
            }

            //Hardcoded Name in here maybe user should be able to change


            //export the Projects
            try
            {
                AccProjectConfig.ExportBim360Projects(exportpath + filename);
            }
            catch (Exception ex)
            {
                statusbar.Text = ex.Message;
                return;
            }
            statusbar.Text = "Export successful";

            dialog.Close();
        }
コード例 #37
0
        private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            InputDialog id = new InputDialog("Path to save files:", Application.StartupPath);

            id.onDispose += (path) =>
            {
                this.Program.ToCSV(path);
                MessageBox.Show("All data have been saved");
            };
            id.ShowDialog();
        }
コード例 #38
0
ファイル: Form1.cs プロジェクト: idenx/Semestr2_TSD
 private void button2_Click(object sender, EventArgs e)
 {
     InputDialog InputDlg = new InputDialog();
     InputDlg.Text = "Ввод разреженной матрицы";
     InputDlg.label1.Text = "Введите матрицу в поле ниже и нажмите кнопу 'Отправить'";
     InputDlg.ShowDialog();
     matrix = new Matrix(InputDlg.richTextBox1.Text);
     this.richTextBox2.Text += "\n\nСоздана разряженная матрица:\n" + matrix.ToString();
     spMatrix = new SparseMatrix(matrix);
     this.richTextBox2.Text += "\n\nРазреженное представление:\n" + spMatrix.ToString();
 }
コード例 #39
0
        private async void ThemeCreateExecute(ThemeInfoBase theme)
        {
            var confirm = await MessagePopup.ShowAsync(Strings.Resources.CreateNewThemeAlert, Strings.Resources.NewTheme, Strings.Resources.CreateTheme, Strings.Resources.Cancel);

            if (confirm != ContentDialogResult.Primary)
            {
                return;
            }

            var input = new InputDialog();

            input.Title  = Strings.Resources.NewTheme;
            input.Header = Strings.Resources.EnterThemeName;
            input.Text   = $"{theme.Name} #2";
            input.IsPrimaryButtonEnabled   = true;
            input.IsSecondaryButtonEnabled = true;
            input.PrimaryButtonText        = Strings.Resources.OK;
            input.SecondaryButtonText      = Strings.Resources.Cancel;

            confirm = await input.ShowQueuedAsync();

            if (confirm != ContentDialogResult.Primary)
            {
                return;
            }

            var preparing = new ThemeCustomInfo {
                Name = input.Text, Parent = theme.Parent
            };
            var fileName = Client.Execute(new CleanFileName(theme.Name)) as Text;

            if (theme is ThemeCustomInfo custom)
            {
                foreach (var item in custom.Values)
                {
                    preparing.Values[item.Key] = item.Value;
                }
            }
            else if (theme is ThemeAccentInfo accent)
            {
                foreach (var item in accent.Values)
                {
                    preparing.Values[item.Key] = item.Value;
                }
            }

            var file = await ApplicationData.Current.LocalFolder.CreateFileAsync("themes\\" + fileName.TextValue + ".unigram-theme", CreationCollisionOption.GenerateUniqueName);

            await _themeService.SerializeAsync(file, preparing);

            preparing.Path = file.Path;

            ThemeEditExecute(preparing);
        }
コード例 #40
0
        /// <summary>
        ///     Save the path to where user saved spelling list to.
        ///     Used to give user a selection of spelling lists to open.
        /// </summary>
        /// <created>art2m,5/19/2019</created>
        /// <changed>art2m,5/19/2019</changed>
        public static void SaveSpellingListPath()
        {
            using (var input = new InputDialog())
            {
                DialogResult result = input.ShowDialog();
            }

            var filePath = CreateUserSpellingListFileName();

            WriteWordsToFile(filePath);
        }
コード例 #41
0
        internal void OpenDialog(Window win)
        {
            var dialog = new InputDialog();

            dialog.Top  = win.Top + 40;
            dialog.Left = win.Left - 230;
            Debug.WriteLine(dialog.Left);
            dialog.ShowDialog();

            Users = Operation.Read();
        }
コード例 #42
0
 private void btnUniverso_Click(object sender, EventArgs e)
 {
     //Vaciamos nuestra variable.
     auxiliar = "";
     //Guardamos en la variable el valor introducido por el usuario.
     auxiliar = InputDialog.mostrar("Introduzca algun dato para el universo");
     //Lo guardamos en nuestra lista correspondiente.
     universo.Add(auxiliar);
     //Lo imprimimos para ver el valor.
     label4.Text += auxiliar + "\n";
 }
コード例 #43
0
 public void OnClick_GitHubLink()
 {
     if (!canEdit)
     {
         Application.OpenURL(missionData.gitHubLink);
     }
     else
     {
         InputDialog.Create(OnInput_GitHubLink, "GitHub Link", "Enter the link to your source code.", "Enter Link...");
     }
 }
コード例 #44
0
ファイル: Program.cs プロジェクト: JaroslavVecera/GitGUI
        public void OnAddBranch(GraphItemModel m)
        {
            var dialog = new InputDialog();

            dialog.Validator = text => Logic.LibGitService.GetInstance().IsValidRefName(text);
            dialog.Text      = "Enter name of new branch";
            if (dialog.ShowDialog() == true)
            {
                LibGitService.GetInstance().Branch(m, dialog.ResponseText);
            }
        }
コード例 #45
0
ファイル: MainForm.cs プロジェクト: joyjones/fire-terminator
        private void iRenameTask_ItemClick(object sender, ItemClickEventArgs e)
        {
            var task = ProjectDoc.Instance.SelectedTaskInfo;
            var dlg  = new InputDialog("重命名任务", "任务名称:", task.Name);

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                task.Name = dlg.ResultText;
                m_EditViewOperater.RefreshProjectTree();
            }
        }
コード例 #46
0
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            string propname = comboProps.SelectedItem.ToString();
            InputDialog new_prop_val_dlg = new InputDialog();
            new_prop_val_dlg.SetInstr("New value property ...");
            new_prop_val_dlg.ShowDialog();
            if (new_prop_val_dlg.DialogResult != System.Windows.Forms.DialogResult.OK)
                return;

            working_component.SetCustomString(propname, new_prop_val_dlg.TextValue);
            DisplayPropVal();
        }
コード例 #47
0
ファイル: InputDialog.cs プロジェクト: egcube/OpenTween
        public static DialogResult Show(IWin32Window owner, string text, string caption, out string inputText)
        {
            using (var dialog = new InputDialog())
            {
                dialog.labelMain.Text = text;
                dialog.Text = caption;

                var result = dialog.ShowDialog(owner);
                inputText = dialog.textBox.Text;

                return result;
            }
        }
コード例 #48
0
ファイル: Form1.cs プロジェクト: BBraunRussia/MT940
        private void Converter()
        {
            try
            {
                using (ExcelDoc excelBook = new ExcelDoc(FileSberbankOpening.GetFileName()))
                {
                    using (FileTxt fileTxt = new FileTxt())
                    {
                        FileSberbank fileSberbank = new FileSberbank(excelBook);

                        InputDialog id = new InputDialog();

                        if (id.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            fileSberbank.Read();

                            fileSberbank.IsSumDebetEqualsDebetTotal();
                            fileSberbank.IsSumCreditEqualsCreditTotal();

                            fileTxt.Init(fileSberbank, excelBook);
                            fileTxt.WriteBody(FileTxt.TypeRow.D, fileSberbank.Debet);
                            fileTxt.WriteBody(FileTxt.TypeRow.C, fileSberbank.Credit);

                            fileTxt.WriteBottom();

                            MessageBox.Show("Файл сформирован.", "Завершено", MessageBoxButtons.OK, MessageBoxIcon.Information);

                        }
                        else
                        {
                            MessageBox.Show("Пользователь отказался от ввода номера выписки, дальнейшее формирование файла не возможно", "Формирование файла отмененно",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                }
            }
            catch (NullReferenceException ex)
            {
                MessageBox.Show(ex.Message, "Формирование файла отмененно", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (OverflowException ex)
            {
                MessageBox.Show(ex.Message, "Формирование файла отмененно", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (NotImplementedException ex)
            {
                MessageBox.Show(ex.Message, "Формирование файла отмененно", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            Close();
        }
コード例 #49
0
        public void CommandBinding_EditRenameCmdExecuted(object sender, System.Windows.Input.ExecutedRoutedEventArgs e)
        {
            BaseEditor obj = MogitorsRoot.Instance.Selected;
            if (obj == null)
                return;

            InputDialog dlg = new InputDialog("Enter a new name", "Name : ", obj.Name);
            if (dlg.ShowDialog() == true)
            {
                string text = dlg.InputText.Trim();
                if (text != obj.Name)
                    obj.Name = text;
            }
        }
コード例 #50
0
ファイル: InputDialog.cs プロジェクト: B00mX0r/MCForge-GUI
 /// <summary>
 /// Shows an input dialog and returns the string the user typed
 /// </summary>
 /// <param name="title">The title of the input box</param>
 /// <param name="message">The message to show</param>
 /// <param name="buttonText">The text of the submit button</param>
 /// <returns></returns>
 public static string showDialog(string title, string message, string buttonText)
 {
     InputDialog i = new InputDialog();
     i.Text = title;
     i.messageLabel.Text = message;
     i.buttonSubmit.Text = buttonText;
     i.txtInput.MinimumSize = new Size(i.buttonSubmit.Location.X, 0);
     string result = null;
     i.buttonSubmit.Click += delegate {
         result = i.txtInput.Text;
         i.Close();
     };
     i.ShowDialog();
     return result;
 }
コード例 #51
0
ファイル: API_MiniFramework.cs プロジェクト: pusp/o2platform
    	//return API_MiniFramework.askQuestion("title","subTitle"); 
    	
    	public static string askQuestion(string title, string subTitle)
    	{
    		var sync = new AutoResetEvent(false);
    		var result = "";
    		O2Thread.staThread(
				()=>{
						var inputDialog = new InputDialog();
			    		inputDialog.InstructionText = title;			    
			    		inputDialog.Text = subTitle;
			    		result = inputDialog.GetText();
			    		sync.Set();
					});
			sync.WaitOne();
			return result;
    	}
コード例 #52
0
ファイル: Form1.cs プロジェクト: idenx/Semestr2_TSD
 private void button4_Click(object sender, EventArgs e)
 {
     InputDialog InputDlg = new InputDialog();
     InputDlg.Text = "Ввод вектора";
     InputDlg.label1.Text = "Введите вектор в поле ниже и нажмите кнопу 'Отправить'";
     InputDlg.ShowDialog();
     String[] StrVector = InputDlg.richTextBox1.Text.Split(' ', '\t');
     this.Vector = new Double[StrVector.Length];
     String vctr = "";
     for (int i = 0; i < StrVector.Length; ++i)
     {
         Double.TryParse(StrVector[i], out this.Vector[i]);
         vctr += Vector[i].ToString() + "\t";
     }
     this.richTextBox1.Text += "\n\nСоздан вектор:\n" + vctr;
 }
コード例 #53
0
ファイル: InputDialog.cs プロジェクト: hong1975/wats
        public static DialogResult Show(string caption, string prompt, ref string inputText, CheckInputDelegate checkDelegate)
        {
            InputDialog inputDialog = new InputDialog();
            inputDialog.mCaption = caption;
            inputDialog.mPrompt = prompt;
            inputDialog.mText = inputText;
            inputDialog.mCheckInputDelegate = checkDelegate;

            DialogResult result = inputDialog.ShowDialog();
            if (result == DialogResult.OK)
            {
                inputText = inputDialog.mText;
            }

            return result;
        }
コード例 #54
0
ファイル: InputDialog.cs プロジェクト: mikkoj/nocs
        public string InputBox(string prompt, string title, string defaultInput)
        {
            // we'll create a new instance of the class and set the given arguments as properties
            var ib = new InputDialog
            {
                FormPrompt = prompt,
                FormCaption = title,
                DefaultValue = defaultInput
            };

            // show the actual dialog
            ib.ShowDialog();

            // retrieve the response string, close the dialog and return the string
            var response = ib.InputResponse;
            ib.Close();
            return response;
        }
コード例 #55
0
        public static DialogResult ShowDialog(IWin32Window parent, string title, string prompt, ref string value)
        {
            InputDialog dialog;
            DialogResult result;

            // initialize the dialog
            dialog = new InputDialog();
            dialog.Text = title;
            dialog.prompt_label.Text = prompt;
            dialog.input_box.Text = value;

            // show the dialog
            result = dialog.ShowDialog(parent);

            // set the output and return
            value = dialog.input_box.Text;
            return result;
        }
コード例 #56
0
ファイル: SymbleEditor.cs プロジェクト: EdgarEDT/myitoppsp
 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     if (((context != null) && (context.Instance != null)) && (provider != null))
     {
         base.editorService = (IWindowsFormsEditorService) provider.GetService(typeof(IWindowsFormsEditorService));
         if (base.editorService != null)
         {
             InputDialog dcd1 = new InputDialog();
             dcd1.InputLength = 3000;
             dcd1.InputString = value.ToString();
             if (base.editorService.ShowDialog(dcd1) == DialogResult.OK)
             {
                 value = dcd1.InputString;
             }
         }
     }
     return value;
 }
コード例 #57
0
ファイル: Dialogs.cs プロジェクト: ta0soft/STEAMp3
    public Dialogs()
    {
        // Loop until the user enters the correct information.
        retry:

        // Create a Steamp3.UI.InputDialog and display it to the user.
        InputDialog input = new InputDialog("Please enter your name:", "John Doe");
        if (input.ShowDialog() == DialogResult.OK)
        {
            // Create a Steamp3.UI.InfoDialog and allow the user to verify.
            InfoDialog info = new InfoDialog("Are you sure this name is correct?" + Environment.NewLine + input.TextBox.Text, InfoDialog.InfoButtons.YesNo);
            if (info.ShowDialog() == DialogResult.No) goto retry;

            // Create another Steamp3.UI.InfoDialog and display it to the user.
            InfoDialog info2 = new InfoDialog("Hello " + input.TextBox.Text + "!");
            info2.ShowDialog();
        }
    }
コード例 #58
0
        private void connectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                InputDialog dialog = new InputDialog("Enter the console's name", "Console Name", "169.254.66.42");
                if (dialog.ShowDialog() != DialogResult.OK)
                    return;
                string consoleName = dialog.GetText();

                console = new XboxDevConsole(consoleName);
                foreach (CommittedMemoryBlock block in console.CommittedMemory)
                {
                    ListViewItem item = new ListViewItem("0x" + block.Base.ToString("X8"));
                    item.SubItems.Add("0x" + block.Size.ToString("X8"));
                    item.SubItems.Add(block.Protection);

                    lstCommitedMemory.Items.Add(item);

                    cmbxMemRegion.Items.Add("0x" + block.Base.ToString("X8") + "\t|\t" + "0x" + block.Size.ToString("X8"));
                }
                cmbxMemRegion.Items.Add("All Regions");
                cmbxMemRegion.Items.Add("Custom");

                foreach (Module module in console.Modules)
                {
                    ListViewItem item = new ListViewItem(module.Name);
                    item.SubItems.Add("0x" + module.BaseAddress.ToString("X8"));
                    item.SubItems.Add("0x" + module.Size.ToString("X8"));
                    item.SubItems.Add(module.Timestamp.ToShortTimeString());
                    item.SubItems.Add("0x" + module.DataAddress.ToString("X8"));
                    item.SubItems.Add("0x" + module.DataSize.ToString("X8"));
                    item.SubItems.Add(module.Thread.ToString());

                    lstModules.Items.Add(item);
                }

                consoleProperties.SelectedObject = console;
                EnableControls(true);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
コード例 #59
0
ファイル: Form1.cs プロジェクト: pichiliani/CoMusic
        public Form1()
        {
            InputDialog d = new InputDialog("Connection details", "Which server:port ?", "localhost:9999");
            if (d.ShowDialog() != DialogResult.OK)
            {
                throw new InvalidOperationException();
            }
            string[] parts = d.Input.Split(':');
            string host = parts[0];
            string port = parts.Length > 1 ? parts[1] : "9999";

            client = new Client();
            client.ConnexionRemoved += client_ConnexionRemoved;
            client.Start();
            chats = client.OpenStringChannel(host, port, ChatMessagesChannelId, ChannelDeliveryRequirements.ChatLike);
            updates = client.OpenSessionChannel(host, port, SessionUpdatesChannelId, ChannelDeliveryRequirements.SessionLike);
            InitializeComponent();
            this.Disposed += Form1_Disposed;
        }
コード例 #60
0
ファイル: CommonDialog.cs プロジェクト: xeno-by/dotwindows
        public static int ForCopyFilesToDevice(IEnumerable<string> files, ref string toPlayListName, string source, bool isMove)
        {
            int totalCount = files.Count();

            string op = isMove ? MsgStr.BtnMove : MsgStr.BtnCopy;

            var dlg = new InputDialog(
                string.Format(MsgStr.MsgCopyFiles, op, totalCount, toPlayListName),
                MsgStr.FarPod, new[] { op, MsgStr.BtnCancel }, toPlayListName);

            dlg.HistoryKey = "PlaylistName";

            if (dlg.Show() && dlg.ClickedButtonNumber == 0)
            {
                toPlayListName = dlg.InputText;
            }

            return dlg.ClickedButtonNumber;
        }