浏览代码

* CounterCreationData.cs: Implemented
* CounterCreationDataCollection.cs: Implemented
* CounterSample.cs: Stubbed Out
* CounterSampleCalculator.cs: Stubbed Out
* InstanceData.cs: Implemented
* InstanceDataCollection.cs: Implemented
* InstanceDataCollectionCollection.cs: Implemented
* MonitoringDescriptionAttribute.cs: Implemented
* PerformanceCounter.cs: Stubbed Out
* PerformanceCounterCategory.cs: Stubbed Out
* PerformanceCounterInstaller.cs: Stubbed Out
* PerformanceCounterManager.cs: Stubbed Out
* PerformanceCounterPermission.cs: Stubbed Out
* PerformanceCounterPermissionAccess.cs: Implemented
* PerformanceCounterPermissionAttribute.cs: Stubbed Out
* PerformanceCounterPermissionEntry.cs: Stubbed Out
* PerformanceCounterPermissionEntryCollection.cs: Implemented
* PerformanceCounterType.cs: Implemented

svn path=/trunk/mcs/; revision=5770

Jonathan Pryor 23 年之前
父节点
当前提交
bce4656698

+ 52 - 0
mcs/class/System/System.Diagnostics/CounterCreationData.cs

@@ -0,0 +1,52 @@
+//
+// System.Diagnostics.CounterCreationData.cs
+//
+// Authors:
+//   Jonathan Pryor ([email protected])
+//
+// (C) 2002
+//
+
+using System;
+using System.Diagnostics;
+
+namespace System.Diagnostics {
+
+	[Serializable]
+	public class CounterCreationData {
+
+		private string help;
+		private string name;
+		private PerformanceCounterType type;
+
+		public CounterCreationData ()
+		{
+		}
+
+		public CounterCreationData (string counterName, 
+			string counterHelp, 
+			PerformanceCounterType counterType)
+		{
+			name = counterName;
+			help = counterHelp;
+			type = counterType;
+		}
+
+		public string CounterHelp {
+			get {return help;}
+			set {help = value;}
+		}
+
+		public string CounterName {
+			get {return name;}
+			set {name = value;}
+		}
+
+		// may throw InvalidEnumArgumentException
+		public PerformanceCounterType CounterType {
+			get {return type;}
+			set {type = value;}
+		}
+	}
+}
+

+ 97 - 0
mcs/class/System/System.Diagnostics/CounterCreationDataCollection.cs

@@ -0,0 +1,97 @@
+//
+// System.Diagnostics.CounterCreationDataCollection.cs
+//
+// Authors:
+//   Jonathan Pryor ([email protected])
+//
+// (C) 2002
+//
+
+using System;
+using System.Collections;
+using System.Diagnostics;
+using System.Globalization;
+
+namespace System.Diagnostics {
+
+	[Serializable]
+	public class CounterCreationDataCollection : CollectionBase {
+
+		public CounterCreationDataCollection ()
+		{
+		}
+
+		public CounterCreationDataCollection (
+			CounterCreationData[] value)
+		{
+			AddRange (value);
+		}
+
+		public CounterCreationDataCollection (
+			CounterCreationDataCollection value)
+		{
+			AddRange (value);
+		}
+
+		public CounterCreationData this [int index] {
+			get {return (CounterCreationData) InnerList[index];}
+			set {InnerList[index] = value;}
+		}
+
+		public int Add (CounterCreationData value)
+		{
+			return InnerList.Add (value);
+		}
+
+		public void AddRange (CounterCreationData[] value)
+		{
+			foreach (CounterCreationData v in value)
+			{
+				Add (v);
+			}
+		}
+
+		public void AddRange (CounterCreationDataCollection value)
+		{
+			foreach (CounterCreationData v in value)
+			{
+				Add (v);
+			}
+		}
+
+		public bool Contains (CounterCreationData value)
+		{
+			return InnerList.Contains (value);
+		}
+
+		public void CopyTo (CounterCreationData[] array, int index)
+		{
+			InnerList.CopyTo (array, index);
+		}
+
+		public int IndexOf (CounterCreationData value)
+		{
+			return InnerList.IndexOf (value);
+		}
+
+		public void Insert (int index, CounterCreationData value)
+		{
+			InnerList.Insert (index, value);
+		}
+
+		protected override void OnInsert (int index, object value)
+		{
+			if (!(value is CounterCreationData))
+				throw new NotSupportedException (Locale.GetText(
+					"You can only insert " + 
+					"CounterCreationData objects into " +
+					"the collection"));
+		}
+
+		public virtual void Remove (CounterCreationData value)
+		{
+			InnerList.Remove (value);
+		}
+	}
+}
+

+ 110 - 0
mcs/class/System/System.Diagnostics/CounterSample.cs

@@ -0,0 +1,110 @@
+//
+// System.Diagnostics.CounterSample.cs
+//
+// Authors:
+//   Jonathan Pryor ([email protected])
+//
+// (C) 2002
+//
+
+using System;
+using System.Collections;
+using System.Diagnostics;
+
+namespace System.Diagnostics {
+
+	public struct CounterSample {
+		
+		private long rawValue;
+		private long baseValue;
+		private long counterFrequency;
+		private long systemFrequency;
+		private long timeStamp;
+		private long timeStamp100nSec; 
+		private long counterTimeStamp;
+		private PerformanceCounterType counterType;
+
+		CounterSample (long rawValue, 
+			long baseValue, 
+			long counterFrequency, 
+			long systemFrequency, 
+			long timeStamp, 
+			long timeStamp100nSec, 
+			PerformanceCounterType counterType)
+			: this (rawValue, baseValue, counterFrequency, 
+				systemFrequency, timeStamp, timeStamp100nSec, 
+				counterType, 0)
+		{
+		}
+
+		CounterSample (long rawValue, 
+			long baseValue, 
+			long counterFrequency, 
+			long systemFrequency, 
+			long timeStamp, 
+			long timeStamp100nSec, 
+			PerformanceCounterType counterType, 
+			long counterTimeStamp)
+		{
+			this.rawValue = rawValue;
+			this.baseValue = baseValue;
+			this.counterFrequency = counterFrequency;
+			this.systemFrequency = systemFrequency;
+			this.timeStamp = timeStamp;
+			this.timeStamp100nSec = timeStamp100nSec;
+			this.counterType = counterType;
+			this.counterTimeStamp = counterTimeStamp;
+		}
+
+		public static CounterSample Empty = new CounterSample (
+			0, 0, 0, 0, 0, 0, 
+			PerformanceCounterType.NumberOfItems32, 
+			0);
+
+		public long BaseValue {
+			get {return baseValue;}
+		}
+
+		public long CounterFrequency {
+			get {return counterFrequency;}
+		}
+
+		public long CounterTimeStamp {
+			get {return counterTimeStamp;}
+		}
+
+		public PerformanceCounterType CounterType {
+			get {return counterType;}
+		}
+
+		public long RawValue {
+			get {return rawValue;}
+		}
+
+		public long SystemFrequency {
+			get {return systemFrequency;}
+		}
+
+		public long TimeStamp {
+			get {return timeStamp;}
+		}
+
+		public long TimeStamp100nSec {
+			get {return timeStamp100nSec;}
+		}
+
+//		[MonoTODO("What's the algorithm?")]
+//		public static float Calculate (CounterSample counterSample)
+//		{
+//			throw new NotSupportedException ();
+//		}
+//
+//		[MonoTODO("What's the algorithm?")]
+//		public static float Calculate (CounterSample counterSample,
+//			CounterSample nextCounterSample)
+//		{
+//			throw new NotSupportedException ();
+//		}
+	}
+}
+

+ 32 - 0
mcs/class/System/System.Diagnostics/CounterSampleCalculator.cs

@@ -0,0 +1,32 @@
+//
+// System.Diagnostics.CounterSampleCalculator.cs
+//
+// Authors:
+//   Jonathan Pryor ([email protected])
+//
+// (C) 2002
+//
+
+using System;
+using System.Collections;
+using System.Diagnostics;
+
+namespace System.Diagnostics {
+
+	public sealed class CounterSampleCalculator {
+
+//		[MonoTODO("What's the algorithm?")]
+//		public static float ComputeCounterValue (CounterSample newSample)
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		[MonoTODO("What's the algorithm?")]
+//		public static float ComputeCounterValue (CounterSample oldSample,
+//			CounterSample newSample)
+//		{
+//			throw new NotImplementedException ();
+//		}
+	}
+}
+

+ 39 - 0
mcs/class/System/System.Diagnostics/InstanceData.cs

@@ -0,0 +1,39 @@
+//
+// System.Diagnostics.InstanceData.cs
+//
+// Authors:
+//   Jonathan Pryor ([email protected])
+//
+// (C) 2002
+//
+
+using System;
+using System.Diagnostics;
+
+namespace System.Diagnostics {
+
+	public class InstanceData {
+
+		private string instanceName;
+		private CounterSample sample;
+
+		public InstanceData (string instanceName, CounterSample sample)
+		{
+			this.instanceName = instanceName;
+			this.sample = sample;
+		}
+
+		public string InstanceName {
+			get {return instanceName;}
+		}
+
+		public long RawValue {
+			get {return sample.RawValue;}
+		}
+
+		public CounterSample Sample {
+			get {return sample;}
+		}
+	}
+}
+

+ 66 - 0
mcs/class/System/System.Diagnostics/InstanceDataCollection.cs

@@ -0,0 +1,66 @@
+//
+// System.Diagnostics.InstanceDataCollection.cs
+//
+// Authors:
+//   Jonathan Pryor ([email protected])
+//
+// (C) 2002
+//
+
+using System;
+using System.Collections;
+using System.Diagnostics;
+
+namespace System.Diagnostics {
+
+	public class InstanceDataCollection : DictionaryBase {
+
+		private string counterName;
+
+		private static void CheckNull (object value, string name)
+		{
+			if (value == null)
+				throw new ArgumentNullException (name);
+		}
+
+		// may throw ArgumentNullException
+		public InstanceDataCollection (string counterName)
+		{
+			CheckNull (counterName, "counterName");
+			this.counterName = counterName;
+		}
+
+		public string CounterName {
+			get {return counterName;}
+		}
+
+		// may throw ArgumentNullException
+		public InstanceData this [string instanceName] {
+			get {
+				CheckNull (instanceName, "instanceName");
+				return (InstanceData) Dictionary [instanceName];
+			}
+		}
+
+		public ICollection Keys {
+			get {return Dictionary.Keys;}
+		}
+
+		public ICollection Values {
+			get {return Dictionary.Values;}
+		}
+
+		// may throw ArgumentNullException
+		public bool Contains (string instanceName)
+		{
+			CheckNull (instanceName, "instanceName");
+			return Dictionary.Contains (instanceName);
+		}
+
+		public void CopyTo (InstanceData[] instances, int index)
+		{
+			Dictionary.CopyTo (instances, index);
+		}
+	}
+}
+

+ 58 - 0
mcs/class/System/System.Diagnostics/InstanceDataCollectionCollection.cs

@@ -0,0 +1,58 @@
+//
+// System.Diagnostics.InstanceDataCollectionCollection.cs
+//
+// Authors:
+//   Jonathan Pryor ([email protected])
+//
+// (C) 2002
+//
+
+using System;
+using System.Collections;
+using System.Diagnostics;
+
+namespace System.Diagnostics {
+
+	public class InstanceDataCollectionCollection : DictionaryBase {
+
+		private static void CheckNull (object value, string name)
+		{
+			if (value == null)
+				throw new ArgumentNullException (name);
+		}
+
+		// may throw ArgumentNullException
+		public InstanceDataCollectionCollection ()
+		{
+		}
+
+		// may throw ArgumentNullException
+		public InstanceDataCollection this [string counterName] {
+			get {
+				CheckNull (counterName, "counterName");
+				return (InstanceDataCollection) Dictionary [counterName];
+			}
+		}
+
+		public ICollection Keys {
+			get {return Dictionary.Keys;}
+		}
+
+		public ICollection Values {
+			get {return Dictionary.Values;}
+		}
+
+		// may throw ArgumentNullException
+		public bool Contains (string counterName)
+		{
+			CheckNull (counterName, "counterName");
+			return Dictionary.Contains (counterName);
+		}
+
+		public void CopyTo (InstanceData[] counters, int index)
+		{
+			Dictionary.CopyTo (counters, index);
+		}
+	}
+}
+

+ 29 - 0
mcs/class/System/System.Diagnostics/MonitoringDescriptionAttribute.cs

@@ -0,0 +1,29 @@
+//
+// System.Diagnostics.MonitoringDescriptionAttribute.cs
+//
+// Authors:
+//   Jonathan Pryor ([email protected])
+//
+// (C) 2002
+//
+
+using System;
+using System.ComponentModel;
+using System.Diagnostics;
+
+namespace System.Diagnostics {
+
+	[AttributeUsage (AttributeTargets.All)]
+	public class MonitoringDescriptionAttribute : DescriptionAttribute {
+
+		public MonitoringDescriptionAttribute (string description)
+			: base (description)
+		{
+		}
+
+		public override string Description {
+			get {return base.Description;}
+		}
+	}
+}
+

+ 216 - 0
mcs/class/System/System.Diagnostics/PerformanceCounter.cs

@@ -0,0 +1,216 @@
+//
+// System.Diagnostics.PerformanceCounter.cs
+//
+// Authors:
+//   Jonathan Pryor ([email protected])
+//
+// (C) 2002
+//
+
+using System;
+using System.ComponentModel;
+using System.Diagnostics;
+
+namespace System.Diagnostics {
+
+	// must be safe for multithreaded operations
+	public class PerformanceCounter : Component, ISupportInitialize {
+
+		private string categoryName;
+		private string counterName;
+		private string instanceName;
+		private string machineName;
+		private bool readOnly;
+
+		[MonoTODO("Find the actual value")]
+		public static int DefaultFileMappingSize = 0x80000;
+
+		// set catname, countname, instname to "", machname to "."
+		public PerformanceCounter ()
+		{
+			categoryName = counterName = instanceName = "";
+			machineName = ".";
+		}
+
+		// throws: InvalidOperationException (if catName or countName
+		// is ""); ArgumentNullException if either is null
+		// sets instName to "", machname to "."
+		public PerformanceCounter (String categoryName, 
+			string counterName)
+			: this (categoryName, counterName, false)
+		{
+		}
+
+		public PerformanceCounter (string categoryName, 
+			string counterName,
+			bool readOnly)
+			: this (categoryName, counterName, "", readOnly)
+		{
+		}
+
+		public PerformanceCounter (string categoryName,
+			string counterName,
+			string instanceName)
+			: this (categoryName, counterName, instanceName, false)
+		{
+		}
+
+		public PerformanceCounter (string categoryName,
+			string counterName,
+			string instanceName,
+			bool readOnly)
+		{
+
+			CategoryName = categoryName;
+			CounterName = counterName;
+
+			if (categoryName == "" || counterName == "")
+				throw new InvalidOperationException ();
+
+			InstanceName = instanceName;
+			this.instanceName = instanceName;
+			this.machineName = ".";
+			this.readOnly = readOnly;
+		}
+
+		public PerformanceCounter (string categoryName,
+			string counterName,
+			string instanceName,
+			string machineName)
+			: this (categoryName, counterName, instanceName, false)
+		{
+			this.machineName = machineName;
+		}
+
+		// may throw ArgumentNullException
+		public string CategoryName {
+			get {return categoryName;}
+			set {
+				if (value == null)
+					throw new ArgumentNullException ("categoryName");
+				categoryName = value;
+			}
+		}
+
+//		// may throw InvalidOperationException
+//		[MonoTODO]
+//		public string CounterHelp {
+//			get {return "";}
+//		}
+//
+		// may throw ArgumentNullException
+		public string CounterName {
+			get {return counterName;}
+			set {
+				if (value == null)
+					throw new ArgumentNullException ("counterName");
+				counterName = value;
+			}
+		}
+
+//		// may throw InvalidOperationException
+//		[MonoTODO]
+//		public PerformanceCounterType CounterType {
+//			get {return 0;}
+//		}
+//
+		public string InstanceName {
+			get {return instanceName;}
+			set {instanceName = value;}
+		}
+
+//		// may throw ArgumentException if machine name format is wrong
+//		[MonoTODO("What's the machine name format?")]
+//		public string MachineName {
+//			get {return machineName;}
+//			set {machineName = value;}
+//		}
+//
+//		// may throw InvalidOperationException, Win32Exception
+//		[MonoTODO]
+//		public long RawValue {
+//			get {return 0;}
+//			set {
+//				throw new NotImplementedException ();
+//			}
+//		}
+//
+//		public bool ReadOnly {
+//			get {return readOnly;}
+//			set {readOnly = value;}
+//		}
+//
+		[MonoTODO]
+		public void BeginInit ()
+		{
+			throw new NotImplementedException ();
+		}
+
+//		[MonoTODO]
+//		public void Close ()
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		[MonoTODO]
+//		public static void CloseSharedResources ()
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		// may throw InvalidOperationException, Win32Exception
+//		[MonoTODO]
+//		public long Decrement ()
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		[MonoTODO]
+//		protected override void Dispose (bool disposing)
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+		[MonoTODO]
+		public void EndInit ()
+		{
+			throw new NotImplementedException ();
+		}
+
+//		// may throw InvalidOperationException, Win32Exception
+//		[MonoTODO]
+//		public long Increment ()
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		// may throw InvalidOperationException, Win32Exception
+//		[MonoTODO]
+//		public long IncrementBy (long value)
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		// may throw InvalidOperationException, Win32Exception
+//		[MonoTODO]
+//		public CounterSample NextSample ()
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		// may throw InvalidOperationException, Win32Exception
+//		[MonoTODO]
+//		public float NextValue ()
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		// may throw InvalidOperationException, Win32Exception
+//		[MonoTODO]
+//		public void RemoveInstance ()
+//		{
+//			throw new NotImplementedException ();
+//		}
+	}
+}
+

+ 182 - 0
mcs/class/System/System.Diagnostics/PerformanceCounterCategory.cs

@@ -0,0 +1,182 @@
+//
+// System.Diagnostics.PerformanceCounterCategory.cs
+//
+// Authors:
+//   Jonathan Pryor ([email protected])
+//
+// (C) 2002
+//
+
+using System;
+using System.Diagnostics;
+
+namespace System.Diagnostics {
+
+	public class PerformanceCounterCategory {
+
+//		[MonoTODO]
+//		public PerformanceCounterCategory ()
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		// may throw ArgumentException (""), ArgumentNullException
+//		[MonoTODO]
+//		public PerformanceCounterCategory (string categoryName)
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		// may throw ArgumentException (""), ArgumentNullException
+//		[MonoTODO]
+//		public PerformanceCounterCategory (string categoryName,
+//			string machineName)
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		// may throw InvalidOperationException, Win32Exception
+//		[MonoTODO]
+//		public string CategoryHelp {
+//			get {throw new NotImplementedException ();}
+//		}
+//
+//		// may throw ArgumentException (""), ArgumentNullException
+//		[MonoTODO]
+//		public string CategoryName {
+//			get {throw new NotImplementedException ();}
+//			set {throw new NotImplementedException ();}
+//		}
+//
+//		// may throw ArgumentException
+//		[MonoTODO]
+//		public string MachineName {
+//			get {throw new NotImplementedException ();}
+//			set {throw new NotImplementedException ();}
+//		}
+//
+//		// may throw ArgumentNullException, InvalidOperationException
+//		// (categoryName isn't set), Win32Exception
+//		[MonoTODO]
+//		public bool CounterExists (string counterName)
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		// may throw ArgumentNullException, InvalidOperationException
+//		// (categoryName is ""), Win32Exception
+//		[MonoTODO]
+//		public bool CounterExists (string counterName, 
+//			string categoryName)
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		// may throw ArgumentNullException, InvalidOperationException
+//		// (categoryName is "", machine name is bad), Win32Exception
+//		[MonoTODO]
+//		public bool CounterExists (string counterName, 
+//			string categoryName,
+//			string machineName)
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		[MonoTODO]
+//		public static PerformanceCounterCategory Create (
+//			string categoryName,
+//			string categoryHelp,
+//			CounterCreationDataCollection counterData)
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		[MonoTODO]
+//		public static PerformanceCounterCategory Create (
+//			string categoryName,
+//			string categoryHelp,
+//			string counterName,
+//			string counterHelp)
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		[MonoTODO]
+//		public static void Delete (string categoryName)
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		[MonoTODO]
+//		public static bool Exists (string categoryName)
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		[MonoTODO]
+//		public static bool Exists (string categoryName, 
+//			string machineName)
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		[MonoTODO]
+//		public static PerformanceCounterCategory[] GetCategories ()
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		[MonoTODO]
+//		public static PerformanceCounterCategory[] GetCategories (
+//			string machineName)
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		[MonoTODO]
+//		public PerformanceCounter[] GetCounters ()
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		[MonoTODO]
+//		public PerformanceCounter[] GetCounters (string instanceName)
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		[MonoTODO]
+//		public string[] GetInstanceNames ()
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		[MonoTODO]
+//		public bool InstanceExists (string instanceName)
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		[MonoTODO]
+//		public bool InstanceExists (string instanceName, 
+//			string categoryName)
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		[MonoTODO]
+//		public bool InstanceExists (string instanceName, 
+//			string categoryName,
+//			string machineName)
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		[MonoTODO]
+//		public InstanceDataCollectionCollection ReadCategory ()
+//		{
+//			throw new NotImplementedException ();
+//		}
+	}
+}
+

+ 82 - 0
mcs/class/System/System.Diagnostics/PerformanceCounterInstaller.cs

@@ -0,0 +1,82 @@
+//
+// System.Diagnostics.PerformanceCounterInstaller.cs
+//
+// Authors:
+//   Jonathan Pryor ([email protected])
+//
+// (C) 2002
+//
+
+using System;
+using System.Collections;
+// using System.Configuration.Install;
+using System.Diagnostics;
+using System.ComponentModel;
+
+namespace System.Diagnostics {
+
+	public class PerformanceCounterInstaller {
+
+//		[MonoTODO]
+//		public PerformanceCounterInstaller ()
+//		{
+//		}
+//
+//		// may throw ArgumentNullException
+//		[MonoTODO]
+//		public string CategoryHelp {
+//			get {throw new NotImplementedException ();}
+//			set {
+//				if (value == null)
+//					throw new ArgumentNullException ();
+//				throw new NotImplementedException ();
+//			}
+//		}
+//
+//		[MonoTODO]
+//		public string CategoryName {
+//			get {throw new NotImplementedException ();}
+//			set {
+//				if (value == null)
+//					throw new ArgumentNullException ();
+//				throw new NotImplementedException ();
+//			}
+//		}
+//
+//		[MonoTODO]
+//		public CounterCreationDataCollection Counters {
+//			get {throw new NotImplementedException ();}
+//		}
+//
+//		[MonoTODO]
+//		public UninstallAction UninstallAction {
+//			get {throw new NotImplementedException ();}
+//			set {throw new NotImplementedException ();}
+//		}
+//
+//		[MonoTODO]
+//		public override void CopyFromComponent (IComponent component)
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		[MonoTODO]
+//		public override void Install (IDictionary stateSaver)
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		[MonoTODO]
+//		public override void Rollback (IDictionary savedState)
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		[MonoTODO]
+//		public override void Uninstall (IDictionary savedState)
+//		{
+//			throw new NotImplementedException ();
+//		}
+	}
+}
+

+ 44 - 0
mcs/class/System/System.Diagnostics/PerformanceCounterManager.cs

@@ -0,0 +1,44 @@
+//
+// System.Diagnostics.PerformanceCounterManager.cs
+//
+// Authors:
+//   Jonathan Pryor ([email protected])
+//
+// (C) 2002
+//
+
+using System;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+
+namespace System.Diagnostics {
+
+	[ComVisible(true)]
+	// [Guid("")]
+	public class PerformanceCounterManager : ICollectData {
+
+//		[MonoTODO]
+//		public PerformanceCounterManager ()
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+		[MonoTODO]
+		void ICollectData.CloseData ()
+		{
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		void ICollectData.CollectData (
+			int callIdx,
+			IntPtr valueNamePtr,
+			IntPtr dataPtr,
+			int totalBytes,
+			out IntPtr res)
+		{
+			throw new NotImplementedException ();
+		}
+	}
+}
+

+ 45 - 0
mcs/class/System/System.Diagnostics/PerformanceCounterPermission.cs

@@ -0,0 +1,45 @@
+//
+// System.Diagnostics.PerformaceCounterPermission.cs
+//
+// Authors:
+//   Jonathan Pryor ([email protected])
+//
+// (C) 2002
+//
+
+using System;
+using System.Diagnostics;
+using System.Security.Permissions;
+
+namespace System.Diagnostics {
+
+	public class PerformaceCounterPermission : ResourcePermissionBase {
+
+//		public PerformaceCounterPermission ()
+//		{
+//		}
+//
+//		public PerformaceCounterPermission (
+//			PerformanceCounterPermissionEntry[] 
+//				permissionAccessEntries)
+//		{
+//		}
+//
+//		public PerformaceCounterPermission (PermissionState state)
+//		{
+//		}
+//
+//		public PerformaceCounterPermission (
+//			PerformanceCounterPermissionAccess permissionAccess, 
+//			string machineName, 
+//			string categoryName)
+//		{
+//		}
+//
+//		public PerformanceCounterPermissionEntryCollection 
+//			PermissionEntries {
+//			get {throw new NotImplementedException ();}
+//		}
+	}
+}
+

+ 22 - 0
mcs/class/System/System.Diagnostics/PerformanceCounterPermissionAccess.cs

@@ -0,0 +1,22 @@
+//
+// System.Diagnostics.PerformanceCounterPermissionAccess.cs
+//
+// Authors:
+//   Jonathan Pryor ([email protected])
+//
+// (C) 2002
+//
+
+using System;
+using System.Diagnostics;
+
+namespace System.Diagnostics {
+
+	public enum PerformanceCounterPermissionAccess {
+		Administrator=0x0E,
+		Browse=0x02,
+		Instrument=0x06,
+		None=0x00
+	}
+}
+

+ 61 - 0
mcs/class/System/System.Diagnostics/PerformanceCounterPermissionAttribute.cs

@@ -0,0 +1,61 @@
+//
+// System.Diagnostics.PerformanceCounterPermissionAttribute.cs
+//
+// Authors:
+//   Jonathan Pryor ([email protected])
+//
+// (C) 2002
+//
+
+using System;
+using System.Diagnostics;
+using System.Security;
+using System.Security.Permissions;
+
+namespace System.Diagnostics {
+
+	[AttributeUsage(
+		AttributeTargets.Assembly |
+		AttributeTargets.Class |
+		AttributeTargets.Struct |
+		AttributeTargets.Constructor |
+		AttributeTargets.Method |
+		AttributeTargets.Event )]
+	[MonoTODO]
+	public class PerformanceCounterPermissionAttribute 
+		: CodeAccessSecurityAttribute {
+
+		[MonoTODO]
+		public PerformanceCounterPermissionAttribute (
+			SecurityAction action) 
+			: base (action)
+		{
+			throw new NotImplementedException ();
+		}
+
+//		[MonoTODO]
+//		public string CategoryName {
+//			get {throw new NotImplementedException ();}
+//			set {throw new NotImplementedException ();}
+//		}
+//
+//		[MonoTODO]
+//		public string MachineName {
+//			get {throw new NotImplementedException ();}
+//			set {throw new NotImplementedException ();}
+//		}
+//
+//		[MonoTODO]
+//		public PerformanceCounterPermissionAccess PermissionAccess {
+//			get {throw new NotImplementedException ();}
+//			set {throw new NotImplementedException ();}
+//		}
+//
+		[MonoTODO]
+		public override IPermission CreatePermission ()
+		{
+			throw new NotImplementedException ();
+		}
+	}
+}
+

+ 44 - 0
mcs/class/System/System.Diagnostics/PerformanceCounterPermissionEntry.cs

@@ -0,0 +1,44 @@
+//
+// System.Diagnostics.PerformanceCounterPermissionEntry.cs
+//
+// Authors:
+//   Jonathan Pryor ([email protected])
+//
+// (C) 2002
+//
+
+using System;
+using System.Diagnostics;
+
+namespace System.Diagnostics {
+
+	[Serializable]
+	[MonoTODO]
+	public class PerformanceCounterPermissionEntry {
+
+//		[MonoTODO]
+//		public PerformanceCounterPermissionEntry (
+//			PerformanceCounterPermissionAccess permissionAccess,
+//			string machineName,
+//			string categoryName)
+//		{
+//			throw new NotImplementedException ();
+//		}
+//
+//		[MonoTODO]
+//		public string CategoryName {
+//			get {throw new NotImplementedException ();}
+//		}
+//
+//		[MonoTODO]
+//		public string MachineName {
+//			get {throw new NotImplementedException ();}
+//		}
+//
+//		[MonoTODO]
+//		public PerformanceCounterPermissionAccess PermissionAccess {
+//			get {throw new NotImplementedException ();}
+//		}
+	}
+}
+

+ 107 - 0
mcs/class/System/System.Diagnostics/PerformanceCounterPermissionEntryCollection.cs

@@ -0,0 +1,107 @@
+//
+// System.Diagnostics.PerformanceCounterPermissionEntryCollection.cs
+//
+// Authors:
+//   Jonathan Pryor ([email protected])
+//
+// (C) 2002
+//
+
+using System;
+using System.Diagnostics;
+using System.Collections;
+using System.Globalization;
+
+namespace System.Diagnostics {
+
+	[Serializable]
+	public class PerformanceCounterPermissionEntryCollection 
+		: CollectionBase 
+	{
+		internal PerformanceCounterPermissionEntryCollection ()
+		{
+		}
+
+		public PerformanceCounterPermissionEntry this [int index] {
+			get {
+				return (PerformanceCounterPermissionEntry)
+					InnerList[index];
+			}
+			set {InnerList[index] = value;}
+		}
+
+		public int Add (PerformanceCounterPermissionEntry value)
+		{
+			return InnerList.Add (value);
+		}
+
+		public void AddRange (PerformanceCounterPermissionEntry[] value)
+		{
+			foreach (PerformanceCounterPermissionEntry e in value)
+				Add (e);
+		}
+
+		public void AddRange (
+			PerformanceCounterPermissionEntryCollection value)
+		{
+			foreach (PerformanceCounterPermissionEntry e in value)
+				Add (e);
+		}
+
+		public bool Contains (PerformanceCounterPermissionEntry value)
+		{
+			return InnerList.Contains (value);
+		}
+
+		public void CopyTo (PerformanceCounterPermissionEntry[] array,
+			int index)
+		{
+			InnerList.CopyTo (array, index);
+		}
+
+		public int IndexOf (PerformanceCounterPermissionEntry value)
+		{
+			return InnerList.IndexOf (value);
+		}
+
+		public void Insert (int index, 
+			PerformanceCounterPermissionEntry value)
+		{
+			InnerList.Insert (index, value);
+		}
+
+		protected override void OnClear ()
+		{
+		}
+
+		protected override void OnInsert (int index, object value)
+		{
+			if (!(value is PerformanceCounterPermissionEntry))
+				throw new NotSupportedException (Locale.GetText(
+					"You can only insert " +
+					"PerformanceCounterPermissionEntry " +
+					"objects into the collection."));
+		}
+
+		protected override void OnRemove (int index, object value)
+		{
+		}
+
+		protected override void OnSet (int index, 
+			object oldValue, 
+			object newValue)
+		{
+			if (!(newValue is PerformanceCounterPermissionEntry))
+				throw new NotSupportedException (Locale.GetText(
+					"You can only insert " +
+					"PerformanceCounterPermissionEntry " +
+					"objects into the collection."));
+		}
+
+		public void Remove (PerformanceCounterPermissionEntry value)
+		{
+			InnerList.Remove (value);
+		}
+	}
+}
+

+ 47 - 0
mcs/class/System/System.Diagnostics/PerformanceCounterType.cs

@@ -0,0 +1,47 @@
+//
+// System.Diagnostics.PerformanceCounterType.cs
+//
+// Authors:
+//   Jonathan Pryor ([email protected])
+//
+// (C) 2002
+//
+
+using System;
+using System.Diagnostics;
+
+namespace System.Diagnostics {
+
+	[Serializable]
+	public enum PerformanceCounterType {
+		NumberOfItemsHEX32=0x00000000,
+		NumberOfItemsHEX64=0x00000100,
+		NumberOfItems32=0x00010000,
+		NumberOfItems64=0x00010100,
+		CounterDelta32=0x00400400,
+		CounterDelta64=0x00400500,
+		SampleCounter=0x00410400,
+		CountPerTimeInterval32=0x00450400,
+		CountPerTimeInterval64=0x00450500,
+		RateOfCountsPerSecond32=0x10410400,
+		RateOfCountsPerSecond64=0x10410500,
+		RawFraction=0x20020400,
+		CounterTimer=0x20410500,
+		Timer100Ns=0x20510500,
+		SampleFraction=0x20C20400,
+		CounterTimerInverse=0x21410500,
+		Timer100NsInverse=0x21510500,
+		CounterMultiTimer=0x22410500,
+		CounterMultiTimer100Ns=0x22510500,
+		CounterMultiTimerInverse=0x23410500,
+		CounterMultiTimer100NsInverse=0x23510500,
+		AverageTimer32=0x30020400,
+		ElapsedTime=0x30240500,
+		AverageCount64=0x40020500,
+		SampleBase=0x40030401,
+		AverageBase=0x40030402,
+		RawBase=0x40030403,
+		CounterMultiBase=0x42030500
+	}
+}
+