private void SetCtrlType() { if (CountBar == null) { return; } string tControl = ThePropertyBag.PropBagGetValue(CountBar.PropertyBag, "ControlType", "="); eFieldType tCtrlType = eFieldType.SingleEnded; if (!string.IsNullOrEmpty(tControl) && TheCommonUtils.CInt(tControl) == 0 && tControl.Length > 0) { TheControlType tType = TheNMIEngine.GetControlTypeByType(tControl); if (tType != null) { ThePropertyBag.PropBagUpdateValue(CountBar.PropertyBag, "EngineName", "=", tType.BaseEngineName); } tCtrlType = eFieldType.UserControl; } else { tCtrlType = (eFieldType)TheCommonUtils.CInt(tControl); } CountBar.Type = tCtrlType; CountBar.Flags = TheCommonUtils.CInt(ThePropertyBag.PropBagGetValue(CountBar.PropertyBag, "Flags", "=")); CountBar.PropertyBag = new TheNMIBaseControl { ParentFld = 1 }; CountBar.UpdateUXProperties(Guid.Empty); CountBar.RegisterUXEvent(MyBaseThing, eUXEvents.OnClick, "click", (sener, para) => { TheThing.SetSafePropertyBool(MyBaseThing, "ClickState", !TheThing.GetSafePropertyBool(MyBaseThing, "ClickState")); }); }
private void SetCtrlType() { if (MySampleControl == null) { return; } string tControl = ThePropertyBag.PropBagGetValue(MySampleControl.PropertyBag, "ControlType", "="); eFieldType tCtrlType = eFieldType.SingleEnded; if (!string.IsNullOrEmpty(tControl) && TheCommonUtils.CInt(tControl) == 0 && tControl.Length > 0) { TheControlType tType = TheNMIEngine.GetControlTypeByType(tControl); if (tType != null) { ThePropertyBag.PropBagUpdateValue(MySampleControl.PropertyBag, "EngineName", "=", tType.BaseEngineName); } tCtrlType = eFieldType.UserControl; } else { tCtrlType = (eFieldType)TheCommonUtils.CInt(tControl); } MySampleControl.Type = tCtrlType; MySampleControl.Flags = TheCommonUtils.CInt(ThePropertyBag.PropBagGetValue(MySampleControl.PropertyBag, "Flags", "=")); MySampleControl.UpdateUXProperties(Guid.Empty); }