public MailboxFolderIdParameter(string mailboxFolderId)
        {
            if (string.IsNullOrEmpty(mailboxFolderId))
            {
                throw new ArgumentNullException("mailboxFolderId");
            }
            this.rawIdentity = mailboxFolderId;
            int num = mailboxFolderId.IndexOf(':');

            if (-1 == num)
            {
                this.RawOwner      = new MailboxIdParameter(mailboxFolderId);
                this.RawFolderPath = MapiFolderPath.IpmSubtreeRoot;
                return;
            }
            string text  = mailboxFolderId.Substring(0, num);
            string text2 = mailboxFolderId.Substring(1 + num);

            if (!string.IsNullOrEmpty(text))
            {
                this.RawOwner = new MailboxIdParameter(text);
            }
            if (string.IsNullOrEmpty(text2))
            {
                throw new FormatException(Strings.ErrorInvalidMailboxFolderIdentity(this.rawIdentity));
            }
            try
            {
                if (text2[0] == '\\' || text2[0] == '￾')
                {
                    this.RawFolderPath = MapiFolderPath.Parse(text2);
                }
                else
                {
                    this.RawFolderStoreId = StoreObjectId.Deserialize(text2);
                }
            }
            catch (FormatException innerException)
            {
                throw new FormatException(Strings.ErrorInvalidMailboxFolderIdentity(this.rawIdentity), innerException);
            }
            catch (CorruptDataException innerException2)
            {
                throw new FormatException(Strings.ErrorInvalidMailboxFolderIdentity(this.rawIdentity), innerException2);
            }
        }
Exemple #2
0
 public static PublicFolderId Parse(string input)
 {
     if (string.IsNullOrEmpty(input))
     {
         throw new FormatException(Strings.ExceptionFormatNotSupported);
     }
     try
     {
         return(new PublicFolderId(MapiFolderPath.Parse(input)));
     }
     catch (FormatException)
     {
     }
     try
     {
         return(new PublicFolderId(MapiEntryId.Parse(input)));
     }
     catch (FormatException)
     {
     }
     return(new PublicFolderId(input));
 }
Exemple #3
0
        // Token: 0x06000B23 RID: 2851 RVA: 0x00023C30 File Offset: 0x00021E30
        internal PublicFolderIdParameter(string publicFolderIdString, bool isEntryId)
        {
            if (string.IsNullOrEmpty(publicFolderIdString))
            {
                throw new ArgumentNullException("publicFolderIdString");
            }
            this.rawIdentity = publicFolderIdString;
            PublicFolderId publicFolderId = null;

            try
            {
                int num = publicFolderIdString.IndexOf('\\');
                if (num < 0)
                {
                    if (isEntryId)
                    {
                        publicFolderId = new PublicFolderId(StoreObjectId.FromHexEntryId(publicFolderIdString));
                    }
                }
                else if (num == 0)
                {
                    if (publicFolderIdString.Length > 1 && publicFolderIdString[num + 1] == '\\')
                    {
                        throw new FormatException(Strings.ErrorIncompletePublicFolderIdParameter(publicFolderIdString));
                    }
                    publicFolderId = new PublicFolderId(MapiFolderPath.Parse(publicFolderIdString));
                }
                else
                {
                    if (!MapiTaskHelper.IsDatacenter)
                    {
                        throw new FormatException(Strings.ErrorIncompletePublicFolderIdParameter(publicFolderIdString));
                    }
                    if (num == publicFolderIdString.Length - 1)
                    {
                        throw new FormatException(Strings.ErrorIncompleteDCPublicFolderIdParameter(publicFolderIdString));
                    }
                    this.Organization = new OrganizationIdParameter(publicFolderIdString.Substring(0, num));
                    if (publicFolderIdString[num + 1] == '\\')
                    {
                        publicFolderId = new PublicFolderId(MapiFolderPath.Parse(publicFolderIdString.Substring(num + 1)));
                    }
                    else if (isEntryId)
                    {
                        publicFolderId = new PublicFolderId(StoreObjectId.FromHexEntryId(publicFolderIdString.Substring(num + 1)));
                    }
                }
            }
            catch (FormatException innerException)
            {
                throw new FormatException(MapiTaskHelper.IsDatacenter ? Strings.ErrorIncompleteDCPublicFolderIdParameter(this.rawIdentity) : Strings.ErrorIncompletePublicFolderIdParameter(this.rawIdentity), innerException);
            }
            catch (CorruptDataException innerException2)
            {
                throw new FormatException(MapiTaskHelper.IsDatacenter ? Strings.ErrorIncompleteDCPublicFolderIdParameter(this.rawIdentity) : Strings.ErrorIncompletePublicFolderIdParameter(this.rawIdentity), innerException2);
            }
            if (publicFolderId != null)
            {
                ((IIdentityParameter)this).Initialize(publicFolderId);
            }
        }