本文整理汇总了C#中Ict.Tools.CodeGeneration.TFormWriter.SetEventHandlerFunction方法的典型用法代码示例。如果您正苦于以下问题:C# TFormWriter.SetEventHandlerFunction方法的具体用法?C# TFormWriter.SetEventHandlerFunction怎么用?C# TFormWriter.SetEventHandlerFunction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ict.Tools.CodeGeneration.TFormWriter
的用法示例。
在下文中一共展示了TFormWriter.SetEventHandlerFunction方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetControlProperties
//.........这里部分代码省略.........
}
if ((ActionToPerform == "actEditBottom") && (ctrl.controlName == "mniEditBottom"))
{
writer.SetControlProperty("mniEditBottom", "ShortcutKeys", "Keys.End | Keys.Control", false);
}
if ((ActionToPerform == "actEditFocusGrid") && (ctrl.controlName == "mniEditFocusGrid"))
{
writer.SetControlProperty("mniEditFocusGrid", "ShortcutKeys", "Keys.G | Keys.Control", false);
}
if ((ActionToPerform == "actEditFilter") && (ctrl.controlName == "mniEditFilter")
&& (writer.FCodeStorage.FControlList.ContainsKey("pnlFilterAndFind")
|| writer.FCodeStorage.ManualFileExistsAndContains(strMniFilterFindClick)))
{
writer.SetControlProperty("mniEditFilter", "ShortcutKeys", "Keys.R | Keys.Control", false);
}
if ((ActionToPerform == "actSave") && (ctrl.controlName == "mniFileSave"))
{
ProcessTemplate snipCtrlS = writer.FTemplate.GetSnippet("PROCESSCMDKEYCTRLS");
writer.FTemplate.InsertSnippet("PROCESSCMDKEY", snipCtrlS);
writer.SetControlProperty("mniFileSave", "ShortcutKeys", "Keys.S | Keys.Control", false);
}
if ((ActionToPerform == "actPrint") && (ctrl.controlName == "mniFilePrint"))
{
writer.SetControlProperty("mniFilePrint", "ShortcutKeys", "Keys.P | Keys.Control", false);
}
if (FCodeStorage.ManualFileExistsAndContains(" " + ActionHandler.actionName.Substring(3) + "(Form AParentForm)"))
{
writer.SetEventHandlerFunction(ActionHandler.actionName.Substring(3), "", ActionHandler.actionName.Substring(
3) + "(this);");
}
}
else if (ctrl.HasAttribute("ActionClick"))
{
if (ctrl.GetAttribute("ActionClick").EndsWith("FilterFind_Click"))
{
// MniFilterFind_Click is part of the base template for many forms.
// We only create an action handler if the screen has a pnlFilterAndFind
if (writer.FCodeStorage.FControlList.ContainsKey("pnlFilterAndFind"))
{
AssignEventHandlerToControl(writer, ctrl, "Click", ctrl.GetAttribute("ActionClick"));
}
}
else
{
// The control is not mniEditFilter or mniEditFind, so just write the resource file item
// The manual code file will have the event handler itself
AssignEventHandlerToControl(writer, ctrl, "Click", ctrl.GetAttribute("ActionClick"));
}
}
else if (ctrl.HasAttribute("ActionDoubleClick"))
{
AssignEventHandlerToControl(writer, ctrl, "DoubleClick", ctrl.GetAttribute("ActionDoubleClick"));
}
else if (ctrl.HasAttribute("ActionOpenScreen"))
{
AssignEventHandlerToControl(writer, ctrl, "Click", "OpenScreen" + ctrl.controlName.Substring(ctrl.controlTypePrefix.Length));
string ActionHandler =
"/// auto generated" + Environment.NewLine +
"protected void OpenScreen" + ctrl.controlName.Substring(ctrl.controlTypePrefix.Length) + "(object sender, EventArgs e)" +
Environment.NewLine +