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