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); }
protected void ApplyInitState(DrawerState state) { if (state != null) { ApplyState(state); } else { ApplySavedOrDefaultState(); } }
public void ApplyStateOrDefault(DrawerState state) { if (state != null) { ApplyState(state); } else { ApplyDefaultState(); } }
public override void ApplyState(DrawerState state) { base.ApplyState(state); var s = state as IntegerDrawerState; if (s == null) { return; } valueField.Hexadecimal = s.Hexadecimal; }
protected override void PopulateState(DrawerState state) { base.PopulateState(state); var s = state as IntegerDrawerState; if (s == null) { return; } s.Hexadecimal = valueField.Hexadecimal; }
public virtual void ApplyState(DrawerState state) { SelfVisible = state.SelfVisible; ChildrenVisible = state.ChildrenVisible; }
protected virtual void PopulateState(DrawerState state) { state.SelfVisible = SelfVisible; state.ChildrenVisible = ChildrenVisible; }
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)); }
public static void Set(string name, DrawerState state) { Instance.states[name] = state; }