Common Custom EditorTask
Common_CustomEditorTask_VBNet\CustomEditorTask_VBNet\CustomEditorSettingsPanel.vb
' Copyright 2010 ESRI
' 
' All rights reserved under the copyright laws of the United States
' and applicable international laws, treaties, and conventions.
' 
' You may freely redistribute and use this sample code, with or
' without modification, provided you include the original copyright
' notice and use restrictions.
' 
' See the use restrictions.
' 

Imports Microsoft.VisualBasic
Imports System
Namespace CustomEditorTask_VBNet
  Public Class CustomEditorSettingsPanel
    Inherits ESRI.ArcGIS.ADF.ArcGISServer.Editor.EditorSettingsPanel
    Public Sub New(ByVal customEditorTask As CustomEditorTask)
      MyBase.New(customEditorTask)
    End Sub

    ' Override creation of the Editor panels in the Settings panel so we can include the CustomSnappingPanel
    Protected Overrides Function CreateEditorPanels() As System.Collections.Generic.List(Of ESRI.ArcGIS.ADF.ArcGISServer.Editor.EditorPanel)
      Dim settingsEditorPanelList As System.Collections.Generic.List(Of ESRI.ArcGIS.ADF.ArcGISServer.Editor.EditorPanel) = New System.Collections.Generic.List(Of ESRI.ArcGIS.ADF.ArcGISServer.Editor.EditorPanel)()

      ' Create the snapping settings panel.  Get a reference to the custom EditorTask 
      ' to access custom properties (i.e. whether to snap in pixel or map units).
      Dim customEditorTask As CustomEditorTask = CType(Me.Task, CustomEditorTask)
      Dim snappingPanel As ESRI.ArcGIS.ADF.ArcGISServer.Editor.EditorPanel = Nothing

      ' If map units are being used for snapping, use the CustomSnappingPanel.  Otherwise, use the default
      If customEditorTask.UseMapUnitsForSnapping Then
        snappingPanel = New CustomSnappingPanel(Me.Task)
        ' Set to false to hide panel
        snappingPanel.Visible = True
      Else
        snappingPanel = New ESRI.ArcGIS.ADF.ArcGISServer.Editor.SnappingPanel(Me.Task)
      End If
      ' Add the snapping panel
      settingsEditorPanelList.Add(snappingPanel)

      ' Create and add the default selection settings panel
      Dim selectionPanel As ESRI.ArcGIS.ADF.ArcGISServer.Editor.EditorPanel = New ESRI.ArcGIS.ADF.ArcGISServer.Editor.SelectionPanel(Me.Task)
      settingsEditorPanelList.Add(selectionPanel)

      ' Create and add the custom polygon to polyline layer settings panel
      Dim customPolygonToLinePanel As PolygonToLineLayerEditorPanel = New PolygonToLineLayerEditorPanel("Polygon to Polyline Settings", Me.Task, "P2PPanel")
      settingsEditorPanelList.Add(customPolygonToLinePanel)

      Return settingsEditorPanelList
    End Function
  End Class
End Namespace