Exemplo n.º 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);
        }
Exemplo n.º 2
0
 protected void ApplyInitState(DrawerState state)
 {
     if (state != null)
     {
         ApplyState(state);
     }
     else
     {
         ApplySavedOrDefaultState();
     }
 }
Exemplo n.º 3
0
 public void ApplyStateOrDefault(DrawerState state)
 {
     if (state != null)
     {
         ApplyState(state);
     }
     else
     {
         ApplyDefaultState();
     }
 }
Exemplo n.º 4
0
        public override void ApplyState(DrawerState state)
        {
            base.ApplyState(state);

            var s = state as IntegerDrawerState;

            if (s == null)
            {
                return;
            }

            valueField.Hexadecimal = s.Hexadecimal;
        }
Exemplo n.º 5
0
        protected override void PopulateState(DrawerState state)
        {
            base.PopulateState(state);

            var s = state as IntegerDrawerState;

            if (s == null)
            {
                return;
            }

            s.Hexadecimal = valueField.Hexadecimal;
        }
Exemplo n.º 6
0
 public virtual void ApplyState(DrawerState state)
 {
     SelfVisible     = state.SelfVisible;
     ChildrenVisible = state.ChildrenVisible;
 }
Exemplo n.º 7
0
 protected virtual void PopulateState(DrawerState state)
 {
     state.SelfVisible     = SelfVisible;
     state.ChildrenVisible = ChildrenVisible;
 }
Exemplo n.º 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));
 }
Exemplo n.º 9
0
 public static void Set(string name, DrawerState state)
 {
     Instance.states[name] = state;
 }