Partager via


ContextStack.Push(Object) Méthode

Définition

Exécute un push de l'objet spécifié, ou place l'objet, dans la pile.

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

Paramètres

context
Object

Objet de contexte devant faire l'objet d'un push dans la pile.

Exceptions

context a la valeur null.

Exemples

L’exemple de code suivant illustre l’envoi de valeurs vers un 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

S’applique à