本文整理汇总了C#中InputDialog类的典型用法代码示例。如果您正苦于以下问题:C# InputDialog类的具体用法?C# InputDialog怎么用?C# InputDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InputDialog类属于命名空间,在下文中一共展示了InputDialog类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Main
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);
}
开发者ID:solson,项目名称:DSAE,代码行数:27,代码来源:Program.cs
示例2: CreateTestWithSingleAlert
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
}
开发者ID:RecursosOnline,项目名称:azure-mobile-services,代码行数:28,代码来源:ZumoTestCommon.cs
示例3: btnAddTheme_Click
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();
}
开发者ID:pafik13,项目名称:PresentationCreator,代码行数:31,代码来源:Main.cs
示例4: buttonAdd_Click
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;
}
}
开发者ID:amoun00,项目名称:Contributions,代码行数:35,代码来源:frmDocEditor.cs
示例5: Run
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;
}
}
}
开发者ID:harrygg,项目名称:VuGenPowerPack,代码行数:25,代码来源:HighlightCommand.cs
示例6: button1_Click
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");
}
开发者ID:NextStalker,项目名称:RegionalReport,代码行数:26,代码来源:RepDistRight.cs
示例7: CreateYesNoTest
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;
}
});
}
开发者ID:nchejara,项目名称:azure-mobile-services,代码行数:29,代码来源:ZumoTestCommon.cs
示例8: InputDialogBox
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;
}
开发者ID:itsff,项目名称:CodeSamples_TTAPI_CSharp,代码行数:8,代码来源:InputForm.cs
示例9: AddButtonCommandExecute
private void AddButtonCommandExecute(object obj)
{
var inputDialog = new InputDialog();
if (inputDialog.ShowDialog().GetValueOrDefault())
{
Attribute.AllowedValuesSet.Add(new StringWrapper(inputDialog.Value));
}
}
开发者ID:hflorin,项目名称:annotator,代码行数:8,代码来源:AddAttributeViewModel.cs
示例10: button5_Click
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();
}
开发者ID:idenx,项目名称:Semestr2_TSD,代码行数:9,代码来源:Form1.cs
示例11: OnEntry
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);
}
开发者ID:ThomasMentzel,项目名称:SlideShareCode,代码行数:10,代码来源:CreateAnything.cs
示例12: InputBox
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;
}
开发者ID:aile54,项目名称:chatclient,代码行数:10,代码来源:FrmPubSub.cs
示例13: ShowInputDialog
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;
}
开发者ID:JoeyEremondi,项目名称:tikzedt,代码行数:10,代码来源:InputDialog.cs
示例14: btnAddPresantation_Click
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();
}
开发者ID:pafik13,项目名称:PresentationCreator,代码行数:11,代码来源:Main.cs
示例15: button2_Click
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();
}
开发者ID:idenx,项目名称:Semestr2_TSD,代码行数:11,代码来源:Form1.cs
示例16: buttonEdit_Click
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();
}
开发者ID:BillSherman,项目名称:GlobalsGraphDB,代码行数:12,代码来源:PropertiesEditor.cs
示例17: Show
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;
}
}
开发者ID:egcube,项目名称:OpenTween,代码行数:13,代码来源:InputDialog.cs
示例18: Converter
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();
}
开发者ID:BBraunRussia,项目名称:MT940,代码行数:51,代码来源:Form1.cs
示例19: CommandBinding_EditRenameCmdExecuted
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;
}
}
开发者ID:andyhebear,项目名称:likeleon,代码行数:14,代码来源:MainWindowCommands.cs
示例20: askQuestion
//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;
}
开发者ID:pusp,项目名称:o2platform,代码行数:17,代码来源:API_MiniFramework.cs
注:本文中的InputDialog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论