本文整理汇总了C#中Dialog.Resize方法的典型用法代码示例。如果您正苦于以下问题:C# Dialog.Resize方法的具体用法?C# Dialog.Resize怎么用?C# Dialog.Resize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dialog
的用法示例。
在下文中一共展示了Dialog.Resize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: scanParse
private void scanParse(ref int i)
{
//parses the GIMMEH
string name = lexemeList [i+1].getName (); //get the lexeme name
string desc = lexemeList [i+1].getDescription (); //get the lexeme description
if (desc == Constants.VARDESC) { //if it is a variable
int index = findVarName (name); //find the variable
if (index != -1) { //if it is inisialized
Dialog inputPrompt = null;
ResponseType response = ResponseType.None;
try {
//create a prompt
inputPrompt = new Dialog (Constants.SCAN, this,
DialogFlags.DestroyWithParent | DialogFlags.Modal,
"OK", ResponseType.Yes);
//set the size
inputPrompt.Resize (300, 50);
//set the layout
inputPrompt.VBox.Add (inputTextView = new TextView ());
//show the prompt
inputPrompt.ShowAll ();
//get the response
response = (ResponseType)inputPrompt.Run ();
} finally {
if (inputPrompt != null) {
if (response == ResponseType.Yes) {
string input = inputTextView.Buffer.Text; //get the input
Value val = new Value (input, Constants.STRING); //store it to the variable as YARN
allTable[index][lexemeList [i + 1].getName ()] = val;
}
inputPrompt.Destroy ();
}
}
} else //else the variable is not yet declared
throw new SyntaxException (WarningMessage.varNoDec (name));
} else //else GIMMEH has no arguments
throw new SyntaxException (WarningMessage.noArguments (Constants.SCAN));
i++;
}