Пример #1
0
        // Implements the OnStartup event
        public Result OnStartup(UIControlledApplication application)
        {
            AddRibbonPanel(application);
            BillofQuantitiesForm = null; // no dialog needed yet; the command will bring it
            thisApp = this;              // static access to this application instance

            return(Result.Succeeded);
        }
Пример #2
0
        //   This method creates and shows a modeless dialog, unless it already exists.
        //   The external command invokes this on the end-user's request

        public void ShowForm(UIApplication uiapp)
        {
            // If we do not have a dialog yet, create and show it
            if (BillofQuantitiesForm == null || BillofQuantitiesForm.IsDisposed)
            {
                // A new handler to handle request posting by the dialog
                RequestHandler handler = new RequestHandler();

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

                // We give the objects to the new dialog;
                // The dialog becomes the owner responsible for disposing them, eventually.
                BillofQuantitiesForm = new BillofQuantitiesForm(exEvent, handler);
                BillofQuantitiesForm.Show();
            }
        }