示例#1
0
        public static ValueDrawer Create(Type ownerType, Type valueType,
                                         string name = null, Drawer parent = null, DrawerState state = null)
        {
            var drawer = CreateImpl(ownerType, valueType);

            drawer.Construct(name, parent);
            drawer.ApplyInitState(state);
            drawer.NotifyCreated();
            return(drawer);
        }
示例#2
0
 protected void ApplyInitState(DrawerState state)
 {
     if (state != null)
     {
         ApplyState(state);
     }
     else
     {
         ApplySavedOrDefaultState();
     }
 }
示例#3
0
 public void ApplyStateOrDefault(DrawerState state)
 {
     if (state != null)
     {
         ApplyState(state);
     }
     else
     {
         ApplyDefaultState();
     }
 }
示例#4
0
        public override void ApplyState(DrawerState state)
        {
            base.ApplyState(state);

            var s = state as IntegerDrawerState;

            if (s == null)
            {
                return;
            }

            valueField.Hexadecimal = s.Hexadecimal;
        }
示例#5
0
        protected override void PopulateState(DrawerState state)
        {
            base.PopulateState(state);

            var s = state as IntegerDrawerState;

            if (s == null)
            {
                return;
            }

            s.Hexadecimal = valueField.Hexadecimal;
        }
示例#6
0
 public virtual void ApplyState(DrawerState state)
 {
     SelfVisible     = state.SelfVisible;
     ChildrenVisible = state.ChildrenVisible;
 }
示例#7
0
 protected virtual void PopulateState(DrawerState state)
 {
     state.SelfVisible     = SelfVisible;
     state.ChildrenVisible = ChildrenVisible;
 }
示例#8
0
 public static T Create <T>(string name = null, Drawer parent = null, DrawerState state = null)
     where T : Drawer
 {
     return((T)Create(typeof(T), name, parent, state));
 }
示例#9
0
 public static void Set(string name, DrawerState state)
 {
     Instance.states[name] = state;
 }