Example #1
0
        void SetCommands()
        {
            //_commands[DBBrowseCommandsEnum.FileOpen] = cmdFileOpen;
            //_commands[DBBrowseCommandsEnum.FileOpenRelated] = cmdFileOpenRelated;
            _commands[DBBrowseCommandsEnum.FileClose] = this.Close;
            _commands[DBBrowseCommandsEnum.FileExit]  = () =>
            {
                OutputWindow.Exit();
                Application.Exit();
            };
            _commands[DBBrowseCommandsEnum.FilePeriod]           = _dateStart.Focus;
            _commands[DBBrowseCommandsEnum.FilePrintCurrentForm] = () => ReportManager.PrintCurrentForm(_grid);
            //_commands[DBBrowseCommandsEnum.FilePrint] = cmdFilePrint;
            //_commands[DBBrowseCommandsEnum.FileExportObjects] = cmdFileExportObjects;
            _commands[DBBrowseCommandsEnum.FileExportResults] = CmdFileExportResults;
            //_commands[DBBrowseCommandsEnum.FileImportObjects] = cmdFileImportObjects;

            _commands[DBBrowseCommandsEnum.EditFind]     = () => _grid.OnFindFirst(new ActionEventArgs());
            _commands[DBBrowseCommandsEnum.EditFindNext] = () => _grid.OnFindNext(new ActionEventArgs());
            _commands[DBBrowseCommandsEnum.EditRefresh]  = () => _grid.Reload();
            //_commands[DBBrowseCommandsEnum.EditQuery] = () => dbGrid.Query();
            //_commands[DBBrowseCommandsEnum.EditFilter] = () => dbGrid.OnFilter(new NewbankEventArgs());
            //_commands[DBBrowseCommandsEnum.EditEdit] = () => dbGrid.OnObjectEdit(new NewbankEventArgs(dbGrid.ReadObject(false)) { ActionID = dbGrid.GetAction(2) });
            //_commands[DBBrowseCommandsEnum.EditNew] = () => dbGrid.OnObjectAdd(new NewbankEventArgs(dbGrid.ReadObject(true)) { ActionID = dbGrid.GetAction(1) });
            //_commands[DBBrowseCommandsEnum.EditCopy] = () => dbGrid.OnObjectCopy(new NewbankEventArgs(dbGrid.ReadObject(false)));
            //_commands[DBBrowseCommandsEnum.EditCut] = () => dbGrid.OnObjectCut(new NewbankEventArgs(dbGrid.ReadObject(false)));
            //_commands[DBBrowseCommandsEnum.EditPaste] = () => dbGrid.OnObjectPaste(new NewbankEventArgs());
            //_commands[DBBrowseCommandsEnum.EditDelete] = () => dbGrid.OnObjectDel(new NewbankEventArgs());
            _commands[DBBrowseCommandsEnum.EditDoSelected] = () => _grid.FilterSelected(_grid.IdColName);
            _commands[DBBrowseCommandsEnum.EditSelectAll]  = () => _grid.SelectAll();
            //_commands[DBBrowseCommandsEnum.EditStat] = () => DBGridCmd.Statistics(dbGrid);
            _commands[DBBrowseCommandsEnum.EditCopyCell] = () => _grid.CopyCellValue();

            //_commands[DBBrowseCommandsEnum.ToolsUpdate] = cmdLoadAssembly;
            //_commands[DBBrowseCommandsEnum.ToolsServerRestart] = cmdServerRestart;
            //_commands[DBBrowseCommandsEnum.ToolsRates] = cmdToolsRates;
            //_commands[DBBrowseCommandsEnum.ToolsLoadRates] = cmdLoadRates;
            //_commands[DBBrowseCommandsEnum.ToolsFile] = cmdFiles;
            //_commands[DBBrowseCommandsEnum.ToolsShowXML] = cmdShowXML;
            //_commands[DBBrowseCommandsEnum.ToolsReportCurrentForm] = () => ReportManager.DesignCurrentForm(dbGrid);
            //_commands[DBBrowseCommandsEnum.ToolsReportDesigner] = () => ReportManager.Design(dbGrid);
            //_commands[DBBrowseCommandsEnum.ToolsRunFromAll] = cmdRunFromAll;

            _commands[DBBrowseCommandsEnum.FavoritesAdd] = CmdFavoritesAdd;
            //_commands[DBBrowseCommandsEnum.FavoritesEdit] = cmdFavoritesEdit;

            _commands[DBBrowseCommandsEnum.HelpAbout] = () => MessageBox.Show(
                $"{Program.AppName} версия: {System.Reflection.Assembly.GetAssembly(typeof(MainForm)).GetName().Version}", "",
                MessageBoxButtons.OK,
                MessageBoxIcon.Information);
        }