public IEnumerable <IADDatabaseCopy> GetAllDatabaseCopies(IADServer server)
        {
            IEnumerable <DatabaseCopy> allRealDatabaseCopies = this.GetAllRealDatabaseCopies(server);

            return(from copy in allRealDatabaseCopies
                   select ADObjectWrapperFactory.CreateWrapper(copy));
        }
        public bool TryFindByExchangeLegacyDN(string legacyExchangeDN, out IADMiniClientAccessServerOrArray adMiniClientAccessServerOrArray)
        {
            MiniClientAccessServerOrArray caServerOrArray = null;
            bool result = this.m_session.TryFindByExchangeLegacyDN(legacyExchangeDN, ADMiniClientAccessServerOrArrayWrapper.PropertiesNeededForCas, out caServerOrArray);

            adMiniClientAccessServerOrArray = ADObjectWrapperFactory.CreateWrapper(caServerOrArray);
            return(result);
        }
 private TADWrapperObject[] FindInternal <TADWrapperObject, TADObject>(ADObjectId rootId, QueryScope scope, QueryFilter filter, SortBy sortBy, int maxResults, IEnumerable <PropertyDefinition> properties = null) where TADWrapperObject : class, IADObjectCommon where TADObject : ADObject, new()
 {
     TADObject[] array = this.m_session.Find <TADObject>(rootId, scope, filter, sortBy, maxResults, properties);
     if (array == null)
     {
         return(null);
     }
     return((from o in array
             select(TADWrapperObject)((object)ADObjectWrapperFactory.CreateWrapper(o))).ToArray <TADWrapperObject>());
 }
 public static IADObjectCommon CreateWrapper(ADObject adObject)
 {
     if (adObject == null)
     {
         return(null);
     }
     if (adObject is Database)
     {
         return(ADObjectWrapperFactory.CreateWrapper((Database)adObject));
     }
     if (adObject is MiniDatabase)
     {
         return(ADObjectWrapperFactory.CreateWrapper((MiniDatabase)adObject));
     }
     if (adObject is DatabaseCopy)
     {
         return(ADObjectWrapperFactory.CreateWrapper((DatabaseCopy)adObject));
     }
     if (adObject is ADComputer)
     {
         return(ADObjectWrapperFactory.CreateWrapper((ADComputer)adObject));
     }
     if (adObject is Server)
     {
         return(ADObjectWrapperFactory.CreateWrapper((Server)adObject));
     }
     if (adObject is MiniServer)
     {
         return(ADObjectWrapperFactory.CreateWrapper((MiniServer)adObject));
     }
     if (adObject is DatabaseAvailabilityGroup)
     {
         return(ADObjectWrapperFactory.CreateWrapper((DatabaseAvailabilityGroup)adObject));
     }
     if (adObject is ClientAccessArray)
     {
         return(ADObjectWrapperFactory.CreateWrapper((ClientAccessArray)adObject));
     }
     if (adObject is MiniClientAccessServerOrArray)
     {
         return(ADObjectWrapperFactory.CreateWrapper((MiniClientAccessServerOrArray)adObject));
     }
     if (adObject is ADSite)
     {
         return(ADObjectWrapperFactory.CreateWrapper((ADSite)adObject));
     }
     ExAssert.RetailAssert(false, "Type '{0}' is not supported by CreateWrapper", new object[]
     {
         adObject.GetType()
     });
     return(null);
 }
 public IADDatabaseAvailabilityGroup FindDagByServer(IADServer server)
 {
     if (server != null)
     {
         ADObjectId databaseAvailabilityGroup = server.DatabaseAvailabilityGroup;
         if (databaseAvailabilityGroup != null && !databaseAvailabilityGroup.IsDeleted)
         {
             DatabaseAvailabilityGroup dag = this.m_session.Read <DatabaseAvailabilityGroup>(databaseAvailabilityGroup);
             return(ADObjectWrapperFactory.CreateWrapper(dag));
         }
     }
     return(null);
 }
 private void CompletePropertiesFromDbCopies(DatabaseCopy[] allCopies)
 {
     if (allCopies == null || allCopies.Length == 0)
     {
         this.AssignCopies(null);
         return;
     }
     ADDatabaseCopyWrapper[] array = new ADDatabaseCopyWrapper[allCopies.Length];
     for (int i = 0; i < allCopies.Length; i++)
     {
         array[i] = ADObjectWrapperFactory.CreateWrapper(allCopies[i]);
     }
     this.AssignCopies(array);
 }
        public IADComputer FindComputerByHostName(string hostName)
        {
            ADComputer adComputer = this.m_session.FindComputerByHostName(hostName);

            return(ADObjectWrapperFactory.CreateWrapper(adComputer));
        }
        public IADServer FindServerByName(string serverShortName)
        {
            Server server = this.m_session.FindServerByName(serverShortName);

            return(ADObjectWrapperFactory.CreateWrapper(server));
        }
        public IADSite GetLocalSite()
        {
            ADSite localSite = this.m_session.GetLocalSite();

            return(ADObjectWrapperFactory.CreateWrapper(localSite));
        }
        public IADMiniClientAccessServerOrArray FindMiniClientAccessServerOrArrayByFqdn(string serverFqdn)
        {
            MiniClientAccessServerOrArray caServerOrArray = this.m_session.FindMiniClientAccessServerOrArrayByFqdn(serverFqdn, ADMiniClientAccessServerOrArrayWrapper.PropertiesNeededForCas);

            return(ADObjectWrapperFactory.CreateWrapper(caServerOrArray));
        }
        public IADMiniClientAccessServerOrArray ReadMiniClientAccessServerOrArray(ADObjectId entryId)
        {
            MiniClientAccessServerOrArray caServerOrArray = this.m_session.ReadMiniClientAccessServerOrArray(entryId, ADMiniClientAccessServerOrArrayWrapper.PropertiesNeededForCas);

            return(ADObjectWrapperFactory.CreateWrapper(caServerOrArray));
        }
        public IADServer FindMiniServerByName(string serverName)
        {
            MiniServer server = this.m_session.FindMiniServerByName(serverName, ADServerWrapper.PropertiesNeededForServer);

            return(ADObjectWrapperFactory.CreateWrapper(server));
        }
        public IADServer ReadMiniServer(ADObjectId entryId)
        {
            MiniServer server = this.m_session.ReadMiniServer(entryId, ADServerWrapper.PropertiesNeededForServer);

            return(ADObjectWrapperFactory.CreateWrapper(server));
        }