public CmdCase(Sugarism.CmdCase model) : base(model) { _model = model; _cmdList = new ObservableCollection <Command>(); foreach (Sugarism.Command cmdModel in _model.CmdList) { Command cmdViewModel = Command.Create(cmdModel); if (null != cmdViewModel) { CmdList.Add(cmdViewModel); cmdViewModel.Owner = this; } else { Log.Error(Properties.Resources.ErrInvalidCmdType); } } _parent = null; InputBindings.Clear(); InputBindings.Add(new KeyBinding(CmdExpand, System.Windows.Input.Key.Enter, ModifierKeys.None)); InputBindings.Add(new KeyBinding(CmdAddChild, System.Windows.Input.Key.A, ModifierKeys.Control)); if (_model.CmdList.Count <= 0) { addSampleCmd(); } }
public void AddCmdCase() { int key = CaseList.Count; Sugarism.CmdCase model = new Sugarism.CmdCase(key); CmdCase cmdCase = new CmdCase(model); int index = key; Insert(index, cmdCase); }
public CmdCase(Sugarism.CmdCase model, Mode mode) : base(model, mode) { _model = model; _cmdList = new List <Command>(); foreach (Sugarism.Command mCmd in _model.CmdList) { Command cmd = Command.Create(mCmd, Mode); _cmdList.Add(cmd); } _cmdIter = _cmdList.GetEnumerator(); _cmdIter.MoveNext(); }
private void delete(Sugarism.CmdCase cmdCase) { _model.CaseList.Remove(cmdCase); }
private void insert(int index, Sugarism.CmdCase cmdCase) { _model.CaseList.Insert(index, cmdCase); }