public GroupMemberDiff(GrouperDocument document, GroupMemberCollection addMemberCollection, GroupMemberCollection removeMemberCollection, GroupMemberCollection unchangedMemberCollection, double changeRatio) { Document = document ?? throw new ArgumentNullException(nameof(document)); Add = addMemberCollection?.AsEnumerable() ?? throw new ArgumentNullException(nameof(addMemberCollection)); Remove = removeMemberCollection?.AsEnumerable() ?? throw new ArgumentNullException(nameof(removeMemberCollection)); Unchanged = unchangedMemberCollection?.AsEnumerable() ?? throw new ArgumentNullException(nameof(unchangedMemberCollection)); ChangeRatio = changeRatio; if (addMemberCollection == removeMemberCollection || addMemberCollection == unchangedMemberCollection || removeMemberCollection == unchangedMemberCollection) { throw new ArgumentException("All collections must be separate objects"); } }
private static int MemberTypesAsFlags(GroupMemberCollection collection) { int flags = 0; foreach (GroupMember member in collection.AsEnumerable()) { if (member.MemberType == GroupMemberTypes.OnPremAd) { flags |= 1; } else // AzureAd { flags |= 2; } } return(flags); }
public GroupMemberDiff(GrouperDocument document, GroupMemberCollection addMemberCollection, GroupMemberCollection removeMemberCollection, GroupMemberCollection unchangedMemberCollection, double changeRatio) { if (addMemberCollection is null) { throw new ArgumentNullException(nameof(addMemberCollection)); } if (removeMemberCollection is null) { throw new ArgumentNullException(nameof(removeMemberCollection)); } if (unchangedMemberCollection is null) { throw new ArgumentNullException(nameof(unchangedMemberCollection)); } Document = document ?? throw new ArgumentNullException(nameof(document)); Add = addMemberCollection.AsEnumerable(); Remove = removeMemberCollection.AsEnumerable(); Unchanged = unchangedMemberCollection.AsEnumerable(); ChangeRatio = changeRatio; }
public void IntersectWith(GroupMemberCollection collection) => _members.IntersectWith(collection.AsEnumerable());
public void SymmetricExceptWith(GroupMemberCollection collection) => _members.SymmetricExceptWith(collection.AsEnumerable());
public void Add(GroupMemberCollection collection) => _members.UnionWith(collection.AsEnumerable());