예제 #1
0
            public HitTestEnumerator(IVisualNode root, Func <IVisual, bool>?filter, Point point, IVisualNode sceneRoot)
            {
                _nodeStack = new PooledStack <Entry>();
                _nodeStack.Push(new Entry(root, false, null, true));

                _filter    = filter;
                _point     = point;
                _sceneRoot = sceneRoot;

                _current = null;
            }
예제 #2
0
        protected static PooledStack <int> CreatePooled(int size)
        {
            var rand  = new Random(RAND_SEED);
            var stack = new PooledStack <int>(size);

            for (int i = 0; i < size; i++)
            {
                stack.Push(rand.Next());
            }
            return(stack);
        }
예제 #3
0
        protected PooledStack <T> GenericStackFactory(int count)
        {
            PooledStack <T> stack = new PooledStack <T>(count);

            RegisterForDispose(stack);
            int seed = count * 34;

            for (int i = 0; i < count; i++)
            {
                stack.Push(CreateT(seed++));
            }
            return(stack);
        }
예제 #4
0
 public void PooledPush()
 {
     if (Type == StackType.Int)
     {
         var stack = new PooledStack <int>();
         for (int i = 0; i < N; i++)
         {
             stack.Push(intArray[i]);
         }
         stack.Dispose();
     }
     else
     {
         var stack = new PooledStack <string>();
         for (int i = 0; i < N; i++)
         {
             stack.Push(stringArray[i]);
         }
         stack.Dispose();
     }
 }