⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 font.cs

📁 是一款式CSDN阅读器,可以方便CSDN用户阅读自己感兴趣的内容!
💻 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;
			}
		}
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -