ContextStack.Push(Object) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Pushes, or places, the specified object onto the stack.
public:
void Push(System::Object ^ context);
public void Push (object context);
member this.Push : obj -> unit
Public Sub Push (context As Object)
Parameters
- context
- Object
The context object to push onto the stack.
Exceptions
context
is null
.
Examples
The following code example demonstrates pushing values to a 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
Applies to
Συνεργαστείτε μαζί μας στο GitHub
Μπορείτε να βρείτε την πηγή για αυτό το περιεχόμενο στο GitHub, όπου μπορείτε επίσης να δημιουργήσετε και να εξετάσετε ζητήματα και αιτήματα έλξης. Για περισσότερες πληροφορίες, ανατρέξτε στον οδηγό συνεργατών.