📄 switch.aspx.cs
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
// Copyright (c) Telligent Systems Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System;
using System.Collections;
using System.Web.UI.WebControls;
using CommunityServer.Blogs.Components;
using CommunityServer.Components;
using CommunityServer.ControlPanel.UI;
using ResourceManager = CommunityServer.ControlPanel.Components.ResourceManager;
namespace CommunityServer.ControlPanel.Blogs
{
/// <summary>
/// Summary description for PostEditorPage.
/// </summary>
public class BlogSwitchPage : BaseBlogPage
{
protected CommunityServer.ControlPanel.Controls.ControlPanelSelectedNavigation SelectedNavigation1;
protected CommunityServer.ControlPanel.Controls.PanelTabControl PanelTabControl1;
protected CommunityServer.ControlPanel.Controls.ResourceControl Resourcecontrol1;
protected CommunityServer.Controls.MPContent PanelDescription;
protected CommunityServer.ControlPanel.Controls.ResourceControl Resourcecontrol2;
protected CommunityServer.Controls.MPContent DescriptionRegion;
protected CommunityServer.ControlPanel.Controls.ControlPanelNavigationSidebar Controlpanelnavigationsidebar1;
protected CommunityServer.Controls.MPContent PanelNavigation;
protected CommunityServer.ControlPanel.Controls.ResourceControl Resourcecontrol3;
protected CommunityServer.ControlPanel.Controls.Hyperlink Hyperlink1;
protected CommunityServer.Controls.MPContent TopLeft;
protected CommunityServer.ControlPanel.Controls.ResourceControl Resourcecontrol4;
protected CommunityServer.Controls.MPContent TaskRegion;
protected CommunityServer.Controls.MPContainer MPContainer;
protected CommunityServer.ControlPanel.Controls.StatusMessage Status;
protected Repeater theBlogs;
override protected void OnInit(EventArgs e)
{
this.Load += new System.EventHandler(this.Page_Load);
base.OnInit(e);
}
private void Page_Load(object sender, System.EventArgs e)
{
}
private class BlogSorter : IComparer
{
#region IComparer Members
public int Compare(object x, object y)
{
Weblog w1 = x as Weblog;
Weblog w2 = y as Weblog;
return w1.ApplicationKey.CompareTo(w2.ApplicationKey);
}
#endregion
}
protected override void Authorize()
{
ArrayList blogs = Weblogs.GetWeblogs(true,false,false);
CSContext context = CSContext.Current;
blogs = Sections.FilterByAccessControl(blogs,Permission.Post,context.User);
if(blogs == null || blogs.Count == 0)
{
Status.Success = false;
Status.Text = ResourceManager.GetString("CP_Blog_Switch_NoBlogsExist");
Status.Visible = true;
}
else
{
ArrayList list = new ArrayList(blogs);
list.Sort(new BlogSorter());
theBlogs.DataSource = list;
theBlogs.DataBind();
}
}
protected string FormatOwners(object obj)
{
if(obj == null)
return string.Empty;
else
{
return obj.ToString().Replace(";", "<br />");
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -