public IEnumerable <Type[]> GetGenericArgumentsCandidates() { IEnumerable <IEnumerable <Type> > product = Combinatorics.CartesianProduct(_genericConstraintsToType.Values); foreach (IEnumerable <Type> candidate in product) { yield return(candidate.ToArray()); } }
private void ClimbArray(Array array) { int dimension = array.Rank; IEnumerable <IEnumerable <int> > indexesSets = Enumerable.Range(0, dimension) .Select(index => Enumerable.Range(array.GetLowerBound(index), array.GetLength(index))); IEnumerable <IEnumerable <int> > allIndexes = Combinatorics.CartesianProduct(indexesSets.Reverse()); foreach (IEnumerable <int> indexSet in allIndexes) { int[] indices = indexSet.Reverse().ToArray(); IReflectionStateMember decorated = (IReflectionStateMember) _stateMemberProvider.ProvideArrayMember(array.GetType(), indices); Type runtimeMemberType = GetRuntimeMemberType(decorated, array); VisitMember(decorated, array, runtimeMemberType, false, false); } }