ContextStack.Push(Object) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將指定的物件推入或放置到堆疊上。
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