本文整理汇总了C#中Timer.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Timer.GetType方法的具体用法?C# Timer.GetType怎么用?C# Timer.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timer
的用法示例。
在下文中一共展示了Timer.GetType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getControlFromNode
private Control getControlFromNode(XmlNode node)
{
string id = "";
if (node.Attributes["id"] != null)
id = node.Attributes["id"].Value;
string value = "";
bool visible = true;
if (node.Attributes["value"] != null)
value = node.Attributes["value"].Value;
if (node.Attributes["label"] != null)
value = node.Attributes["label"].Value;
if (node.Attributes["text"] != null)
value = node.Attributes["text"].Value;
if (node.Attributes["visible"] != null)
visible = bool.Parse(node.Attributes["visible"].Value);
string style = "";
if (node.Attributes["style"] != null)
style = node.Attributes["style"].Value;
bool enabled = true;
if (node.Attributes["enabled"] != null)
enabled = bool.Parse(node.Attributes["enabled"].Value);
string onclick = "";
if (node.Attributes["onclick"] != null)
onclick = node.Attributes["onclick"].Value;
switch (node.Name.ToLower()) {
case "panel":
Panel panel = new Panel();
panel.id = id;
panel.Value = value;
panel.Visible = visible;
panel.Style = style;
return panel;
break;
case "page":
Page page = new Page();
page.id = id;
return page;
break;
case "textbox":
TextBox text = new TextBox();
text.id = id;
text.Enabled = enabled;
if (node.Attributes["onkeypressenter"] != null) {
onclick = node.Attributes["onkeypressenter"].Value;
if (onclick != "") {
text.GetType().GetEvent("OnKeyPressEnter").AddEventHandler(text, Delegate.CreateDelegate(typeof(Control.TriggeredEvent), (Control)this.page ?? (Control)this.panel, onclick.Split('|')[0]));
if (onclick.Split('|').Length == 2) {
text.Where = onclick.Split('|')[1];
}
}
}
text.text = value;
text.Style = style;
if (node.Attributes["multiline"] != null) {
text.Multiline = bool.Parse(node.Attributes["multiline"].Value);
if (node.Attributes["rows"] != null)
text.Rows = int.Parse(node.Attributes["rows"].Value);
if (node.Attributes["cols"] != null)
text.Cols = int.Parse(node.Attributes["cols"].Value);
}
return text;
break;
case "label":
Label label = new Label();
label.id = id;
label.text = value;
label.Style = style;
return label;
break;
case "button":
Button button = new Button();
button.id = id;
button.Enabled = enabled;
button.label = value;
if (node.Attributes["enabled"] != null)
button.Enabled = bool.Parse(node.Attributes["enabled"].Value);
if (onclick != "") {
button.GetType().GetEvent("OnClick").AddEventHandler(button, Delegate.CreateDelegate(typeof(Control.TriggeredEvent), (Control)this.page ?? (Control)this.panel, onclick.Split('|')[0]));
if (onclick.Split('|').Length == 2) {
button.Where = onclick.Split('|')[1];
}
}
button.Style = style;
return button;
break;
case "table":
Table table = new Table();
table.id = id;
table.Style = style;
return table;
break;
case "tr":
TableRow row = new TableRow();
if (node.Attributes["colspan"] != null)
//.........这里部分代码省略.........