public void ProcessModeGridViewCell(int rowIndex, int columnIndex, PresentationModel presentationModel)
        {
            if (rowIndex >= 0)
            {
                Mode mode = presentationModel.GetModeByIndex(rowIndex);
                ModeDetail detailForm = new ModeDetail(presentationModel, mode);
                detailForm.Text = mode.Name;
                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 2
                    case 0:
                        CloseModeDetailForm(mode);
                        RemoveMode(mode);
                        RemoveImage(mode.Name);
                        break;

                    case 3:
                        mode.IsEnable = !mode.IsEnable;
                        break;

                    default:
                        OpenModeDetailForm(mode, detailForm);
                        break;
                }
            }
        }
 static void Main()
 {
     Model model = new Model();
     PresentationModel presentationModel = new PresentationModel(model);
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new EasyControl(presentationModel));
 }
 //新增模式
 public PoseCombinationSelect(PresentationModel model, Mode mode)
 {
     _presentationModel = model;
     _mode = mode;
     _isEdit = false;
     InitializeComponent();
     InitailizePoseboard();
     InitailizeKeyboard();
 }
 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 EasyControl(PresentationModel model)
        {
            InitializeComponent();
            _presentationModel = model;
            BindingSource source = new BindingSource(_presentationModel.GetModeList(), null);
            _modeGridView.DataSource = source;

            // must be last line
            InitializeGridView();
        }
 //編輯模式
 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 ModeAdd(PresentationModel presentationModel)
 {
     InitializeComponent();
     _presentationModel = presentationModel;
 }