コード例 #1
0
        void BrowseCombo(ComboBox box)
        {
            AnkhDiffTool tool = box.SelectedItem as AnkhDiffTool;

            string line;

            if (tool != null)
            {
                line = string.Format("\"{0}\" {1}", tool.Program, tool.Arguments);
            }
            else
            {
                line = box.Text;
            }

            using (ToolArgumentDialog dlg = new ToolArgumentDialog())
            {
                dlg.Value = line;
                dlg.SetTemplates(Context.GetService <IAnkhDiffHandler>().ArgumentDefinitions);

                if (DialogResult.OK == dlg.ShowDialog(Context))
                {
                    string newValue = dlg.Value;

                    if (!string.IsNullOrEmpty(newValue) && newValue != line)
                    {
                        box.DropDownStyle = ComboBoxStyle.DropDown;
                        box.SelectedItem  = null;
                        box.Text          = newValue;
                    }
                }
            }
        }
コード例 #2
0
        void BrowseCombo(ComboBox box)
        {
            AnkhDiffTool tool = box.SelectedItem as AnkhDiffTool;

            string line;
            if (tool != null)
            {
                line = string.Format("\"{0}\" {1}", tool.Program, tool.Arguments);
            }
            else
                line = box.Text;

            using (ToolArgumentDialog dlg = new ToolArgumentDialog())
            {
                dlg.Value = line;
                dlg.SetTemplates(Context.GetService<IAnkhDiffHandler>().ArgumentDefinitions);

                if (DialogResult.OK == dlg.ShowDialog(Context))
                {
                    string newValue = dlg.Value;

                    if (!string.IsNullOrEmpty(newValue) && newValue != line)
                    {
                        box.DropDownStyle = ComboBoxStyle.DropDown;
                        box.SelectedItem = null;
                        box.Text = newValue;
                    }
                }
            }
        }