public MailboxFolderIdParameter(MailboxFolderId mailboxFolderId)
 {
     if (null == mailboxFolderId)
     {
         throw new ArgumentNullException("mailboxFolderId");
     }
     this.rawIdentity = mailboxFolderId.ToString();
     ((IIdentityParameter)this).Initialize(mailboxFolderId);
 }
Exemplo n.º 2
0
        private MailboxFolder[] LinkFolders(MailboxFolder[] rows, FolderPickerType folderPickerType)
        {
            Hashtable hashtable = new Hashtable();

            for (int i = 0; i < rows.Length; i++)
            {
                hashtable[rows[i].Folder.FolderStoreObjectId] = i;
            }
            for (int j = 0; j < rows.Length; j++)
            {
                MailboxFolder folder = rows[j].Folder;
                if (!(folder.DefaultFolderType == DefaultFolderType.CommunicatorHistory))
                {
                    if (folderPickerType == FolderPickerType.VoiceMailFolderPicker)
                    {
                        if (folder.DefaultFolderType != DefaultFolderType.None && folder.DefaultFolderType != DefaultFolderType.Inbox && folder.DefaultFolderType != DefaultFolderType.Root)
                        {
                            goto IL_138;
                        }
                    }
                    else
                    {
                        if (folderPickerType != FolderPickerType.RulesFolderPicker)
                        {
                            throw new NotSupportedException();
                        }
                        if (folder.DefaultFolderType == DefaultFolderType.Outbox)
                        {
                            goto IL_138;
                        }
                    }
                    MailboxFolderId parentFolder = folder.ParentFolder;
                    if (parentFolder != null && hashtable.Contains(parentFolder.StoreObjectId))
                    {
                        int num = (int)hashtable[parentFolder.StoreObjectId];
                        rows[num].Children.Add(rows[j]);
                    }
                }
                IL_138 :;
            }
            for (int k = 0; k < rows.Length; k++)
            {
                if (rows[k].Folder.DefaultFolderType == DefaultFolderType.Root)
                {
                    rows[k].Name = RbacPrincipal.Current.Name;
                    rows[k].Children.Sort();
                    return(new MailboxFolder[]
                    {
                        rows[k]
                    });
                }
            }
            return(null);
        }
 void IIdentityParameter.Initialize(ObjectId objectId)
 {
     if (objectId == null)
     {
         throw new ArgumentNullException("objectId");
     }
     if (!(objectId is MailboxFolderId))
     {
         throw new NotSupportedException("objectId: " + objectId.GetType().FullName);
     }
     this.InternalMailboxFolderId = (MailboxFolderId)objectId;
     this.RawOwner         = new MailboxIdParameter(this.InternalMailboxFolderId.MailboxOwnerId);
     this.RawFolderPath    = this.InternalMailboxFolderId.MailboxFolderPath;
     this.RawFolderStoreId = this.InternalMailboxFolderId.StoreObjectIdValue;
 }
Exemplo n.º 4
0
 public static ObjectId RedactFolderId(ObjectId folderId, out string raw, out string redacted)
 {
     raw      = null;
     redacted = null;
     if (folderId is MailboxFolderId)
     {
         MailboxFolderId mailboxFolderId = (MailboxFolderId)folderId;
         folderId = new MailboxFolderId(SuppressingPiiData.Redact(mailboxFolderId.MailboxOwnerId, out raw, out redacted), mailboxFolderId.StoreObjectIdValue, mailboxFolderId.MailboxFolderPath);
     }
     if (folderId is Microsoft.Exchange.Data.Storage.Management.PublicFolderId)
     {
         Microsoft.Exchange.Data.Storage.Management.PublicFolderId publicFolderId = (Microsoft.Exchange.Data.Storage.Management.PublicFolderId)folderId;
         folderId = new Microsoft.Exchange.Data.Storage.Management.PublicFolderId(publicFolderId.OrganizationId, publicFolderId.StoreObjectId, SuppressingPiiData.Redact(publicFolderId.MapiFolderPath, out raw, out redacted));
     }
     return(folderId);
 }
Exemplo n.º 5
0
        private UMMailboxConfiguration GetPresentationObject(UMSubscriber subscriber)
        {
            UMMailboxConfiguration ummailboxConfiguration = new UMMailboxConfiguration(this.DataObject.Identity);

            ummailboxConfiguration.Greeting = subscriber.ConfigFolder.CurrentMailboxGreetingType;
            ummailboxConfiguration.DefaultPlayOnPhoneNumber           = subscriber.ConfigFolder.PlayOnPhoneDialString;
            ummailboxConfiguration.ReadOldestUnreadVoiceMessagesFirst = subscriber.ConfigFolder.ReadUnreadVoicemailInFIFOOrder;
            ummailboxConfiguration.ReceivedVoiceMailPreviewEnabled    = subscriber.ConfigFolder.ReceivedVoiceMailPreviewEnabled;
            ummailboxConfiguration.SentVoiceMailPreviewEnabled        = subscriber.ConfigFolder.SentVoiceMailPreviewEnabled;
            byte[]          entryId       = Convert.FromBase64String(subscriber.ConfigFolder.TelephoneAccessFolderEmail);
            StoreObjectId   storeObjectId = StoreObjectId.FromProviderSpecificId(entryId);
            ADUser          dataObject    = this.DataObject;
            MailboxFolderId identity      = new MailboxFolderId(dataObject.Id, storeObjectId, null);

            using (MailboxFolderDataProvider mailboxFolderDataProvider = new MailboxFolderDataProvider(base.SessionSettings, this.DataObject, "get-ummailboxconfiguration"))
            {
                ummailboxConfiguration.FolderToReadEmailsFrom = (MailboxFolder)mailboxFolderDataProvider.Read <MailboxFolder>(identity);
            }
            return(ummailboxConfiguration);
        }