Esempio n. 1
0
        public static OwaStoreObjectId CreateFromItemId(StoreObjectId itemStoreObjectId, Folder containerFolder)
        {
            if (itemStoreObjectId == null)
            {
                throw new ArgumentNullException("itemStoreObjectId");
            }
            if (containerFolder == null)
            {
                throw new ArgumentNullException("containerFolder");
            }
            OwaStoreObjectIdType owaStoreObjectIdType = OwaStoreObjectIdType.MailBoxObject;
            string legacyDN = null;

            if (Utilities.IsPublic(containerFolder))
            {
                owaStoreObjectIdType = OwaStoreObjectIdType.PublicStoreItem;
            }
            else if (Utilities.IsOtherMailbox(containerFolder))
            {
                owaStoreObjectIdType = OwaStoreObjectIdType.OtherUserMailboxObject;
                legacyDN             = Utilities.GetMailboxSessionLegacyDN(containerFolder);
            }
            else if (Utilities.IsInArchiveMailbox(containerFolder))
            {
                owaStoreObjectIdType = OwaStoreObjectIdType.ArchiveMailboxObject;
                legacyDN             = Utilities.GetMailboxSessionLegacyDN(containerFolder);
            }
            return(OwaStoreObjectId.CreateFromItemId(itemStoreObjectId, (containerFolder.Id == null) ? null : containerFolder.Id.ObjectId, owaStoreObjectIdType, legacyDN));
        }
 private string GetInlineReferenceUrl(AttachmentPolicy.Level level, AttachmentLink imageAttachmentLink, HtmlWriter writer)
 {
     imageAttachmentLink.MarkInline(true);
     if (AttachmentPolicy.Level.Allow == level)
     {
         StringBuilder stringBuilder = new StringBuilder();
         if (this.isEmbeddedItem)
         {
             stringBuilder.Append(this.embeddedItemUrl);
         }
         else
         {
             stringBuilder.Append(OwaSafeHtmlCallbackBase.AttachmentBaseUrl);
             bool             flag             = this.owaStoreObjectIdType == OwaStoreObjectIdType.OtherUserMailboxObject || this.owaStoreObjectIdType == OwaStoreObjectIdType.ArchiveMailboxObject;
             OwaStoreObjectId owaStoreObjectId = OwaStoreObjectId.CreateFromItemId(this.itemId, flag ? null : this.parentId, this.owaStoreObjectIdType, this.legacyDN);
             stringBuilder.Append(Utilities.UrlEncode(owaStoreObjectId.ToString()));
             stringBuilder.Append("&attcnt=1&attid0=");
         }
         stringBuilder.Append(Utilities.UrlEncode(imageAttachmentLink.AttachmentId.ToBase64String()));
         if (!this.isEmbeddedItem && !string.IsNullOrEmpty(imageAttachmentLink.ContentId))
         {
             stringBuilder.Append("&attcid0=");
             stringBuilder.Append(Utilities.UrlEncode(imageAttachmentLink.ContentId));
         }
         return(stringBuilder.ToString());
     }
     this.hasBlockedImagesInCurrentPass = true;
     this.hasBlockedInlineAttachments   = true;
     return(OwaSafeHtmlOutboundCallbacks.BlockedUrlPageValue);
 }
Esempio n. 3
0
 internal static OwaStoreObjectId CreateFromPublicStoreItemId(StoreObjectId publicStoreItemId, StoreObjectId publicStoreFolderId)
 {
     if (publicStoreItemId == null)
     {
         throw new ArgumentNullException("publicStoreItemId");
     }
     if (publicStoreFolderId == null)
     {
         throw new ArgumentNullException("publicStoreFolderId");
     }
     return(OwaStoreObjectId.CreateFromItemId(publicStoreItemId, publicStoreFolderId, OwaStoreObjectIdType.PublicStoreItem, null));
 }
Esempio n. 4
0
 public static OwaStoreObjectId CreateFromItemId(StoreObjectId itemStoreObjectId, OwaStoreObjectId containerFolderId)
 {
     if (itemStoreObjectId == null)
     {
         throw new ArgumentNullException("itemStoreObjectId");
     }
     if (containerFolderId == null)
     {
         throw new ArgumentNullException("containerFolderId");
     }
     return(OwaStoreObjectId.CreateFromItemId(itemStoreObjectId, containerFolderId.StoreObjectId, containerFolderId.OwaStoreObjectIdType, containerFolderId.MailboxOwnerLegacyDN));
 }
Esempio n. 5
0
        public static OwaStoreObjectId CreateFromStoreObject(StoreObject storeObject)
        {
            if (storeObject == null)
            {
                throw new ArgumentNullException("storeObject");
            }
            if (storeObject.Id == null)
            {
                throw new ArgumentException("storeObject.Id must not be null");
            }
            OwaStoreObjectIdType owaStoreObjectIdType = OwaStoreObjectIdType.MailBoxObject;
            string legacyDN = null;

            if (Utilities.IsOtherMailbox(storeObject))
            {
                owaStoreObjectIdType = OwaStoreObjectIdType.OtherUserMailboxObject;
                legacyDN             = Utilities.GetMailboxSessionLegacyDN(storeObject);
            }
            else if (Utilities.IsInArchiveMailbox(storeObject))
            {
                owaStoreObjectIdType = OwaStoreObjectIdType.ArchiveMailboxObject;
                legacyDN             = Utilities.GetMailboxSessionLegacyDN(storeObject);
            }
            if (storeObject is Item)
            {
                if (Utilities.IsPublic(storeObject))
                {
                    owaStoreObjectIdType = OwaStoreObjectIdType.PublicStoreItem;
                }
                return(OwaStoreObjectId.CreateFromItemId(storeObject.Id.ObjectId, (owaStoreObjectIdType == OwaStoreObjectIdType.OtherUserMailboxObject) ? null : storeObject.ParentId, owaStoreObjectIdType, legacyDN));
            }
            if (storeObject is Folder)
            {
                if (Utilities.IsPublic(storeObject))
                {
                    owaStoreObjectIdType = OwaStoreObjectIdType.PublicStoreFolder;
                }
                return(OwaStoreObjectId.CreateFromFolderId(storeObject.Id.ObjectId, owaStoreObjectIdType, legacyDN));
            }
            string message = string.Format(CultureInfo.InvariantCulture, "OwaStoreObjectId.CreateOwaStoreObjectId(StoreObject) only support item or folder as input, but the input is an {0}", new object[]
            {
                storeObject.GetType().ToString()
            });

            throw new ArgumentOutOfRangeException("storeObject", message);
        }
Esempio n. 6
0
        // Token: 0x06000F5C RID: 3932 RVA: 0x0005F528 File Offset: 0x0005D728
        public Item BindItem(StoreObjectId itemId, bool isPublic, StoreObjectId folderId)
        {
            OwaStoreObjectId owaStoreObjectId = OwaStoreObjectId.CreateFromItemId(itemId, OwaStoreObjectId.CreateFromFolderId(folderId, isPublic ? OwaStoreObjectIdType.PublicStoreFolder : OwaStoreObjectIdType.MailBoxObject));

            try
            {
                return(Utilities.GetItem <Item>(this.userContext, owaStoreObjectId, new PropertyDefinition[0]));
            }
            catch (StoragePermanentException)
            {
            }
            catch (StorageTransientException)
            {
            }
            catch (OwaPermanentException)
            {
            }
            catch (OwaTransientException)
            {
            }
            return(null);
        }