Ejemplo n.º 1
0
        public Result OnShutdown(UIControlledApplication a)
        {
            if (m_MyFormClearInstance != null && !m_MyFormClearInstance.IsDisposed)
            {
                m_MyFormClearInstance.Dispose();
                m_MyFormClearInstance = null;

                // if we've had a dialog, we had subscribed
                //a.Idling -= IdlingHandler;
            }

            if (m_MyFormLineStyles != null && !m_MyFormLineStyles.IsDisposed)
            {
                m_MyFormLineStyles.Dispose();
                m_MyFormLineStyles = null;

                // if we've had a dialog, we had subscribed
                //a.Idling -= IdlingHandler;
            }

            if (m_MyFormLinePatterns != null && !m_MyFormLinePatterns.IsDisposed)
            {
                m_MyFormLinePatterns.Dispose();
                m_MyFormLinePatterns = null;

                // if we've had a dialog, we had subscribed
                //a.Idling -= IdlingHandler;
            }

            return(Result.Succeeded);
        }
Ejemplo n.º 2
0
        public Result OnStartup(UIControlledApplication a)
        {
            m_MyFormClearInstance = null;
            m_MyFormLineStyles    = null;
            m_MyFormLinePatterns  = null; // no dialog needed yet; the command will bring it
            thisApp = this;               // static access to this application instance

            string fullPath   = System.Reflection.Assembly.GetExecutingAssembly().Location;
            string folderPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);

            string myRibbon = "AECOM";

            a.CreateRibbonTab(myRibbon);

            RibbonPanel panelA = a.CreateRibbonPanel(myRibbon, "AECOM Tools");

            //Pull Down Button
            PulldownButtonData pullDownData = new PulldownButtonData("General Tools", "General Tools");

            pullDownData.Image      = new BitmapImage(new Uri(Path.Combine(folderPath, "tools_16.png"), UriKind.Absolute));
            pullDownData.LargeImage = new BitmapImage(new Uri(Path.Combine(folderPath, "tools_32.png"), UriKind.Absolute));

            PulldownButton pullDownButton = panelA.AddItem(pullDownData) as PulldownButton;

            PushButton btnClearInstancesPullDown   = pullDownButton.AddPushButton(new PushButtonData("ClearDWG", "Clear imported DWG", fullPath, "GeneralTools.CommandClearInstances"));
            PushButton btnDeleteLineStyles         = pullDownButton.AddPushButton(new PushButtonData("Line Styles", "Line Styles Descr", fullPath, "GeneralTools.CommandLineStyles"));
            PushButton btnRenameLineStylesPullDown = pullDownButton.AddPushButton(new PushButtonData("Line Patterns", "Rename Line Styles", fullPath, "GeneralTools.CommandLinePatterns"));

            return(Result.Succeeded);
        }
Ejemplo n.º 3
0
        public void ShowFormClearInst(UIApplication uiapp)
        {
            // If we do not have a dialog yet, create and show it
            if (m_MyFormClearInstance == null || m_MyFormClearInstance.IsDisposed)
            {
                m_MyFormClearInstance = new ClearInstancesForm();
                m_MyFormClearInstance.Show();

                // if we have a dialog, we need Idling too
                //uiapp.Idling += IdlingHandler;
            }
        }