コード例 #1
0
        private MonadConnectionInfo DiscoverConnectionInfo()
        {
            SupportedVersionList supportedVersionList = null;
            MonadConnectionInfo  result = new ConnectionRetryDiscoverer(this).DiscoverConnectionInfo(out supportedVersionList, (OrganizationType.LocalOnPremise == this.Type || OrganizationType.Cloud == this.Type || OrganizationType.RemoteOnPremise == this.Type) ? this.SlotVersion : string.Empty);

            if (this.Type == OrganizationType.Cloud)
            {
                if (supportedVersionList.Count == 0)
                {
                    throw new SupportedVersionListFormatException(Strings.AtLeastOneVersionMustBeSupported);
                }
                if (supportedVersionList.IsSupported(this.SlotVersion))
                {
                    throw new VersionMismatchException(Strings.MicrosoftExchangeOnPremise, supportedVersionList);
                }
            }
            else if (this.Type == OrganizationType.RemoteOnPremise)
            {
                if (supportedVersionList == null || supportedVersionList.Count == 0)
                {
                    throw new InvalidOperationException(Strings.SP1ConnectToRTMServerError);
                }
                if (!supportedVersionList.IsSupported(this.SlotVersion))
                {
                    throw new InvalidOperationException(Strings.IncampatibleVersionConnectionError(supportedVersionList.GetLatestVersion(), this.SlotVersion));
                }
            }
            return(result);
        }
コード例 #2
0
        private string AllocateSlot(SupportedVersionList supportedVersionList)
        {
            IEnumerable <Slot> source = from s in this.slots
                                        where supportedVersionList.IsSupported(s.Version) && !s.Removed && !this.IsInUse(s.Key)
                                        select s;

            if (source.Count <Slot>() > 0)
            {
                return(source.First <Slot>().Key);
            }
            IEnumerable <Slot> source2 = from s in this.slots
                                         where !s.Removed && !this.IsInUse(s.Key)
                                         select s;

            if (source2.Count <Slot>() > 0)
            {
                return(source2.First <Slot>().Key);
            }
            return(null);
        }
コード例 #3
0
 public List <Slot> GetCompatibleSlots(SupportedVersionList supportedVersionList)
 {
     return((from c in this.slots
             where supportedVersionList.IsSupported(c.Version)
             select c).ToList <Slot>());
 }