次の方法で共有


ContextStack.Pop メソッド

スタックから現在のオブジェクトをポップ (削除) し、オブジェクトの値を返します。

Public Function Pop() As Object
[C#]
public object Pop();
[C++]
public: Object* Pop();
[JScript]
public function Pop() : Object;

戻り値

スタックからポップされたオブジェクト。スタック上にオブジェクトがない場合は、 null 参照 (Visual Basic では Nothing) を返します。

使用例

[Visual Basic, C#, C++] ContextStack から値をポップするコード例を次に示します。

 
' 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

[C#] 
// 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 );
}

[C++] 
// Push ten items on to the stack and output the value of each.
for( int number = 0; number < 10; number ++ )
{
   Console::WriteLine( S"Value pushed to stack: {0}", __box(number));
   stack->Push(__box(number));
}

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

ContextStack クラス | ContextStack メンバ | System.ComponentModel.Design.Serialization 名前空間