private void addSampleCmd() { Sugarism.CmdBackground bgModel = new Sugarism.CmdBackground(Sugarism.CmdBackground.START_ID); CmdBackground cmdBackground = new CmdBackground(bgModel); Insert(0, cmdBackground); Sugarism.CmdSwitch switchModel = new Sugarism.CmdSwitch(ScenarioEditor.Model.Character.START_ID); CmdSwitch cmdSwitch = new CmdSwitch(switchModel); Insert(1, cmdSwitch); Sugarism.CmdLines linesModel = new Sugarism.CmdLines(ScenarioEditor.Model.Character.START_ID); CmdLines cmdlines = new CmdLines(linesModel); Insert(2, cmdlines); // test : appear, target appear, disappear CmdAppear cmdAppear = (CmdAppear)Command.Create(Sugarism.Command.Type.Appear); Insert(3, cmdAppear); CmdTargetAppear cmdTargetAppear = (CmdTargetAppear)Command.Create(Sugarism.Command.Type.TargetAppear); Insert(4, cmdTargetAppear); CmdDisappear cmdDisappear = (CmdDisappear)Command.Create(Sugarism.Command.Type.Disappear); Insert(5, cmdDisappear); }
public CmdSwitch(Sugarism.CmdSwitch model, Mode mode) : base(model, mode) { _model = model; _caseList = new List <CmdCase>(); foreach (Sugarism.CmdCase mCase in _model.CaseList) { CmdCase cmdCase = new CmdCase(mCase, Mode); _caseList.Add(cmdCase); } }
public CmdSwitch(Sugarism.CmdSwitch model) : base(model) { _model = model; _caseList = new ObservableCollection <CmdCase>(); foreach (Sugarism.CmdCase cmdCase in _model.CaseList) { CmdCase cmdCaseVm = new CmdCase(cmdCase); CaseList.Add(cmdCaseVm); cmdCaseVm.Parent = this; } IsExpanded = true; InputBindings.Add(new KeyBinding(CmdExpand, Key.Enter, ModifierKeys.None)); Common.Instance.CharacterListChangeEvent.Attach(onCharacterListChanged); }