Пример #1
0
        internal override void RestoreBookmark(ResultSetBookmark bookmark)
        {
            GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "Restoring from bookmark");

            Debug.Assert(bookmark is SAMMembersSetBookmark);
            SAMMembersSetBookmark samBookmark = (SAMMembersSetBookmark)bookmark;

            _groupsToVisit        = samBookmark.groupsToVisit;
            _groupsVisited        = samBookmark.groupsVisited;
            _group                = samBookmark.group;
            _membersEnumerator    = samBookmark.membersEnumerator;
            _current              = samBookmark.current;
            _currentFakePrincipal = samBookmark.currentFakePrincipal;
            _currentForeign       = samBookmark.currentForeign;
            _foreignMembers       = samBookmark.foreignMembers;
            _foreignGroups        = samBookmark.foreignGroups;

            if (_foreignResultSet != null)
            {
                _foreignResultSet.Dispose();
            }

            _foreignResultSet = samBookmark.foreignResultSet;
            _atBeginning      = samBookmark.atBeginning;
        }
Пример #2
0
        internal override ResultSetBookmark BookmarkAndReset()
        {
            SAMMembersSetBookmark sAMMembersSetBookmark = new SAMMembersSetBookmark();

            sAMMembersSetBookmark.groupsToVisit = this.groupsToVisit;
            this.groupsToVisit = new List <string>();
            string item = this.groupsVisited[0];

            sAMMembersSetBookmark.groupsVisited = this.groupsVisited;
            this.groupsVisited = new List <string>();
            this.groupsVisited.Add(item);
            sAMMembersSetBookmark.@group            = this.@group;
            sAMMembersSetBookmark.membersEnumerator = this.membersEnumerator;
            this.@group = this.originalGroup;
            UnsafeNativeMethods.IADsMembers aDsMember = [email protected]();
            this.membersEnumerator        = ((IEnumerable)aDsMember).GetEnumerator();
            sAMMembersSetBookmark.current = this.current;
            sAMMembersSetBookmark.currentFakePrincipal = this.currentFakePrincipal;
            sAMMembersSetBookmark.currentForeign       = this.currentForeign;
            this.current = null;
            this.currentFakePrincipal              = null;
            this.currentForeign                    = null;
            sAMMembersSetBookmark.foreignMembers   = this.foreignMembers;
            sAMMembersSetBookmark.foreignGroups    = this.foreignGroups;
            sAMMembersSetBookmark.foreignResultSet = this.foreignResultSet;
            this.foreignMembers                    = new List <DirectoryEntry>();
            this.foreignGroups                = new List <GroupPrincipal>();
            this.foreignResultSet             = null;
            sAMMembersSetBookmark.atBeginning = this.atBeginning;
            this.atBeginning = true;
            return(sAMMembersSetBookmark);
        }
Пример #3
0
        internal override void RestoreBookmark(ResultSetBookmark bookmark)
        {
            SAMMembersSetBookmark sAMMembersSetBookmark = (SAMMembersSetBookmark)bookmark;

            this.groupsToVisit        = sAMMembersSetBookmark.groupsToVisit;
            this.groupsVisited        = sAMMembersSetBookmark.groupsVisited;
            this.@group               = sAMMembersSetBookmark.@group;
            this.membersEnumerator    = sAMMembersSetBookmark.membersEnumerator;
            this.current              = sAMMembersSetBookmark.current;
            this.currentFakePrincipal = sAMMembersSetBookmark.currentFakePrincipal;
            this.currentForeign       = sAMMembersSetBookmark.currentForeign;
            this.foreignMembers       = sAMMembersSetBookmark.foreignMembers;
            this.foreignGroups        = sAMMembersSetBookmark.foreignGroups;
            if (this.foreignResultSet != null)
            {
                this.foreignResultSet.Dispose();
            }
            this.foreignResultSet = sAMMembersSetBookmark.foreignResultSet;
            this.atBeginning      = sAMMembersSetBookmark.atBeginning;
        }
Пример #4
0
        internal override ResultSetBookmark BookmarkAndReset()
        {
            GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "Bookmarking");

            SAMMembersSetBookmark bookmark = new SAMMembersSetBookmark();

            bookmark.groupsToVisit = _groupsToVisit;
            _groupsToVisit         = new List <string>();

            string originalGroupPath = _groupsVisited[0];

            bookmark.groupsVisited = _groupsVisited;
            _groupsVisited         = new List <string>();
            _groupsVisited.Add(originalGroupPath);

            bookmark.group             = _group;
            bookmark.membersEnumerator = _membersEnumerator;
            _group = _originalGroup;
            UnsafeNativeMethods.IADsMembers iADsMembers = _group.Members();
            _membersEnumerator = ((IEnumerable)iADsMembers).GetEnumerator();

            bookmark.current = _current;
            bookmark.currentFakePrincipal = _currentFakePrincipal;
            bookmark.currentForeign       = _currentForeign;
            _current = null;
            _currentFakePrincipal = null;
            _currentForeign       = null;

            bookmark.foreignMembers   = _foreignMembers;
            bookmark.foreignGroups    = _foreignGroups;
            bookmark.foreignResultSet = _foreignResultSet;
            _foreignMembers           = new List <DirectoryEntry>();
            _foreignGroups            = new List <GroupPrincipal>();
            _foreignResultSet         = null;

            bookmark.atBeginning = _atBeginning;
            _atBeginning         = true;

            return(bookmark);
        }
Пример #5
0
		internal override ResultSetBookmark BookmarkAndReset()
		{
			SAMMembersSetBookmark sAMMembersSetBookmark = new SAMMembersSetBookmark();
			sAMMembersSetBookmark.groupsToVisit = this.groupsToVisit;
			this.groupsToVisit = new List<string>();
			string item = this.groupsVisited[0];
			sAMMembersSetBookmark.groupsVisited = this.groupsVisited;
			this.groupsVisited = new List<string>();
			this.groupsVisited.Add(item);
			sAMMembersSetBookmark.@group = this.@group;
			sAMMembersSetBookmark.membersEnumerator = this.membersEnumerator;
			this.@group = this.originalGroup;
			UnsafeNativeMethods.IADsMembers aDsMember = [email protected]();
			this.membersEnumerator = ((IEnumerable)aDsMember).GetEnumerator();
			sAMMembersSetBookmark.current = this.current;
			sAMMembersSetBookmark.currentFakePrincipal = this.currentFakePrincipal;
			sAMMembersSetBookmark.currentForeign = this.currentForeign;
			this.current = null;
			this.currentFakePrincipal = null;
			this.currentForeign = null;
			sAMMembersSetBookmark.foreignMembers = this.foreignMembers;
			sAMMembersSetBookmark.foreignGroups = this.foreignGroups;
			sAMMembersSetBookmark.foreignResultSet = this.foreignResultSet;
			this.foreignMembers = new List<DirectoryEntry>();
			this.foreignGroups = new List<GroupPrincipal>();
			this.foreignResultSet = null;
			sAMMembersSetBookmark.atBeginning = this.atBeginning;
			this.atBeginning = true;
			return sAMMembersSetBookmark;
		}
Пример #6
0
        override internal ResultSetBookmark BookmarkAndReset()
        {
            GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "Bookmarking");

            SAMMembersSetBookmark bookmark = new SAMMembersSetBookmark();

            bookmark.groupsToVisit = _groupsToVisit;
            _groupsToVisit = new List<string>();

            string originalGroupPath = _groupsVisited[0];
            bookmark.groupsVisited = _groupsVisited;
            _groupsVisited = new List<string>();
            _groupsVisited.Add(originalGroupPath);

            bookmark.group = _group;
            bookmark.membersEnumerator = _membersEnumerator;
            _group = _originalGroup;
            UnsafeNativeMethods.IADsMembers iADsMembers = _group.Members();
            _membersEnumerator = ((IEnumerable)iADsMembers).GetEnumerator();

            bookmark.current = _current;
            bookmark.currentFakePrincipal = _currentFakePrincipal;
            bookmark.currentForeign = _currentForeign;
            _current = null;
            _currentFakePrincipal = null;
            _currentForeign = null;

            bookmark.foreignMembers = _foreignMembers;
            bookmark.foreignGroups = _foreignGroups;
            bookmark.foreignResultSet = _foreignResultSet;
            _foreignMembers = new List<DirectoryEntry>();
            _foreignGroups = new List<GroupPrincipal>();
            _foreignResultSet = null;

            bookmark.atBeginning = _atBeginning;
            _atBeginning = true;

            return bookmark;
        }