コード例 #1
0
 //新增模式
 public PoseCombinationSelect(PresentationModel model, Window window)
 {
     _presentationModel = model;
     _window = window;
     _isEdit = false;
     InitializeComponent();
 }
コード例 #2
0
 public WindowAdd(PresentationModel presentationModel, Window window)
 {
     InitializeComponent();
     _presentationModel = presentationModel;
     _window = window;
     _nameTextBox.Text = _window.Name;
     _imageTextBox.Text = _window.GetImagePath();
     _isEdit = true;
 }
コード例 #3
0
 public WindowDetail(PresentationModel model, Window window)
 {
     InitializeComponent();
     _presentationModel = model;
     _window = window;
     _modePictureBox.Invalidate();
     BindingSource source = new BindingSource(window.GetPoseCollection(), null);
     _poseCombinationGridView.DataSource = source;
     Text = window.Name;
     InitializeGridView();
 }
コード例 #4
0
 public void ProcessClickSaveButton(Window window, bool isEdit, string windowName, string windowImage)
 {
     if (isEdit)
         window.Name = windowName;
     else
         window = AddWindow(windowName);
     if (windowImage == "")
         window.SetImage("Image/Myo.png");
     else
         window.SetImage(windowImage);
 }
コード例 #5
0
 //編輯模式
 public PoseCombinationSelect(PresentationModel model, Window window, int editIndex)
 {
     _presentationModel = model;
     _window = window;
     _isEdit = true;
     _editIndex = editIndex;
     InitializeComponent();
     InitailizePoseCombination(window.GetPoseCombination(editIndex));
     CheckIsContinue();
     _posePictureBox.Invalidate();
     _keyPictureBox.Invalidate();
 }
コード例 #6
0
 public void AddPoseCombination(Window window, PoseCombination poseCombination, bool isEdit, int editIndex, Form form)
 {
     if (isEdit && !window.IsExistPoseCombinationEdit(poseCombination, editIndex))
     {
         window.RemovePoseCombinationByIndex(editIndex);
         window.InsertPoseCombination(editIndex, poseCombination);
         form.Close();
     }
     else if (!isEdit && !window.IsExistPoseCombination(poseCombination))
     {
         window.AddPoseCombination(poseCombination);
         form.Close();
     }
     else
         MessageBox.Show("此手勢組合已選擇過!!!", "警告", MessageBoxButtons.OK);
 }
コード例 #7
0
        public void ProcessPoseCombinationGridViewCell(Window window, int rowIndex, int columnIndex)
        {
            if (rowIndex >= 0)
            {
                PoseCombinationSelect poseCombinationForm = new PoseCombinationSelect(this, window, 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:
                        window.RemovePoseCombinationByIndex(rowIndex);
                        break;

                    case 4:
                        window.GetPoseCombination(rowIndex).IsEnable = !window.GetPoseCombination(rowIndex).IsEnable;
                        break;

                    default:
                        poseCombinationForm.ShowDialog();
                        break;
                }
            }
        }
コード例 #8
0
 /**
  * 加入操縱軟體
  */
 public void AddWindow(Window window)
 {
     _windowList.Add(window);
 }
コード例 #9
0
        /**
         * 取得篩選過後的手勢組合,如果清單中為空的,則取得該視窗下的所有手勢組合
         */
        private List<PoseCombination> GetFilterPoseCollection(Window window)
        {
            List<PoseCombination> poseCollection;
            if (_filter.Count > 0)
            {
                poseCollection = _filter;
            }
            else
            {
                try
                {
                    poseCollection = window.GetPoseCollectionList();
                }
                catch (Exception)
                {
                    poseCollection = new List<PoseCombination>();
                    //throw new Exception("this window is not defined on list");
                }
            }

            return poseCollection;
        }
コード例 #10
0
 public void SetFocusWindow(string name)
 {
     _focusWindow = _windowList.FirstOrDefault(item => name.ToLower().IndexOf(item.Name.ToLower()) != -1);
     if (_focusWindow != null && !_focusWindow.IsEnable)
     {
         _focusWindow = null;
     }
 }
コード例 #11
0
 /**
  * 刪除操縱軟體
  */
 public void RemoveWindow(Window window)
 {
     _windowList.Remove(window);
 }
コード例 #12
0
 public void OpenDetailForm(Window window)
 {
     window.IsOpen = true;
 }
コード例 #13
0
 private void OpenWindowDetailForm(Window window, Form detailForm)
 {
     if (!window.IsOpen)
     {
         OpenDetailForm(window);
         detailForm.Show();
     }
     else
     {
         Form openedForm = ExistForm(window);
         openedForm.Activate();
     }
 }
コード例 #14
0
 private Form ExistForm(Window window)
 {
     FormCollection openForms = Application.OpenForms;
     foreach (Form form in openForms)
     {
         if (form.Text == window.Name)
         {
             return form;
         }
     }
     return null;
 }
コード例 #15
0
 private void CloseWindowDetailForm(Window window)
 {
     Form openedForm = ExistForm(window);
     if (openedForm != null)
         openedForm.Close();
 }
コード例 #16
0
 public void RemoveWindow(Window window)
 {
     _model.RemoveWindow(window);
 }