定义社区节点
源代码在线查看: font.cs
using System;
using System.Collections.Generic;
using System.Text;
namespace feiyun0112.cnblogs.com.CSDNReader.Model
{
class Font
{
private System.Drawing.Font _NoReadFont;
private System.Drawing.Font _ReadAgainFont;
private System.Drawing.Font _ReadedFont;
private System.Drawing.Font _NormalFont;
private System.Drawing.Font _RepliedFont;
private System.Drawing.Font _ReadedRepliedFont;
private string _name;
private float _size;
private System.Drawing.FontStyle _style;
public Font()
{
this._name = "Arial";
this._size = 8f;
this._style = System.Drawing.FontStyle.Regular;
}
public System.Drawing.Font NoRead
{
get
{
if (this._NoReadFont == null)
{
System.Drawing.Font font1 = this.Normal ;
if (this.Normal.FontFamily.IsStyleAvailable(System.Drawing.FontStyle.Bold))
{
this._NoReadFont = new System.Drawing.Font(font1, font1.Style | System.Drawing.FontStyle.Bold);
}
else
{
this._NoReadFont = this.Normal;
}
}
return this._NoReadFont;
}
}
public System.Drawing.Font ReadAgain
{
get
{
if (this._ReadAgainFont == null)
{
System.Drawing.Font font1 = this.Normal;
if (this.Normal.FontFamily.IsStyleAvailable(System.Drawing.FontStyle.Bold))
{
this._ReadAgainFont = new System.Drawing.Font(font1, font1.Style | System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic);
}
else
{
this._ReadAgainFont = this.Normal;
}
}
return this._ReadAgainFont;
}
}
public System.Drawing.Font Replied
{
get
{
if (this._RepliedFont == null)
{
System.Drawing.Font font1 = this.Normal;
if (this.Normal.FontFamily.IsStyleAvailable(System.Drawing.FontStyle.Bold))
{
this._RepliedFont = new System.Drawing.Font(font1, font1.Style | System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Strikeout);
}
else
{
this._RepliedFont = this.Normal;
}
}
return this._RepliedFont;
}
}
public System.Drawing.Font ReadedReplied
{
get
{
if (this._ReadedRepliedFont == null)
{
System.Drawing.Font font1 = this.Normal;
if (this.Normal.FontFamily.IsStyleAvailable(System.Drawing.FontStyle.Bold))
{
this._ReadedRepliedFont = new System.Drawing.Font(font1, font1.Style | System.Drawing.FontStyle.Strikeout);
}
else
{
this._ReadedRepliedFont = this.Normal;
}
}
return this._ReadedRepliedFont;
}
}
public System.Drawing.Font Readed
{
get
{
if (this._ReadedFont == null)
{
//System.Drawing.Font font1 = this.Normal;
this._ReadedFont = this.Normal;
}
return this._ReadedFont;
}
}
public System.Drawing.Font Normal
{
get
{
if (this._NormalFont == null)
{
this._NormalFont = new System.Drawing.Font(this._name, this._size, this._style);
}
return this._NormalFont;
}
//set
//{
// this._NormalFont = value;
// this._NoReadFont = null;
// this._ReadAgainFont = null;
// this._name = this._NormalFont.Name;
// this._size = this._NormalFont.Size;
// this._style = this._NormalFont.Style;
//}
}
}
}