/// <summary> /// 增加控件绑定事件 /// </summary> void AddCtrlBindEvent(XmlTemplate xml) { var _cc = ParseControlConfig.GetControlConfig(CurrentSelectedSetEventControl.GetType().Name); var _be = _cc.Events.Where(p => p.Name.Equals(this.EventName)).GetFirst <BindEvent>(); EventBindInfo _ebi = new EventBindInfo(); _ebi.ControlName = this.EventControlName; _ebi.Item = new List <CtrlBindEventInfo>(); CtrlBindEventInfo _cbei = new CtrlBindEventInfo(); _cbei.EventName = this.EventName; _cbei.AssemblyName = _be.AssemblyName; _cbei.BindFunctionName = _be.BindFunctionName; _ebi.Item.Add(_cbei); xml.EventBindItem.Add(_ebi); IDesignFramework.UpdateCurrentTemplate(); }
/// <summary> /// 获取控件名称 /// </summary> /// <returns></returns> string _GetControlName() { /************************************************************************ * 判断当前事件名称【EventName】它是来到于哪里,是Form还是自己所在控件里 * * 如果来到是Form里的话,此时的_ControlName就是用Wrapper.ParseControlName()得到 * * 否而的话,就不分析Control控件了 * ************************************************************************/ var cc = ParseControlConfig.GetControlConfig(CurrentSelectedSetEventControl.GetType().Name); if (null == cc || null == cc.Functions || 0 == cc.Functions.Count) { return(Wrapper.ParseControlName(EventControlName));; } var fi = cc.Functions.Where(p => p.Name.Equals(EventName)).GetFirst <FunctionInfo>(); if (null == fi) { return(Wrapper.ParseControlName(EventControlName)); } return(EventControlName); }