public virtual IDerivation FindDerivation(string aName) { if (ParentDerivation != null) { return(ParentDerivation.FindDerivation(aName)); } return(null); }
public IDerivation GetAllDeque() { List <IDerivation> lList = new List <IDerivation>(TargetList.mList); if (null != TargetList.ParentDerivation) { DerivationBase lParent = TargetList.ParentDerivation.ParentDerivation; while (null != lParent) { IDerivation d = lParent.FindDerivation(TargetListName); if (d != null) { //string s = d.ToString(); ListDerivation ld = d as ListDerivation; if (null != ld) { lList.AddRange(ld.mList); lParent = ld.ParentDerivation; if (null != lParent) { lParent = lParent.ParentDerivation; } } } else { lParent = null; } } } int randIndex = lList.Count + 1; NormalDistribution nd = new NormalDistribution(0, 1000); while (randIndex >= lList.Count) { randIndex = Math.Abs(nd.intND()); } return(lList[randIndex]); }