/// <summary>
        /// Обработка для нового редактора
        /// </summary>
        /// <param name="editorItem">Элемент из редактора</param>
        /// <param name="oF">Функция</param>
        private void ExecuteForEditor(Editor.ITreeViewItem editorItem,
                                      Function oF)
        {
            if (editorItem.IsUseDevList)
            {
                string devName;
                bool   res = Device.DeviceManager.CheckDeviceName(oF.Name,
                                                                  out devName, out _, out _, out _, out _);

                if (res)
                {
                    string checkedDevices = editorItem.EditText[1];
                    string newDevices     = MakeNewCheckedDevices(devName,
                                                                  checkedDevices);
                    Editor.Editor.GetInstance().EditorForm
                    .SetNewVal(newDevices);

                    //Обновление списка устройств при его наличии.
                    if (DFrm.GetInstance().IsVisible() == true)
                    {
                        DFrm.OnSetNewValue onSetNewValue = null;
                        DFrm.GetInstance().ShowDisplayObjects(editorItem,
                                                              onSetNewValue);
                    }
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        ///This function is called when executing the action.
        /// </summary>
        ///<returns>true, if the action performed successfully</returns>
        public bool Execute(ActionCallingContext ctx)
        {
            try
            {
                if (EProjectManager.GetInstance().GetCurrentPrj() == null)
                {
                    MessageBox.Show("Нет открытого проекта!", "EPlaner",
                                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                else
                {
                    Editor.ITreeViewItem treeViewItem          = null;
                    DFrm.OnSetNewValue   OnSetNewValueFunction = null;
                    bool isRebuiltTree = true;
                    DFrm.GetInstance().ShowDisplayObjects(treeViewItem,
                                                          OnSetNewValueFunction, isRebuiltTree);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            return(true);
        }
Esempio n. 3
0
        /// <summary>
        ///This function is called when executing the action.
        /// </summary>
        ///<returns>true, if the action performed successfully</returns>
        public bool Execute(ActionCallingContext ctx)
        {
            try
            {
                if (EProjectManager.GetInstance().GetCurrentPrj() == null)
                {
                    MessageBox.Show("Нет открытого проекта!", "EPlaner",
                                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                else
                {
                    Device.DeviceType[]    devTypes    = null;      // All.
                    Device.DeviceSubType[] devSubTypes = null;      // All.

                    bool               showChannels          = true;
                    bool               showCheckboxes        = false;
                    string             checkedDev            = "";
                    DFrm.OnSetNewValue OnSetNewValueFunction = null;
                    bool               isRebuiltTree         = true;

                    DFrm.GetInstance().ShowDevices(
                        Device.DeviceManager.GetInstance(), devTypes,
                        devSubTypes, showChannels, showCheckboxes, checkedDev,
                        OnSetNewValueFunction, isRebuiltTree);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            return(true);
        }