Exemplo n.º 1
0
      public StackDebugView(Stack stack)
      {
        if (stack == null)
          throw new ArgumentNullException("stack");

        this.stack = stack;
      }
Exemplo n.º 2
0
      internal StackEnumerator(Stack stack)
      {
        // Contract.Requires(stack != null);
        // Contract.Requires(stack._array != null);
        Contract.Requires(stack._size <= stack._array.Length);

        _stack = stack;
        _version = _stack._version;
        _index = -2;
        currentElement = null;
      }
Exemplo n.º 3
0
    public static Stack Synchronized(Stack stack)
    {
      if (stack == null)
        throw new Exception();

      return new SyncStack(stack);
    }
Exemplo n.º 4
0
 internal SyncStack(Stack stack)
 {
   // Contract.Requires(stack != null);
   _s = stack;
   _root = stack.SyncRoot;
 }
Exemplo n.º 5
0
    public virtual Object Clone()
    {
      // Contract.Ensures(Contract.Result<Object>() != null);

      Stack s = new Stack(_size);

      s._size = _size;
      Array.Copy(_array, 0, s._array, 0, _size);
      s._version = _version;
      
      return s;
    }