当前位置: 首页>>代码示例>>C#>>正文


C# TFormWriter.SetEventHandlerToControl方法代码示例

本文整理汇总了C#中Ict.Tools.CodeGeneration.TFormWriter.SetEventHandlerToControl方法的典型用法代码示例。如果您正苦于以下问题:C# TFormWriter.SetEventHandlerToControl方法的具体用法?C# TFormWriter.SetEventHandlerToControl怎么用?C# TFormWriter.SetEventHandlerToControl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ict.Tools.CodeGeneration.TFormWriter的用法示例。


在下文中一共展示了TFormWriter.SetEventHandlerToControl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetControlProperties

        /// <summary>write the code for the designer file where the properties of the control are written</summary>
        public override ProcessTemplate SetControlProperties(TFormWriter writer, TControlDef ctrl)
        {
            base.SetControlProperties(writer, ctrl);

            if (ctrl.GetAttribute("AutoComplete").EndsWith("History"))
            {
                writer.SetControlProperty(ctrl, "AcceptNewValues", "true");
                writer.SetEventHandlerToControl(ctrl.controlName,
                    "AcceptNewEntries",
                    "TAcceptNewEntryEventHandler",
                    "FPetraUtilsObject.AddComboBoxHistory");
                writer.CallControlFunction(ctrl.controlName, "SetDataSourceStringList(\"\")");
                writer.Template.AddToCodelet("INITUSERCONTROLS",
                    "FPetraUtilsObject.LoadComboBoxHistory(" + ctrl.controlName + ");" + Environment.NewLine);
            }

            return writer.FTemplate;
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:19,代码来源:ControlGeneratorComboboxes.cs

示例2: AssignEventHandlerToControl

        /// <summary>
        /// assign event handler to control
        /// </summary>
        public void AssignEventHandlerToControl(TFormWriter writer, TControlDef ctrl, string AEvent, string AEventHandlerType, string ActionToPerform)
        {
            if ((AEvent == null) || (AEvent.Length == 0))
            {
                return;
            }

            if (ActionToPerform.StartsWith("act"))
            {
                TActionHandler ActionHandler = writer.CodeStorage.FActionList[ActionToPerform];

                if (ActionHandler.actionId.Length > 0)
                {
                    // actionId is managed by FPetraUtilsObject
                    // need a special function that wraps calls to FPetraUtilsObject, otherwise problems in designer
                    ActionToPerform = ActionHandler.actionName;
                }
                else if (ActionHandler.actionClick.Length > 0)
                {
                    if (ActionHandler.actionClick.StartsWith("FPetraUtilsObject"))
                    {
                        // need a special function that wraps calls to FPetraUtilsObject, otherwise problems in designer
                        ActionToPerform = ActionHandler.actionName;
                    }
                    else
                    {
                        // direct call
                        ActionToPerform = ActionHandler.actionClick;
                    }
                }
                else
                {
                    ActionToPerform = "";
                }
            }
            else
            {
                // direct call: use ActionToPerform
            }

            if (ActionToPerform.Length > 0)
            {
                writer.SetEventHandlerToControl(ctrl.controlName, AEvent, AEventHandlerType, ActionToPerform);
            }
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:48,代码来源:ControlGeneratorBase.cs


注:本文中的Ict.Tools.CodeGeneration.TFormWriter.SetEventHandlerToControl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。