Exemple #1
0
        public static Tool SelectTool(MachineType machineType)
        {
            if (_toolsForm == null)
            {
                _toolsForm = new ToolsForm();
            }
            _toolsForm.Text = $"Инструмент {machineType}";
            _toolsForm.ToolBindingSource.DataSource = _tools[machineType];

            if (Autodesk.AutoCAD.ApplicationServices.Application.ShowModalDialog(_toolsForm) == DialogResult.OK)
            {
                return((Tool)_toolsForm.ToolBindingSource.Current);
            }
            return(null);
        }
Exemple #2
0
        public static Tool SelectTool(MachineType machineType)
        {
            if (_toolsForm == null)
            {
                _toolsForm            = new ToolsForm();
                _toolsForm.LoadTools += LoadTools;
            }
            _toolsForm.Text          = $"Инструмент {machineType}";
            _toolsForm.bLoad.Enabled = machineType == MachineType.ScemaLogic;
            _toolsForm.ToolBindingSource.DataSource = Settings.GetTools(machineType);

            var result = Autodesk.AutoCAD.ApplicationServices.Application.ShowModalDialog(_toolsForm);

            Settings.Save();

            return(result == DialogResult.OK ? (Tool)_toolsForm.ToolBindingSource.Current : null);
        }