Ejemplo n.º 1
0
        public void CreateCategory()
        {
            base.ThrowIfCannotActAsOwner();
            string text = (string)base.GetParameter("nm");

            if (text.Length > 255)
            {
                throw new OwaInvalidRequestException("Category name cannot be longer than 255 characters.");
            }
            int color = (int)base.GetParameter("clr");

            if (!CategorySwatch.IsValidCategoryColor(color))
            {
                throw new OwaInvalidRequestException("Category color must be in the range [-1, 24].");
            }
            text = text.Trim();
            if (text.Length == 0)
            {
                RenderingUtilities.RenderError(base.UserContext, this.Writer, 1243373352);
                return;
            }
            if (text.Contains(",") || text.Contains(";") || text.Contains("؛") || text.Contains("﹔") || text.Contains(";"))
            {
                RenderingUtilities.RenderError(base.UserContext, this.Writer, 1243373352);
                return;
            }
            if (CategoryEventHandler.guidRegEx.IsMatch(text))
            {
                RenderingUtilities.RenderError(base.UserContext, this.Writer, 1243373352);
                return;
            }
            MasterCategoryList masterCategoryList = base.UserContext.GetMasterCategoryList(true);

            if (masterCategoryList.Contains(text))
            {
                RenderingUtilities.RenderError(base.UserContext, this.Writer, -210070156);
                return;
            }
            Category category = Category.Create(text, color, false);

            masterCategoryList.Add(category);
            ManageCategoriesDialog.RenderCategory(this.Writer, category);
            masterCategoryList.Save();
        }
Ejemplo n.º 2
0
        // Token: 0x060021C9 RID: 8649 RVA: 0x000C0E10 File Offset: 0x000BF010
        internal void RenderSearch(Folder folder)
        {
            OutlookModule  outlookModule  = OutlookModule.None;
            SearchScope    value          = SearchScope.SelectedFolder;
            bool           flag           = false;
            bool           flag2          = false;
            MailboxSession mailboxSession = base.UserContext.MailboxSession;

            if (folder != null)
            {
                outlookModule  = Utilities.GetModuleForFolder(folder, base.UserContext);
                value          = base.UserContext.UserOptions.GetSearchScope(outlookModule);
                mailboxSession = (folder.Session as MailboxSession);
                if (mailboxSession != null && mailboxSession.Mailbox.IsContentIndexingEnabled && folder.Id.ObjectId.Equals(base.UserContext.GetRootFolderId(mailboxSession)))
                {
                    value = SearchScope.AllFoldersAndItems;
                }
                flag = Utilities.IsPublic(folder);
                if (!flag)
                {
                    flag2 = Utilities.IsOtherMailbox(folder);
                }
            }
            this.Writer.Write("<div id=divSearchBox class=iactv ");
            this.Writer.Write("style=\"top:");
            this.Writer.Write(this.SearchControlTop);
            this.Writer.Write("px;\">");
            this.Writer.Write("<div id=divBasicSearch");
            if (!this.FindBarOn)
            {
                this.Writer.Write(" style=\"display:none\"");
            }
            this.Writer.Write(">");
            this.Writer.Write("<div id=divSearch");
            this.Writer.Write(" iScp=\"");
            this.Writer.Write((int)value);
            this.Writer.Write("\"");
            if (this.RenderSearchDropDown)
            {
                this.Writer.Write(" sFldNm=\"");
                Utilities.HtmlEncode(this.ContainerName, this.Writer);
                this.Writer.Write("\" L_Fld=\"");
                this.Writer.Write(LocalizedStrings.GetHtmlEncoded(-41655958));
                this.Writer.Write("\" L_FldSub=\"");
                this.Writer.Write(LocalizedStrings.GetHtmlEncoded(-444616176));
                this.Writer.Write("\"");
                if (outlookModule == OutlookModule.Contacts || outlookModule == OutlookModule.Tasks)
                {
                    this.Writer.Write(" L_Mod=\"");
                    if (outlookModule == OutlookModule.Contacts)
                    {
                        this.Writer.Write(LocalizedStrings.GetHtmlEncoded(-1237143503));
                    }
                    else
                    {
                        this.Writer.Write(LocalizedStrings.GetHtmlEncoded(-464657744));
                    }
                    this.Writer.Write("\"");
                }
                else
                {
                    this.Writer.Write(" L_FldAll=\"");
                    if (Utilities.IsInArchiveMailbox(folder))
                    {
                        string s = string.Format(CultureInfo.InvariantCulture, LocalizedStrings.GetNonEncoded(1451900553), new object[]
                        {
                            Utilities.GetMailboxOwnerDisplayName((MailboxSession)folder.Session)
                        });
                        Utilities.HtmlEncode(s, this.Writer);
                    }
                    else
                    {
                        this.Writer.Write(LocalizedStrings.GetHtmlEncoded(-622081149));
                    }
                    this.Writer.Write("\"");
                }
            }
            if (!this.AllowAdvancedSearch)
            {
                this.Writer.Write(" style=\"");
                this.Writer.Write(base.UserContext.IsRtl ? "left:" : "right:");
                this.Writer.Write("5px;\">");
            }
            this.Writer.Write(">");
            this.Writer.Write("<div id=divTxt class=\"");
            this.Writer.Write((this.RenderSearchDropDown && folder != null && !Utilities.IsOtherMailbox(folder)) ? "txtBox" : "txtBoxNoScope");
            this.Writer.Write("\">");
            this.Writer.Write("<input type=text maxlength=256 id=txtS");
            if (this.RenderSearchDropDown)
            {
                string s2;
                switch (value)
                {
                case SearchScope.SelectedFolder:
                    s2 = string.Format(CultureInfo.InvariantCulture, LocalizedStrings.GetNonEncoded(-41655958), new object[]
                    {
                        this.ContainerName
                    });
                    goto IL_442;

                case SearchScope.SelectedAndSubfolders:
                    s2 = string.Format(CultureInfo.InvariantCulture, LocalizedStrings.GetNonEncoded(-444616176), new object[]
                    {
                        this.ContainerName
                    });
                    goto IL_442;

                case SearchScope.AllItemsInModule:
                    if (outlookModule == OutlookModule.Contacts)
                    {
                        s2 = LocalizedStrings.GetNonEncoded(-1237143503);
                        goto IL_442;
                    }
                    s2 = LocalizedStrings.GetNonEncoded(-464657744);
                    goto IL_442;
                }
                if (Utilities.IsInArchiveMailbox(folder))
                {
                    s2 = string.Format(CultureInfo.InvariantCulture, LocalizedStrings.GetNonEncoded(1451900553), new object[]
                    {
                        Utilities.GetMailboxOwnerDisplayName((MailboxSession)folder.Session)
                    });
                }
                else
                {
                    s2 = LocalizedStrings.GetNonEncoded(-622081149);
                }
IL_442:
                this.Writer.Write(" class=inactv fScp=1 value=\"");
                Utilities.HtmlEncode(s2, this.Writer);
                this.Writer.Write("\"");
            }
            this.Writer.Write("></div>");
            this.Writer.Write("<div ");
            if (folder != null && Utilities.IsOtherMailbox(folder))
            {
                this.Writer.Write("class=\"sImgb iactv\" ");
            }
            else
            {
                this.Writer.Write("class=\"sImg iactv\" ");
            }
            if (!this.RenderSearchDropDown)
            {
                this.Writer.Write(" style=\"");
                this.Writer.Write(base.UserContext.IsRtl ? "left:" : "right:");
                this.Writer.Write("0px;\"");
            }
            this.Writer.Write("id=divSIcon>");
            base.UserContext.RenderThemeImage(this.Writer, ThemeFileId.Search, null, new object[]
            {
                "id=imgS"
            });
            this.Writer.Write("</div>");
            if (folder == null || !Utilities.IsOtherMailbox(folder))
            {
                this.Writer.Write("<div id=divSScp class=iactv");
                this.Writer.Write(this.RenderSearchDropDown ? ">" : " style=\"display:none\">");
                base.UserContext.RenderThemeImage(this.Writer, ThemeFileId.DownButton3);
                this.Writer.Write("</div>");
            }
            this.Writer.Write("</div>");
            if (this.AllowAdvancedSearch)
            {
                this.Writer.Write("<div id=divASChevron>");
                base.UserContext.RenderThemeImage(this.Writer, ThemeFileId.Expand, null, new object[]
                {
                    "id=imgSAS",
                    "title=\"" + LocalizedStrings.GetHtmlEncoded(903934295) + "\""
                });
                base.UserContext.RenderThemeImage(this.Writer, ThemeFileId.Collapse, null, new object[]
                {
                    "id=imgHAS",
                    "style=display:none",
                    "title=\"" + LocalizedStrings.GetHtmlEncoded(-5515128) + "\""
                });
                this.Writer.Write("</div>");
            }
            this.Writer.Write("</div>");
            this.Writer.Write("<div id=divAS style=\"display:none;\">");
            if (this is FolderListViewSubPage && !flag && !mailboxSession.Mailbox.IsContentIndexingEnabled && !flag2)
            {
                this.Writer.Write("<div id=divDsblCI style=\"display:none\">");
                RenderingUtilities.RenderError(base.UserContext, this.Writer, -485624509);
                this.Writer.Write("</div>");
            }
            this.Writer.Write("</div>");
            this.Writer.Write("</div>");
        }
Ejemplo n.º 3
0
        // Token: 0x06002BED RID: 11245 RVA: 0x000F5698 File Offset: 0x000F3898
        protected void RenderNoScriptInfobar()
        {
            SanitizedHtmlString noScriptHtml = Utilities.GetNoScriptHtml();

            RenderingUtilities.RenderError(base.UserContext, base.Response.Output, noScriptHtml);
        }