ISessionStateItemCollection.Item[] 속성

정의

컬렉션의 값을 가져오거나 설정합니다.

오버로드

Item[Int32]

숫자 인덱스별로 컬렉션의 값을 가져오거나 설정합니다.

Item[String]

이름별로 컬렉션의 값을 가져오거나 설정합니다.

Item[Int32]

숫자 인덱스별로 컬렉션의 값을 가져오거나 설정합니다.

public:
 property System::Object ^ default[int] { System::Object ^ get(int index); void set(int index, System::Object ^ value); };
public object this[int index] { get; set; }
member this.Item(int) : obj with get, set
Default Public Property Item(index As Integer) As Object

매개 변수

index
Int32

컬렉션에 있는 값의 숫자 인덱스입니다.

속성 값

Object

지정된 인덱스에 저장된 컬렉션의 값입니다.

예제

다음 코드 예제에서는 세션 변수 이름 및 값을 저장 하는 데 사용 SortedList 하는 속성의 Item[Int32] 구현을 보여 있습니다. 인터페이스의 전체 구현 ISessionStateItemCollection 예제는 인터페이스 개요에 제공된 예제를 ISessionStateItemCollection 참조하세요.

public object this[int index]
{
  get { return pItems[index]; }
  set
  {
    pItems[index] = value;
    pDirty = true;
  }
}
Public Property Item(index As Integer) As Object Implements ISessionStateItemCollection.Item
  Get
    Return pItems(index)
  End Get
  Set
    pItems(index) = value
    pDirty = True
  End Set
End Property

추가 정보

적용 대상

Item[String]

이름별로 컬렉션의 값을 가져오거나 설정합니다.

public:
 property System::Object ^ default[System::String ^] { System::Object ^ get(System::String ^ name); void set(System::String ^ name, System::Object ^ value); };
public object this[string name] { get; set; }
member this.Item(string) : obj with get, set
Default Public Property Item(name As String) As Object

매개 변수

name
String

컬렉션에 있는 값의 키 이름입니다.

속성 값

Object

컬렉션에 있는 지정된 이름의 값입니다.

예제

다음 코드 예제에서는 세션 변수 이름 및 값을 저장 하는 데 사용 SortedList 하는 속성의 Item[String] 구현을 보여 있습니다. 인터페이스의 전체 구현 ISessionStateItemCollection 예제는 인터페이스 개요에 제공된 예제를 ISessionStateItemCollection 참조하세요.

public object this[string name]
{
  get { return pItems[name]; }
  set
  {
    pItems[name] = value;
    pDirty = true;
  }
}
Public Property Item(name As String) As Object Implements ISessionStateItemCollection.Item
  Get
    Return pItems(name)
  End Get
  Set
    pItems(name) = value
    pDirty = True
  End Set
End Property

추가 정보

적용 대상