Example #1
0
 public void Add(With element)
 {
     int n = this.elements.Length;
     int i = this.length++;
     if (i == n)
     {
         int m = n * 2; if (m < 16) m = 16;
         With[] newElements = new With[m];
         for (int j = 0; j < n; j++) newElements[j] = elements[j];
         this.elements = newElements;
     }
     this.elements[i] = element;
 }
Example #2
0
 public WithList(int capacity)
 {
     this.elements = new With[capacity];
 }
Example #3
0
 public WithList(params With[] elements)
 {
     if (elements == null) elements = new With[0];
     this.elements = elements;
     this.length = elements.Length;
 }
Example #4
0
 public WithList()
 {
     this.elements = new With[16];
 }