Common Custom EditorTask
Common_CustomEditorTask_CSharp\CustomEditorTask_CSharp\CustomEditorSettingsPanel.cs
// 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.
// 

namespace CustomEditorTask_CSharp
{
    public class CustomEditorSettingsPanel : ESRI.ArcGIS.ADF.ArcGISServer.Editor.EditorSettingsPanel
    {                
        public CustomEditorSettingsPanel(CustomEditorTask customEditorTask) : base(customEditorTask) { }

        // Override creation of the Editor panels in the Settings panel so we can include the CustomSnappingPanel
        protected override System.Collections.Generic.List<ESRI.ArcGIS.ADF.ArcGISServer.Editor.EditorPanel> 
            CreateEditorPanels()
        {            
            System.Collections.Generic.List<ESRI.ArcGIS.ADF.ArcGISServer.Editor.EditorPanel> settingsEditorPanelList = 
                new System.Collections.Generic.List<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).
            CustomEditorTask customEditorTask = (CustomEditorTask)this.Task;
            ESRI.ArcGIS.ADF.ArcGISServer.Editor.EditorPanel snappingPanel = null;

            // If map units are being used for snapping, use the CustomSnappingPanel.  Otherwise, use the default
            if (customEditorTask.UseMapUnitsForSnapping)
            {
                snappingPanel = new CustomSnappingPanel(this.Task);
                // Set to false to hide panel
                snappingPanel.Visible = true;
            }
            else
            {
                snappingPanel = new ESRI.ArcGIS.ADF.ArcGISServer.Editor.SnappingPanel(this.Task);
            }
            // Add the snapping panel
            settingsEditorPanelList.Add(snappingPanel);

            // Create and add the default selection settings panel
            ESRI.ArcGIS.ADF.ArcGISServer.Editor.EditorPanel selectionPanel = 
                new ESRI.ArcGIS.ADF.ArcGISServer.Editor.SelectionPanel(this.Task);
            settingsEditorPanelList.Add(selectionPanel);            
            
            // Create and add the custom polygon to polyline layer settings panel
            PolygonToLineLayerEditorPanel customPolygonToLinePanel = 
                new PolygonToLineLayerEditorPanel("Polygon to Polyline Settings", this.Task, "P2PPanel");
            settingsEditorPanelList.Add(customPolygonToLinePanel);

            return settingsEditorPanelList;
        }              
    }
}