Disco.Services.Interop.ActiveDirectory.ActiveDirectoryContext.UpdateSearchAllForestServers C# (CSharp) Method

UpdateSearchAllForestServers() public method

public UpdateSearchAllForestServers ( DiscoDataContext Database, bool SearchAllForestServers ) : bool
Database Disco.Data.Repository.DiscoDataContext
SearchAllForestServers bool
return bool
        public bool UpdateSearchAllForestServers(DiscoDataContext Database, bool SearchAllForestServers)
        {
            if (SearchAllForestServers == false)
            {
                Database.DiscoConfiguration.ActiveDirectory.SearchAllForestServers = false;
                this._SearchAllForestServers = false;
                return true;
            }
            else
            {
                var forestServers = ADDiscoverForestServers.LoadForestServersBlocking();
                if (forestServers.Count <= ActiveDirectory.MaxForestServerSearch)
                {
                    Database.DiscoConfiguration.ActiveDirectory.SearchAllForestServers = true;
                    this._SearchAllForestServers = true;
                    return true;
                }
                else
                {
                    Database.DiscoConfiguration.ActiveDirectory.SearchAllForestServers = false;
                    this._SearchAllForestServers = false;
                    return false;
                }
            }
        }