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

📄 enterprisecounter.cs

📁 用于c#.net数据库操作的类库。能把结婚集以数组的形成操作。
💻 CS
字号:
using System;
using System.Collections;
using System.Diagnostics;

namespace EnterpriseObjects
{
	public class EnterpriseCounter
	{
		// members...
		public string Name;
		public string HelpText;
		public PerformanceCounterType Type;
		public PerformanceCounter Counter;
		private Hashtable _instances = new Hashtable();

		public EnterpriseCounter()
		{
		}

		public EnterpriseCounter(string name, string helpText, PerformanceCounterType type)
		{
			Name = name;
			HelpText = helpText;
			Type = type;
		}

		public void RegisterInstance(object theObject)
		{
			// do we have this object?
			int hashCode = theObject.GetHashCode();
			if(_instances.Contains(hashCode) == false)
			{
				_instances.Add(hashCode, null);
				Counter.Increment();
			}
		}

		public void DeregisterInstance(object theObject)
		{
			// get the hashcode...
			int hashCode = theObject.GetHashCode();
			if(_instances.Contains(hashCode) == true)
			{
				_instances.Remove(hashCode);
				Counter.Decrement();
			}
		}
	}
}

⌨️ 快捷键说明

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