//新增模式 public PoseCombinationSelect(PresentationModel model, Mode mode) { _presentationModel = model; _mode = mode; _isEdit = false; InitializeComponent(); InitailizePoseboard(); InitailizeKeyboard(); }
public void AddPoseCombination(Mode mode, PoseCombination poseCombination, bool isEdit, int editIndex) { if (isEdit) { mode.RemovePoseCombinationByIndex(editIndex); mode.InsertPoseCombination(editIndex, poseCombination); } else mode.AddPoseCombination(poseCombination); }
public ModeDetail(PresentationModel model, Mode mode) { InitializeComponent(); _presentationModel = model; _mode = mode; _modePictureBox.Invalidate(); BindingSource source = new BindingSource(mode.GetPoseCombinationList(), null); _poseCombinationGridView.DataSource = source; InitializeGridView(); }
public int GetModeIndex(Mode mode) { int index = -1; for (index = 0; index < _modeList.Count; index++) { if (_modeList[index] == mode) { break; } } return index; }
//編輯模式 public PoseCombinationSelect(PresentationModel model, Mode mode, int editIndex) { _presentationModel = model; _mode = mode; _isEdit = true; _editIndex = editIndex; InitializeComponent(); InitailizePoseCombination(mode.GetPoseCombination(editIndex)); InitailizePoseboard(); InitailizeKeyboard(); CheckIsContinue(); _posePictureBox.Invalidate(); _keyPictureBox.Invalidate(); }
public void ProcessPoseCombinationGridViewCell(Mode mode, int rowIndex, int columnIndex, PresentationModel presentationModel) { if (rowIndex >= 0) { PoseCombinationSelect poseCombinationForm = new PoseCombinationSelect(presentationModel, mode, rowIndex); switch (columnIndex) { // this is delete button, we add delete columns first, then format binding columns // so delete button columns index while be 0, even we setting displayIndex is 1 case 0: mode.RemovePoseCombinationByIndex(rowIndex); break; case 2: mode.GetPoseCombination(rowIndex).IsEnable = !mode.GetPoseCombination(rowIndex).IsEnable; break; default: poseCombinationForm.ShowDialog(); break; } } }
public void OpenDetailForm(Mode mode) { mode.IsOpen = true; }
private void OpenModeDetailForm(Mode mode, Form detailForm) { if (!mode.IsOpen) { OpenDetailForm(mode); detailForm.Show(); } else { Form openedForm = ExistForm(mode); openedForm.Activate(); } }
private Form ExistForm(Mode mode) { FormCollection openForms = Application.OpenForms; foreach (Form form in openForms) { if (form.Text == mode.Name) { return form; } } return null; }
private void CloseModeDetailForm(Mode mode) { Form openedForm = ExistForm(mode); if (openedForm != null) openedForm.Close(); }
public void RemoveMode(Mode mode) { _model.RemoveMode(mode); }
//刪除操縱軟體 public void RemoveMode(Mode mode) { _modeList.Remove(mode); }
// create a new mode, and adding mode list public Mode AddMode(string name) { Mode mode = new Mode(name); _modeList.Add(mode); return mode; }