InitHelpers() публичный Метод

public InitHelpers ( ToolStripMenuItem toolsMenuItem, bool forDesigner ) : void
toolsMenuItem System.Windows.Forms.ToolStripMenuItem
forDesigner bool
Результат void
Пример #1
0
        public ServerManager()
        {
            if (Properties.Settings.Default.CallUpgrade)
            {
                Properties.Settings.Default.Upgrade();
                Properties.Settings.Default.CallUpgrade = false;
                Properties.Settings.Default.Save();
            }

            InitializeComponent();
            mainPropertyGrid.PropertySort = PropertySort.Categorized;
            sourceHelper = new TreeViewEditorHelper() { sortColumnAlphaOrderToolStripMenuItem = sortColumnAlphaOrderToolStripMenuItem, sortColumnSQLOrderToolStripMenuItem = sortColumnSQLOrderToolStripMenuItem, addFromToolStripMenuItem = addFromToolStripMenuItem, addToolStripMenuItem = addToolStripMenuItem, removeToolStripMenuItem = removeToolStripMenuItem, copyToolStripMenuItem = copyToolStripMenuItem, removeRootToolStripMenuItem = removeRootToolStripMenuItem, treeContextMenuStrip = treeContextMenuStrip, mainTreeView = mainTreeView };
            toolStripHelper = new ToolStripEditorHelper() { MainToolStrip = mainToolStrip, MainPropertyGrid = mainPropertyGrid, EntityHandler = this, MainTreeView = mainTreeView };
            toolsHelper = new ToolsHelper() { EntityHandler = this };
            toolsHelper.InitHelpers(toolsToolStripMenuItem, false);
            HelperEditor.HandlerInterface = this;

            configureMenuItem.Click += configureClick;
            configurationToolStripMenuItem.DropDownItems.Add(configureMenuItem);

            configurationToolStripMenuItem.DropDownItems.Add(new ToolStripSeparator());
            publishWebMenuItem.Click += configureClick;
            configurationToolStripMenuItem.DropDownItems.Add(publishWebMenuItem);

            configurationToolStripMenuItem.DropDownItems.Add(new ToolStripSeparator());
            securityMenuItem.Click += securityClick;
            configurationToolStripMenuItem.DropDownItems.Add(securityMenuItem);

            ShowIcon = true;
            Icon = Properties.Resources.serverManager;

            //Repository management, should be part of the installation
            _repository = Repository.Create();
            if (_repository == null)
            {
                _repository = new Repository();
                MessageBox.Show("No repository has been defined or found for this installation. Reports will not be rendered. Please modify the .configuration file to set a RepositoryPath containing at least a Views subfolder", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            //handle program args
            string[] args = Environment.GetCommandLineArgs();
            bool open = (args.Length >= 2 && args[1].ToLower() == "/o");
            string fileToOpen = null;
            if (args.Length >= 3 && File.Exists(args[2])) fileToOpen = args[2];
            //and last used file
            if (!open && File.Exists(Properties.Settings.Default.LastUsedFile))
            {
                open = true;
                fileToOpen = Properties.Settings.Default.LastUsedFile;
            }
            if (open && HasValidRepositoryDirectory(fileToOpen))
            {
                openFile(fileToOpen);
            }
            else
            {
                IsModified = false;
                init();
            }
        }
Пример #2
0
        public ReportDesigner()
        {
            if (Properties.Settings.Default.CallUpgrade)
            {
                Properties.Settings.Default.Upgrade();
                Properties.Settings.Default.CallUpgrade = false;
                Properties.Settings.Default.Save();
            }

            InitializeComponent();
            mainPropertyGrid.PropertySort = PropertySort.Categorized;

            treeViewHelper = new TreeViewEditorHelper() { Report = _report, sortColumnAlphaOrderToolStripMenuItem = sortColumnAlphaOrderToolStripMenuItem, sortColumnSQLOrderToolStripMenuItem = sortColumnSQLOrderToolStripMenuItem, addFromToolStripMenuItem = addFromToolStripMenuItem, addToolStripMenuItem = addToolStripMenuItem, removeToolStripMenuItem = removeToolStripMenuItem, copyToolStripMenuItem = copyToolStripMenuItem, removeRootToolStripMenuItem = removeRootToolStripMenuItem, treeContextMenuStrip = treeContextMenuStrip, mainTreeView = mainTreeView, ForReport = true };
            mainTreeView.AfterSelect += treeViewHelper.AfterSelect;

            toolStripHelper = new ToolStripEditorHelper() { MainToolStrip = mainToolStrip, MainPropertyGrid = mainPropertyGrid, EntityHandler = this, MainTreeView = mainTreeView };
            toolsHelper = new ToolsHelper() { EntityHandler = this };
            toolsHelper.InitHelpers(toolsToolStripMenuItem, true);

            HelperEditor.HandlerInterface = this;


            mainSplitContainer.Panel2.Controls.Add(modelPanel);
            modelPanel.Dock = DockStyle.Fill;
            mainSplitContainer.Panel2.Controls.Add(viewPanel);
            viewPanel.Dock = DockStyle.Fill;

            ShowIcon = true;
            Icon = Properties.Resources.reportDesigner;
        }