Author: miguel
Date: 2007-01-12 23:30:06 -0500 (Fri, 12 Jan 2007)
New Revision: 70948
Added:
trunk/mcs/class/System/System.ComponentModel/DataObjectFieldAttribute.cs
Modified:
trunk/mcs/class/System/System.ComponentModel/ChangeLog
trunk/mcs/class/System/System.Diagnostics/ChangeLog
trunk/mcs/class/System/System.Diagnostics/Trace.cs
trunk/mcs/class/System/System.Diagnostics/TraceImpl.cs
trunk/mcs/class/System/System.dll.sources
Log:
2007-01-12 Miguel de Icaza <[EMAIL PROTECTED]>
* DataObjectFieldAttribute.cs: Add new file.
2007-01-12 Miguel de Icaza <[EMAIL PROTECTED]>
* Trace.cs: Add a number of 2.0 overloads.
Modified: trunk/mcs/class/System/System.ComponentModel/ChangeLog
===================================================================
--- trunk/mcs/class/System/System.ComponentModel/ChangeLog 2007-01-13
04:10:01 UTC (rev 70947)
+++ trunk/mcs/class/System/System.ComponentModel/ChangeLog 2007-01-13
04:30:06 UTC (rev 70948)
@@ -1,3 +1,7 @@
+2007-01-12 Miguel de Icaza <[EMAIL PROTECTED]>
+
+ * DataObjectFieldAttribute.cs: Add new file.
+
2007-01-11 Dick Porter <[EMAIL PROTECTED]>
* Win32Exception.cs: Add error 50 (ERROR_NOT_SUPPORTED)
Added: trunk/mcs/class/System/System.ComponentModel/DataObjectFieldAttribute.cs
===================================================================
--- trunk/mcs/class/System/System.ComponentModel/DataObjectFieldAttribute.cs
2007-01-13 04:10:01 UTC (rev 70947)
+++ trunk/mcs/class/System/System.ComponentModel/DataObjectFieldAttribute.cs
2007-01-13 04:30:06 UTC (rev 70948)
@@ -0,0 +1,97 @@
+//
+// Copyright 2006 Novell, Inc (http://www.novell.com)
+//
+// Authors:
+// Miguel de Icaza <[EMAIL PROTECTED]>
+//
+// 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
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace System.ComponentModel
+{
+ [AttributeUsageAttribute (AttributeTargets.Property)]
+ public sealed class DataObjectFieldAttribute : Attribute
+ {
+ bool primary_key, is_identity, is_nullable;
+ int length = -1;
+
+ public DataObjectFieldAttribute (bool primaryKey)
+ {
+ primary_key = primaryKey;
+ }
+
+ public DataObjectFieldAttribute (bool primaryKey, bool
isIdentity)
+ {
+ primary_key = primaryKey;
+ is_identity = isIdentity;
+ }
+
+ public DataObjectFieldAttribute (bool primaryKey, bool
isIdentity, bool isNullable)
+ {
+ primary_key = primaryKey;
+ is_identity = isIdentity;
+ is_nullable = isNullable;
+ }
+
+ public DataObjectFieldAttribute (bool primaryKey, bool
isIdentity, bool isNullable, int length)
+ {
+ primary_key = primaryKey;
+ is_identity = isIdentity;
+ is_nullable = isNullable;
+ this.length = length;
+ }
+
+
+ public override bool Match (object obj) {
+ if (!(obj is DataObjectFieldAttribute))
+ return false;
+ return ((DataObjectFieldAttribute) obj).MethodType ==
MethodType;
+ }
+
+ public override bool Equals (object obj)
+ {
+ DataObjectFieldAttribute other = obj as
DataObjectFieldAttribute;
+ if (other == null)
+ return false;
+
+ return other.primary_key == primary_key &&
+ other.is_identity == is_identity &&
+ other.is_nullable == is_nullable &&
+ other.length == length;
+ }
+
+ public override int GetHashCode ()
+ {
+ return ((primary_key ? 1 : 0) |
+ (is_identity ? 2 : 0) |
+ (is_nullable ? 4 : 0)) ^
+ length;
+
+ }
+ }
+}
+
+#endif
Property changes on:
trunk/mcs/class/System/System.ComponentModel/DataObjectFieldAttribute.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/mcs/class/System/System.Diagnostics/ChangeLog
===================================================================
--- trunk/mcs/class/System/System.Diagnostics/ChangeLog 2007-01-13 04:10:01 UTC
(rev 70947)
+++ trunk/mcs/class/System/System.Diagnostics/ChangeLog 2007-01-13 04:30:06 UTC
(rev 70948)
@@ -1,3 +1,7 @@
+2007-01-12 Miguel de Icaza <[EMAIL PROTECTED]>
+
+ * Trace.cs: Add a number of 2.0 overloads.
+
2007-01-02 Gert Driesen <[EMAIL PROTECTED]>
* Process.cs: Allow GetProcesses and GetProcessById overloads with
Modified: trunk/mcs/class/System/System.Diagnostics/Trace.cs
===================================================================
--- trunk/mcs/class/System/System.Diagnostics/Trace.cs 2007-01-13 04:10:01 UTC
(rev 70947)
+++ trunk/mcs/class/System/System.Diagnostics/Trace.cs 2007-01-13 04:30:06 UTC
(rev 70948)
@@ -33,6 +33,7 @@
using System;
using System.Diagnostics;
+using System.Reflection;
namespace System.Diagnostics {
@@ -213,6 +214,49 @@
{
TraceImpl.WriteLineIf (condition, message, category);
}
+
+#if NET_2_0
+ void DoTrace (string kind, Assembly report, string message)
+ {
+ TraceImpl.WriteLine (String.Format ("{0} {1} : 0 :
{2}", report.Location, kind, message));
+ }
+
+ [Conditional("TRACE")]
+ public static void TraceError (string message)
+ {
+ DoTrace ("Error", Assembly.GetCallingAssembly (),
message);
+ }
+
+ [Conditional("TRACE")]
+ public static void TraceError (string message, params object []
args)
+ {
+ DoTrace ("Error", Assembly.GetCallingAssembly (),
String.Format (message, args));
+ }
+
+ [Conditional("TRACE")]
+ public static void TraceInformation (string message)
+ {
+ DoTrace ("Information", Assembly.GetCallingAssembly (),
message);
+ }
+
+ [Conditional("TRACE")]
+ public static void TraceInformation (string message, params
object [] args)
+ {
+ DoTrace ("Information", Assembly.GetCallingAssembly (),
String.Format (message, args));
+ }
+
+ [Conditional("TRACE")]
+ public static void TraceWarning (string message)
+ {
+ DoTrace ("Warning", Assembly.GetCallingAssembly (),
message);
+ }
+
+ [Conditional("TRACE")]
+ public static void TraceWarning (string message, params object
[] args)
+ {
+ DoTrace ("Warning", Assembly.GetCallingAssembly (),
String.Format (message, args));
+ }
+#endif
}
}
Modified: trunk/mcs/class/System/System.Diagnostics/TraceImpl.cs
===================================================================
--- trunk/mcs/class/System/System.Diagnostics/TraceImpl.cs 2007-01-13
04:10:01 UTC (rev 70947)
+++ trunk/mcs/class/System/System.Diagnostics/TraceImpl.cs 2007-01-13
04:30:06 UTC (rev 70948)
@@ -188,6 +188,7 @@
}
// FIXME: From testing .NET, this method should display a dialog
+ //(it probably depends on the listener)p
[MonoTODO]
public static void Fail (string message)
{
@@ -199,6 +200,7 @@
}
// FIXME: From testing .NET, this method should display a dialog
+ // (it probably depends on the listener)p
[MonoTODO]
public static void Fail (string message, string detailMessage)
{
Modified: trunk/mcs/class/System/System.dll.sources
===================================================================
--- trunk/mcs/class/System/System.dll.sources 2007-01-13 04:10:01 UTC (rev
70947)
+++ trunk/mcs/class/System/System.dll.sources 2007-01-13 04:30:06 UTC (rev
70948)
@@ -189,6 +189,7 @@
System.ComponentModel/Container.cs
System.ComponentModel/CultureInfoConverter.cs
System.ComponentModel/DataObjectAttribute.cs
+System.ComponentModel/DataObjectFieldAttribute.cs
System.ComponentModel/DataObjectMethodAttribute.cs
System.ComponentModel/DataObjectMethodType.cs
System.ComponentModel/DateTimeConverter.cs
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches