static OverloadGroupEquivalenceInfo GetOverloadGroupEquivalence(Dictionary <string, List <RuntimeArgument> > groupDefinitions) { OverloadGroupEquivalenceInfo overloadGroupsInfo = new OverloadGroupEquivalenceInfo(); if (!groupDefinitions.IsNullOrEmpty()) { string[] groupNames = new string[groupDefinitions.Count]; groupDefinitions.Keys.CopyTo(groupNames, 0); for (int i = 0; i < groupNames.Length; i++) { string group1 = groupNames[i]; HashSet <RuntimeArgument> group1Args = new HashSet <RuntimeArgument>(groupDefinitions[group1]); for (int j = i + 1; j < groupNames.Length; j++) { string group2 = groupNames[j]; HashSet <RuntimeArgument> group2Args = new HashSet <RuntimeArgument>(groupDefinitions[group2]); if (group1Args.IsProperSupersetOf(group2Args)) { overloadGroupsInfo.SetAsSuperset(group1, group2); } else if (group1Args.IsProperSubsetOf(group2Args)) { overloadGroupsInfo.SetAsSuperset(group2, group1); } else if (group1Args.SetEquals(group2Args)) { overloadGroupsInfo.SetAsEquivalent(group1, group2); } else if (group1Args.Overlaps(group2Args)) { overloadGroupsInfo.SetAsOverlapping(group1, group2); } else // the groups are disjoint. { overloadGroupsInfo.SetAsDisjoint(group1, group2); } } } } return(overloadGroupsInfo); }
private static OverloadGroupEquivalenceInfo GetOverloadGroupEquivalence(Dictionary <string, List <RuntimeArgument> > groupDefinitions) { OverloadGroupEquivalenceInfo info = new OverloadGroupEquivalenceInfo(); if (!groupDefinitions.IsNullOrEmpty()) { string[] array = new string[groupDefinitions.Count]; groupDefinitions.Keys.CopyTo(array, 0); for (int i = 0; i < array.Length; i++) { string str = array[i]; HashSet <RuntimeArgument> set = new HashSet <RuntimeArgument>(groupDefinitions[str]); for (int j = i + 1; j < array.Length; j++) { string str2 = array[j]; HashSet <RuntimeArgument> other = new HashSet <RuntimeArgument>(groupDefinitions[str2]); if (set.IsProperSupersetOf(other)) { info.SetAsSuperset(str, str2); } else if (set.IsProperSubsetOf(other)) { info.SetAsSuperset(str2, str); } else if (set.SetEquals(other)) { info.SetAsEquivalent(str, str2); } else if (set.Overlaps(other)) { info.SetAsOverlapping(str, str2); } else { info.SetAsDisjoint(str, str2); } } } } return(info); }
static OverloadGroupEquivalenceInfo GetOverloadGroupEquivalence(Dictionary<string, List<RuntimeArgument>> groupDefinitions) { OverloadGroupEquivalenceInfo overloadGroupsInfo = new OverloadGroupEquivalenceInfo(); if (!groupDefinitions.IsNullOrEmpty()) { string[] groupNames = new string[groupDefinitions.Count]; groupDefinitions.Keys.CopyTo(groupNames, 0); for (int i = 0; i < groupNames.Length; i++) { string group1 = groupNames[i]; HashSet<RuntimeArgument> group1Args = new HashSet<RuntimeArgument>(groupDefinitions[group1]); for (int j = i + 1; j < groupNames.Length; j++) { string group2 = groupNames[j]; HashSet<RuntimeArgument> group2Args = new HashSet<RuntimeArgument>(groupDefinitions[group2]); if (group1Args.IsProperSupersetOf(group2Args)) { overloadGroupsInfo.SetAsSuperset(group1, group2); } else if (group1Args.IsProperSubsetOf(group2Args)) { overloadGroupsInfo.SetAsSuperset(group2, group1); } else if (group1Args.SetEquals(group2Args)) { overloadGroupsInfo.SetAsEquivalent(group1, group2); } else if (group1Args.Overlaps(group2Args)) { overloadGroupsInfo.SetAsOverlapping(group1, group2); } else // the groups are disjoint. { overloadGroupsInfo.SetAsDisjoint(group1, group2); } } } } return overloadGroupsInfo; }
private static OverloadGroupEquivalenceInfo GetOverloadGroupEquivalence(Dictionary<string, List<RuntimeArgument>> groupDefinitions) { OverloadGroupEquivalenceInfo info = new OverloadGroupEquivalenceInfo(); if (!groupDefinitions.IsNullOrEmpty()) { string[] array = new string[groupDefinitions.Count]; groupDefinitions.Keys.CopyTo(array, 0); for (int i = 0; i < array.Length; i++) { string str = array[i]; HashSet<RuntimeArgument> set = new HashSet<RuntimeArgument>(groupDefinitions[str]); for (int j = i + 1; j < array.Length; j++) { string str2 = array[j]; HashSet<RuntimeArgument> other = new HashSet<RuntimeArgument>(groupDefinitions[str2]); if (set.IsProperSupersetOf(other)) { info.SetAsSuperset(str, str2); } else if (set.IsProperSubsetOf(other)) { info.SetAsSuperset(str2, str); } else if (set.SetEquals(other)) { info.SetAsEquivalent(str, str2); } else if (set.Overlaps(other)) { info.SetAsOverlapping(str, str2); } else { info.SetAsDisjoint(str, str2); } } } } return info; }