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

📄 faketicker.cs

📁 Csharp网络应用案例导航 Csharp网络应用案例导航
💻 CS
字号:
using System;
using System.Collections;

namespace Ticker
{
	/// <summary>
	///  FakeTicker class.
	/// </summary>
	[Serializable]
	public class FakeTicker : EventArgs
	{
		private string strName;
		private int nValue;
		private Random rand;

		/// <summary>
		/// 名字属性
		/// The name of this ticker
		/// </summary>
		public string Name
		{
			get
			{
				return strName;
			}
			set
			{
				strName = value;
			}
		}

		/// <summary>
		/// Value属性
		///  The current value for this ticker
		/// </summary>
		public int Value
		{
			get
			{
				return nValue;
			}
			set
			{
				nValue = value;
			}
		}

		/// <summary>
		/// block the standard constructor
		/// </summary>
		private FakeTicker()
		{
		}

		/// <summary>
		/// 构造函数
		/// public constructor
		/// </summary>
		/// <param name="sName">The Name for this FakeTicker</param>
		/// <param name="nCount">The Starting parameter for this FakeTicker</param>
		public FakeTicker( string sName, int nSeed )
		{
			///根据nSeed的值产生一个随机数列
			rand = new Random( nSeed );
			Value = rand.Next();
			Name = sName;
		}


		/// <summary>
		///更新ticker的值
		///  Calculate the value for this ticker
		/// </summary>
		/// <returns>The next random value for this ticker</returns>
		public int Calculate()
		{
			return Value = rand.Next();
		}

	}

}

⌨️ 快捷键说明

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