コード例 #1
0
 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");
     }
 }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: GroupMemberDiff.cs プロジェクト: lulzzz/Grouper
 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;
 }
コード例 #4
0
 public void IntersectWith(GroupMemberCollection collection) => _members.IntersectWith(collection.AsEnumerable());
コード例 #5
0
 public void SymmetricExceptWith(GroupMemberCollection collection) => _members.SymmetricExceptWith(collection.AsEnumerable());
コード例 #6
0
 public void Add(GroupMemberCollection collection) => _members.UnionWith(collection.AsEnumerable());