Private m_application As IApplication Private m_mxdocument As IMxDocument Private m_map As IMap Private m_pExt As IExtensionConfig Public Overrides Sub OnCreate(ByVal hook As Object) If Not hook Is Nothing Then m_application = CType(hook, IApplication) m_mxdocument = CType(m_application.Document, IMxDocument) m_map = m_mxdocument.ActivatedView.FocusMap m_pExt = CType(m_application.FindExtensionByName("myExt.extMain"), IExtensionConfig) 'blah End If End Sub Public Overrides ReadOnly Property Enabled() As Boolean Get m_mxdocument = CType(m_application.Document, IMxDocument) m_map = m_mxdocument.ActivatedView.FocusMap If (m_pExt IsNot Nothing) Then If (m_pExt.State = esriExtensionState.esriESEnabled And m_map.LayerCount > 0) Then Enabled = True Else Enabled = False End If Else Enabled = False End If End Get End Property
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.