MarkItUp.SingleUserBlog.Web/TwoColumn.master.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using MarkItUp.SingleUserBlog.Common;

    public partial class TwoColumnMasterPage : MasterPage {
        protected UserControl pnlPageTasks;
        protected MarkItUp.SingleUserBlog.UI.WebParts.BlogWebPartManager WebPartManager1;
        protected HtmlContainerControl pagecontainer;
        protected HtmlContainerControl editorpanel;
        protected Repeater rptMainMenu;
        protected HtmlLink linkWebFeed;
        protected HtmlLink linkRsd;
        protected HtmlMeta metaKeywords;
        protected HtmlMeta metaDescription;

        protected override void OnInit(EventArgs e) {
            base.OnInit(e);

            Page.Title = BlogConfigurationSettings.BlogTitle;
            metaKeywords.Content = BlogConfigurationSettings.Keywords;
            metaDescription.Content = BlogConfigurationSettings.Description;
            linkWebFeed.Attributes["title"] = BlogConfigurationSettings.BlogTitle + " web feed";
            // Windows Live Writer doesn't support a relative path here - it has to be fully qualified with the domain name
            linkRsd.Href = Globals.UrlStartPath + "Rsd.ashx";

            if (!Page.ClientScript.IsClientScriptBlockRegistered("dialogURL")) {
                string script = string.Format("var dialogPage = \"{0}CatalogDialog.aspx\"", Globals.UrlStartPath);
                Page.ClientScript.RegisterClientScriptBlock(GetType(), "dialogURL", script, true) ;
            }
        }

        protected override void OnPreRender(EventArgs e) {
            base.OnPreRender(e);

            pnlPageTasks.Visible = WebPartManager1.Personalization.CanEnterSharedScope;
            ToggleEditorZone();
            FilterMenuItems();
        }


        private void ToggleEditorZone() {

            WebPartDisplayMode mode = WebPartManager1.DisplayMode;
            bool displaySidePanel = (
                    (mode == WebPartManager.EditDisplayMode && WebPartManager1.SelectedWebPart != null)
                    |
                    (mode == WebPartManager.CatalogDisplayMode)
                );

            
            if (displaySidePanel) {
                pagecontainer.Attributes.Add("class", "lz");
                editorpanel.Attributes.Add("class", "rzs");
            } else {
                pagecontainer.Attributes.Add("class", "lzs");
                editorpanel.Attributes.Add("class", "rz");
后面还有 36 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。