예제 #1
0
      public StackDebugView(Stack stack)
      {
        if (stack == null)
          throw new ArgumentNullException("stack");

        this.stack = stack;
      }
예제 #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;
      }
예제 #3
0
    public static Stack Synchronized(Stack stack)
    {
      if (stack == null)
        throw new Exception();

      return new SyncStack(stack);
    }
예제 #4
0
 internal SyncStack(Stack stack)
 {
   // Contract.Requires(stack != null);
   _s = stack;
   _root = stack.SyncRoot;
 }
예제 #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;
    }