コード例 #1
0
 private bool ValidMailboxLocationsRaw()
 {
     if (this.propertyBag != null)
     {
         MultiValuedProperty <ADObjectIdWithString> multiValuedProperty = this.propertyBag[IADMailStorageSchema.MailboxLocationsRaw] as MultiValuedProperty <ADObjectIdWithString>;
         if (multiValuedProperty.Count != this.mailboxInfo.Count)
         {
             return(false);
         }
         foreach (ADObjectIdWithString adobjectIdWithString in multiValuedProperty)
         {
             IMailboxLocationInfo mailboxLocationInfo = new MailboxLocationInfo(adobjectIdWithString.StringValue);
             if (!this.mailboxInfo.ContainsKey(mailboxLocationInfo.MailboxGuid))
             {
                 return(false);
             }
             if (!this.mailboxInfo[mailboxLocationInfo.MailboxGuid].Equals(mailboxLocationInfo))
             {
                 return(false);
             }
         }
         return(true);
     }
     return(true);
 }
コード例 #2
0
 // Token: 0x06001D08 RID: 7432 RVA: 0x00078A14 File Offset: 0x00076C14
 public MailboxLocationInfo(Guid mailboxGuid, ADObjectId databaseLocation, MailboxLocationType mailboxLocationType)
 {
     MailboxLocationInfo.ValidateMailboxInfo(mailboxGuid, databaseLocation);
     this.MailboxGuid         = mailboxGuid;
     this.databaseLocation    = ((databaseLocation != null) ? new ADObjectId(databaseLocation.ObjectGuid, databaseLocation.PartitionFQDN) : null);
     this.MailboxLocationType = mailboxLocationType;
     this.infoToString        = null;
 }
コード例 #3
0
        // Token: 0x06001D09 RID: 7433 RVA: 0x00078A60 File Offset: 0x00076C60
        public MailboxLocationInfo(string mailboxLocationString)
        {
            if (string.IsNullOrEmpty(mailboxLocationString))
            {
                throw new ArgumentNullException("mailboxLocationString");
            }
            string[] array = mailboxLocationString.Split(new string[]
            {
                MailboxLocationInfo.MailboxLocationDelimiter
            }, StringSplitOptions.None);
            int minValue = int.MinValue;

            if (array.Length > 1 && (!int.TryParse(array[0], out minValue) || minValue > MailboxLocationInfo.MaxSerializableVersion || minValue < 0))
            {
                throw new ArgumentException("mailboxLocationString");
            }
            Guid   guid = Guid.Empty;
            string text = null;

            for (int i = 1; i < array.Length; i++)
            {
                if (!string.IsNullOrEmpty(array[i]))
                {
                    try
                    {
                        switch (i)
                        {
                        case 1:
                            this.MailboxGuid = Guid.Parse(array[1]);
                            break;

                        case 2:
                            this.MailboxLocationType = (MailboxLocationType)Enum.Parse(typeof(MailboxLocationType), array[2]);
                            break;

                        case 3:
                            text = array[3];
                            break;

                        case 4:
                            guid = Guid.Parse(array[4]);
                            break;
                        }
                    }
                    catch (Exception innerException)
                    {
                        throw new ADOperationException(DirectoryStrings.CannotParse(array[i]), innerException);
                    }
                }
            }
            if (!guid.Equals(Guid.Empty) && text != null)
            {
                this.databaseLocation = new ADObjectId(guid, text);
            }
            MailboxLocationInfo.ValidateMailboxInfo(this.MailboxGuid, this.databaseLocation);
            this.infoToString = null;
        }
コード例 #4
0
        // Token: 0x06001D11 RID: 7441 RVA: 0x00078CC4 File Offset: 0x00076EC4
        public override bool Equals(object obj)
        {
            MailboxLocationInfo mailboxLocationInfo = obj as MailboxLocationInfo;

            if (mailboxLocationInfo == null)
            {
                return(false);
            }
            bool flag = false;

            if (mailboxLocationInfo.DatabaseLocation == null && this.DatabaseLocation == null)
            {
                flag = true;
            }
            else if (mailboxLocationInfo.DatabaseLocation != null && this.DatabaseLocation != null)
            {
                flag = mailboxLocationInfo.DatabaseLocation.Equals(this.DatabaseLocation);
            }
            return(mailboxLocationInfo.MailboxGuid.Equals(this.MailboxGuid) && flag && mailboxLocationInfo.MailboxLocationType == this.MailboxLocationType);
        }
コード例 #5
0
 internal MailboxLocationCollection(IPropertyBag propertyBag)
 {
     this.Initialize();
     if (propertyBag[IADMailStorageSchema.MailboxLocationsRaw] == null)
     {
         propertyBag[IADMailStorageSchema.MailboxLocationsRaw] = new MultiValuedProperty <ADObjectIdWithString>(false, IADMailStorageSchema.MailboxLocationsRaw, new ADObjectIdWithString[0]);
     }
     if (propertyBag[IADMailStorageSchema.MailboxGuidsRaw] == null)
     {
         propertyBag[IADMailStorageSchema.MailboxGuidsRaw] = new MultiValuedProperty <Guid>(false, IADMailStorageSchema.MailboxGuidsRaw, new Guid[0]);
     }
     this.locations   = (propertyBag[IADMailStorageSchema.MailboxLocationsRaw] as MultiValuedProperty <ADObjectIdWithString>);
     this.guids       = (propertyBag[IADMailStorageSchema.MailboxGuidsRaw] as MultiValuedProperty <Guid>);
     this.propertyBag = propertyBag;
     if (this.GetPrimaryOrArchiveMailboxInfo(MailboxLocationType.Primary) != null)
     {
         this.mailboxTypeCount[0]++;
     }
     if (this.GetPrimaryOrArchiveMailboxInfo(MailboxLocationType.MainArchive) != null)
     {
         this.mailboxTypeCount[1]++;
     }
     foreach (ADObjectIdWithString adobjectIdWithString in this.locations)
     {
         IMailboxLocationInfo info = new MailboxLocationInfo(adobjectIdWithString.StringValue);
         this.ValidateAndAddMailboxInfo(info, false);
     }
     this.isInitialGuidsValid = this.ValidRawGuids();
     if (!this.isInitialGuidsValid)
     {
         this.guids.Clear();
         foreach (Guid item in this.mailboxInfo.Keys)
         {
             this.guids.Add(item);
         }
     }
 }
コード例 #6
0
        public void AddMailboxLocation(Guid mailboxGuid, ADObjectId databaseLocation, MailboxLocationType mailboxLocationType)
        {
            IMailboxLocationInfo mailboxLocation = new MailboxLocationInfo(mailboxGuid, databaseLocation, mailboxLocationType);

            this.AddMailboxLocation(mailboxLocation);
        }