예제 #1
0
        public static void ShowProjectExplorer(bool bVisible)
        {
            // Note that the IsVisible property on the dockable window does not
            // seem to track the state of the window properly. Especially if the user
            // clicks the "Pin" icon to close the dockable window. This seems to be a reliable
            // method for re-opening the dockable window when this happens.
            // http://forums.arcgis.com/threads/11692-ArcGIS10-Add-Ins-and-Dockable-Window
            //
            ESRI.ArcGIS.esriSystem.IUID pUI = new ESRI.ArcGIS.esriSystem.UID();
            pUI.Value = ThisAddIn.IDs.GCDAddIn_ucProjectManager;

            ESRI.ArcGIS.Framework.IDockableWindow docWin = ArcMap.DockableWindowManager.GetDockableWindow((ESRI.ArcGIS.esriSystem.UID)pUI);
            if (docWin is ESRI.ArcGIS.Framework.IDockableWindow)
            {
                docWin.Show(bVisible);

                if (bVisible)
                {
                    try
                    {
                        // Try and refresh the project window.
                        ucProjectManager.AddinImpl winImpl = ESRI.ArcGIS.Desktop.AddIns.AddIn.FromID <ucProjectManager.AddinImpl>(ThisAddIn.IDs.GCDAddIn_ucProjectManager);
                        winImpl.UI.LoadTree();
                    }
                    catch (Exception ex)
                    {
                        naru.error.ExceptionUI.HandleException(ex, "Error Opening Project Explorer", GCDCore.Properties.Resources.NewIssueURL);
                    }
                }
            }
        }
        protected override void OnUpdate()
        {
            // the tool is enable only if the diagram is in memory
            try
            {
                if (ArcMap.Application == null)
                {
                    Enabled = false;
                    return;
                }

                SetTargetLayer();

                if (m_schematicLayer == null)
                {
                    Enabled = false;
                    return;
                }

                if (m_schematicLayer.IsEditingSchematicDiagram() == false)
                {
                    Enabled = false;
                    if (m_dockableWindow != null)
                    {
                        m_dockableWindow.Show(false);
                    }

                    return;
                }

                ISchematicInMemoryDiagram inMemoryDiagram = m_schematicLayer.SchematicInMemoryDiagram;

                if (inMemoryDiagram == null)
                {
                    Enabled = false;
                }
                else
                {
                    Enabled = true;
                }
            }
            catch (System.Exception e)
            {
                System.Windows.Forms.MessageBox.Show(e.Message);
            }
            return;
        }
예제 #3
0
        public btnLaunchWindow()
        {
            ESRI.ArcGIS.esriSystem.UID dockWinID = new ESRI.ArcGIS.esriSystem.UIDClass();
            dockWinID.Value = ThisAddIn.IDs.winTextToFeature;

            // Use GetDockableWindow directly as we want the client IDockableWindow not the internal class
            ESRI.ArcGIS.Framework.IDockableWindow dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID);

            dockWindow.Show(true);
        }
예제 #4
0
 private void WireDocumentEvents()
 {
     ArcMap.Events.CloseDocument += delegate()
     {
         if (m_dockWindow != null)
         {
             m_dockWindow.Show(false);
         }
         if (m_dockWindowInfo != null)
         {
             m_dockWindowInfo.Show(false);
         }
         if (m_dockWindowApply != null)
         {
             m_dockWindowApply.Show(false);
         }
     };
 }
        protected override void OnActivate()
        {
            try
            {
                this.Cursor = Cursors.Cross;

                CurrentDigitTool.CurrentTool.currentDigit = this;

                SetTargetLayer();

                ESRI.ArcGIS.Framework.IDockableWindowManager dockWinMgr = ArcMap.DockableWindowManager;
                UID u = new UID();
                u.Value = "DigitTool_DockableWindowCS";

                if (dockWinMgr == null)
                {
                    return;
                }

                m_dockableWindow = dockWinMgr.GetDockableWindow(u);

                if (m_dockableDigit == null)
                {
                    m_dockableDigit = CurrentDigitTool.CurrentTool.digitDockableWindow;
                }

                if (m_dockableDigit != null)
                {
                    m_dockableDigit.Init(m_schematicLayer);
                }

                m_dockableWindow.Show(true);

                CurrentDigitTool.CurrentTool.currentDockableWindow = m_dockableWindow;
            }
            catch (System.Exception e)
            {
                System.Windows.Forms.MessageBox.Show(e.Message);
            }
        }
        protected override void OnActivate()
        {
            try
            {
                this.Cursor = Cursors.Cross;

                CurrentDigitTool.CurrentTool.currentDigit = this;

                SetTargetLayer();

                ESRI.ArcGIS.Framework.IDockableWindowManager dockWinMgr = ArcMap.DockableWindowManager;
                UID u = new UID();
                u.Value = "DigitTool_DockableWindowCS";

                if (dockWinMgr == null)
                    return;

                m_dockableWindow = dockWinMgr.GetDockableWindow(u);

                if (m_dockableDigit == null)
                    m_dockableDigit = CurrentDigitTool.CurrentTool.digitDockableWindow;

                if (m_dockableDigit != null)
                    m_dockableDigit.Init(m_schematicLayer);

                m_dockableWindow.Show(true);

                CurrentDigitTool.CurrentTool.currentDockableWindow = m_dockableWindow;
            }
            catch (System.Exception e)
            {
                System.Windows.Forms.MessageBox.Show(e.Message);
            }
        }