Example #1
0
        public void RefreshComPropList(IPropGWAble com)
        {
            _PropPanel.Children.Clear();
            Type tp = com.GetType();
            bool cl = false;

            foreach (PropertyInfo pi in tp.GetProperties())
            {
                if (Attribute.IsDefined(pi, typeof(PropDiscribeAttribute)))
                {
                    PropDiscribeAttribute pat = pi.GetCustomAttributes(typeof(PropDiscribeAttribute), true)[0] as PropDiscribeAttribute;
                    APropItem             itm = PropItemFactory.GetPropItem(pat, com, pi);
                    var  showitm = itm.GetControl();
                    Grid grd     = new Grid();
                    grd.Background = cl ? color1 : color2;
                    cl             = !cl;
                    grd.Children.Add(showitm);
                    _PropPanel.Children.Add(grd);
                    itm.TimeToShowHelpString += itm_TimeToShowHelpString;
                }
            }
            if (_PropPanel.Children.Count == 0)
            {
                _TxtHelp.Text = "该控件没有可以设置的属性。";
            }
        }
Example #2
0
        void itm_OnPropValueChanged(APropItem sender, IPropGWAble setee, PropertyInfo pi, object value)
        {
            int index = (int)sender.AttrParam;

            _Values[index] = value;
            setee.SetProp(pi, _Values);
        }
Example #3
0
 public TextPropItem(IPropGWAble jc, PropertyInfo pi, PropDiscribeAttribute attr)
 {
     _Ctrl   = jc;
     _PI     = pi;
     _Attr   = attr;
     AutoSet = true;
 }
Example #4
0
        void itm_OnPropValueChanged(APropItem sender, IPropGWAble arg1, PropertyInfo arg2, object arg3)
        {
            JWCControl jc = arg1 as JWCControl;

            if (jc == null)
            {
                return;
            }
            if (jc.Focused)
            {
                RefreshCurrName(jc);
            }
        }
Example #5
0
        public static APropItem GetPropItem(PropDiscribeAttribute attr, IPropGWAble jc, PropertyInfo pi)
        {
            var type = attr.ShowType;

            switch (type)
            {
            case CreatorPropType.Text: return(new TextPropItem(jc, pi, attr));

            case CreatorPropType.Boolean: return(new BoolPropItem(jc, pi, attr));

            case CreatorPropType.Multi: return(new MultiPropItem(jc, pi, attr));

            case CreatorPropType.DialogWithText: return(new DialogWithTextPropItem(jc, pi, attr));

            case CreatorPropType.EnumDropDown: return(new EnumDropdownPropItem(jc, pi, attr));

            default:
                throw new NotImplementedException("你没有实现这种CreatorPropType:" + type.ToString());
                return(null);
            }
        }
Example #6
0
 public MultiPropItem(IPropGWAble jc, PropertyInfo pi, PropDiscribeAttribute attr)
 {
     _Ctrl = jc;
     _PI   = pi;
     _Attr = attr;
 }