// Token: 0x06001F2E RID: 7982 RVA: 0x000B3280 File Offset: 0x000B1480
        public static void RenderSwatch(TextWriter writer, ItemColor itemColor)
        {
            string str = "catFlg";
            int    num = (int)itemColor;

            CategorySwatch.RenderSwatch(writer, str + num.ToString(CultureInfo.InvariantCulture));
        }
        // Token: 0x06001F25 RID: 7973 RVA: 0x000B2FF4 File Offset: 0x000B11F4
        private static string GetCategoryHtml(Category category)
        {
            string        text          = category.Name;
            bool          flag          = false;
            StringBuilder stringBuilder = new StringBuilder();
            StringWriter  stringWriter  = new StringWriter(stringBuilder);

            if (35 < text.Length)
            {
                text = text.Substring(0, 35) + "...";
                flag = true;
            }
            stringWriter.Write("<span class=\"listItm\"");
            if (flag)
            {
                stringWriter.Write(" title=\"");
                Utilities.HtmlEncode(category.Name, stringWriter);
                stringWriter.Write("\" ");
            }
            stringWriter.Write(">");
            CategorySwatch.RenderSwatch(stringWriter, category);
            stringWriter.Write("&nbsp;");
            Utilities.HtmlEncode(text, stringWriter);
            stringWriter.Write("</span>");
            stringWriter.Close();
            return(stringBuilder.ToString());
        }
        // Token: 0x06001F2A RID: 7978 RVA: 0x000B3190 File Offset: 0x000B1390
        public static void RenderViewCategorySwatches(TextWriter writer, UserContext userContext, string[] categories, bool isToDoItem, FlagStatus flagStatus, int itemColorInt, OwaStoreObjectId folderId, bool renderEmpty)
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            if (userContext == null)
            {
                throw new ArgumentNullException("userContext");
            }
            int num  = 3;
            int num2 = 0;

            if (categories != null)
            {
                MasterCategoryList masterCategoryList = userContext.GetMasterCategoryList(folderId);
                if (masterCategoryList != null)
                {
                    int num3 = 0;
                    while (num3 < categories.Length && num2 < num)
                    {
                        Category category = masterCategoryList[categories[num3]];
                        if (category != null && category.Color != -1)
                        {
                            CategorySwatch.RenderSwatch(writer, category);
                            num2++;
                        }
                        num3++;
                    }
                }
            }
            if (num2 == 0 && !isToDoItem && flagStatus == FlagStatus.Flagged && itemColorInt != -1)
            {
                CategorySwatch.RenderSwatch(writer, (ItemColor)itemColorInt);
                num2++;
            }
            if (renderEmpty && num2 == 0)
            {
                CategorySwatch.RenderSwatch(writer, null);
            }
        }
        // Token: 0x06001F28 RID: 7976 RVA: 0x000B3104 File Offset: 0x000B1304
        public static void RenderViewCategorySwatches(TextWriter writer, UserContext userContext, Item item, OwaStoreObjectId folderId)
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            if (userContext == null)
            {
                throw new ArgumentNullException("userContext");
            }
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            string[]   property  = ItemUtility.GetProperty <string[]>(item, ItemSchema.Categories, null);
            FlagStatus property2 = ItemUtility.GetProperty <FlagStatus>(item, ItemSchema.FlagStatus, FlagStatus.NotFlagged);
            int        property3 = ItemUtility.GetProperty <int>(item, ItemSchema.ItemColor, -1);
            bool       property4 = ItemUtility.GetProperty <bool>(item, ItemSchema.IsToDoItem, false);

            CategorySwatch.RenderViewCategorySwatches(writer, userContext, property, property4, property2, property3, folderId);
        }
Exemple #5
0
        private void RenderCategories(TextWriter writer, bool conversationMode)
        {
            string[] itemProperty = this.dataSource.GetItemProperty <string[]>(conversationMode ? ConversationItemSchema.ConversationCategories : ItemSchema.Categories, null);
            writer.Write("<div id=\"");
            writer.Write("divCatGroup");
            writer.Write("\"");
            if (this.userContext.CanActAsOwner && itemProperty != null && 0 < itemProperty.Length)
            {
                writer.Write(" title=\"");
                for (int i = 0; i < itemProperty.Length; i++)
                {
                    if (i != 0)
                    {
                        writer.Write("; ");
                    }
                    Utilities.HtmlEncode(itemProperty[i], writer);
                }
                writer.Write("\"");
            }
            writer.Write(">");
            int        itemColorInt = -1;
            bool       isToDoItem   = false;
            FlagStatus itemProperty2;

            if (conversationMode)
            {
                itemProperty2 = (FlagStatus)this.dataSource.GetItemProperty <int>(ConversationItemSchema.ConversationFlagStatus, 0);
            }
            else
            {
                itemProperty2 = this.dataSource.GetItemProperty <FlagStatus>(ItemSchema.FlagStatus, FlagStatus.NotFlagged);
                itemColorInt  = this.dataSource.GetItemProperty <int>(ItemSchema.ItemColor, -1);
                isToDoItem    = this.dataSource.GetItemProperty <bool>(ItemSchema.IsToDoItem, false);
            }
            OwaStoreObjectId folderId = OwaStoreObjectId.CreateFromString(this.dataSource.ContainerId);

            CategorySwatch.RenderViewCategorySwatches(writer, this.userContext, itemProperty, isToDoItem, itemProperty2, itemColorInt, folderId);
            writer.Write("</div>");
        }
Exemple #6
0
        internal static void RenderCategory(TextWriter writer, Category category)
        {
            string text  = category.Name;
            string text2 = null;

            if (50 < text.Length)
            {
                text  = text.Substring(0, 50) + "...";
                text2 = category.Name;
            }
            writer.Write("<div nowrap");
            if (text2 != null)
            {
                writer.Write(" title=\"");
                Utilities.HtmlEncode(text2, writer);
                writer.Write("\"");
            }
            writer.Write(">");
            CategorySwatch.RenderSwatch(writer, category);
            writer.Write("&nbsp;");
            Utilities.HtmlEncode(text, writer, true);
            writer.Write("</div>");
        }
        private void RenderCategoryMenuItemHtml(TextWriter output)
        {
            string text = this.currentCategory.Name;
            bool   flag = false;

            if (35 < text.Length)
            {
                text = text.Substring(0, 35) + "...";
                flag = true;
            }
            if (flag)
            {
                output.Write("<span title=\"");
                Utilities.HtmlEncode(this.currentCategory.Name, output);
                output.Write("\">");
            }
            CategorySwatch.RenderSwatch(output, this.currentCategory);
            output.Write(" ");
            Utilities.HtmlEncode(text, output);
            if (flag)
            {
                output.Write("</span>");
            }
        }
 // Token: 0x06001F2B RID: 7979 RVA: 0x000B322D File Offset: 0x000B142D
 public static string GetCategoryClassName(Category category)
 {
     return(CategorySwatch.GetCategoryClassNameFromColor((category != null) ? category.Color : -1));
 }
 // Token: 0x06001F29 RID: 7977 RVA: 0x000B317B File Offset: 0x000B137B
 public static void RenderViewCategorySwatches(TextWriter writer, UserContext userContext, string[] categories, bool isToDoItem, FlagStatus flagStatus, int itemColorInt, OwaStoreObjectId folderId)
 {
     CategorySwatch.RenderViewCategorySwatches(writer, userContext, categories, isToDoItem, flagStatus, itemColorInt, folderId, true);
 }
        // Token: 0x06001F31 RID: 7985 RVA: 0x000B32DC File Offset: 0x000B14DC
        public static void RenderCategories(OwaContext owaContext, TextWriter writer, IStorePropertyBag storePropertyBag, StoreSession storeSession)
        {
            if (owaContext == null)
            {
                throw new ArgumentNullException("owaContext");
            }
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            if (storePropertyBag == null)
            {
                throw new ArgumentNullException("storePropertyBag");
            }
            string[] property = ItemUtility.GetProperty <string[]>(storePropertyBag, ItemSchema.Categories, null);
            string   value    = owaContext.UserContext.IsRtl ? "rtl" : "ltr";
            int      num      = 0;

            if (property != null && 0 < property.Length)
            {
                MasterCategoryList masterCategoryList = null;
                try
                {
                    if (storeSession != null && owaContext.UserContext.IsOtherMailbox(storeSession))
                    {
                        masterCategoryList = owaContext.UserContext.GetMasterCategoryList(storeSession as MailboxSession);
                    }
                    else
                    {
                        masterCategoryList = owaContext.UserContext.GetMasterCategoryList();
                    }
                }
                catch (QuotaExceededException ex)
                {
                    ExTraceGlobals.CoreTracer.TraceDebug <string>(0L, "CategorySwatch.RenderCategories: Failed. Exception: {0}", ex.Message);
                    return;
                }
                if (masterCategoryList != null)
                {
                    for (int i = 0; i < property.Length; i++)
                    {
                        writer.Write("<span class=\"spanCatContainer\" dir=\"");
                        writer.Write(value);
                        writer.Write("\">");
                        CategorySwatch.RenderSwatch(writer, masterCategoryList[property[i]]);
                        writer.Write("&nbsp;");
                        Utilities.SanitizeHtmlEncode(property[i], writer);
                        if (i < property.Length - 1)
                        {
                            writer.Write("; ");
                        }
                        writer.Write("</span><wbr>");
                        num++;
                    }
                }
            }
            if (num == 0)
            {
                writer.Write("<span class=\"spanCatContainer catAfter\" dir=\"");
                writer.Write(value);
                writer.Write("\">");
                int legacyColoredFlag = ItemUtility.GetLegacyColoredFlag(storePropertyBag);
                if (0 < legacyColoredFlag && legacyColoredFlag < CategorySwatch.FlagCategory.Length)
                {
                    CategorySwatch.RenderSwatch(writer, (ItemColor)legacyColoredFlag);
                    writer.Write("<span id=\"vaM\">");
                    writer.Write(SanitizedHtmlString.FromStringId(CategorySwatch.FlagCategory[legacyColoredFlag]));
                    writer.Write("</span>");
                }
                writer.Write("</span>");
            }
        }
 // Token: 0x06001F30 RID: 7984 RVA: 0x000B32CA File Offset: 0x000B14CA
 public static void RenderCategories(OwaContext owaContext, TextWriter writer, Item item)
 {
     CategorySwatch.RenderCategories(owaContext, writer, item, item.Session);
 }
 // Token: 0x06001F2D RID: 7981 RVA: 0x000B326F File Offset: 0x000B146F
 public static void RenderSwatch(TextWriter writer, Category category)
 {
     CategorySwatch.RenderSwatch(writer, CategorySwatch.GetCategoryClassName(category));
 }