Imports System.Runtime.InteropServices Imports ESRI.ArcGIS.Carto Imports ESRI.ArcGIS.esriSystem Imports ESRI.ArcGIS.Geometry Imports ESRI.ArcGIS.Display <Guid("E9CB507B-9A23-4272-B4E6-65AE059DEBD4"), ComVisible(True), ClassInterface(ClassInterfaceType.None), ProgId("AnchorPP.TestLayer")> Public Class TestLayer : Implements ILayer, IPersistVariant Private m_point As IPoint = Nothing Private m_UID As UID Public Sub New() MyBase.New() m_point = New PointClass() End Sub Public ReadOnly Property AreaOfInterest As ESRI.ArcGIS.Geometry.IEnvelope Implements ESRI.ArcGIS.Carto.ILayer.AreaOfInterest Get End Get End Property Public Property Cached As Boolean Implements ESRI.ArcGIS.Carto.ILayer.Cached Get Return False End Get Set(ByVal value As Boolean) End Set End Property Public Sub Draw(ByVal DrawPhase As ESRI.ArcGIS.esriSystem.esriDrawPhase, ByVal Display As ESRI.ArcGIS.Display.IDisplay, ByVal TrackCancel As ESRI.ArcGIS.esriSystem.ITrackCancel) Implements ESRI.ArcGIS.Carto.ILayer.Draw m_point.X = My.Document.ActiveView.Extent.XMin + My.Document.ActiveView.Extent.Width \ 2 m_point.Y = My.Document.ActiveView.Extent.YMin + My.Document.ActiveView.Extent.Height \ 2 Dim simplepointsymbol As New SimpleMarkerSymbol Dim red As New RgbColor red.Red = 255 simplepointsymbol.Color = red simplepointsymbol.Size = 5 simplepointsymbol.Style = esriSimpleMarkerStyle.esriSMSCircle Display.SetSymbol(simplepointsymbol) Display.DrawPoint(m_point) End Sub Public Property MaximumScale As Double Implements ESRI.ArcGIS.Carto.ILayer.MaximumScale Get End Get Set(ByVal value As Double) End Set End Property Public Property MinimumScale As Double Implements ESRI.ArcGIS.Carto.ILayer.MinimumScale Get End Get Set(ByVal value As Double) End Set End Property Public Property Name As String Implements ESRI.ArcGIS.Carto.ILayer.Name Get Return "TestLayer" End Get Set(ByVal value As String) End Set End Property Public Property ShowTips As Boolean Implements ESRI.ArcGIS.Carto.ILayer.ShowTips Get End Get Set(ByVal value As Boolean) End Set End Property Public WriteOnly Property SpatialReference As ESRI.ArcGIS.Geometry.ISpatialReference Implements ESRI.ArcGIS.Carto.ILayer.SpatialReference Set(ByVal value As ESRI.ArcGIS.Geometry.ISpatialReference) End Set End Property Public ReadOnly Property SupportedDrawPhases As Integer Implements ESRI.ArcGIS.Carto.ILayer.SupportedDrawPhases Get Return CInt(esriDrawPhase.esriDPGeography) End Get End Property Public ReadOnly Property TipText(ByVal x As Double, ByVal y As Double, ByVal Tolerance As Double) As String Implements ESRI.ArcGIS.Carto.ILayer.TipText Get End Get End Property Public ReadOnly Property Valid As Boolean Implements ESRI.ArcGIS.Carto.ILayer.Valid Get Return True End Get End Property Public Property Visible As Boolean Implements ESRI.ArcGIS.Carto.ILayer.Visible Get Return True End Get Set(ByVal value As Boolean) End Set End Property Public ReadOnly Property ID As ESRI.ArcGIS.esriSystem.UID Implements ESRI.ArcGIS.esriSystem.IPersistVariant.ID Get m_UID = New UID m_UID.Value = "{" & Me.GetType.GUID.ToString & "}" Return m_UID End Get End Property Public Sub Load(ByVal Stream As ESRI.ArcGIS.esriSystem.IVariantStream) Implements ESRI.ArcGIS.esriSystem.IPersistVariant.Load Dim value = Stream.Read End Sub Public Sub Save(ByVal Stream As ESRI.ArcGIS.esriSystem.IVariantStream) Implements ESRI.ArcGIS.esriSystem.IPersistVariant.Save Stream.Write("some value") End Sub End Class
Solved! Go to Solution.