2007-08-06 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Mon, 6 Aug 2007 05:40:47 +0000 (05:40 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Mon, 6 Aug 2007 05:40:47 +0000 (05:40 -0000)
* PerformanceCounterInstanceLifetime.cs
  PerformanceCounterCategoryType.cs : new.
* ICollectData.cs ProcessStartInfo.cs
  InstanceDataCollectionCollection.cs PerformanceCounter.cs
  InstanceDataCollection.cs Process.cs :
  cosmetic attributes cleanup.

* System.dll.sources : added PerformanceCounterInstanceLifetime.cs
  and PerformanceCounterCategoryType.cs.

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

mcs/class/System/ChangeLog
mcs/class/System/System.Diagnostics/ChangeLog
mcs/class/System/System.Diagnostics/ICollectData.cs
mcs/class/System/System.Diagnostics/InstanceDataCollection.cs
mcs/class/System/System.Diagnostics/InstanceDataCollectionCollection.cs
mcs/class/System/System.Diagnostics/PerformanceCounter.cs
mcs/class/System/System.Diagnostics/PerformanceCounterCategoryType.cs [new file with mode: 0644]
mcs/class/System/System.Diagnostics/PerformanceCounterInstanceLifetime.cs [new file with mode: 0644]
mcs/class/System/System.Diagnostics/Process.cs
mcs/class/System/System.Diagnostics/ProcessStartInfo.cs
mcs/class/System/System.dll.sources

index 8f73c0b4eae88883039190b0cf90e546139bd0a4..69796c43f3a7afd895c31cf5cfd93869dbe072b9 100644 (file)
@@ -1,3 +1,8 @@
+2007-08-06  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * System.dll.sources : added PerformanceCounterInstanceLifetime.cs
+         and PerformanceCounterCategoryType.cs.
+
 2007-08-01  Atsushi Enomoto  <atsushi@ximian.com>
 
        * System_test.dll.sources : added BackgroundWorkerTest.cs.
index 898216feaffbfe56b83c20934ab9bf28e52b2932..36833c670c1bb9bcf4923cabe517ccf87f87e63b 100644 (file)
@@ -1,3 +1,12 @@
+2007-08-06  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * PerformanceCounterInstanceLifetime.cs
+         PerformanceCounterCategoryType.cs : new.
+       * ICollectData.cs ProcessStartInfo.cs
+         InstanceDataCollectionCollection.cs PerformanceCounter.cs
+         InstanceDataCollection.cs Process.cs :
+         cosmetic attributes cleanup.
+
 2007-08-03  Jb Evain  <jbevain@novell.com>
 
        * FileVersionInfo.cs: force the use of the params
index 34d5f30dccb015e8825f1fc2487a98d0259e4efa..c52f9871589b2547568d646cb80496cb73d4c032 100644 (file)
@@ -36,6 +36,9 @@ namespace System.Diagnostics
 {
        [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
        [Guid("73386977-D6FD-11D2-BED5-00C04F79E3AE")]
+#if NET_2_0
+       [ComImport]
+#endif
        public interface ICollectData {
                void CloseData ();
                [return: MarshalAs(UnmanagedType.I4)]
index e57bb5da5b61629939711c4280da1d8ec4cdf8fc..f50923f3819a2831a08528b2b1ffe125ac6addb2 100644 (file)
@@ -45,6 +45,9 @@ namespace System.Diagnostics {
                }
 
                // may throw ArgumentNullException
+#if NET_2_0
+               [Obsolete ("Use InstanceDataCollectionCollection indexer instead.")]
+#endif
                public InstanceDataCollection (string counterName)
                {
                        CheckNull (counterName, "counterName");
index 1901a92d2a1f36dd95f2792a9d050c50a4c177e1..909fed6edc92e14d6f1c59632b48c6d5c42c786c 100644 (file)
@@ -43,6 +43,9 @@ namespace System.Diagnostics {
                }
 
                // may throw ArgumentNullException
+#if NET_2_0
+               [Obsolete ("Use PerformanceCounterCategory.ReadCategory()")]
+#endif
                public InstanceDataCollectionCollection ()
                {
                }
index 6f62763b0c7a4cf58add24c450f0218a80b06ff6..61b19acfb4f8ed1878734cf40e222391b4f0183e 100644 (file)
@@ -34,11 +34,16 @@ using System;
 using System.ComponentModel;
 using System.ComponentModel.Design;
 using System.Diagnostics;
+#if NET_2_0
+using System.Runtime.ConstrainedExecution;
+#endif
 
 namespace System.Diagnostics {
 
        // must be safe for multithreaded operations
+#if !NET_2_0
        [Designer ("Microsoft.VisualStudio.Install.PerformanceCounterDesigner, " + Consts.AssemblyMicrosoft_VisualStudio)]
+#endif
        [InstallerType (typeof (PerformanceCounterInstaller))]
        public sealed class PerformanceCounter : Component, ISupportInitialize 
        {
@@ -233,6 +238,9 @@ namespace System.Diagnostics {
 
                // may throw InvalidOperationException, Win32Exception
                [MonoTODO]
+#if NET_2_0
+               [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
+#endif
                public long IncrementBy (long value)
                {
                        throw new NotImplementedException ();
@@ -254,6 +262,9 @@ namespace System.Diagnostics {
 
                // may throw InvalidOperationException, Win32Exception
                [MonoTODO]
+#if NET_2_0
+               [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
+#endif
                public void RemoveInstance ()
                {
                        throw new NotImplementedException ();
diff --git a/mcs/class/System/System.Diagnostics/PerformanceCounterCategoryType.cs b/mcs/class/System/System.Diagnostics/PerformanceCounterCategoryType.cs
new file mode 100644 (file)
index 0000000..11c6f1f
--- /dev/null
@@ -0,0 +1,40 @@
+//
+// PerformanceCounterCategoryType.cs
+//
+// Author:
+//   Atsushi Enomoto  <atsushi@ximian.com>
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_2_0
+
+namespace System.Diagnostics 
+{
+       public enum PerformanceCounterCategoryType
+       {
+               SingleInstance,
+               MultiInstance,
+               Unknown = -1,
+       }
+}
+
+#endif
diff --git a/mcs/class/System/System.Diagnostics/PerformanceCounterInstanceLifetime.cs b/mcs/class/System/System.Diagnostics/PerformanceCounterInstanceLifetime.cs
new file mode 100644 (file)
index 0000000..ffc6488
--- /dev/null
@@ -0,0 +1,39 @@
+//
+// PerformanceCounterInstanceLifetime.cs
+//
+// Author:
+//   Atsushi Enomoto  <atsushi@ximian.com>
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_2_0
+
+namespace System.Diagnostics 
+{
+       public enum PerformanceCounterInstanceLifetime
+       {
+               Global,
+               Process,
+       }
+}
+
+#endif
index c857d251104cb65081644e3f6ede5f026419d70a..c91720a7bfe1f8448401f6f5dab1eb57e91e3e16 100644 (file)
@@ -48,6 +48,9 @@ namespace System.Diagnostics {
        [Designer ("System.Diagnostics.Design.ProcessDesigner, " + Consts.AssemblySystem_Design)]
        [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
        [PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)]
+#if NET_2_0
+       [MonitoringDescription ("Represents a system process")]
+#endif
        public class Process : Component 
        {
                [StructLayout(LayoutKind.Sequential)]
@@ -404,6 +407,7 @@ namespace System.Diagnostics {
                [MonoTODO]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                [MonitoringDescription ("The number of bytes that are not pageable.")]
+               [ComVisible (false)]
                public long NonpagedSystemMemorySize64 {
                        get {
                                return(0);
@@ -413,6 +417,7 @@ namespace System.Diagnostics {
                [MonoTODO]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                [MonitoringDescription ("The number of bytes that are paged.")]
+               [ComVisible (false)]
                public long PagedMemorySize64 {
                        get {
                                return(0);
@@ -422,6 +427,7 @@ namespace System.Diagnostics {
                [MonoTODO]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                [MonitoringDescription ("The amount of paged system memory in bytes.")]
+               [ComVisible (false)]
                public long PagedSystemMemorySize64 {
                        get {
                                return(0);
@@ -431,6 +437,7 @@ namespace System.Diagnostics {
                [MonoTODO]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                [MonitoringDescription ("The maximum amount of paged memory used by this process.")]
+               [ComVisible (false)]
                public long PeakPagedMemorySize64 {
                        get {
                                return(0);
@@ -440,6 +447,7 @@ namespace System.Diagnostics {
                [MonoTODO]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                [MonitoringDescription ("The maximum amount of virtual memory used by this process.")]
+               [ComVisible (false)]
                public long PeakVirtualMemorySize64 {
                        get {
                                return(0);
@@ -449,6 +457,7 @@ namespace System.Diagnostics {
                [MonoTODO]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                [MonitoringDescription ("The maximum amount of system memory used by this process.")]
+               [ComVisible (false)]
                public long PeakWorkingSet64 {
                        get {
                                return(0);
@@ -481,6 +490,9 @@ namespace System.Diagnostics {
                [MonoTODO]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                [MonitoringDescription ("The amount of memory exclusively used by this process.")]
+#if NET_2_0
+               [Obsolete ("Use PrivateMemorySize64")]
+#endif
                public int PrivateMemorySize {
                        get {
                                return(0);
@@ -700,9 +712,20 @@ namespace System.Diagnostics {
                }
 
 #if NET_2_0
+               [MonoTODO]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [MonitoringDescription ("The amount of memory exclusively used by this process.")]
+               [ComVisible (false)]
+               public long PrivateMemorySize64 {
+                       get {
+                               return(0);
+                       }
+               }
+
                [MonoTODO]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                [MonitoringDescription ("The amount of virtual memory currently used for this process.")]
+               [ComVisible (false)]
                public long VirtualMemorySize64 {
                        get {
                                return(0);
@@ -712,6 +735,7 @@ namespace System.Diagnostics {
                [MonoTODO]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                [MonitoringDescription ("The amount of physical memory currently used for this process.")]
+               [ComVisible (false)]
                public long WorkingSet64 {
                        get {
                                return(0);
@@ -1149,7 +1173,11 @@ namespace System.Diagnostics {
                }
 
 #if NET_2_0
+               [Browsable (true)]
+               [MonitoringDescription ("Raised when it receives output data")]
                public event DataReceivedEventHandler OutputDataReceived;
+               [Browsable (true)]
+               [MonitoringDescription ("Raised when it receives error data")]
                public event DataReceivedEventHandler ErrorDataReceived;
 
                void OnOutputDataReceived (string str)
index 621b99041f93994236369131407c47c5d3ba03a3..76f359f2d355aa2ca5a4b00b4805a42f3680478d 100644 (file)
@@ -74,6 +74,9 @@ namespace System.Diagnostics
                [TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
 
                [MonitoringDescription ("Command line agruments for this process.")]
+#if NET_2_0
+               [NotifyParentPropertyAttribute (true)]
+#endif
                public string Arguments {
                        get {
                                return(arguments);
@@ -85,6 +88,9 @@ namespace System.Diagnostics
                
                [DefaultValue (false)]
                [MonitoringDescription ("Start this process with a new window.")]
+#if NET_2_0
+               [NotifyParentPropertyAttribute (true)]
+#endif
                public bool CreateNoWindow {
                        get {
                                return(create_no_window);
@@ -98,6 +104,9 @@ namespace System.Diagnostics
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Content), DefaultValue (null)]
                [Editor ("System.Diagnostics.Design.StringDictionaryEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
                [MonitoringDescription ("Environment variables used for this process.")]
+#if NET_2_0
+               [NotifyParentPropertyAttribute (true)]
+#endif
                public StringDictionary EnvironmentVariables {
                        get {
                                if (envVars == null) {
@@ -116,6 +125,9 @@ namespace System.Diagnostics
                
                [DefaultValue (false)]
                [MonitoringDescription ("Thread shows dialogboxes for errors.")]
+#if NET_2_0
+               [NotifyParentPropertyAttribute (true)]
+#endif
                public bool ErrorDialog {
                        get {
                                return(error_dialog);
@@ -139,6 +151,9 @@ namespace System.Diagnostics
                [Editor ("System.Diagnostics.Design.StartFileNameEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
                [TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
                [MonitoringDescription ("The name of the resource to start this process.")]
+#if NET_2_0
+               [NotifyParentPropertyAttribute (true)]
+#endif
                public string FileName {
                        get {
                                return(filename);
@@ -150,6 +165,9 @@ namespace System.Diagnostics
                
                [DefaultValue (false)]
                [MonitoringDescription ("Errors of this process are redirected.")]
+#if NET_2_0
+               [NotifyParentPropertyAttribute (true)]
+#endif
                public bool RedirectStandardError {
                        get {
                                return(redirect_standard_error);
@@ -161,6 +179,9 @@ namespace System.Diagnostics
                
                [DefaultValue (false)]
                [MonitoringDescription ("Standard input of this process is redirected.")]
+#if NET_2_0
+               [NotifyParentPropertyAttribute (true)]
+#endif
                public bool RedirectStandardInput {
                        get {
                                return(redirect_standard_input);
@@ -172,6 +193,9 @@ namespace System.Diagnostics
                
                [DefaultValue (false)]
                [MonitoringDescription ("Standart output of this process is redirected.")]
+#if NET_2_0
+               [NotifyParentPropertyAttribute (true)]
+#endif
                public bool RedirectStandardOutput {
                        get {
                                return(redirect_standard_output);
@@ -183,6 +207,9 @@ namespace System.Diagnostics
                
                [DefaultValue (true)]
                [MonitoringDescription ("Use the shell to start this process.")]
+#if NET_2_0
+               [NotifyParentPropertyAttribute (true)]
+#endif
                public bool UseShellExecute {
                        get {
                                return(use_shell_execute);
@@ -195,6 +222,9 @@ namespace System.Diagnostics
                [DefaultValue ("")]
                [TypeConverter ("System.Diagnostics.Design.VerbConverter, " + Consts.AssemblySystem_Design)]
                [MonitoringDescription ("The verb to apply to a used document.")]
+#if NET_2_0
+               [NotifyParentPropertyAttribute (true)]
+#endif
                public string Verb {
                        get {
                                return(verb);
@@ -214,6 +244,9 @@ namespace System.Diagnostics
                
                [DefaultValue (typeof (ProcessWindowStyle), "Normal")]
                [MonitoringDescription ("The window style used to start this process.")]
+#if NET_2_0
+               [NotifyParentPropertyAttribute (true)]
+#endif
                public ProcessWindowStyle WindowStyle {
                        get {
                                return(window_style);
@@ -227,6 +260,9 @@ namespace System.Diagnostics
                [Editor ("System.Diagnostics.Design.WorkingDirectoryEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
                [TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
                [MonitoringDescription ("The initial directory for this process.")]
+#if NET_2_0
+               [NotifyParentPropertyAttribute (true)]
+#endif
                public string WorkingDirectory {
                        get {
                                return(working_directory);
index 2fe7e02ef8b91303e1b0b7f883494a315a1004b2..50f17591c40c3e0ebb4275f1527411a6852fdcf5 100644 (file)
@@ -495,8 +495,10 @@ System.Diagnostics/MonitoringDescriptionAttribute.cs
 System.Diagnostics/NullEventLog.cs
 System.Diagnostics/OverflowAction.cs
 System.Diagnostics/PerformanceCounterCategory.cs
+System.Diagnostics/PerformanceCounterCategoryType.cs
 System.Diagnostics/PerformanceCounter.cs
 System.Diagnostics/PerformanceCounterInstaller.cs
+System.Diagnostics/PerformanceCounterInstanceLifetime.cs
 System.Diagnostics/PerformanceCounterManager.cs
 System.Diagnostics/PerformanceCounterPermissionAccess.cs
 System.Diagnostics/PerformanceCounterPermissionAttribute.cs