Example #1
0
        //   The external command invokes this on the end-user's request
        public void ShowForm()
        {
            // If we do not have a dialog yet, create and show it
            if (m_MyForm == null)
            {
                // A new handler to handle request posting by the dialog
                ExternalEventClashDetection handler = new ExternalEventClashDetection();

                // External Event for the dialog to use (to post requests)
                ExternalEvent exEvent = ExternalEvent.Create(handler);

                // External execution handler to provide the needed context by revit to perform modifications on active document
                CleanViewHandler cleanViewHandler = new CleanViewHandler();
                // External event used for clean elements on the active view
                ExternalEvent externalCleanEvent = ExternalEvent.Create(cleanViewHandler);

                // We give the objects to the new dialog;
                // The dialog becomes the owner responsible for disposing them, eventually.
                m_MyForm         = new MainUserControl(exEvent, handler, externalCleanEvent);
                m_MyForm.Closed += MyFormClosed;
                m_MyForm.Show();
            }
        }
Example #2
0
        private void AddDocContents()
        {
            _tasksQueueManager = new TasksQueueManager();

            var theme = new VS2012LightTheme();

            this.dockPanel.Theme         = theme;
            this.dockPanel.DocumentStyle = DocumentStyle.DockingSdi;

            _queueUserControl = new QueueUserControl(_tasksQueueManager.TasksQueue);
            _queueUserControl.Show(this.dockPanel, DockState.DockRight);

            _logUserControl = new LogUserControl();
            _logUserControl.Show(this.dockPanel, DockState.DockBottom);

            _filtersUserControl = new FiltersUserControl();
            _filtersUserControl.Show(this.dockPanel, DockState.DockLeft);
            _filtersUserControl.OnFilterChanged += FiltersUserControlOnOnFilterChanged;

            _mainUserControl       = new MainUserControl();
            _mainUserControl.Tasks = _tasksQueueManager.TasksQueue;
            _mainUserControl.Show(this.dockPanel, DockState.Document);
            _mainUserControl.OnSynchRebinded += _mainUserControl_OnSynchRebinded;
        }