Explorar o código

* Microsoft.VisualBasic.dll.sources: Added DefaultArgumentValueAttribute.cs
* Makefile: Removed '/unsafe' switch to the C# compiler

* DateAndTime.cs (DateTime.Today): Changed signature of stime().

* VBMath.cs:
* Interaction.cs:
* Information.cs:
* Globals.cs:
* Financial.cs:
* FileSystem.cs:
* ErrObject.cs:
* Conversion.cs:
* Constants.cs:

* DefaultArgumentValueAttribute.cs: Added a new internal attribute
Microsoft.VisualBasic.CompilerServices.__DefaultArgumentValueAttribute
to workaround the limitations in C# syntax. Refer the comments
in the file for more information about this attribute.

* VBBinder.cs:
* StringType.cs:
* SingleType.cs:
* ShortType.cs:
* LongType.cs:
* LateBinding.cs:
* IntegerType.cs:
* FlowControl.cs:
* ExceptionUtils.cs:
* DoubleType.cs:
* DecimalType.cs:
* DateType.cs:
* CharType.cs:
* CharArrayType.cs:
* ByteType.cs:
* BooleanType.cs:

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

Jambunathan K %!s(int64=21) %!d(string=hai) anos
pai
achega
8be9944b1b
Modificáronse 32 ficheiros con 327 adicións e 142 borrados
  1. 4 0
      mcs/class/Microsoft.VisualBasic/ChangeLog
  2. 1 1
      mcs/class/Microsoft.VisualBasic/Makefile
  3. 1 0
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic.dll.sources
  4. 21 0
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ChangeLog
  5. 2 1
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Constants.cs
  6. 2 1
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Conversion.cs
  7. 12 11
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateAndTime.cs
  8. 4 5
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ErrObject.cs
  9. 39 40
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FileSystem.cs
  10. 19 20
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Financial.cs
  11. 2 1
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Globals.cs
  12. 4 6
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Information.cs
  13. 17 19
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Interaction.cs
  14. 2 2
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/BooleanType.cs
  15. 3 2
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ByteType.cs
  16. 31 0
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ChangeLog
  17. 2 2
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/CharArrayType.cs
  18. 2 2
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/CharType.cs
  19. 3 2
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DateType.cs
  20. 2 2
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DecimalType.cs
  21. 124 0
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DefaultArgumentValueAttribute.cs
  22. 2 2
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DoubleType.cs
  23. 3 3
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ExceptionUtils.cs
  24. 2 2
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/FlowControl.cs
  25. 3 2
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IntegerType.cs
  26. 3 2
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LateBinding.cs
  27. 2 2
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LongType.cs
  28. 2 2
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ShortType.cs
  29. 2 2
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/SingleType.cs
  30. 3 2
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StringType.cs
  31. 3 2
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/VBBinder.cs
  32. 5 4
      mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBMath.cs

+ 4 - 0
mcs/class/Microsoft.VisualBasic/ChangeLog

@@ -1,3 +1,7 @@
+2004-09-05  Jambunathan K  <[email protected]>
+	* Microsoft.VisualBasic.dll.sources: Added DefaultArgumentValueAttribute.cs
+	* Makefile: Removed '/unsafe' switch to the C# compiler
+
 2004-07-31  Jambunathan K  <[email protected]>
 	* Makefile: Added /unsafe switch to the compiler command line.
 	This is required as setting of Today and TimeOfDay makes a libc

+ 1 - 1
mcs/class/Microsoft.VisualBasic/Makefile

@@ -4,7 +4,7 @@ SUBDIRS =
 include ../../build/rules.make
 
 LIBRARY = Microsoft.VisualBasic.dll
-LIB_MCS_FLAGS = /r:$(corlib) /r:System.dll @Microsoft.VisualBasic.dll.resources /unsafe
+LIB_MCS_FLAGS = /r:$(corlib) /r:System.dll @Microsoft.VisualBasic.dll.resources 
 
 LIB_MCS_FLAGS_RESOURCES = $(LIB_MCS_FLAGS) 
 

+ 1 - 0
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic.dll.sources

@@ -72,3 +72,4 @@ Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/TODOAttribute.cs
 Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/Utils.cs
 Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/VBBinder.cs
 Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/VBErrors.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DefaultArgumentValueAttribute.cs

+ 21 - 0
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ChangeLog

@@ -1,3 +1,24 @@
+2004-09-05  Jambunathan K  <[email protected]>
+	* DateAndTime.cs (DateTime.Today): Changed signature of stime().
+	
+	* VBMath.cs: 
+	* Interaction.cs: 
+	* Information.cs: 
+	* Globals.cs: 
+	* Financial.cs: 
+	* FileSystem.cs: 
+	* ErrObject.cs: 
+	* Conversion.cs: 
+	* Constants.cs: 
+
+	Replaced System.ComponentModel.EditorBrowsableAttribute and
+	Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute
+	with their short and sweet equivalents.
+
+	Replaced System.ComponentModel.DefaultValueAttribute with the
+	newly introduced Microsoft.VisualBasic.CompilerServices
+	.__DefaultArgumentValueAttribute.
+
 2004-08-16  Jambunathan K  <[email protected]>
 	* Interaction.cs: 
 	* Information.cs: 

+ 2 - 1
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Constants.cs

@@ -32,9 +32,10 @@
 //
 
 using System;
+using Microsoft.VisualBasic.CompilerServices;
 
 namespace Microsoft.VisualBasic {
-	[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute] 
+	[StandardModule] 
 	sealed public class Constants {
 		private Constants () {}
 

+ 2 - 1
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Conversion.cs

@@ -32,9 +32,10 @@
 
 using System;
 using System.Text.RegularExpressions;
+using Microsoft.VisualBasic.CompilerServices;
 
 namespace Microsoft.VisualBasic {
-	[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute] 
+	[StandardModule] 
 	sealed public class Conversion {
 		///
 		/// <summary>

+ 12 - 11
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateAndTime.cs

@@ -36,10 +36,11 @@ using System;
 using System.Runtime.InteropServices;
 using System.ComponentModel;
 using System.Globalization;
+using Microsoft.VisualBasic.CompilerServices;
 
-namespace Microsoft.VisualBasic 
+namespace Microsoft.VisualBasic 
 {
-	[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute] 
+	[StandardModule] 
 	sealed public class DateAndTime {
 
 		private DateAndTime ()
@@ -53,7 +54,7 @@ namespace Microsoft.VisualBasic
 			}
 			
 			set { 
-				string [] formats = { "M-d-yyyy", "M-d-y", "M/d/yyyy", "M/d/y" };
+				string [] formats = { "M-d-yyyy", "M-d-y", "M/d/yyyy", "M/d/y" };
 
 				try {
 					DateTime dtToday = DateTime.ParseExact(value, formats,
@@ -69,9 +70,9 @@ namespace Microsoft.VisualBasic
 		}
 		
                 [DllImport("libc")]
-                unsafe static extern int stime (void *t);
+                static extern int stime (ref int t);
 
-		unsafe public static System.DateTime Today {
+		public static System.DateTime Today {
 			get { 
 				return DateTime.Today; 
 			}
@@ -82,7 +83,7 @@ namespace Microsoft.VisualBasic
                                 System.TimeSpan secondsTimeSpan = NewDate.ToUniversalTime() - new DateTime(1970, 1, 1, 0, 0, 0);
                                 int seconds = (int) secondsTimeSpan.TotalSeconds;
 
-                                if(stime((void *) &seconds) == -1)
+                                if(stime(ref seconds) == -1)
                                         throw new UnauthorizedAccessException("The caller is not the super-user.");
             		}
  
@@ -102,7 +103,7 @@ namespace Microsoft.VisualBasic
 			get { return DateTime.Now; }
 		}
 
-		unsafe public static System.DateTime TimeOfDay {  
+		public static System.DateTime TimeOfDay {  
 			get { 
 				TimeSpan TSpan = DateTime.Now.TimeOfDay;
 
@@ -118,7 +119,7 @@ namespace Microsoft.VisualBasic
 		                 TimeSpan secondsTimeSpan = NewTime.ToUniversalTime() - new DateTime(1970, 1, 1, 0, 0, 0, 0);
                 		 int seconds = (int) secondsTimeSpan.TotalSeconds;
 
-                		 if(stime((void *) &seconds) == -1)
+                		 if(stime(ref seconds) == -1)
 					 throw new UnauthorizedAccessException("The caller is not the super-user.");
            		}
  
@@ -126,8 +127,8 @@ namespace Microsoft.VisualBasic
 
 		public static string TimeString {  
 			get { return DateTime.Now.ToString("HH:mm:ss"); } 
-			set { 
-				string format = "HH:mm:ss";
+			set { 
+				string format = "HH:mm:ss";
 
 				try {
 					DateTime dtToday = DateTime.ParseExact(value, format,
@@ -138,7 +139,7 @@ namespace Microsoft.VisualBasic
 				}
 				catch {
 					throw new InvalidCastException();
-				} 
+				} 
 			} 
 		}
 	

+ 4 - 5
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ErrObject.cs

@@ -35,7 +35,6 @@
 
 using System;
 using System.Runtime.InteropServices;
-using System.ComponentModel;
 using Microsoft.VisualBasic.CompilerServices;
 using System.Diagnostics;
 
@@ -242,10 +241,10 @@ namespace Microsoft.VisualBasic
 
 		[MonoTODO]
 		public void Raise (System.Int32 Number, 
-				   [Optional, DefaultValue(null)] System.Object Source, 
-				   [Optional, DefaultValue(null)] System.Object Description, 
-				   [Optional, DefaultValue(null)] System.Object HelpFile, 
-				   [Optional, DefaultValue(null)] System.Object HelpContext) 
+				   [Optional, __DefaultArgumentValue(null)] System.Object Source, 
+				   [Optional, __DefaultArgumentValue(null)] System.Object Description, 
+				   [Optional, __DefaultArgumentValue(null)] System.Object HelpFile, 
+				   [Optional, __DefaultArgumentValue(null)] System.Object HelpContext) 
 		{ 
 			Exception e;
 			

+ 39 - 40
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FileSystem.cs

@@ -29,7 +29,6 @@ using System.Collections;
 using System.Globalization;
 using Microsoft.VisualBasic;
 using System.Runtime.InteropServices;
-using System.ComponentModel;
 using Microsoft.VisualBasic.CompilerServices;
 
 /**
@@ -124,9 +123,9 @@ namespace Microsoft.VisualBasic
 					    int fileNumber,
 					    String fileName,
 					    OpenMode mode,
-					    [Optional, DefaultValue(-1)] OpenAccess access, 
-					    [Optional, DefaultValue(-1)] OpenShare share, 
-					    [Optional, DefaultValue(-1)] int recordLength)
+					    [Optional, __DefaultArgumentValue((OpenAccess)(-1))] OpenAccess access, 
+					    [Optional, __DefaultArgumentValue((OpenShare)(-1))] OpenShare share, 
+					    [Optional, __DefaultArgumentValue(-1)] int recordLength)
 
 		{
 			if (!isFileNumberFree(fileNumber))
@@ -162,7 +161,7 @@ namespace Microsoft.VisualBasic
 
 		public static void FilePut(int fileNumber,
 					   bool value,
-					   [Optional, DefaultValue(-1)] long  recordNumber)
+					   [Optional, __DefaultArgumentValue(-1)] long  recordNumber)
 		{
 			checkRecordNumber(recordNumber,false);
 			VBFile vbFile = getVBFile(fileNumber);
@@ -172,7 +171,7 @@ namespace Microsoft.VisualBasic
 
 		public static void FilePut(int fileNumber, 
 					   byte value, 
-					   [Optional, DefaultValue((long)-1)] long  recordNumber)
+					   [Optional, __DefaultArgumentValue((long)-1)] long  recordNumber)
 		{
 			checkRecordNumber(recordNumber,false);
 			VBFile vbFile = getVBFile(fileNumber);
@@ -181,7 +180,7 @@ namespace Microsoft.VisualBasic
 
 		public static void FilePut(int fileNumber, 
 					   short value, 
-					   [Optional, DefaultValue((long)-1)] long  recordNumber)
+					   [Optional, __DefaultArgumentValue((long)-1)] long  recordNumber)
 		{
 			checkRecordNumber(recordNumber,false);
 			VBFile vbFile = getVBFile(fileNumber);
@@ -191,7 +190,7 @@ namespace Microsoft.VisualBasic
 
 		public static void FilePut(int fileNumber, 
 					   char value, 
-					   [Optional, DefaultValue((long)-1)] long  recordNumber)
+					   [Optional, __DefaultArgumentValue((long)-1)] long  recordNumber)
 		{
 			checkRecordNumber(recordNumber,false);
 			VBFile vbFile = getVBFile(fileNumber);
@@ -200,7 +199,7 @@ namespace Microsoft.VisualBasic
 
 		public static void FilePut(int fileNumber, 
 					   int value, 
-					   [Optional, DefaultValue((long)-1)] long  recordNumber)
+					   [Optional, __DefaultArgumentValue((long)-1)] long  recordNumber)
 		{
 			checkRecordNumber(recordNumber,false);
 			VBFile vbFile = getVBFile(fileNumber);
@@ -209,7 +208,7 @@ namespace Microsoft.VisualBasic
 
 		public static void FilePut(int fileNumber, 
 					   long value, 
-					   [Optional, DefaultValue((long)-1)] long  recordNumber)
+					   [Optional, __DefaultArgumentValue((long)-1)] long  recordNumber)
 		{
 			checkRecordNumber(recordNumber,false);
 			VBFile vbFile = getVBFile(fileNumber);
@@ -219,7 +218,7 @@ namespace Microsoft.VisualBasic
 
 		public static void FilePut(int fileNumber, 
 					   float value, 
-					   [Optional, DefaultValue((long)-1)] long  recordNumber)
+					   [Optional, __DefaultArgumentValue((long)-1)] long  recordNumber)
 		{
 			checkRecordNumber(recordNumber,false);
 			VBFile vbFile = getVBFile(fileNumber);
@@ -228,7 +227,7 @@ namespace Microsoft.VisualBasic
 
 		public static void FilePut(int fileNumber, 
 					   double value, 
-					   [Optional, DefaultValue((long)-1)] long  recordNumber)
+					   [Optional, __DefaultArgumentValue((long)-1)] long  recordNumber)
 		{
 			checkRecordNumber(recordNumber,false);
 			VBFile vbFile = getVBFile(fileNumber);
@@ -237,8 +236,8 @@ namespace Microsoft.VisualBasic
 
 		public static void FilePut(int fileNumber,
 					   String value,
-					   [Optional, DefaultValue((long)-1)] long recordNumber,
-					   [Optional, DefaultValue(false)] bool stringIsFixedLength)
+					   [Optional, __DefaultArgumentValue((long)-1)] long recordNumber,
+					   [Optional, __DefaultArgumentValue(false)] bool stringIsFixedLength)
 		{
 			checkRecordNumber(recordNumber,true);
 			VBFile vbFile = getVBFile(fileNumber);
@@ -247,7 +246,7 @@ namespace Microsoft.VisualBasic
 
 		public static void FilePut(int fileNumber,
 					   DateTime value,
-					   [Optional, DefaultValue((long)-1)] long  recordNumber)
+					   [Optional, __DefaultArgumentValue((long)-1)] long  recordNumber)
 		{
 			checkRecordNumber(recordNumber,false);
 			VBFile vbFile = getVBFile(fileNumber);
@@ -256,7 +255,7 @@ namespace Microsoft.VisualBasic
 
 		public static void FileGet(int fileNumber,
 					   ref bool value,
-					   [Optional, DefaultValue((long)-1)] long recordNumber) 
+					   [Optional, __DefaultArgumentValue((long)-1)] long recordNumber) 
 
 		{
 			checkRecordNumber(recordNumber,false);
@@ -316,7 +315,7 @@ namespace Microsoft.VisualBasic
 		public static void FileGet(
 					   int fileNumber,
 					   ref byte value,
-					   [Optional, DefaultValue((long)-1)] long recordNumber) 
+					   [Optional, __DefaultArgumentValue((long)-1)] long recordNumber) 
 
 		{
 			checkRecordNumber(recordNumber,false);
@@ -327,7 +326,7 @@ namespace Microsoft.VisualBasic
 		public static void FileGet(
 					   int fileNumber,
 					   ref short value,
-					   [Optional, DefaultValue((long)-1)] long recordNumber) 
+					   [Optional, __DefaultArgumentValue((long)-1)] long recordNumber) 
 
 		{
 			checkRecordNumber(recordNumber,false);
@@ -338,7 +337,7 @@ namespace Microsoft.VisualBasic
 		public static void FileGet(
 					   int fileNumber,
 					   ref char value,
-					   [Optional, DefaultValue((long)-1)] long recordNumber) 
+					   [Optional, __DefaultArgumentValue((long)-1)] long recordNumber) 
 
 
 		{
@@ -350,7 +349,7 @@ namespace Microsoft.VisualBasic
 
 		public static void FileGet(int fileNumber, 
 					   ref int value,
-   					   [Optional, DefaultValue((long)-1)] long recordNumber) 
+   					   [Optional, __DefaultArgumentValue((long)-1)] long recordNumber) 
 		{
 			checkRecordNumber(recordNumber,false);
 			VBFile vbFile = getVBFile(fileNumber);
@@ -359,7 +358,7 @@ namespace Microsoft.VisualBasic
 
 		public static void FileGet(int fileNumber, 
 					   ref long value, 
-					   [Optional, DefaultValue((long)-1)] long recordNumber) 
+					   [Optional, __DefaultArgumentValue((long)-1)] long recordNumber) 
 		{
 			checkRecordNumber(recordNumber,false);
 			VBFile vbFile = getVBFile(fileNumber);
@@ -368,7 +367,7 @@ namespace Microsoft.VisualBasic
 
 		public static void FileGet(int fileNumber,
 					   ref float value,
-					   [Optional, DefaultValue((long)-1)] long recordNumber) 
+					   [Optional, __DefaultArgumentValue((long)-1)] long recordNumber) 
 		{
 			checkRecordNumber(recordNumber,false);
 			VBFile vbFile = getVBFile(fileNumber);
@@ -377,7 +376,7 @@ namespace Microsoft.VisualBasic
 
 		public static void FileGet(int fileNumber,
 					   ref double value,
-					   [Optional, DefaultValue((long)-1)] long recordNumber) 
+					   [Optional, __DefaultArgumentValue((long)-1)] long recordNumber) 
 					   
 		{
 			checkRecordNumber(recordNumber,false);
@@ -387,7 +386,7 @@ namespace Microsoft.VisualBasic
 
 		public static void FileGet(int fileNumber,
 					   ref Decimal value,
-					   [Optional, DefaultValue((long)-1)] long recordNumber) 
+					   [Optional, __DefaultArgumentValue((long)-1)] long recordNumber) 
 					   
 		{
 			checkRecordNumber(recordNumber,false);
@@ -397,8 +396,8 @@ namespace Microsoft.VisualBasic
 
 		public static void FileGet(int fileNumber,
 					   ref string value,
-					   [Optional, DefaultValue((long)-1)] long recordNumber,
-					   [Optional, DefaultValue(false)] bool bIgnored)
+					   [Optional, __DefaultArgumentValue((long)-1)] long recordNumber,
+					   [Optional, __DefaultArgumentValue(false)] bool bIgnored)
 		{
 			checkRecordNumber(recordNumber,true);
 			VBFile vbFile = getVBFile(fileNumber);
@@ -407,7 +406,7 @@ namespace Microsoft.VisualBasic
 
 		public static void FileGet(int fileNumber,
 					   ref Object value,
-					   [Optional, DefaultValue((long)-1)] long recordNumber) 
+					   [Optional, __DefaultArgumentValue((long)-1)] long recordNumber) 
 		{
 			checkRecordNumber(recordNumber,false);
 			VBFile vbFile = getVBFile(fileNumber);
@@ -723,7 +722,7 @@ namespace Microsoft.VisualBasic
 		}
 
 		public static /*synchronized*/ String Dir(String pathName, 
-							  [Optional, DefaultValue(0)] 
+							  [Optional, __DefaultArgumentValue((FileAttribute)0)] 
 							  FileAttribute fileAttribute)
 		{
 			_fileIndex = 0;
@@ -952,7 +951,7 @@ namespace Microsoft.VisualBasic
 
 		public static void FileGetObject(int fileNumber,
 						 ref object value,
-						 [Optional, DefaultValue((long)-1)] long recordNumber) 
+						 [Optional, __DefaultArgumentValue((long)-1)] long recordNumber) 
 
 
 		{
@@ -1028,7 +1027,7 @@ namespace Microsoft.VisualBasic
 
 		public static void FileGet(int fileNumber,
 					   ref DateTime value,
-					   [Optional, DefaultValue((long)-1)] long recordNumber)
+					   [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
 
 		{
 			checkRecordNumber(recordNumber,true);
@@ -1044,9 +1043,9 @@ namespace Microsoft.VisualBasic
 
 		public static void FileGet(int fileNumber,
 					   ref Array value,
-					   [Optional, DefaultValue((long)-1)] long recordNumber, 
-					   [Optional, DefaultValue(false)] bool arrayIsDynamic, 
-					   [Optional, DefaultValue(false)] bool stringIsFixedLength) 
+					   [Optional, __DefaultArgumentValue((long)-1)] long recordNumber, 
+					   [Optional, __DefaultArgumentValue(false)] bool arrayIsDynamic, 
+					   [Optional, __DefaultArgumentValue(false)] bool stringIsFixedLength) 
 
 
 		{
@@ -1057,7 +1056,7 @@ namespace Microsoft.VisualBasic
 
 		public static void FilePutObject(int fileNumber,
 						 Object value,
-						 [Optional, DefaultValue((long)-1)] long recordNumber)
+						 [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
 
 		{
 			checkRecordNumber(recordNumber,true);
@@ -1111,7 +1110,7 @@ namespace Microsoft.VisualBasic
 		[System.ObsoleteAttribute(obsoleteMsg, false)] 
 		public static void FilePut(Object FileNumber,
 					   Object Value,
-					   [Optional, DefaultValue(-1)] System.Object RecordNumber)
+					   [Optional, __DefaultArgumentValue(-1)] System.Object RecordNumber)
 		{
 			throw new ArgumentException(Utils.GetResourceString("UseFilePutObject"));
 		}
@@ -1119,7 +1118,7 @@ namespace Microsoft.VisualBasic
 		[MonoTODO]
 		public static void FilePut(int FileNumber,
 					   ValueType Value,
-					   [Optional, DefaultValue((long)-1)] System.Int64 RecordNumber)
+					   [Optional, __DefaultArgumentValue((long)-1)] System.Int64 RecordNumber)
 
 		{
 			throw new NotImplementedException();
@@ -1127,9 +1126,9 @@ namespace Microsoft.VisualBasic
 
 		public static void FilePut(int fileNumber,
 					   Array value,
-					   [Optional, DefaultValue((long)-1)] long recordNumber,
-					   [Optional, DefaultValue(false)] bool arrayIsDynamic,
-					   [Optional, DefaultValue(false)] bool stringIsFixedLength)
+					   [Optional, __DefaultArgumentValue((long)-1)] long recordNumber,
+					   [Optional, __DefaultArgumentValue(false)] bool arrayIsDynamic,
+					   [Optional, __DefaultArgumentValue(false)] bool stringIsFixedLength)
 		{
 			checkRecordNumber(recordNumber,true);
 			VBFile vbFile = getVBFile(fileNumber);
@@ -1138,7 +1137,7 @@ namespace Microsoft.VisualBasic
 
 		public static void FilePut(int fileNumber,
 					   Decimal value,
-					   [Optional, DefaultValue((long)-1)] long  recordNumber)
+					   [Optional, __DefaultArgumentValue((long)-1)] long  recordNumber)
 		{
 			checkRecordNumber(recordNumber,true);
 			VBFile vbFile = getVBFile(fileNumber);

+ 19 - 20
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Financial.cs

@@ -32,11 +32,10 @@
 //
 
 using System;
-using System.ComponentModel;
 using System.Runtime.InteropServices;
 using Microsoft.VisualBasic.CompilerServices;
-
-namespace Microsoft.VisualBasic
+
+namespace Microsoft.VisualBasic
 {
 	[StandardModule] 
 	sealed public class Financial {
@@ -46,7 +45,7 @@ namespace Microsoft.VisualBasic
 		// Properties
 		// Methods
 		public static double DDB (double Cost, double Salvage, double Life, double Period, 
-					  [Optional, DefaultValue (2)] double Factor)
+					  [Optional, __DefaultArgumentValue(2)] double Factor)
 		{ 
 			// LAMESPEC: MSDN says Life and Factor only throws exception if < 0, but Implementation throws exception if <= 0
 			if (Cost < 0
@@ -61,8 +60,8 @@ namespace Microsoft.VisualBasic
 		}
 		
 		public static double FV (double Rate, double NPer, double Pmt, 
-					 [Optional, DefaultValue (0)] double PV, 
-					 [Optional, DefaultValue (0)] DueDate Due)
+					 [Optional, __DefaultArgumentValue(0)] double PV, 
+					 [Optional, __DefaultArgumentValue(0)] DueDate Due)
 		{ 
 			Pmt = -Pmt;
 			PV = -PV;
@@ -81,8 +80,8 @@ namespace Microsoft.VisualBasic
 		}
 		
 		public static double IPmt (double Rate, double Per, double NPer, double PV, 
-					   [Optional, DefaultValue (0)] double FV, 
-					   [Optional, DefaultValue (0)] DueDate Due)
+					   [Optional, __DefaultArgumentValue(0)] double FV, 
+					   [Optional, __DefaultArgumentValue(0)] DueDate Due)
 		{ 
 			double totalFutureVal;
 			double totalPaymentValue;
@@ -104,7 +103,7 @@ namespace Microsoft.VisualBasic
 			return (totalFutureVal * Rate);
 		}
 		
-		public static double IRR (ref double[] ValueArray, [Optional, DefaultValue (0.1)] double Guess) 
+		public static double IRR (ref double[] ValueArray, [Optional, __DefaultArgumentValue(0.1)] double Guess) 
 		{ 
 			double origPV, updatedPV, updateGuess, tmp;
 			double rateDiff = 0.0;
@@ -207,8 +206,8 @@ namespace Microsoft.VisualBasic
 		}
 		
 		public static double NPer (double Rate, double Pmt, double PV, 
-					   [Optional, DefaultValue (0)] double FV, 
-					   [Optional, DefaultValue (0)] DueDate Due)
+					   [Optional, __DefaultArgumentValue(0)] double FV, 
+					   [Optional, __DefaultArgumentValue(0)] DueDate Due)
 		{ 
 			double totalIncomeFromFlow, sumOfPvAndPayment, currentValueOfPvAndPayment;
 			if (Rate == 0 && Pmt == 0)
@@ -261,8 +260,8 @@ namespace Microsoft.VisualBasic
 		}
 		
 		public static double Pmt (double Rate, double NPer, double PV, 
-					  [Optional, DefaultValue (0)] double FV, 
-					  [Optional, DefaultValue (0)] DueDate Due)
+					  [Optional, __DefaultArgumentValue(0)] double FV, 
+					  [Optional, __DefaultArgumentValue(0)] DueDate Due)
 		{ 
 			PV = -PV;
 			FV = -FV;
@@ -289,8 +288,8 @@ namespace Microsoft.VisualBasic
 		}
 		
 		public static double PPmt (double Rate, double Per, double NPer, double PV, 
-					   [Optional, DefaultValue (0)] double FV, 
-					   [Optional, DefaultValue (0)] DueDate Due)
+					   [Optional, __DefaultArgumentValue(0)] double FV, 
+					   [Optional, __DefaultArgumentValue(0)] DueDate Due)
 		{ 
 			if ((Per <= 0) || (Per >= (NPer + 1)))
 				throw new ArgumentException(Utils.GetResourceString ("PPMT_PerGT0AndLTNPer", "Per"));
@@ -300,8 +299,8 @@ namespace Microsoft.VisualBasic
 		}
 		
 		public static double PV (double Rate, double NPer, double Pmt, 
-					 [Optional, DefaultValue (0)] double FV, 
-					 [Optional, DefaultValue (0)] DueDate Due)
+					 [Optional, __DefaultArgumentValue(0)] double FV, 
+					 [Optional, __DefaultArgumentValue(0)] DueDate Due)
 		{ 
 			Pmt = -Pmt;
 			FV = -FV;
@@ -318,9 +317,9 @@ namespace Microsoft.VisualBasic
 		}
 		
 		public static double Rate (double NPer, double Pmt, double PV, 
-					   [Optional, DefaultValue (0)] double FV, 
-					   [Optional, DefaultValue (0)] DueDate Due, 
-					   [Optional, DefaultValue (0.1)] double Guess)
+					   [Optional, __DefaultArgumentValue(0)] double FV, 
+					   [Optional, __DefaultArgumentValue(0)] DueDate Due, 
+					   [Optional, __DefaultArgumentValue(0.1)] double Guess)
 		{ 
 			double updatedGuess, tmp, origFv, updatedFv;
 			double rateDiff = 0.0;

+ 2 - 1
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Globals.cs

@@ -32,10 +32,11 @@
   */
 
 using System;
+using Microsoft.VisualBasic.CompilerServices;
 
 namespace Microsoft.VisualBasic {
 
-	[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+	[StandardModule]
 	sealed public class Globals	{
 		
 		// prevent public constructor

+ 4 - 6
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Information.cs

@@ -37,14 +37,12 @@
 
 using System;
 using System.Runtime.InteropServices;
-using System.ComponentModel;
 using System.Globalization;
+using Microsoft.VisualBasic.CompilerServices;
 
 namespace Microsoft.VisualBasic
 {
-	using CompilerServices;
-
-	[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute] 
+	[StandardModule] 
 	sealed public class Information {
 
 		private Information ()
@@ -232,7 +230,7 @@ namespace Microsoft.VisualBasic
 		}
 
 		public static System.Int32 UBound (System.Array Array, 
-						   [Optional, DefaultValue(1)] 
+						   [Optional, __DefaultArgumentValue(1)] 
 						   System.Int32 Rank) 
 		{ 
 			Exception e;
@@ -256,7 +254,7 @@ namespace Microsoft.VisualBasic
 		}
 
 		public static System.Int32 LBound (System.Array Array, 
-						   [Optional, DefaultValue(1)] 
+						   [Optional, __DefaultArgumentValue(1)] 
 						   System.Int32 Rank) 
 		{ 
 			Exception e;

+ 17 - 19
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Interaction.cs

@@ -38,15 +38,13 @@ using System.Reflection;
 using System.Collections;
 using System.Diagnostics;
 using System.Runtime.InteropServices;
-using System.ComponentModel;
+using Microsoft.VisualBasic.CompilerServices;
 
 //using Windows.Drawing;
 //using System.Windows.Forms;
 
-using Microsoft.VisualBasic.CompilerServices;
-
 namespace Microsoft.VisualBasic {
-	[StandardModuleAttribute] 
+	[StandardModule] 
 	[StructLayoutAttribute(LayoutKind.Auto)] 
 	sealed public class Interaction {
 
@@ -58,9 +56,9 @@ namespace Microsoft.VisualBasic {
 		// Methods
 		//[MonoTODO]
 		public static System.Int32 Shell (System.String Pathname, 
-						  [Optional, DefaultValue(2)] AppWinStyle Style, 
-						  [Optional, DefaultValue(false)] System.Boolean Wait, 
-						  [Optional, DefaultValue(-1)] System.Int32 Timeout)
+						  [Optional, __DefaultArgumentValue(2)] AppWinStyle Style, 
+						  [Optional, __DefaultArgumentValue(false)] System.Boolean Wait, 
+						  [Optional, __DefaultArgumentValue(-1)] System.Int32 Timeout)
 		{ 
 			Process prcs = new Process();
 
@@ -125,10 +123,10 @@ namespace Microsoft.VisualBasic {
 			
 		[MonoTODO]
 		public static System.String InputBox (System.String Prompt, 
-						      [Optional, DefaultValue("")] System.String Title, 
-						      [Optional, DefaultValue("")] System.String DefaultResponse, 
-						      [Optional, DefaultValue(-1)] System.Int32 XPos, 
-						      [Optional, DefaultValue(-1)] System.Int32 YPos)
+						      [Optional, __DefaultArgumentValue("")] System.String Title, 
+						      [Optional, __DefaultArgumentValue("")] System.String DefaultResponse, 
+						      [Optional, __DefaultArgumentValue(-1)] System.Int32 XPos, 
+						      [Optional, __DefaultArgumentValue(-1)] System.Int32 YPos)
 		{ 
 			throw new NotImplementedException ();
 		}
@@ -219,8 +217,8 @@ namespace Microsoft.VisualBasic {
 			
 		[MonoTODO]
 		public static void DeleteSetting (System.String AppName, 
-						  [Optional, DefaultValue(null)] System.String Section, 
-						  [Optional, DefaultValue(null)] System.String Key)
+						  [Optional, __DefaultArgumentValue(null)] System.String Section, 
+						  [Optional, __DefaultArgumentValue(null)] System.String Key)
 		{ 
 			throw new NotImplementedException ();
 		}
@@ -235,7 +233,7 @@ namespace Microsoft.VisualBasic {
 		public static System.String GetSetting (System.String AppName, 
 							System.String Section, 
 							System.String Key, 
-							[Optional, DefaultValue("")] System.String Default)
+							[Optional, __DefaultArgumentValue("")] System.String Default)
 		{ 
 			throw new NotImplementedException ();
 		}
@@ -248,14 +246,14 @@ namespace Microsoft.VisualBasic {
 			
 		[MonoTODO]
 		public static System.Object CreateObject (System.String ProgId, 
-							  [Optional, DefaultValue("")] System.String ServerName)
+							  [Optional, __DefaultArgumentValue("")] System.String ServerName)
 		{ 
 			throw new NotImplementedException ();
 		}
 			
 		[MonoTODO]
-		public static System.Object GetObject ([Optional, DefaultValue(null)] System.String PathName, 
-						       [Optional, DefaultValue(null)] System.String Class)
+		public static System.Object GetObject ([Optional, __DefaultArgumentValue(null)] System.String PathName, 
+						       [Optional, __DefaultArgumentValue(null)] System.String Class)
 		{ 
 			throw new NotImplementedException ();
 		}
@@ -376,8 +374,8 @@ namespace Microsoft.VisualBasic {
 
 		[MonoTODO]
 		public static MsgBoxResult MsgBox (System.Object Prompt, 
-						   [Optional, DefaultValue(0)]MsgBoxStyle Buttons, 
-						   [Optional, DefaultValue(null)] System.Object Title)
+						   [Optional, __DefaultArgumentValue(0)]MsgBoxStyle Buttons, 
+						   [Optional, __DefaultArgumentValue(null)] System.Object Title)
 		{ 
 			throw new NotImplementedException ();
 			/*	//MessageButtons msgBoxButtons = 0;

+ 2 - 2
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/BooleanType.cs

@@ -32,11 +32,11 @@
   */
 using System;
 using System.Globalization;
+using System.ComponentModel;
 
 namespace Microsoft.VisualBasic.CompilerServices
 {
-	[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 
-	[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute] 
+	[StandardModule, EditorBrowsableAttribute(EditorBrowsableState.Never)] 
 	sealed public class BooleanType {
 		private BooleanType () {}
 

+ 3 - 2
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ByteType.cs

@@ -35,10 +35,11 @@
      * Class that converts objects to Byte value.
      */
 using System;
+using System.ComponentModel;
+
 namespace Microsoft.VisualBasic.CompilerServices 
 {
-	[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute] 
-	[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 
+	[StandardModule, EditorBrowsableAttribute(EditorBrowsableState.Never)] 
 	sealed public class ByteType {
 		private ByteType () {}
     

+ 31 - 0
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ChangeLog

@@ -1,3 +1,34 @@
+2004-09-05  Jambunathan K  <[email protected]>
+	* DefaultArgumentValueAttribute.cs: Added a new internal attribute
+	  Microsoft.VisualBasic.CompilerServices.__DefaultArgumentValueAttribute
+	  to workaround the limitations in C# syntax. Refer the comments
+	  in the file for more information about this attribute.
+
+	* VBBinder.cs: 
+	* StringType.cs: 
+	* SingleType.cs: 
+	* ShortType.cs: 
+	* LongType.cs: 
+	* LateBinding.cs: 
+	* IntegerType.cs: 
+	* FlowControl.cs: 
+	* ExceptionUtils.cs: 
+	* DoubleType.cs: 
+	* DecimalType.cs: 
+	* DateType.cs: 
+	* CharType.cs: 
+	* CharArrayType.cs: 
+	* ByteType.cs: 
+	* BooleanType.cs: 
+
+	Replaced System.ComponentModel.EditorBrowsableAttribute and
+	Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute
+	with their short and sweet equivalents.
+
+	Replaced System.ComponentModel.DefaultValueAttribute with the
+	newly introduced Microsoft.VisualBasic.CompilerServices
+	.__DefaultArgumentValueAttribute.
+
 2004-08-03 Satya Sudha K <[email protected]>
         * ObjectType.cs: Fix for bug #61749  
 

+ 2 - 2
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/CharArrayType.cs

@@ -30,11 +30,11 @@
   * DEALINGS IN THE SOFTWARE.
   */
 using System;
+using System.ComponentModel;
 
 namespace Microsoft.VisualBasic.CompilerServices
 {
-	[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute] 
-	[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 
+	[StandardModule, EditorBrowsable(EditorBrowsableState.Never)] 
 	sealed public class CharArrayType {
 		private CharArrayType () {}
 

+ 2 - 2
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/CharType.cs

@@ -30,11 +30,11 @@
   */
 
 using System;
+using System.ComponentModel;
 
 namespace Microsoft.VisualBasic.CompilerServices
 {
-	[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute] 
-	[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 
+	[StandardModule, EditorBrowsable(EditorBrowsableState.Never)] 
 	sealed public class CharType {
 		private CharType () {}
 

+ 3 - 2
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DateType.cs

@@ -35,9 +35,10 @@
  * Class that converts objects to DateTime object
  */
 using System;
+using System.ComponentModel;
+
 namespace Microsoft.VisualBasic.CompilerServices {
-	[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute] 
-	[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 
+	[StandardModule, EditorBrowsable(EditorBrowsableState.Never)] 
 	sealed public class DateType {
 		private DateType () {}
 

+ 2 - 2
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DecimalType.cs

@@ -31,10 +31,10 @@
   */
 using System;
 using System.Globalization;
+using System.ComponentModel;
 
 namespace Microsoft.VisualBasic.CompilerServices {
-	[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 
-	[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute] 
+	[StandardModule, EditorBrowsable(EditorBrowsableState.Never)] 
 	sealed public class DecimalType {
 		private DecimalType () {}
 

+ 124 - 0
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DefaultArgumentValueAttribute.cs

@@ -0,0 +1,124 @@
+//
+// Microsoft.VisualBasic.CompilerServices.__DefaultArgumentValueAttribute.cs
+//
+// Authors:
+//   Jambunathan K ([email protected])
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.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.
+//
+
+using System;
+
+namespace Microsoft.VisualBasic.CompilerServices
+{
+	// Many of the methods of Microsoft.VisualBasic.dll take
+	// default argument values. The whole of Mono's
+	// Microsoft.VisualBasic.dll is implemented in C# and C#
+	// provides no standard constructs that lets a method specify
+	// default argument values and set appropriate metadata on a
+	// method parameter.
+
+	// This internal attribute:
+	// Microsoft.VisualBasic.CompilerServices.__DefaultArgumentValueAttribute
+	// is used to associate a default argument value with a method
+	// parameter. 
+
+	// The compiled Microsoft.VisualBasic.dll assembly is then
+	// post-processed through a "disassemble-fixup-assemble cycle"
+	// which strips off the "__DefaultArgumentValue" custom
+	// attribute from the method parameter and replaces it with
+	// the suitable CIL parameter flags and constants.
+
+	[AttributeUsage(AttributeTargets.Parameter)]
+	internal sealed class __DefaultArgumentValueAttribute : Attribute
+	{
+		private object DefaultArgumentValue;
+
+		public __DefaultArgumentValueAttribute (bool value)
+		{
+			DefaultArgumentValue = value;
+		}
+
+		public __DefaultArgumentValueAttribute (char value)
+		{
+			DefaultArgumentValue = value;
+		}
+
+		public __DefaultArgumentValueAttribute (byte value)
+		{
+			DefaultArgumentValue = value;
+		}
+
+		public __DefaultArgumentValueAttribute (short value)
+		{
+			DefaultArgumentValue = value;
+		}
+
+		public __DefaultArgumentValueAttribute (int value)
+		{
+			DefaultArgumentValue = value;
+		}
+
+		public __DefaultArgumentValueAttribute (long value)
+		{
+			DefaultArgumentValue = value;
+		}
+
+		public __DefaultArgumentValueAttribute (float value)
+		{
+			DefaultArgumentValue = value;
+		}
+
+		public __DefaultArgumentValueAttribute (double value)
+		{
+			DefaultArgumentValue = value;
+		}
+
+		public __DefaultArgumentValueAttribute (string value)
+		{
+			DefaultArgumentValue = value;
+		}
+
+		public __DefaultArgumentValueAttribute (object value)
+		{
+			DefaultArgumentValue = value;
+		}
+
+		public object Value {
+			get { return DefaultArgumentValue; }
+		}
+
+		public override bool Equals (object obj)
+		{
+			if (!(obj is __DefaultArgumentValueAttribute))
+				return false;
+			if (obj == this)
+				return true;
+			return ((__DefaultArgumentValueAttribute) obj).Value == DefaultArgumentValue;
+		}
+
+		public override int GetHashCode()
+		{
+			return DefaultArgumentValue.GetHashCode();
+		}
+	}
+}

+ 2 - 2
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DoubleType.cs

@@ -27,11 +27,11 @@
  */
 using System;
 using System.Globalization;
+using System.ComponentModel;
 
 namespace Microsoft.VisualBasic.CompilerServices
 {
-	[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute] 
-	[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 
+	[StandardModule, EditorBrowsableAttribute(EditorBrowsableState.Never)] 
 	sealed public class DoubleType {
 		private DoubleType () {}
 

+ 3 - 3
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ExceptionUtils.cs

@@ -27,11 +27,11 @@ using System;
 using System.Collections;
 using System.Reflection;
 using System.IO;
+using System.ComponentModel;
+using System.Runtime.InteropServices;
 
 namespace Microsoft.VisualBasic.CompilerServices {
-	[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute] 
-	[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 
-	[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Auto)] 
+	[StandardModule, StructLayout(LayoutKind.Auto), EditorBrowsable(EditorBrowsableState.Never)] 
 	sealed public class ExceptionUtils {
 		private ExceptionUtils () {}
 

+ 2 - 2
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/FlowControl.cs

@@ -35,11 +35,11 @@
 
 using System;
 using System.Collections;
+using System.ComponentModel;
 
 namespace Microsoft.VisualBasic.CompilerServices 
 {
-	[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute] 
-	[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 
+	[StandardModule, EditorBrowsable(EditorBrowsableState.Never)] 
 	sealed public class FlowControl {
 		private FlowControl () {}
 

+ 3 - 2
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IntegerType.cs

@@ -32,11 +32,12 @@
   * DEALINGS IN THE SOFTWARE.
   */
 using System;
+using System.ComponentModel;
 using Microsoft.VisualBasic;
+
 namespace Microsoft.VisualBasic.CompilerServices
 {
-	[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute] 
-	[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 
+	[StandardModule, EditorBrowsable(EditorBrowsableState.Never)] 
 	sealed public class IntegerType {
 		private IntegerType () {}
 

+ 3 - 2
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LateBinding.cs

@@ -38,10 +38,11 @@
 using System;
 using System.Reflection;
 using Microsoft.VisualBasic;
+using System.ComponentModel;
+
 
 namespace Microsoft.VisualBasic.CompilerServices {
-	[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
-	[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+	[StandardModule, EditorBrowsable(EditorBrowsableState.Never)]
 	sealed public class LateBinding {
 		private LateBinding () {}
 

+ 2 - 2
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LongType.cs

@@ -31,11 +31,11 @@
   */
 
 using System;
+using System.ComponentModel;
 
 namespace Microsoft.VisualBasic.CompilerServices
 {
-	[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 
-	[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute] 
+	[StandardModule, EditorBrowsable(EditorBrowsableState.Never)] 
 	sealed public class LongType {
 		private LongType () {}
 

+ 2 - 2
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ShortType.cs

@@ -31,11 +31,11 @@
   */
 
 using System;
+using System.ComponentModel;
 
 namespace Microsoft.VisualBasic.CompilerServices
 {
-	[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute] 
-	[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 
+	[StandardModule, EditorBrowsableAttribute(EditorBrowsableState.Never)] 
 	sealed public class ShortType {
 		private ShortType () {}
 

+ 2 - 2
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/SingleType.cs

@@ -33,11 +33,11 @@
    * Class that converts objects to single value.
    */
 using System;
+using System.ComponentModel;
 using System.Globalization;
 
 namespace Microsoft.VisualBasic.CompilerServices {
-	[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 
-	[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute] 
+	[StandardModuleAttribute, EditorBrowsableAttribute(EditorBrowsableState.Never)] 
 	sealed public class SingleType {
 		private SingleType () {}
 

+ 3 - 2
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StringType.cs

@@ -35,9 +35,10 @@
 using System;
 using System.Globalization;
 using System.Text;
+using System.ComponentModel;
+
 namespace Microsoft.VisualBasic.CompilerServices {
-	[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 
-	[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute] 
+	[StandardModule, EditorBrowsableAttribute(EditorBrowsableState.Never)] 
 	sealed public class StringType {
 		private StringType () {}
 

+ 3 - 2
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/VBBinder.cs

@@ -34,11 +34,12 @@ using System;
 using System.Reflection;
 using System.Globalization;
 using Microsoft.VisualBasic;
+using System.ComponentModel;
+
 
 namespace Microsoft.VisualBasic.CompilerServices
 {
-	[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
-	[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+	[StandardModule, EditorBrowsableAttribute(EditorBrowsableState.Never)]
 	public class VBBinder : Binder
 	{
 		public VBBinder() : base()

+ 5 - 4
mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBMath.cs

@@ -33,9 +33,10 @@
 //
 
 using System;
+using Microsoft.VisualBasic.CompilerServices;
 
 namespace Microsoft.VisualBasic {
-	[Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute] 
+	[StandardModule] 
 	sealed public class VBMath {
 
 		private VBMath ()
@@ -54,12 +55,12 @@ namespace Microsoft.VisualBasic {
 			return last; 
 		}
 		public static float Rnd (float Number) 
-		{
+		{
 			if (Number == 0.0)
 			{
 				return last;
-			} 
-			else if (Number < 0.0 )
+			} 
+			else if (Number < 0.0 )
 			{
 				//fd: What does this mean?
 				//fd: ms-help://MS.VSCC/MS.MSDNVS/script56/html/vsstmRandomize