Example #1
0
        /// <summary>
        /// Implements the OnStartup event
        /// </summary>
        /// <param name="application"></param>
        /// <returns></returns>
        public Result OnStartup(UIControlledApplication application)
        {
            AddMenu(application);
            m_TagsForm = null; // no dialog needed yet; the command will bring it
            thisApp    = this; // static access to this application instance

            return(Result.Succeeded);
        }
Example #2
0
        /// <summary>
        ///   This method creates and shows a modeless dialog, unless it already exists.
        /// </summary>
        /// <remarks>
        ///   The external command invokes this on the end-user's request
        /// </remarks>
        ///
        public void ShowTagsForm(UIApplication uiapp)
        {
            // If we do not have a dialog yet, create and show it
            if (m_TagsForm == null || m_TagsForm.IsDisposed)
            {
                // A new handler to handle request posting by the dialog
                ExternalEventHandler handler = new ExternalEventHandler(thisApp);

                // 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 fore disposing them, eventually.
                m_TagsForm = new SetTagsInterface(exEvent, handler, thisApp);
                m_TagsForm.Show();
            }
        }