protected virtual TControlSw CreateSwControlInPage(IPropertyManagerPage2 page, ControlOptionsAttribute opts, IAttributeSet atts) { if (m_App.IsVersionNewerOrEqual(SwVersion_e.Sw2014, 1)) { return(page.AddControl2(atts.Id, (short)m_Type, atts.Name, (short)opts.Align, (short)opts.Options, atts.Description) as TControlSw); } else { return(page.AddControl(atts.Id, (short)m_Type, atts.Name, (short)opts.Align, (short)opts.Options, atts.Description) as TControlSw); } }
protected override PropertyManagerPageOptionBox CreateSwControlInPage(IPropertyManagerPage2 page, ControlOptionsAttribute opts, IAttributeSet atts) { return(CreateOptionBoxControl(opts, atts, (int id, short controlType, string caption, short leftAlign, int options, string tip) => { if (m_App.IsVersionNewerOrEqual(SwVersion_e.Sw2014, 1)) { return page.AddControl2(id, controlType, caption, leftAlign, options, tip) as IPropertyManagerPageOption; } else { return page.AddControl(id, controlType, caption, leftAlign, options, tip) as IPropertyManagerPageOption; } })); }
/// <summary> /// 添加WPF控件 /// </summary> /// <param name="id"></param> /// <param name="caption"></param> /// <param name="tip"></param> /// <param name="leftAlign"></param> /// <param name="options"></param> /// <param name="uiElementConfig"></param> /// <returns></returns> public IPropertyManagerPageWindowFromHandle AddWPFUserControl(int id, string caption, string tip, swPropertyManagerPageControlLeftAlign_e leftAlign, IEnumerable <swAddControlOptions_e> options, Action <IPropertyManagerPageWindowFromHandleWrapper> uiElementConfig) { short controlType = (int)swPropertyManagerPageControlType_e.swControlType_WindowFromHandle; var WpfPMPWindow = (IPropertyManagerPageWindowFromHandle)Page.AddControl2(id, controlType, caption, (short)leftAlign, PropertyManagerPage2Extension.CombineOptions(options), tip); if (uiElementConfig != null && WpfPMPWindow != null) { uiElementConfig(new IPropertyManagerPageWindowFromHandleWrapper(WpfPMPWindow)); } return(WpfPMPWindow); }