Share via


ContextStack.Push(Object) 메서드

정의

지정된 개체를 스택에 푸시하거나 저장합니다.

public:
 void Push(System::Object ^ context);
public void Push (object context);
member this.Push : obj -> unit
Public Sub Push (context As Object)

매개 변수

context
Object

스택에 푸시할 컨택스트 개체입니다.

예외

context이(가) null인 경우

예제

다음 코드 예제에서는으로 값을 푸시하는 ContextStack합니다.

// Push ten items on to the stack and output the value of each.
for ( int number = 0; number < 10; number++ )
{
   Console::WriteLine( "Value pushed to stack: {0}", number );
   stack->Push( number );
}
// Push ten items on to the stack and output the value of each.
for( int number = 0; number < 10; number ++ )
{
    Console.WriteLine( "Value pushed to stack: "+number.ToString() );
    stack.Push( number );
}
' Push ten items on to the stack and output the value of each.
Dim number As Integer
For number = 0 To 9
    Console.WriteLine(("Value pushed to stack: " + number.ToString()))
    stack.Push(number)
Next number

적용 대상