Imports System.Runtime.InteropServices
Imports ESRI.ArcGIS.Framework
Imports ESRI.ArcGIS.ADF.CATIDs
<ComClass(DockWin.ClassId, DockWin.InterfaceId, DockWin.EventsId), _
ProgId("IMKPO.DockWin")> _
Public Class DockWin
Implements IDockableWindowDef
Dim m_pfrmDockWin As New frmDockWin
#Region "COM GUIDs"
' These GUIDs provide the COM identity for this class
' and its COM interfaces. If you change them, existing
' clients will no longer be able to access the class.
Public Const ClassId As String = "454b8fc7-5ec1-4b8e-a264-2ac4ce5dfd12"
Public Const InterfaceId As String = "e0b2d512-855e-4fe7-b5be-27942d36a8d3"
Public Const EventsId As String = "f6a8224d-798d-42b0-b300-b505d83f2e3f"
#End Region
#Region "COM Registration Function(s)"
<ComRegisterFunction(), ComVisibleAttribute(False)> _
Public Shared Sub RegisterFunction(ByVal registerType As Type)
' Required for ArcGIS Component Category Registrar support
ArcGISCategoryRegistration(registerType)
'Add any COM registration code after the ArcGISCategoryRegistration() call
End Sub
<ComUnregisterFunction(), ComVisibleAttribute(False)> _
Public Shared Sub UnregisterFunction(ByVal registerType As Type)
' Required for ArcGIS Component Category Registrar support
ArcGISCategoryUnregistration(registerType)
'Add any COM unregistration code after the ArcGISCategoryUnregistration() call
End Sub
#Region "ArcGIS Component Category Registrar generated code"
Private Shared Sub ArcGISCategoryRegistration(ByVal registerType As Type)
Dim regKey As String = String.Format("HKEY_CLASSES_ROOT\CLSID\{{{0}}}", registerType.GUID)
MxDockableWindows.Register(regKey)
'MxCommands.Register(regKey)
End Sub
Private Shared Sub ArcGISCategoryUnregistration(ByVal registerType As Type)
Dim regKey As String = String.Format("HKEY_CLASSES_ROOT\CLSID\{{{0}}}", registerType.GUID)
MxDockableWindows.Unregister(regKey)
'MxCommands.Unregister(regKey)
End Sub
#End Region
#End Region
' A creatable COM class must have a Public Sub New()
' with no parameters, otherwise, the class will not be
' registered in the COM registry and cannot be created
' via CreateObject.
Public Sub New()
MyBase.New()
End Sub
Public ReadOnly Property Caption() As String Implements ESRI.ArcGIS.Framework.IDockableWindowDef.Caption
Get
Caption = " Points monitoring"
End Get
End Property
Public ReadOnly Property ChildHWND() As Integer Implements ESRI.ArcGIS.Framework.IDockableWindowDef.ChildHWND
Get
ChildHWND = m_pfrmDockWin.Panel1.Handle.ToInt32()
End Get
End Property
Public ReadOnly Property Name() As String Implements ESRI.ArcGIS.Framework.IDockableWindowDef.Name
Get
Name = "twPointsMonitoring"
End Get
End Property
Public Sub OnCreate(ByVal hook As Object) Implements ESRI.ArcGIS.Framework.IDockableWindowDef.OnCreate
'm_pfrmDockWin = New frmDockWin
'Dim pTR As Windows.Forms.TreeView
'pTR = New Windows.Forms.TreeView
'm_pfrmDockWin.Controls.Add(pTR)
'pTR.Dock = Windows.Forms.DockStyle.Fill
End Sub
Public Sub OnDestroy() Implements ESRI.ArcGIS.Framework.IDockableWindowDef.OnDestroy
End Sub
Public ReadOnly Property UserData() As Object Implements ESRI.ArcGIS.Framework.IDockableWindowDef.UserData
Get
UserData = m_pfrmDockWin.Panel1
End Get
End Property
End Class
Imports System.Runtime.InteropServices
Imports System.Drawing
Imports ESRI.ArcGIS.ADF.BaseClasses
Imports ESRI.ArcGIS.ADF.CATIDs
Imports ESRI.ArcGIS.Controls
Imports ESRI.ArcGIS.Framework
<ComClass(CmdDockWin.ClassId, CmdDockWin.InterfaceId, CmdDockWin.EventsId), _
ProgId("IMKPO.CmdDockWin")> _
Public NotInheritable Class CmdDockWin
Inherits BaseCommand
#Region "COM GUIDs"
' These GUIDs provide the COM identity for this class
' and its COM interfaces. If you change them, existing
' clients will no longer be able to access the class.
Public Const ClassId As String = "c3b23df7-b090-4a55-a292-43f3e3c913f4"
Public Const InterfaceId As String = "9dacc4e0-2660-4273-9827-c736a0105561"
Public Const EventsId As String = "46039c94-d0d4-4716-afc1-9af9be673fb5"
#End Region
#Region "COM Registration Function(s)"
<ComRegisterFunction(), ComVisibleAttribute(False)> _
Public Shared Sub RegisterFunction(ByVal registerType As Type)
' Required for ArcGIS Component Category Registrar support
ArcGISCategoryRegistration(registerType)
'Add any COM registration code after the ArcGISCategoryRegistration() call
End Sub
<ComUnregisterFunction(), ComVisibleAttribute(False)> _
Public Shared Sub UnregisterFunction(ByVal registerType As Type)
' Required for ArcGIS Component Category Registrar support
ArcGISCategoryUnregistration(registerType)
'Add any COM unregistration code after the ArcGISCategoryUnregistration() call
End Sub
#Region "ArcGIS Component Category Registrar generated code"
Private Shared Sub ArcGISCategoryRegistration(ByVal registerType As Type)
Dim regKey As String = String.Format("HKEY_CLASSES_ROOT\CLSID\{{{0}}}", registerType.GUID)
&