Exemplo n.º 1
0
        private void CalculateDependenciesAndRoots()
        {
            if (!_invalidStateInputOutput)
            {
                return;
            }

            _invalidStateInputOutput = false;

            IVariationGeneratorCollection possibleRoots = new IVariationGeneratorCollection();

            foreach (IVariationGenerator vg in Generators)
            {
                if (possibleRoots.Contains(vg))
                {
                    throw new InvalidOperationException("Cannot have the same IVariationGenerator twice as child of the TXR.");
                }

                possibleRoots.Add(vg);

                FindAndRemoveFalseRoots(possibleRoots, vg);
            }

            _vgRoots = possibleRoots;
        }
Exemplo n.º 2
0
        private static void FindAndRemoveFalseRoots(IVariationGeneratorCollection possibleRoots, IVariationGenerator vg)
        {
            foreach (IVariationGenerator childVG in vg.Dependencies)
            {
                if (possibleRoots.Contains(childVG))
                {
                    possibleRoots.Remove(childVG);
                }

                FindAndRemoveFalseRoots(possibleRoots, childVG);
            }
        }
Exemplo n.º 3
0
 ///<summary>
 ///</summary>
 public TestExtenderGraph()
 {
     _vgCollection = new IVariationGeneratorCollection();
     _vgCollection.CollectionChanged += new EventHandler(_vgCollection_CollectionChanged);
     _currentTXR = this;
 }