ArcIMS Select Buffer tool
ArcIMS_SelectBufferTool_VBNet\App_Code\LayerNames.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
Imports System.Data
Imports System.Configuration
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Imports System.Collections
Imports System.Collections.Generic

' Layer names for dynamic layers
Public Class LayerNames : Implements IEnumerator, IEnumerable

    Public Shared ReadOnly SelectionToolActive As String = "selectiontoolactive"
    Public Shared ReadOnly SelectionToolTarget As String = "selectiontooltarget"
    Public Shared ReadOnly SelectionToolBuffer As String = "selectiontoolbuffer"
    Public Shared ReadOnly BufferToolLine As String = "buffertoolline"
    Public Shared ReadOnly BufferToolTarget As String = "buffertooltarget"

    Private position As Integer = -1
    Private layers() As String = _
                       { _
                        New String(SelectionToolActive), _
                        New String(SelectionToolTarget), _
                        New String(SelectionToolBuffer), _
                        New String(BufferToolLine), _
                        New String(BufferToolTarget) _
                       }

    Public Function GetEnumerator() As IEnumerator Implements IEnumerable.GetEnumerator
        Return CType(Me, IEnumerator)
    End Function

    Public Function MoveNext() As Boolean Implements IEnumerator.MoveNext
        position += 1
        Return (position < layers.Length)
    End Function

    Public Sub Reset() Implements IEnumerator.Reset
        position = -1
    End Sub

    Public ReadOnly Property Current() As Object Implements IEnumerator.Current
        Get
            Return layers(position)
        End Get
    End Property

End Class