📄 aboutauthor.cs
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
// Copyright (c) Telligent Systems Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System;
using System.Web.UI.WebControls;
using CommunityServer.Blogs.Components;
using CommunityServer.Components;
using CommunityServer.Controls;
namespace CommunityServer.Blogs.Controls
{
/// <summary>
/// Summary description for AboutAuthor.
/// </summary>
public class AboutAuthor : WeblogThemedControl
{
public AboutAuthor()
{
}
private IText bio;
private IText name;
private string _userName = null;
public string UserName
{
get{return _userName;}
set{_userName = value;}
}
public override void DataBind()
{
base.DataBind ();
if(!Globals.IsNullorEmpty(UserName))
{
User u = Users.GetUser(0,UserName,false,true);
if(u != null)
{
if(name != null)
{
name.Text = u.DisplayName;
}
if(bio != null && !Globals.IsNullorEmpty(u.Profile.Bio))
{
bio.Text = u.Profile.Bio;
}
}
}
}
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender (e);
if(bio == null || Globals.IsNullorEmpty(bio.Text))
{
this.Controls.Clear();
this.Visible = false;
}
}
/// <summary>
/// Override this method to attach templated or external skin controls to local references.
/// </summary>
/// <remarks>
/// This will only be called if the non-default skin is used.
/// </remarks>
protected override void AttachChildControls()
{
bio = FindText("bio");
name = FindText("username");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -