Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/class/Microsoft.VisualBasic')
-rw-r--r--mcs/class/Microsoft.VisualBasic/.cvsignore4
-rw-r--r--mcs/class/Microsoft.VisualBasic/Changelog21
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic.build40
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/AppWinStyle.cs18
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/CallType.cs16
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ChangeLog6
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Collection.cs314
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ComClassAttribute.cs35
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/CompareMethod.cs26
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Constants.cs136
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ControlChars.cs27
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Conversion.cs616
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateAndTime.cs478
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateFormat.cs37
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateInterval.cs22
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DueDate.cs14
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ErrObject.cs121
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FileAttribute.cs20
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FileSystem.cs422
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Financial.cs48
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FirstDayOfWeek.cs20
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FirstWeekOfYear.cs16
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Globals.cs30
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Information.cs61
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Interaction.cs39
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/BooleanType.cs32
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ByteType.cs33
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/CharArrayType.cs27
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/CharType.cs27
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DateType.cs36
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DecimalType.cs34
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DoubleType.cs33
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ExceptionUtils.cs20
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/FlowControl.cs41
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/HostServices.cs24
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IVbHost.cs20
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IncompleteInitialization.cs19
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IntegerType.cs33
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LateBinding.cs51
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LongType.cs26
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ObjectType.cs60
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/OptionCompareAttribute.cs32
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/OptionTextAttribute.cs20
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ProjectData.cs98
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ShortType.cs26
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/SingleType.cs30
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StandardModuleAttribute.cs20
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StaticLocalInitFlag.cs20
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StringType.cs94
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/TODOAttribute.cs39
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/Utils.cs31
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/MsgBoxResult.cs19
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/MsgBoxStyle.cs32
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/OpenAccess.cs16
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/OpenMode.cs17
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/OpenShare.cs17
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/SpcInfo.cs20
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Strings.cs1124
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/TODOAttribute.cs39
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/TabInfo.cs23
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/TriState.cs19
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBFixedArrayAttribute.cs30
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBFixedStringAttribute.cs26
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBMath.cs53
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VariantType.cs32
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VbStrConv.cs73
-rw-r--r--mcs/class/Microsoft.VisualBasic/Test/.cvsignore1
-rw-r--r--mcs/class/Microsoft.VisualBasic/Test/AllTests.cs33
-rw-r--r--mcs/class/Microsoft.VisualBasic/Test/ChangeLog8
-rw-r--r--mcs/class/Microsoft.VisualBasic/Test/CollectionTest.cs535
-rw-r--r--mcs/class/Microsoft.VisualBasic/Test/ConversionTest.cs674
-rw-r--r--mcs/class/Microsoft.VisualBasic/Test/DateAndTimeTest.cs388
-rw-r--r--mcs/class/Microsoft.VisualBasic/Test/Microsoft.VisualBasic_test.build63
-rw-r--r--mcs/class/Microsoft.VisualBasic/list62
-rw-r--r--mcs/class/Microsoft.VisualBasic/makefile.gnu13
75 files changed, 6830 insertions, 0 deletions
diff --git a/mcs/class/Microsoft.VisualBasic/.cvsignore b/mcs/class/Microsoft.VisualBasic/.cvsignore
new file mode 100644
index 00000000000..0c2ee6906fa
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/.cvsignore
@@ -0,0 +1,4 @@
+list
+.makefrag
+.response
+library-deps.stamp
diff --git a/mcs/class/Microsoft.VisualBasic/Changelog b/mcs/class/Microsoft.VisualBasic/Changelog
new file mode 100644
index 00000000000..3e13ab05798
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Changelog
@@ -0,0 +1,21 @@
+2002-08-15 Tim Coleman <tim@timcoleman.com>
+ * list:
+ * makefile.gnu:
+ Added files to allow build on linux.
+
+2002-05-12 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
+
+ * Microsoft.VisualBasic.Strings: Strings.cs - Merged all method implementations provided
+ by Martin Adoue, with method signatures (specially attributes) provided
+ by Chris J. Breisch. Some tweaking for the Mid member (two overloads versus third optional parameter).
+
+
+
+2002-05-18 Chris J Breisch <cjbreisch@altavista.net>
+
+ * Microsoft.VisualBasic: *.cs/Test/*.cs - Cleaned up code, added
+ implementations for Collection.cs, Conversion.cs and NUnit Tests
+ for both
+
+
+
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic.build b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic.build
new file mode 100644
index 00000000000..bc0ddd3e961
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic.build
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+
+<!-- NAnt build file for System.dll -->
+
+<project name="System" default="build">
+ <property name="debug" value="false"/>
+
+ <target name="build">
+ <mkdir dir="../lib"/>
+ <csc target="library" output="../lib/Microsoft.VisualBasic.dll" debug="${debug}">
+ <arg value="/nowarn:1595"/>
+ <arg value="/noconfig"/> <!-- don't reference ms assemblies -->
+
+ <!-- cor compare dies with these currently -->
+ <!--<arg value="/nostdlib"/>--> <!-- don't reference mscorlib -->
+ <!--<arg value="/lib:../lib/"/>-->
+ <!--<arg value="/r:..\lib\corlib.dll"/>-->
+ <!--<arg value="/r:..\lib\System.dll"/>-->
+ <arg value="/r:System.dll"/>
+ <sources>
+ <includes name="**/*.cs"/>
+ <excludes name="Test/**"/>
+ </sources>
+ <references>
+ <!--<includes name="../lib/corlib.dll"/>-->
+ <!--<includes name="../lib/System.dll"/>-->
+ </references>
+ </csc>
+ <copy file="../lib/Microsoft.VisualBasic.dll" tofile="Test/Microsoft.VisualBasic.dll"/>
+ </target>
+
+ <target name="test" depends="build">
+ <nant basedir="Test" target="test"/>
+ </target>
+
+ <target name="clean">
+ <nant basedir="Test" target="clean"/>
+ <delete file="../lib/Microsoft.VisualBasic.dll" failonerror="false"/>
+ </target>
+</project>
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/AppWinStyle.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/AppWinStyle.cs
new file mode 100644
index 00000000000..210ee7d8e4a
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/AppWinStyle.cs
@@ -0,0 +1,18 @@
+//
+// AppWinStyle.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+namespace Microsoft.VisualBasic {
+ public enum AppWinStyle : short {
+ Hide = 0,
+ NormalFocus = 1,
+ MinimizedFocus = 2,
+ MaximizedFocus = 3,
+ NormalNoFocus = 4,
+ MinimizedNoFocus = 6
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/CallType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/CallType.cs
new file mode 100644
index 00000000000..d726be52606
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/CallType.cs
@@ -0,0 +1,16 @@
+//
+// CallType.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+namespace Microsoft.VisualBasic {
+ public enum CallType : int {
+ Method = 1,
+ Get = 2,
+ Let = 4,
+ Set = 8
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ChangeLog b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ChangeLog
new file mode 100644
index 00000000000..9aa67f57abc
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ChangeLog
@@ -0,0 +1,6 @@
+2002-08-15 Tim Coleman <tim@timcoleman.com>
+ * ChangeLog:
+ Added a ChangeLog
+ * Constants.cs:
+ Make these actual constants so mcs will compile them.
+
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Collection.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Collection.cs
new file mode 100644
index 00000000000..29e171b0b38
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Collection.cs
@@ -0,0 +1,314 @@
+//
+// Collection.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+using System;
+using System.Runtime.InteropServices;
+using System.Collections;
+using System.ComponentModel;
+
+
+namespace Microsoft.VisualBasic {
+ sealed public class Collection : ICollection, IList {
+ //
+ // <summary>
+ // Collection : The BASIC Collection Object
+ // </summary>
+ //
+ // <remarks>
+ // </remarks>
+ // Declarations
+ private Hashtable m_Hashtable = new Hashtable();
+ private ArrayList m_HashIndexers = new ArrayList();
+ internal bool Modified = false;
+
+ private class ColEnumerator: IEnumerator
+ //
+ // <summary>
+ // ColEnumerator : This internal class is used
+ // for enumerating through our Collection
+ // </summary>
+ //
+ // <remarks>
+ // </remarks>
+ {
+ private int Index;
+ private Collection Col;
+ private object Item;
+
+ public ColEnumerator(Collection coll)
+ {
+ Col = coll;
+ Index = 0;
+ Col.Modified = false;
+ }
+
+ public void Reset()
+ {
+ if (Col.Modified)
+ {
+ // FIXME : spec says throw exception, MS doesn't
+ // throw new InvalidOperationException();
+ }
+ Index = 0;
+ }
+
+ public bool MoveNext()
+ {
+ if (Col.Modified)
+ {
+ // FIXME : spec says throw exception, MS doesn't
+ // throw new InvalidOperationException();
+ }
+ Index++;
+ try {
+ Item = Col[Index];
+ }
+ catch {
+ // do nothing
+ }
+
+ return Index <= Col.Count;
+ }
+
+ public object Current {
+ get {
+ if (Index == 0) {
+ // FIXME : spec says throw InvalidOperation,
+ // but MS throws IndexOutOfRange
+ throw new IndexOutOfRangeException();
+ // throw new InvalidOperationException();
+ }
+ else {
+ return Item;
+ }
+ }
+ }
+
+ // The current property on the IEnumerator interface:
+ object IEnumerator.Current {
+ get {
+ return(Current);
+ }
+ }
+ }
+ // Constructors
+ // Properties
+ System.Boolean IList.IsReadOnly {
+ get {return false;}
+ }
+
+ System.Boolean ICollection.IsSynchronized {
+ get {return m_Hashtable.IsSynchronized;}
+ }
+
+ System.Object ICollection.SyncRoot {
+ get {return m_Hashtable.SyncRoot;}
+ }
+
+ System.Boolean IList.IsFixedSize {
+ get {return false;}
+ }
+
+ public System.Int32 Count {
+ get {return m_HashIndexers.Count;}
+ }
+
+ [ReadOnly(true)]
+ [System.Runtime.CompilerServices.IndexerName("Item")]
+ public System.Object this [System.Int32 Index] {
+ get {
+ try {
+ // Collections are 1-based
+ return m_Hashtable[m_HashIndexers[Index-1]];
+ }
+ catch {
+ throw new IndexOutOfRangeException();
+ }
+ }
+ set {throw new NotImplementedException();}
+ }
+
+ [System.Runtime.CompilerServices.IndexerName("Item")]
+ public System.Object this [System.Object Index]
+ {
+ get {
+ if (Index is string) {
+ if (m_HashIndexers.IndexOf(Index) < 0) {
+ // throw new IndexOutOfRangeException();
+ // FIXME : Spec Says IndexOutOfRange...MS throws Argument
+ throw new ArgumentException();
+ }
+ return m_Hashtable[Index];
+ }
+ else {
+ throw new ArgumentException();
+ }
+ }
+ }
+
+ // Methods
+ System.Int32 IList.IndexOf (System.Object value)
+ {
+ int LastPos = 0;
+ bool Found = false;
+
+ while (!Found) {
+ LastPos = m_HashIndexers.IndexOf(value.GetHashCode(), LastPos);
+ if (LastPos == -1) {
+ Found = true;
+ } else if (m_Hashtable[m_HashIndexers[LastPos]] == value) {
+ Found = true;
+ }
+ }
+ return LastPos;
+ }
+
+ System.Boolean IList.Contains (System.Object value)
+ {
+ return m_Hashtable.ContainsValue(value);
+ }
+
+ void IList.Clear ()
+ {
+ m_Hashtable.Clear();
+ m_HashIndexers.Clear();
+ }
+
+ public void Remove (System.String Key)
+ {
+ int Index;
+
+ try {
+ Index = m_HashIndexers.IndexOf(Key) + 1;
+ Remove(Index);
+ }
+ catch {
+ throw new ArgumentException();
+ }
+ }
+
+ public void Remove (System.Int32 Index)
+ {
+ try {
+ // Collections are 1-based
+ m_Hashtable.Remove(m_HashIndexers[Index-1]);
+ m_HashIndexers.RemoveAt(Index-1);
+ Modified = true;
+ }
+ catch {
+ throw new IndexOutOfRangeException();
+ }
+ }
+
+ void IList.Remove (System.Object value)
+ {
+ if (!(value is string)) {
+ throw new ArgumentException();
+ }
+ Remove((string)value);
+ }
+
+ void IList.RemoveAt (System.Int32 index)
+ {
+ Remove(index);
+ }
+
+ void IList.Insert (System.Int32 index, System.Object value)
+ {
+ Insert(index, value, value.GetHashCode().ToString());
+ }
+
+ void Insert(System.Int32 index, System.Object value, string Key)
+ {
+ m_HashIndexers.Insert(index -1, Key);
+ m_Hashtable.Add(Key, value);
+ Modified = true;
+ }
+
+ System.Int32 IList.Add (System.Object Item)
+ {
+ return Add(Item, Item.GetHashCode().ToString());
+ }
+
+ System.Int32 Add(System.Object Item, string Key)
+ {
+ m_Hashtable.Add(Key, Item);
+ Modified = true;
+
+ return m_HashIndexers.Add(Key);
+ }
+
+ private int GetIndexPosition(System.Object Item)
+ {
+ int Position = int.MinValue;
+
+ if (Item is string) {
+ Position = m_HashIndexers.IndexOf(Item) + 1;
+ }
+ else if (Item is int) {
+ Position = Convert.ToInt32(Item);
+ }
+ else {
+ throw new InvalidCastException();
+ }
+ if (Position < 0) {
+ throw new ArgumentException();
+ }
+ return Position;
+ }
+
+ public void Add (System.Object Item,
+ [Optional] [DefaultValue(null)] String Key,
+ [Optional] [DefaultValue(null)] System.Object Before,
+ [Optional] [DefaultValue(null)] System.Object After)
+ {
+ int Position = int.MinValue;
+
+ // check for valid args
+ if (Before != null && After != null) {
+ throw new ArgumentException();
+ }
+ if (Key != null && m_HashIndexers.IndexOf(Key) != -1) {
+ throw new ArgumentException();
+ }
+ if (Before != null) {
+ Position = GetIndexPosition(Before);
+ }
+ if (After != null) {
+ Position = GetIndexPosition(After) + 1;
+ }
+ if (Key == null) {
+ Key = Item.GetHashCode().ToString();
+ }
+
+ if (Position > (m_HashIndexers.Count+1) || Position == int.MinValue) {
+ Add(Item, Key);
+ }
+ else {
+ Insert(Position, Item, Key);
+ }
+ }
+
+ void ICollection.CopyTo (System.Array array, System.Int32 index)
+ {
+ System.Array NewArray =
+ Array.CreateInstance(typeof(System.Object),
+ m_HashIndexers.Count - index);
+
+ // Collections are 1-based
+ for (int i = index -1; i < m_HashIndexers.Count; i++) {
+ NewArray.SetValue(m_Hashtable[m_HashIndexers[i]], i - index);
+ }
+ }
+
+ public IEnumerator GetEnumerator ()
+ {
+ return new ColEnumerator(this);
+ }
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ComClassAttribute.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ComClassAttribute.cs
new file mode 100644
index 00000000000..efd694246b4
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ComClassAttribute.cs
@@ -0,0 +1,35 @@
+//
+// ComClassAttribute.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+
+using System;
+
+namespace Microsoft.VisualBasic {
+ [System.AttributeUsageAttribute(System.AttributeTargets.Class)]
+ sealed public class ComClassAttribute : System.Attribute {
+ // Declarations
+ // Constructors
+ [MonoTODO]
+ ComClassAttribute(System.String _ClassID) { throw new NotImplementedException (); }
+ [MonoTODO]
+ ComClassAttribute(System.String _ClassID, System.String _InterfaceID) { throw new NotImplementedException (); }
+ [MonoTODO]
+ ComClassAttribute(System.String _ClassID, System.String _InterfaceID, System.String _EventId) { throw new NotImplementedException (); }
+ // Properties
+ [MonoTODO]
+ public System.String EventID { get { throw new NotImplementedException (); } }
+ [MonoTODO]
+ public System.Boolean InterfaceShadows { get { throw new NotImplementedException (); } }
+ [MonoTODO]
+ public System.String ClassID { get { throw new NotImplementedException (); } }
+ [MonoTODO]
+ public System.String InterfaceID { get { throw new NotImplementedException (); } }
+ // Methods
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/CompareMethod.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/CompareMethod.cs
new file mode 100644
index 00000000000..5b93a2351ef
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/CompareMethod.cs
@@ -0,0 +1,26 @@
+//
+// CompareMethod.cs
+//
+// Author:
+// Martin Adoue (martin@cwanet.com)
+//
+// (C) 2002 Martin Adoue
+//
+namespace Microsoft.VisualBasic {
+
+ /// <summary>
+ /// The CompareMethod enumeration contains constants used to determine the
+ /// way strings are compared when using functions such as InStr and StrComp.
+ /// These constants can be used anywhere in your code.
+ /// </summary>
+ public enum CompareMethod : int {
+ /// <summary>
+ /// Performs a binary comparison
+ /// </summary>
+ Binary = 0,
+ /// <summary>
+ /// Performs a textual comparison
+ /// </summary>
+ Text = 1
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Constants.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Constants.cs
new file mode 100644
index 00000000000..7ffb8f73bb8
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Constants.cs
@@ -0,0 +1,136 @@
+//
+// Constants.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+
+using System;
+
+namespace Microsoft.VisualBasic {
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ sealed public class Constants {
+ // Declarations
+ public const System.Int32 vbObjectError = (System.Int32)(-2147221504);
+ public const System.String vbCrLf = "\n\r";
+ public const System.String vbNewLine = "\n\r";
+ public const System.String vbCr = "\n";
+ public const System.String vbLf = "\r";
+ public const System.String vbBack = "\b";
+ public const System.String vbFormFeed = "\f";
+ public const System.String vbTab = "\t";
+ public const System.String vbVerticalTab = "\v";
+ public const System.String vbNullChar = "\0";
+ public const System.String vbNullString = "";
+
+ public const AppWinStyle vbHide = AppWinStyle.Hide;
+ public const AppWinStyle vbNormalFocus = AppWinStyle.NormalFocus;
+ public const AppWinStyle vbMinimizedFocus = AppWinStyle.MinimizedFocus;
+ public const AppWinStyle vbMaximizedFocus = AppWinStyle.MaximizedFocus;
+ public const AppWinStyle vbNormalNoFocus = AppWinStyle.NormalNoFocus;
+ public const AppWinStyle vbMinimizedNoFocus = AppWinStyle.MinimizedNoFocus;
+
+ public const CallType vbMethod = CallType.Method;
+ public const CallType vbGet = CallType.Get;
+ public const CallType vbLet = CallType.Let;
+ public const CallType vbSet = CallType.Set;
+
+ public const CompareMethod vbBinaryCompare = CompareMethod.Binary;
+ public const CompareMethod vbTextCompare = CompareMethod.Text;
+
+ public const DateFormat vbGeneralDate = DateFormat.GeneralDate;
+ public const DateFormat vbLongDate = DateFormat.LongDate;
+ public const DateFormat vbShortDate = DateFormat.ShortDate;
+ public const DateFormat vbLongTime = DateFormat.LongTime;
+ public const DateFormat vbShortTime = DateFormat.ShortTime;
+
+ public const FirstDayOfWeek vbUseSystemDayOfWeek = FirstDayOfWeek.System;
+ public const FirstDayOfWeek vbSunday = FirstDayOfWeek.Sunday;
+ public const FirstDayOfWeek vbMonday = FirstDayOfWeek.Monday;
+ public const FirstDayOfWeek vbTuesday = FirstDayOfWeek.Tuesday;
+ public const FirstDayOfWeek vbWednesday = FirstDayOfWeek.Wednesday;
+ public const FirstDayOfWeek vbThursday = FirstDayOfWeek.Thursday;
+ public const FirstDayOfWeek vbFriday = FirstDayOfWeek.Friday;
+ public const FirstDayOfWeek vbSaturday = FirstDayOfWeek.Saturday;
+
+ public const FileAttribute vbNormal = FileAttribute.Normal;
+ public const FileAttribute vbReadOnly = FileAttribute.ReadOnly;
+ public const FileAttribute vbHidden = FileAttribute.Hidden;
+ public const FileAttribute vbSystem = FileAttribute.System;
+ public const FileAttribute vbVolume = FileAttribute.Volume;
+ public const FileAttribute vbDirectory = FileAttribute.Directory;
+ public const FileAttribute vbArchive = FileAttribute.Archive;
+
+ public const FirstWeekOfYear vbUseSystem = FirstWeekOfYear.System;
+ public const FirstWeekOfYear vbFirstJan1 = FirstWeekOfYear.Jan1;
+ public const FirstWeekOfYear vbFirstFourDays = FirstWeekOfYear.FirstFourDays;
+ public const FirstWeekOfYear vbFirstFullWeek = FirstWeekOfYear.FirstFullWeek;
+
+ public const VbStrConv vbUpperCase = VbStrConv.UpperCase;
+ public const VbStrConv vbLowerCase = VbStrConv.LowerCase;
+ public const VbStrConv vbProperCase = VbStrConv.ProperCase;
+ public const VbStrConv vbWide = VbStrConv.Wide;
+ public const VbStrConv vbNarrow = VbStrConv.Narrow;
+ public const VbStrConv vbKatakana = VbStrConv.Katakana;
+ public const VbStrConv vbHiragana = VbStrConv.Hiragana;
+ public const VbStrConv vbSimplifiedChinese = VbStrConv.SimplifiedChinese;
+ public const VbStrConv vbTraditionalChinese = VbStrConv.TraditionalChinese;
+ public const VbStrConv vbLinguisticCasing = VbStrConv.LinguisticCasing;
+
+ public const TriState vbUseDefault = TriState.UseDefault;
+ public const TriState vbTrue = TriState.True;
+ public const TriState vbFalse = TriState.False;
+
+ public const VariantType vbEmpty = VariantType.Empty;
+ public const VariantType vbNull = VariantType.Null;
+ public const VariantType vbInteger = VariantType.Integer;
+ public const VariantType vbLong = VariantType.Long;
+ public const VariantType vbSingle = VariantType.Single;
+ public const VariantType vbDouble = VariantType.Double;
+ public const VariantType vbCurrency = VariantType.Currency;
+ public const VariantType vbDate = VariantType.Date;
+ public const VariantType vbString = VariantType.String;
+ public const VariantType vbObject = VariantType.Object;
+ public const VariantType vbBoolean = VariantType.Boolean;
+ public const VariantType vbVariant = VariantType.Variant;
+ public const VariantType vbDecimal = VariantType.Decimal;
+ public const VariantType vbByte = VariantType.Byte;
+ public const VariantType vbUserDefinedType = VariantType.UserDefinedType;
+ public const VariantType vbArray = VariantType.Array;
+
+ public const MsgBoxResult vbOK = MsgBoxResult.OK;
+ public const MsgBoxResult vbCancel = MsgBoxResult.Cancel;
+ public const MsgBoxResult vbAbort = MsgBoxResult.Abort;
+ public const MsgBoxResult vbRetry = MsgBoxResult.Retry;
+ public const MsgBoxResult vbIgnore = MsgBoxResult.Ignore;
+ public const MsgBoxResult vbYes = MsgBoxResult.Yes;
+ public const MsgBoxResult vbNo = MsgBoxResult.No;
+
+ public const MsgBoxStyle vbOKOnly = MsgBoxStyle.OKOnly;
+ public const MsgBoxStyle vbOKCancel = MsgBoxStyle.OKCancel;
+ public const MsgBoxStyle vbAbortRetryIgnore = MsgBoxStyle.AbortRetryIgnore;
+ public const MsgBoxStyle vbYesNoCancel = MsgBoxStyle.YesNoCancel;
+ public const MsgBoxStyle vbYesNo = MsgBoxStyle.YesNo;
+ public const MsgBoxStyle vbRetryCancel = MsgBoxStyle.RetryCancel;
+ public const MsgBoxStyle vbCritical = MsgBoxStyle.Critical;
+ public const MsgBoxStyle vbQuestion = MsgBoxStyle.Question;
+ public const MsgBoxStyle vbExclamation = MsgBoxStyle.Exclamation;
+ public const MsgBoxStyle vbInformation = MsgBoxStyle.Information;
+ public const MsgBoxStyle vbDefaultButton1 = MsgBoxStyle.DefaultButton1;
+ public const MsgBoxStyle vbDefaultButton2 = MsgBoxStyle.DefaultButton2;
+ public const MsgBoxStyle vbDefaultButton3 = MsgBoxStyle.DefaultButton3;
+ public const MsgBoxStyle vbApplicationModal = MsgBoxStyle.ApplicationModal;
+ public const MsgBoxStyle vbSystemModal = MsgBoxStyle.SystemModal;
+ public const MsgBoxStyle vbMsgBoxHelp = MsgBoxStyle.MsgBoxHelp;
+ public const MsgBoxStyle vbMsgBoxRight = MsgBoxStyle.MsgBoxRight;
+ public const MsgBoxStyle vbMsgBoxRtlReading = MsgBoxStyle.MsgBoxRtlReading;
+ public const MsgBoxStyle vbMsgBoxSetForeground = MsgBoxStyle.MsgBoxSetForeground;
+
+ // Constructors
+ // Properties
+ // Methods
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ControlChars.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ControlChars.cs
new file mode 100644
index 00000000000..480e4be1b25
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ControlChars.cs
@@ -0,0 +1,27 @@
+//
+// ControlChars.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+namespace Microsoft.VisualBasic {
+ sealed public class ControlChars {
+ // Declarations
+ public const System.String CrLf = "\n\r";
+ public const System.String NewLine = "\n\r";
+ public const System.Char Cr = '\n';
+ public const System.Char Lf = '\r';
+ public const System.Char Back = '\b';
+ public const System.Char FormFeed = '\f';
+ public const System.Char Tab = '\t';
+ public const System.Char VerticalTab = '\v';
+ public const System.Char NullChar = '\0';
+ public const System.Char Quote = '"';
+ // Constructors
+ // Properties
+ // Methods
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Conversion.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Conversion.cs
new file mode 100644
index 00000000000..38308a61605
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Conversion.cs
@@ -0,0 +1,616 @@
+//
+// Conversion.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+
+using System;
+using System.Text.RegularExpressions;
+
+namespace Microsoft.VisualBasic {
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ sealed public class Conversion {
+ //
+ // <summary>
+ // Collection : The BASIC Collection Object
+ // </summary>
+ //
+ // <remarks>
+ // </remarks>
+ // Declarations
+ private static readonly char[] _HexDigits = {
+ '0', '1', '2', '3', '4', '5', '6', '7',
+ '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
+ };
+ private static readonly char[] _OctDigits = {
+ '0', '1', '2', '3', '4', '5', '6', '7'
+ };
+ private static readonly long[] _Maxes = {
+ 32767, 2147483647, 9223372036854775807
+ };
+ private enum SizeIndexes {
+ Int16 = 0,
+ Int32 = 1,
+ Int64 = 2
+ };
+
+ // Constructors
+ // Properties
+ // Methods
+ [MonoTODO]
+ public static string ErrorToString () {
+ throw new NotImplementedException ();
+ }
+ [MonoTODO]
+ public static string ErrorToString (
+ System.Int32 ErrorNumber) {
+ throw new NotImplementedException ();
+ }
+
+ // Return whether d is +/- Could do this with a macro,
+ // but this is cleaner
+ private static int Sign(double d) { return d > 0 ? 1 : -1;}
+
+ // try to cast an Object to a string...used in several places
+ private static string CastToString (System.Object Expression) {
+ try {
+ return (string)Expression;
+ }
+ catch {
+ throw new InvalidCastException();
+ }
+ }
+
+ // Fix on Integer types doesn't do anything
+ public static short Fix (short Number) { return Number; }
+ public static int Fix (int Number) { return Number; }
+ public static long Fix (long Number) { return Number; }
+
+ // Fix on other numberic types = Sign(Number) * Int(Abs(Number))
+ public static double Fix (double Number) {
+ return Sign(Number) * Int (Math.Abs (Number));
+ }
+ public static float Fix (float Number) {
+ return Sign(Number) * Int (Math.Abs (Number));
+ }
+ public static decimal Fix (decimal Number) {
+ return Sign((double)Number) * Int (Math.Abs (Number));
+ }
+
+ // Fix on an Object type is trickier
+ // first we have to cast it to the right type
+ public static System.Object Fix (System.Object Number)
+ {
+ // always start out by throwing an exception
+ // if Number is null
+ if (Number == null) {
+ throw new ArgumentNullException ("Number",
+ "Value cannot be null");
+ }
+
+ TypeCode TC = Type.GetTypeCode (Number.GetType ());
+
+ // switch on TypeCode and call appropriate Fix method
+ switch (TC) {
+ case TypeCode.Decimal:
+ return Fix (Convert.ToDecimal (Number));
+ case TypeCode.Double:
+ return Fix (Convert.ToDouble (Number));
+ case TypeCode.Single:
+ return Fix (Convert.ToSingle (Number));
+ case TypeCode.String:
+ return Fix (Double.Parse (
+ CastToString (Number)));
+
+ // for integer types, don't need to do anything
+ case TypeCode.Byte:
+ case TypeCode.Int16:
+ case TypeCode.Int32:
+ case TypeCode.Int64:
+ case TypeCode.SByte:
+ case TypeCode.UInt16:
+ case TypeCode.UInt32:
+ case TypeCode.UInt64:
+ return Number;
+
+ // spec defines Empty as returning 0
+ case TypeCode.Empty:
+ return 0;
+
+ // we can't convert these types
+ case TypeCode.Boolean:
+ case TypeCode.Char:
+ case TypeCode.DateTime:
+ case TypeCode.DBNull:
+ case TypeCode.Object:
+ default:
+ throw new ArgumentException (
+ "Type of argument 'Number' is '"
+ + Number.GetType().FullName +
+ "', which is not numeric.");
+ }
+ }
+
+ // Int on Integer types doesn't do anything
+ public static short Int (short Number) { return Number; }
+ public static int Int (int Number) { return Number; }
+ public static long Int (long Number) { return Number; }
+
+ // Int on other numberic types is same thing as "Floor"
+ public static double Int (double Number) {
+ return (double) Math.Floor(Number);
+ }
+ public static float Int (float Number) {
+ return (float) Math.Floor(Number);
+ }
+ public static decimal Int (decimal Number) {
+ return Decimal.Floor(Number);
+ }
+
+ // doing an Int on an Object is trickier
+ // first we have to cast to the correct type
+ public static System.Object Int (System.Object Number) {
+ // always start out by throwing an exception
+ // if Number is null
+ if (Number == null) {
+ throw new ArgumentNullException("Number",
+ "Value cannot be null");
+ }
+
+ TypeCode TC = Type.GetTypeCode (Number.GetType ());
+
+ // switch on TypeCode and call appropriate Int method
+ switch (TC) {
+ case TypeCode.Decimal:
+ return Int (Convert.ToDecimal (Number));
+ case TypeCode.Double:
+ return Int (Convert.ToDouble (Number));
+ case TypeCode.Single:
+ return Int (Convert.ToSingle (Number));
+ case TypeCode.String:
+ return Int (Double.Parse (
+ CastToString(Number)));
+
+ // Int on integer types does nothing
+ case TypeCode.Byte:
+ case TypeCode.Int16:
+ case TypeCode.Int32:
+ case TypeCode.Int64:
+ case TypeCode.SByte:
+ case TypeCode.UInt16:
+ case TypeCode.UInt32:
+ case TypeCode.UInt64:
+ return Number;
+
+ // Spec defines Empty as returning 0
+ case TypeCode.Empty:
+ return 0;
+
+ // otherwise, it's we can't cast to a numeric
+ case TypeCode.Boolean:
+ case TypeCode.Char:
+ case TypeCode.DateTime:
+ case TypeCode.DBNull:
+ case TypeCode.Object:
+ default:
+ throw new ArgumentException (
+ "Type of argument 'Number' is '" +
+ Number.GetType().FullName +
+ "', which is not numeric.");
+ }
+ }
+
+ // we use this internally to get a string
+ // representation of a number in a specific base
+ private static string ToBase (ulong Number, int Length,
+ char[] BaseDigits, uint Base) {
+ int i;
+ ulong r;
+ // we use a char array here for performance
+ char [] c = new Char[Length];
+ string s = null;
+
+
+ for (i = Length - 1; i >= 0; i--) {
+ r = Number % Base;
+ Number = Number / Base;
+ c[i] = BaseDigits[r];
+ if (Number == 0) {
+ s = new string (c, i, Length - i);
+ break;
+ }
+ }
+ if (s == null) {
+ return new string (c);
+ }
+ else {
+ return s;
+ }
+ }
+
+
+ // convert a number to Hex
+ // a little bit of magic goes on here with negative #'s
+ private static string ToHex(long Number, int Digits,
+ SizeIndexes Size) {
+ ulong UNumber;
+
+ if (Number < 0) {
+ // we add maxint of the Number's type
+ // twice and then 2 more...this has the
+ // effect of turning it into a ulong
+ // that has the same hex representation
+ UNumber = (ulong)((Number + 2) +
+ _Maxes[(int)Size]) +
+ (ulong)_Maxes[(int)Size];
+ }
+ else {
+ UNumber = (ulong)Number;
+ }
+ return ToBase(UNumber, Digits, _HexDigits, 16);
+ }
+
+ // call our private function,
+ // passing it the size of the item to convert
+ public static string Hex (short Number) {
+ return ToHex(Number, 4, SizeIndexes.Int16);
+ }
+ public static string Hex (byte Number) {
+ return ToHex(Number, 2, SizeIndexes.Int16);
+ }
+ public static string Hex (int Number) {
+ return ToHex(Number, 8, SizeIndexes.Int32);
+ }
+ public static string Hex (long Number) {
+ return ToHex(Number, 16, SizeIndexes.Int64);
+ }
+
+ // Objects are trickier
+ // first we have to cast to appropriate type
+ public static System.String Hex (System.Object Number) {
+ // always start out by throwing an exception
+ // if Number is null
+ if (Number == null) {
+ throw new ArgumentNullException ("Number",
+ "Value cannot be null");
+ }
+
+ TypeCode TC = Type.GetTypeCode (Number.GetType ());
+
+ switch (TC) {
+ // try to parse the string as an Int32,
+ // then an Int64, if that fails
+ case TypeCode.String:
+ try {
+ return Hex (
+ Int32.Parse (
+ CastToString (Number)));
+ }
+ catch {
+ return Hex (
+ Int64.Parse (
+ CastToString (Number)));
+ }
+
+ // for the int types,
+ // just call the normal "Hex" for that type
+ case TypeCode.Byte:
+ return Hex ((byte)Number);
+ case TypeCode.Int16:
+ return Hex ((short)Number);
+ case TypeCode.Int32:
+ return Hex ((int)Number);
+ case TypeCode.Int64:
+ return Hex ((long)Number);
+
+ // empty is defined as returning 0
+ case TypeCode.Empty:
+ return "0";
+
+ // we can't do any of these types
+ case TypeCode.Boolean:
+ case TypeCode.Char:
+ case TypeCode.DBNull:
+ case TypeCode.DateTime:
+ case TypeCode.Decimal:
+ case TypeCode.Double:
+ case TypeCode.Object:
+ case TypeCode.SByte:
+ case TypeCode.Single:
+ case TypeCode.UInt16:
+ case TypeCode.UInt32:
+ case TypeCode.UInt64:
+ default:
+ throw new ArgumentException (
+ "Type of argument 'Number' is '" +
+ Number.GetType().FullName +
+ "', which is not numeric.");
+ }
+ }
+
+ // ToOct works just like ToHex, only in Octal.
+ private static string ToOct(long Number, int Digits,
+ SizeIndexes Size) {
+ ulong UNumber;
+
+ if (Number < 0) {
+ // for neg numbers add the maxint of
+ // the appropriate size twice, and then two more
+ // this has the effect of turning it
+ // into a ulong with the same oct representation
+ UNumber = (ulong)((Number + 2) +
+ _Maxes[(int)Size]) +
+ (ulong)(_Maxes[(int)Size]);
+ }
+ else {
+ UNumber = (ulong)Number;
+ }
+ return ToBase (UNumber, Digits, _OctDigits, 8);
+ }
+
+ // call ToOct with appropriate information
+ public static string Oct (short Number) {
+ return ToOct(Number, 6, SizeIndexes.Int16);
+ }
+ public static string Oct (byte Number) {
+ return ToOct(Number, 3, SizeIndexes.Int16);
+ }
+ public static string Oct (int Number) {
+ return ToOct(Number, 11, SizeIndexes.Int32);
+ }
+ public static string Oct (long Number) {
+ return ToOct(Number, 22, SizeIndexes.Int64);
+ }
+
+ // Objects are always trickier
+ // first need to cast to appropriate type
+ public static string Oct (System.Object Number) {
+ // first, always throw an exception if Number is null
+ if (Number == null) {
+ throw new ArgumentNullException("Number",
+ "Value cannot be null");
+ }
+
+ TypeCode TC = Type.GetTypeCode (Number.GetType ());
+
+ switch (TC) {
+ // try to parse a string as an Int32
+ // and then an Int64
+ case TypeCode.String:
+ try {
+ return Oct (
+ Int32.Parse (
+ CastToString (Number)));
+ }
+ catch {
+ return Oct (
+ Int64.Parse (
+ CastToString (Number)));
+ }
+
+ // integer types just call the appropriate "Oct"
+ case TypeCode.Byte:
+ return Oct ((byte)Number);
+ case TypeCode.Int16:
+ return Oct ((short)Number);
+ case TypeCode.Int32:
+ return Oct ((int)Number);
+ case TypeCode.Int64:
+ return Oct ((long)Number);
+
+ // Empty is defined as returning 0
+ case TypeCode.Empty:
+ return "0";
+
+ // We can't convert these to Octal
+ case TypeCode.Boolean:
+ case TypeCode.Char:
+ case TypeCode.DBNull:
+ case TypeCode.DateTime:
+ case TypeCode.Decimal:
+ case TypeCode.Double:
+ case TypeCode.Object:
+ case TypeCode.SByte:
+ case TypeCode.Single:
+ case TypeCode.UInt16:
+ case TypeCode.UInt32:
+ case TypeCode.UInt64:
+ default:
+ throw new ArgumentException (
+ "Type of argument 'Number' is '" +
+ Number.GetType().FullName +
+ "', which is not numeric.");
+ }
+ }
+
+ // Str is pretty easy now that we have a language
+ // with a ToString method()
+ public static string Str (System.Object Number) {
+
+ // check for null as always and throw an exception
+ if (Number == null) {
+ throw new ArgumentNullException("Number");
+ }
+
+ switch (Type.GetTypeCode (Number.GetType ())) {
+ // for unsigned types, just call ToString
+ case TypeCode.Byte:
+ case TypeCode.UInt16:
+ case TypeCode.UInt32:
+ case TypeCode.UInt64:
+ return Number.ToString();
+
+ // for signed types, we have to leave a
+ // space for the missing + sign
+ case TypeCode.Decimal:
+ return ((decimal)Number > 0 ? " " : "")
+ + Number.ToString();
+ case TypeCode.Double:
+ return ((double)Number > 0 ? " " : "")
+ + Number.ToString();
+ case TypeCode.Int16:
+ return ((short)Number > 0 ? " " : "")
+ + Number.ToString();
+ case TypeCode.Int32:
+ return ((int)Number > 0 ? " " : "")
+ + Number.ToString();
+ case TypeCode.Int64:
+ return ((long)Number > 0 ? " " : "")
+ + Number.ToString();
+ case TypeCode.SByte:
+ return ((sbyte)Number > 0 ? " " : "")
+ + Number.ToString();
+ case TypeCode.Single:
+ return ((float)Number > 0 ? " " : "")
+ + Number.ToString();
+
+ // can't cast anything else to a Number
+ default:
+ throw new InvalidCastException(
+ "Argument 'Number' cannot be converted to a numeric value.");
+ }
+ }
+
+ // The Val function is pretty bizarre
+ // Val ("&HFF") = 255
+ // Val ("&O377") = 255
+ // Val ("1234 Any Street") = 1234
+ // Val (" 12 45 . 90 7 E + 0 0 2 ") = 1245.907e+002 = 124590.7
+ public static double Val (string InputStr) {
+ int i;
+ int Base;
+ int NumChars = 0;
+ char c;
+ int Length = InputStr.Length;
+ char[] Number = new char[Length];
+ bool FoundRadixPrefix = false;
+ Regex NumberReg;
+ Match NumberMatch;
+
+ Base = 10;
+ Number[0] = '\0';
+
+ // go through string
+ for (i = 0; i < Length; i++) {
+ c = InputStr[i];
+
+ // look for Radix prefix "&"
+ if (i == 0 && c == '&') {
+ FoundRadixPrefix = true;
+ }
+
+ // look for an H or O following the prefix
+ else if (FoundRadixPrefix && i == 1 &&
+ (char.ToLower(c) == 'h' ||
+ char.ToLower(c) == 'o')) {
+ if (c == 'H') {
+ Base = 16;
+ }
+ else {
+ Base = 8;
+ }
+ }
+
+ // if we didn't find a radix prefix,
+ // ignore whitespace
+ else if (char.IsWhiteSpace(c) && (Base == 10)) {
+ continue;
+ }
+
+ // mash what's left together
+ else {
+ Number[NumChars++] = c;
+ }
+ }
+
+ // now we have a string to parse
+ switch (Base) {
+ // FIXME : for Octal and Hex,
+ // Regex is probably overkill
+ // Even for base 10, it might be faster
+ // to write our own parser
+ case 8:
+ NumberReg = new Regex ("^[0-7]*");
+ NumberMatch = NumberReg.Match (
+ new string(Number, 0, NumChars));
+ break;
+ case 16:
+ NumberReg = new Regex ("^[0-9a-f]*",
+ RegexOptions.IgnoreCase);
+ NumberMatch = NumberReg.Match (
+ new string(Number, 0, NumChars));
+ break;
+ case 10:
+ default:
+ NumberReg = new Regex (
+ "^[+-]?\\d*\\.?\\d*(e?[+-]?\\d*)",
+ RegexOptions.IgnoreCase);
+ NumberMatch = NumberReg.Match (
+ new string(Number, 0, NumChars));
+ break;
+
+
+ }
+
+ // we found a match, try to convert it
+ if (NumberMatch.Success) {
+ try {
+ switch (Base) {
+ case 10:
+ return
+ Convert.ToDouble (
+ NumberMatch.Value);
+ case 8:
+ case 16:
+ return (double)
+ Convert.ToInt64 (
+ NumberMatch.Value,
+ Base);
+ default:
+ return (double)0;
+ }
+ }
+ catch {
+ throw new OverflowException();
+ }
+ }
+ else {
+ return (double)0;
+ }
+ }
+
+ // Val on a char type is pretty simple '9' = 9, 'a' = exception
+ public static int Val (char Expression) {
+ if (char.IsDigit(Expression)) {
+ return Expression - '0';
+ }
+ else {
+ throw new ArgumentException();
+ }
+ }
+
+ // if it's an object, and we can't convert
+ // it to a string, it's an exception
+ public static double Val (System.Object Expression) {
+ // always check for null first
+ if (Expression == null) {
+ throw new ArgumentNullException ("Expression",
+ "Value cannot be null");
+ }
+
+ try {
+ return Val (CastToString (Expression));
+ }
+ catch {
+ throw new ArgumentException(
+ "Type of argument 'Expression' is '" +
+ Expression.GetType().FullName +
+ "', which can nt be converted to numeric.");
+ }
+ }
+ // Events
+ }
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateAndTime.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateAndTime.cs
new file mode 100644
index 00000000000..6d809db4923
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateAndTime.cs
@@ -0,0 +1,478 @@
+//
+// DateAndTime.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+
+using System;
+using System.Runtime.InteropServices;
+using System.ComponentModel;
+using System.Globalization;
+
+namespace Microsoft.VisualBasic
+{
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ sealed public class DateAndTime {
+ public static string DateString {
+ get {
+ return DateTime.Today.ToString("MM-dd-yyyy");
+ }
+
+ set {
+ string [] formats = { "M-d-yyyy", "M-d-y", "M/d/yyyy", "M/d/y" };
+
+ try {
+ DateTime dtToday = DateTime.ParseExact(value, formats,
+ DateTimeFormatInfo.CurrentInfo,
+ DateTimeStyles.None);
+
+ Today = dtToday;
+ }
+ catch {
+ throw new InvalidCastException();
+ }
+ }
+ }
+
+ public static System.DateTime Today {
+ get { return DateTime.Today; }
+ set {
+ // FIXME: This needs to use some OS specific code
+ // I've already written it for Windows
+ // and Unix won't be hard, but need an
+ // OS object from the compiler
+ // OS specific code needs to check permissions
+ // too, and throw an ArgumentOutOfRangeException
+ // if no permissions
+// DateTime dtNow = DateTime.Now;
+//
+// SysTime.LocalTime = new DateTime(value.Year,
+// value.Month, value.Day, dtNow.Hour,
+// dtNow.Minute, dtNow.Second, dtNow.Millisecond);
+ throw new NotImplementedException();
+ }
+ }
+
+ public static double Timer {
+ get {
+ DateTime DTNow = DateTime.Now;
+
+ return DTNow.Hour * 3600 + DTNow.Minute * 60 +
+ DTNow.Second + DTNow.Millisecond /
+ 1000D;
+ }
+ }
+
+ public static System.DateTime Now {
+ get { return DateTime.Now; }
+ }
+
+ public static System.DateTime TimeOfDay {
+ get {
+ TimeSpan TSpan = DateTime.Now.TimeOfDay;
+
+ return new DateTime(1, 1, 1, TSpan.Hours,
+ TSpan.Minutes, TSpan.Seconds,
+ TSpan.Milliseconds);
+ }
+ set {
+ // FIXME: This needs to use some OS specific code
+ // I've already written it for Windows
+ // and Unix won't be hard, but need an
+ // OS object from the compiler
+ // OS specific code needs to check permissions
+ // too, and throw an ArgumentOutOfRangeException
+ // if no permissions
+// DateTime dtToday = DateTime.Today;
+//
+// SysTime.LocalTime = new DateTime(dtToday.Year,
+// dtToday.Month, dtToday.Day, value.Hour,
+// value.Minute, value.Second, value.Millisecond);
+ throw new NotImplementedException();
+ }
+ }
+
+ public static string TimeString {
+ get { return DateTime.Now.ToString("HH:mm:ss"); }
+ set {
+ string format = "HH:mm:ss";
+
+ try {
+ DateTime dtToday = DateTime.ParseExact(value, format,
+ DateTimeFormatInfo.CurrentInfo,
+ DateTimeStyles.None);
+
+ TimeOfDay = dtToday;
+ }
+ catch {
+ throw new InvalidCastException();
+ }
+ }
+ }
+
+ // Methods
+ public static System.DateTime DateAdd (DateInterval Interval,
+ double Number, System.DateTime DateValue) {
+
+ switch (Interval) {
+ case DateInterval.Year:
+ return DateValue.AddYears((int)Number);
+ case DateInterval.Quarter:
+ return DateValue.AddMonths((int)Number * 3);
+ case DateInterval.Month:
+ return DateValue.AddMonths((int)Number);
+ case DateInterval.WeekOfYear:
+ return DateValue.AddDays(Number * 7);
+ case DateInterval.Day:
+ case DateInterval.DayOfYear:
+ case DateInterval.Weekday:
+ return DateValue.AddDays(Number);
+ case DateInterval.Hour:
+ return DateValue.AddHours(Number);
+ case DateInterval.Minute:
+ return DateValue.AddMinutes(Number);
+ case DateInterval.Second:
+ return DateValue.AddSeconds(Number);
+ default:
+ throw new ArgumentException();
+ }
+ }
+
+ private static DayOfWeek GetDayRule(FirstDayOfWeek StartOfWeek, DayOfWeek DayRule)
+ {
+ switch (StartOfWeek) {
+ case FirstDayOfWeek.System:
+ return DayRule;
+ case FirstDayOfWeek.Sunday:
+ return DayOfWeek.Sunday;
+ case FirstDayOfWeek.Monday:
+ return DayOfWeek.Monday;
+ case FirstDayOfWeek.Tuesday:
+ return DayOfWeek.Tuesday;
+ case FirstDayOfWeek.Wednesday:
+ return DayOfWeek.Wednesday;
+ case FirstDayOfWeek.Thursday:
+ return DayOfWeek.Thursday;
+ case FirstDayOfWeek.Friday:
+ return DayOfWeek.Friday;
+ case FirstDayOfWeek.Saturday:
+ return DayOfWeek.Saturday;
+ default:
+ throw new ArgumentException();
+ }
+ }
+
+ private static CalendarWeekRule GetWeekRule(FirstWeekOfYear StartOfYear, CalendarWeekRule WeekRule)
+ {
+ switch (StartOfYear) {
+ case FirstWeekOfYear.System:
+ return WeekRule;
+ case FirstWeekOfYear.FirstFourDays:
+ return CalendarWeekRule.FirstFourDayWeek;
+ case FirstWeekOfYear.FirstFullWeek:
+ return CalendarWeekRule.FirstFullWeek;
+ case FirstWeekOfYear.Jan1:
+ return CalendarWeekRule.FirstDay;
+ default:
+ throw new ArgumentException();
+ }
+ }
+
+ public static long DateDiff (DateInterval Interval,
+ System.DateTime Date1, System.DateTime Date2,
+ [Optional] [DefaultValue(FirstDayOfWeek.Sunday)]
+ FirstDayOfWeek StartOfWeek,
+ [Optional] [DefaultValue(FirstWeekOfYear.Jan1)]
+ FirstWeekOfYear StartOfYear)
+ {
+
+ int YearMonths;
+ int YearQuarters;
+ int YearWeeks;
+ CalendarWeekRule WeekRule = CalendarWeekRule.FirstDay;
+ DayOfWeek DayRule = DateTimeFormatInfo.CurrentInfo.FirstDayOfWeek;
+ Calendar CurCalendar = CultureInfo.CurrentCulture.Calendar;
+
+ switch (Interval) {
+ case DateInterval.Year:
+ return Date2.Year - Date1.Year;
+ case DateInterval.Quarter:
+ YearQuarters = (Date2.Year - Date1.Year) * 4;
+ return Date2.Month / 4 - Date1.Month / 4 + YearQuarters;
+ case DateInterval.Month:
+ YearMonths = (Date2.Year - Date1.Year) * 12;
+ return Date2.Month - Date1.Month + YearMonths;
+ case DateInterval.WeekOfYear:
+ YearWeeks = (Date2.Year - Date1.Year) * 53;
+ DayRule = GetDayRule(StartOfWeek, DayRule);
+ WeekRule = GetWeekRule(StartOfYear, WeekRule);
+ return CurCalendar.GetWeekOfYear(Date2, WeekRule, DayRule) -
+ CurCalendar.GetWeekOfYear(Date1,WeekRule, DayRule) +
+ YearWeeks;
+ case DateInterval.Weekday:
+ return ((TimeSpan)(Date2.Subtract(Date1))).Days / 7;
+ case DateInterval.DayOfYear:
+ case DateInterval.Day:
+ return ((TimeSpan)(Date2.Subtract(Date1))).Days;
+ case DateInterval.Hour:
+ return ((TimeSpan)(Date2.Subtract(Date1))).Hours;
+ case DateInterval.Minute:
+ return ((TimeSpan)(Date2.Subtract(Date1))).Minutes;
+ case DateInterval.Second:
+ return ((TimeSpan)(Date2.Subtract(Date1))).Seconds;
+ default:
+ throw new ArgumentException();
+ }
+ }
+
+ private static int ConvertWeekDay(DayOfWeek Day, int Offset)
+ {
+
+ int Weekday = (int)Day + Offset;
+
+ if (Weekday > 7) {
+ Weekday -= 7;
+ }
+
+ switch((DayOfWeek)Weekday) {
+ case DayOfWeek.Sunday:
+ return (int)FirstDayOfWeek.Sunday;
+ case DayOfWeek.Monday:
+ return (int)FirstDayOfWeek.Monday;
+ case DayOfWeek.Tuesday:
+ return (int)FirstDayOfWeek.Tuesday;
+ case DayOfWeek.Wednesday:
+ return (int)FirstDayOfWeek.Wednesday;
+ case DayOfWeek.Thursday:
+ return (int)FirstDayOfWeek.Thursday;
+ case DayOfWeek.Friday:
+ return (int)FirstDayOfWeek.Friday;
+ case DayOfWeek.Saturday:
+ return (int)FirstDayOfWeek.Saturday;
+ default:
+ throw new ArgumentException();
+ }
+
+ }
+
+ public static int DatePart
+ (
+ Microsoft.VisualBasic.DateInterval Interval,
+ System.DateTime DateValue,
+ [Optional] [DefaultValue(FirstDayOfWeek.Sunday)]
+ FirstDayOfWeek StartOfWeek,
+ [Optional] [DefaultValue(FirstWeekOfYear.Jan1)]
+ FirstWeekOfYear StartOfYear) {
+
+ CalendarWeekRule WeekRule = CalendarWeekRule.FirstDay;
+ DayOfWeek DayRule = DateTimeFormatInfo.CurrentInfo.FirstDayOfWeek;
+ Calendar CurCalendar = CultureInfo.CurrentCulture.Calendar;
+
+ switch (Interval) {
+ case DateInterval.Year:
+ return DateValue.Year;
+ case DateInterval.Quarter:
+ return DateValue.Month / 4 + 1;
+ case DateInterval.Month:
+ return DateValue.Month;
+ case DateInterval.WeekOfYear:
+ DayRule = GetDayRule(StartOfWeek, DayRule);
+ WeekRule = GetWeekRule(StartOfYear, WeekRule);
+ return CurCalendar.GetWeekOfYear(DateValue, WeekRule, DayRule);
+ case DateInterval.Weekday:
+ return ConvertWeekDay(DateValue.DayOfWeek, (int)DayRule);
+ case DateInterval.DayOfYear:
+ return DateValue.DayOfYear;
+ case DateInterval.Day:
+ return DateValue.Day;
+ case DateInterval.Hour:
+ return DateValue.Hour;
+ case DateInterval.Minute:
+ return DateValue.Minute;
+ case DateInterval.Second:
+ return DateValue.Second;
+ default:
+ throw new ArgumentException();
+ }
+ }
+
+ private static DateInterval DateIntervalFromString(string Interval)
+ {
+ switch (Interval) {
+ case "yyyy":
+ return DateInterval.Year;
+ case "q":
+ return DateInterval.Quarter;
+ case "m":
+ return DateInterval.Month;
+ case "ww":
+ return DateInterval.WeekOfYear;
+ case "w":
+ return DateInterval.Weekday;
+ case "d":
+ return DateInterval.Day;
+ case "y":
+ return DateInterval.DayOfYear;
+ case "h":
+ return DateInterval.Hour;
+ case "n":
+ return DateInterval.Minute;
+ case "s":
+ return DateInterval.Second;
+ default:
+ throw new ArgumentException();
+ }
+ }
+
+ public static System.DateTime DateAdd (string Interval,
+ double Number, System.Object DateValue)
+ {
+ if (DateValue == null) {
+ throw new ArgumentNullException("DateValue", "Value can not be null.");
+ }
+ if (!(DateValue is DateTime)) {
+ throw new InvalidCastException();
+ }
+
+ return DateAdd(DateIntervalFromString(Interval), Number, (DateTime)DateValue);
+ }
+
+ public static System.Int64 DateDiff (string Interval,
+ System.Object Date1, System.Object Date2,
+ [Optional] [DefaultValue(FirstDayOfWeek.Sunday)]
+ FirstDayOfWeek StartOfWeek,
+ [Optional] [DefaultValue(FirstWeekOfYear.Jan1)]
+ FirstWeekOfYear StartOfYear)
+ {
+ if (Date1 == null) {
+ throw new ArgumentNullException("Date1", "Value can not be null.");
+ }
+ if (Date2 == null) {
+ throw new ArgumentNullException("Date2", "Value can not be null.");
+ }
+ if (!(Date1 is DateTime)) {
+ throw new InvalidCastException();
+ }
+ if (!(Date2 is DateTime)) {
+ throw new InvalidCastException();
+ }
+
+ return DateDiff(DateIntervalFromString(Interval), (DateTime)Date1,
+ (DateTime)Date2, StartOfWeek, StartOfYear);
+
+ }
+
+ public static System.Int32 DatePart (string Interval,
+ System.Object DateValue,
+ [Optional] [DefaultValue(FirstDayOfWeek.Sunday)]
+ FirstDayOfWeek StartOfWeek,
+ [Optional] [DefaultValue(FirstWeekOfYear.Jan1)]
+ FirstWeekOfYear StartOfYear)
+ {
+ if (DateValue == null) {
+ throw new ArgumentNullException("DateValue", "Value can not be null.");
+ }
+ if (!(DateValue is DateTime)) {
+ throw new InvalidCastException();
+ }
+
+
+ return DatePart(DateIntervalFromString(Interval),
+ (DateTime)DateValue, StartOfWeek, StartOfYear);
+ }
+
+ public static System.DateTime DateSerial (int Year, int Month, int Day)
+ {
+ return new DateTime(Year, Month, Day);
+ }
+
+ public static System.DateTime TimeSerial (int Hour, int Minute, int Second)
+ {
+ return new DateTime(1, 1, 1, Hour, Minute, Second);
+ }
+
+ public static System.DateTime DateValue (string StringDate)
+ {
+ return DateTime.Parse(StringDate);
+ }
+
+ public static System.DateTime TimeValue (string StringTime)
+ {
+ return DateTime.Parse(StringTime);
+ }
+
+ public static int Year (System.DateTime DateValue)
+ {
+ return DateValue.Year;
+ }
+
+ public static int Month (System.DateTime DateValue)
+ {
+ return DateValue.Month;
+ }
+
+ public static int Day (System.DateTime DateValue)
+ {
+ return DateValue.Day;
+ }
+
+ public static int Hour (System.DateTime TimeValue)
+ {
+ return TimeValue.Hour;
+ }
+
+ public static int Minute (System.DateTime TimeValue)
+ {
+ return TimeValue.Minute;
+ }
+
+ public static int Second (System.DateTime TimeValue)
+ {
+ return TimeValue.Second;
+ }
+
+ public static int Weekday (System.DateTime DateValue,
+ [Optional] [DefaultValue(FirstDayOfWeek.Sunday)]
+ FirstDayOfWeek StartOfWeek)
+ {
+ return DatePart(DateInterval.Weekday, DateValue, StartOfWeek, FirstWeekOfYear.System);
+ }
+
+ public static System.String MonthName (int Month,
+ [Optional] [DefaultValue(false)] bool Abbreviate)
+ {
+ if (Month < 1 || Month > 13) {
+ throw new ArgumentException();
+ }
+ if (Abbreviate) {
+ return CultureInfo.CurrentCulture.DateTimeFormat.GetAbbreviatedMonthName(Month);
+ }
+ else {
+ return CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(Month);
+ }
+ }
+
+ public static System.String WeekdayName (int Weekday,
+ [Optional] [DefaultValue(false)] System.Boolean Abbreviate,
+ [Optional] [DefaultValue(FirstDayOfWeek.System)]
+ FirstDayOfWeek FirstDayOfWeekValue)
+ {
+ if (Weekday < 1 || Weekday > 7) {
+ throw new ArgumentException();
+ }
+ Weekday += (int)FirstDayOfWeekValue;
+ if (Weekday > 7) {
+ Weekday -= 7;
+ }
+ if (Abbreviate) {
+ return CultureInfo.CurrentCulture.DateTimeFormat.GetAbbreviatedDayName((DayOfWeek)Weekday);
+ }
+ else {
+ return CultureInfo.CurrentCulture.DateTimeFormat.GetDayName((DayOfWeek)Weekday);
+ }
+ }
+ }
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateFormat.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateFormat.cs
new file mode 100644
index 00000000000..9ffcd7ebf10
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateFormat.cs
@@ -0,0 +1,37 @@
+//
+// DateFormat.cs
+//
+// Author:
+// Martin Adoue (martin@cwanet.com)
+//
+// (C) 2002 Martin Adoue
+//
+namespace Microsoft.VisualBasic {
+
+ /// <summary>
+ /// When you call the DateValue function, you can use the following
+ /// enumeration members in your code in place of the actual values.
+ /// </summary>
+ public enum DateFormat : int {
+ /// <summary>
+ /// For real numbers, displays a date and time. If the number has no fractional part, displays only a date. If the number has no integer part, displays time only. Date and time display is determined by your computer's regional settings.
+ /// </summary>
+ GeneralDate = 0,
+ /// <summary>
+ /// Displays a date using the long-date format specified in your computer's regional settings.
+ /// </summary>
+ LongDate = 1,
+ /// <summary>
+ /// Displays a date using the short-date format specified in your computer's regional settings.
+ /// </summary>
+ ShortDate = 2,
+ /// <summary>
+ /// Displays a time using the long-time format specified in your computer's regional settings.
+ /// </summary>
+ LongTime = 3,
+ /// <summary>
+ /// Displays a time using the short-time format specified in your computer's regional settings.
+ /// </summary>
+ ShortTime = 4
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateInterval.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateInterval.cs
new file mode 100644
index 00000000000..2c86a14733e
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateInterval.cs
@@ -0,0 +1,22 @@
+//
+// DateInterval.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+namespace Microsoft.VisualBasic {
+ public enum DateInterval : int {
+ Year = 0,
+ Quarter = 1,
+ Month = 2,
+ DayOfYear = 3,
+ Day = 4,
+ WeekOfYear = 5,
+ Weekday = 6,
+ Hour = 7,
+ Minute = 8,
+ Second = 9
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DueDate.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DueDate.cs
new file mode 100644
index 00000000000..82bc60f988e
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DueDate.cs
@@ -0,0 +1,14 @@
+//
+// DueDate.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+namespace Microsoft.VisualBasic {
+ public enum DueDate : int {
+ EndOfPeriod = 0,
+ BegOfPeriod = 1
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ErrObject.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ErrObject.cs
new file mode 100644
index 00000000000..54a9c6d1890
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ErrObject.cs
@@ -0,0 +1,121 @@
+//
+// ErrObject.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+// Francesco Delfino (pluto@tipic.com)
+//
+// (C) 2002 Chris J Breisch
+// 2002 pluto@tipic.com
+//
+
+using System;
+
+namespace Microsoft.VisualBasic
+{
+ sealed public class ErrObject {
+ // Declarations
+ int pHelpContext;
+ int pLastDllError;
+ int pNumber;
+ int pErl;
+ string pSource;
+ string pHelpFile;
+ string pDescription;
+ System.Exception pException;
+ // Constructors
+ // Properties
+ [MonoTODO]
+ public System.Int32 HelpContext
+ {
+ get {
+ return pHelpContext;
+ }
+ set {
+ pHelpContext = value;
+ }
+ }
+ [MonoTODO]
+ public System.Int32 LastDllError {
+ get {
+ return pLastDllError;
+ }
+ }
+ [MonoTODO]
+ public System.Int32 Number {
+ get {
+ return pNumber;
+ }
+ set {
+ pNumber = value;
+ }
+ }
+ [MonoTODO]
+ public System.Int32 Erl {
+ get {
+ return pErl;
+ }
+ }
+ [MonoTODO]
+ public System.String Source {
+ get {
+ return pSource;
+ }
+ set {
+ pSource = value;
+ }
+ }
+ [MonoTODO]
+ public System.String HelpFile {
+ get {
+ return pHelpFile;
+ }
+ set {
+ pHelpFile = value;
+ }
+ }
+ [MonoTODO]
+ public System.String Description {
+ get {
+ return pDescription;
+ }
+ set {
+ pDescription = value;
+ }
+ }
+ // Methods
+ [MonoTODO("We should parse the exception object to obtain VB-like error code. Not a trivial task!")]
+ internal void SetException (Exception ex)
+ {
+ if (pException != ex)
+ {
+ pNumber = 0xFFFF;
+ pSource = ex.Source;
+ pDescription = ex.Message + "\n" + ex.StackTrace;
+ }
+ }
+
+ [MonoTODO]
+ public System.Exception GetException ()
+ {
+ return pException;
+ }
+ [MonoTODO]
+ public void Clear () {
+ pHelpContext=0;
+ pLastDllError=0;
+ pNumber=0;
+ pErl=0;
+ pSource="";
+ pHelpFile="";
+ pDescription="";
+ pException= null;
+ }
+ [MonoTODO]
+ public void Raise (System.Int32 Number, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.Object Source, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.Object Description, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.Object HelpFile, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.Object HelpContext)
+ {
+ throw new NotImplementedException ();
+ }
+ // Events
+ };
+} \ No newline at end of file
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FileAttribute.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FileAttribute.cs
new file mode 100644
index 00000000000..96dc29a3f4e
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FileAttribute.cs
@@ -0,0 +1,20 @@
+//
+// FileAttribute.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+namespace Microsoft.VisualBasic {
+ [System.FlagsAttribute]
+ public enum FileAttribute : int {
+ Normal = 0,
+ ReadOnly = 1,
+ Hidden = 2,
+ System = 4,
+ Volume = 8,
+ Directory = 16,
+ Archive = 32
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FileSystem.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FileSystem.cs
new file mode 100644
index 00000000000..5e743d2bce1
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FileSystem.cs
@@ -0,0 +1,422 @@
+//
+// FileSystem.cs
+//
+// Author:
+//
+// Daniel Campos ( danielcampos@myway.com )
+//
+//
+
+using System;
+using System.IO;
+namespace Microsoft.VisualBasic
+{
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ sealed public class FileSystem {
+ private static System.IO.FileStream[] FHandle=new FileStream[255];
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ [MonoTODO("Needs testing")]
+ public static void ChDir (System.String Path)
+ {
+ if ( (Path=="") || (Path==null))
+ throw new System.ArgumentException("Path is empty");
+ try
+ {
+ Environment.CurrentDirectory=Path;
+ }
+ catch ( Exception e){ throw new System.IO.FileNotFoundException ("Invalid drive is specified, or drive is unavailable");}
+
+ }
+
+ [MonoTODO]
+ public static void ChDrive (System.Char Drive) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void ChDrive (System.String Drive) { throw new NotImplementedException (); }
+
+ [MonoTODO("Needs testing")]
+ public static System.String CurDir ()
+ {
+ return Environment.CurrentDirectory;
+ }
+
+ [MonoTODO]
+ public static System.String CurDir (System.Char Drive) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.String Dir () { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.String Dir (System.String Pathname, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] Microsoft.VisualBasic.FileAttribute Attributes) { throw new NotImplementedException (); }
+
+ [MonoTODO("Needs testing")]
+ public static void MkDir (System.String Path)
+ {
+ // if a file called like 'path' does exist
+ // no exception is generated using .net
+ // A little extrange?
+ if (Path==null || Path=="")
+ {
+ throw new System.ArgumentException();
+ }
+ else
+ {
+ if (System.IO.Directory.Exists (Path))
+ throw new System.IO.IOException("Directory already exists");
+ else
+ System.IO.Directory.CreateDirectory(Path);
+ }
+ }
+
+ [MonoTODO("Needs testing")]
+ public static void RmDir (System.String Path)
+ {
+ System.IO.Directory.Delete(Path);
+ }
+
+ [MonoTODO("Needs testing")]
+ public static void FileCopy (System.String Source, System.String Destination)
+ {
+ // using VB, filecopy always overwrites Destination
+ System.IO.File.Copy(Source,Destination,true);
+ }
+
+ [MonoTODO("Needs testing")]
+ public static System.DateTime FileDateTime (System.String PathName)
+ {
+ // A better exception handling is needed : exceptions
+ // are not the same as 'GetLastWriteTime'
+ return System.IO.File.GetLastWriteTime (PathName);
+ }
+
+ [MonoTODO]
+ public static System.Int64 FileLen (System.String PathName) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static Microsoft.VisualBasic.FileAttribute GetAttr (System.String PathName) { throw new NotImplementedException (); }
+
+ [MonoTODO("Needs testing")]
+ public static void Kill (System.String PathName)
+ {
+ if (!System.IO.File.Exists(PathName))
+ throw new System.IO.FileNotFoundException();
+ else
+ System.IO.File.Delete(PathName);
+ }
+
+ [MonoTODO]
+ public static void SetAttr (System.String PathName, Microsoft.VisualBasic.FileAttribute Attributes) { throw new NotImplementedException (); }
+
+ [MonoTODO("Needs testing")]
+ public static void FileOpen (System.Int32 FileNumber, System.String FileName, Microsoft.VisualBasic.OpenMode Mode, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] Microsoft.VisualBasic.OpenAccess Access, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] Microsoft.VisualBasic.OpenShare Share, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int32 RecordLength)
+ {
+ // at this moment you can open a file
+ // only for Append, Input or Output
+ System.IO.FileMode MyMode;
+ System.IO.FileAccess MyAccess;
+ System.IO.FileShare MyShare;
+ if ( RecordLength < -1 )
+ throw new System.ArgumentException("Record Length is negative (nad not equal to -1)");
+ if ( RecordLength > 32767)
+ throw new System.ArgumentException ("Invalid Record Length");
+ if (FileNumber <0 || FileNumber > 255)
+ throw new System.IO.IOException(FileNumber.ToString() + " is invalid (<-1 or >255)",5);
+
+ FileNumber--;
+ if (FHandle[FileNumber] != null)
+ throw new System.IO.IOException (FileNumber.ToString() + " is in use",5);
+
+ switch (Mode)
+ {
+ case Microsoft.VisualBasic.OpenMode.Append :
+ MyMode=System.IO.FileMode.Append ;
+ break;
+ case Microsoft.VisualBasic.OpenMode.Binary :
+ throw new NotImplementedException ();
+
+ case Microsoft.VisualBasic.OpenMode.Input :
+ MyMode=System.IO.FileMode.Open ;
+ break;
+ case Microsoft.VisualBasic.OpenMode.Output :
+ MyMode=System.IO.FileMode.OpenOrCreate ;
+ break;
+ case Microsoft.VisualBasic.OpenMode.Random :
+ throw new NotImplementedException ();
+ default:
+ throw new System.ArgumentException("Invalid Share");
+ }
+ switch (Access)
+ {
+ case Microsoft.VisualBasic.OpenAccess.ReadWrite :
+ case Microsoft.VisualBasic.OpenAccess.Default :
+ MyAccess=System.IO.FileAccess.ReadWrite;
+ break;
+ case Microsoft.VisualBasic.OpenAccess.Read :
+ MyAccess=System.IO.FileAccess.Read;
+ break;
+ case Microsoft.VisualBasic.OpenAccess.Write :
+ MyAccess=System.IO.FileAccess.Write;
+ break;
+ default:
+ throw new System.ArgumentException("Invalid Access");
+
+ }
+ switch(Share)
+ {
+ case Microsoft.VisualBasic.OpenShare.Default :
+ case Microsoft.VisualBasic.OpenShare.Shared :
+ MyShare=System.IO.FileShare.ReadWrite ;
+ break;
+ case Microsoft.VisualBasic.OpenShare.LockRead :
+ MyShare=System.IO.FileShare.Write;
+ break;
+ case Microsoft.VisualBasic.OpenShare.LockReadWrite :
+ MyShare=System.IO.FileShare.None ;
+ break;
+ case Microsoft.VisualBasic.OpenShare.LockWrite :
+ MyShare=System.IO.FileShare.Read;
+ break;
+ default:
+ throw new System.ArgumentException("Invalid Share");
+ }
+ FHandle[FileNumber]=new System.IO.FileStream (FileName,MyMode,MyAccess,MyShare);
+
+
+
+
+ }
+
+ [MonoTODO("Needs testing")]
+ public static void FileClose (params System.Int32[] FileNumbers)
+ {
+ int bucle=0;
+ if (FileNumbers.Length == 0)
+ {
+ for(bucle=0;bucle<255;bucle++)
+ {
+ if (FHandle[bucle]!=null)
+ try
+ {
+ FHandle[bucle].Close();
+ }
+ catch (Exception e) {e.GetType (); FHandle[bucle]=null ;}
+ }
+ }
+ else
+ {
+ for(bucle=0;bucle<FileNumbers.Length;bucle++)
+ {
+ if ( FHandle [ FileNumbers[bucle] - 1 ] != null )
+ {
+ if (FileNumbers[bucle]>0 && FileNumbers[bucle]<256)
+ {
+ try
+ {
+ FHandle[ FileNumbers[bucle] - 1].Close();
+ FHandle[ FileNumbers[bucle] - 1]=null;
+ }
+ catch (Exception e){e.GetType (); FHandle[ FileNumbers[bucle] - 1]= null ;}
+ }
+ else
+ throw new System.IO.IOException (FileNumbers[bucle].ToString() + " Does not exist",52);
+ }
+ else
+ throw new System.IO.IOException (FileNumbers[bucle].ToString() + " Does not exist",52);
+ }
+ }
+ }
+
+ [MonoTODO]
+ public static void FileGetObject (System.Int32 FileNumber, ref System.Object Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FileGet (System.Int32 FileNumber, ref System.ValueType Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FileGet (System.Int32 FileNumber, ref System.Array Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] ref System.Boolean ArrayIsDynamic, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] ref System.Boolean StringIsFixedLength) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FileGet (System.Int32 FileNumber, ref System.Boolean Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FileGet (System.Int32 FileNumber, ref System.Byte Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FileGet (System.Int32 FileNumber, ref System.Int16 Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FileGet (System.Int32 FileNumber, ref System.Int32 Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FileGet (System.Int32 FileNumber, ref System.Int64 Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FileGet (System.Int32 FileNumber, ref System.Char Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FileGet (System.Int32 FileNumber, ref System.Single Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FileGet (System.Int32 FileNumber, ref System.Double Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FileGet (System.Int32 FileNumber, ref System.Decimal Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FileGet (System.Int32 FileNumber, ref System.String Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] ref System.Boolean StringIsFixedLength) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FileGet (System.Int32 FileNumber, ref System.DateTime Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FilePutObject (System.Int32 FileNumber, System.Object Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ [System.ObsoleteAttribute("Use FilePutObject to write Object types, or coerce FileNumber and RecordNumber to Integer for writing non-Object types", false)]
+ public static void FilePut (System.Object FileNumber, System.Object Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Object RecordNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FilePut (System.Int32 FileNumber, System.ValueType Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FilePut (System.Int32 FileNumber, System.Array Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] System.Boolean ArrayIsDynamic, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] System.Boolean StringIsFixedLength) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FilePut (System.Int32 FileNumber, System.Boolean Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FilePut (System.Int32 FileNumber, System.Byte Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FilePut (System.Int32 FileNumber, System.Int16 Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FilePut (System.Int32 FileNumber, System.Int32 Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FilePut (System.Int32 FileNumber, System.Int64 Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FilePut (System.Int32 FileNumber, System.Char Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FilePut (System.Int32 FileNumber, System.Single Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FilePut (System.Int32 FileNumber, System.Double Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FilePut (System.Int32 FileNumber, System.Decimal Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FilePut (System.Int32 FileNumber, System.String Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] System.Boolean StringIsFixedLength) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FilePut (System.Int32 FileNumber, System.DateTime Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void Print (System.Int32 FileNumber, params System.Object[] Output) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void PrintLine (System.Int32 FileNumber, params System.Object[] Output) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void Input (System.Int32 FileNumber, ref System.Object Value) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void Input (System.Int32 FileNumber, ref System.Boolean Value) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void Input (System.Int32 FileNumber, ref System.Byte Value) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void Input (System.Int32 FileNumber, ref System.Int16 Value) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void Input (System.Int32 FileNumber, ref System.Int32 Value) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void Input (System.Int32 FileNumber, ref System.Int64 Value) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void Input (System.Int32 FileNumber, ref System.Char Value) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void Input (System.Int32 FileNumber, ref System.Single Value) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void Input (System.Int32 FileNumber, ref System.Double Value) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void Input (System.Int32 FileNumber, ref System.Decimal Value) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void Input (System.Int32 FileNumber, ref System.String Value) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void Input (System.Int32 FileNumber, ref System.DateTime Value) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void Write (System.Int32 FileNumber, params System.Object[] Output) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void WriteLine (System.Int32 FileNumber, params System.Object[] Output) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.String InputString (System.Int32 FileNumber, System.Int32 CharCount) { throw new NotImplementedException (); }
+
+ [MonoTODO("Needs testing")]
+ public static System.String LineInput (System.Int32 FileNumber)
+ {
+ string retval="";
+ int buf='\x00';
+ bool found=false;
+ if ( FileNumber<1 || FileNumber>255)
+ throw new System.IO.IOException (FileNumber.ToString() + " does not exists",52);
+ if ( FHandle[FileNumber - 1] == null)
+ throw new System.IO.IOException (FileNumber.ToString() + " does not exists",52);
+
+ if ( EOF(FileNumber) )
+ throw new System.IO.EndOfStreamException();
+
+ while (!found)
+ {
+
+ buf=FHandle[FileNumber - 1].ReadByte();
+ if ( (buf == -1) || (buf == '\x0A' ) )
+ found=true;
+ else
+ retval+= ((char)buf).ToString();
+ }
+ if ( retval.Length > 0 )
+ if ( (buf == '\x0A') && (retval[retval.Length -1 ] == '\x0D') )
+ retval=retval.Substring(0,retval.Length -1) ;
+ Console.WriteLine (retval);
+ return retval;
+
+ }
+
+ [MonoTODO]
+ public static void Lock (System.Int32 FileNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void Lock (System.Int32 FileNumber, System.Int64 Record) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void Lock (System.Int32 FileNumber, System.Int64 FromRecord, System.Int64 ToRecord) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void Unlock (System.Int32 FileNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void Unlock (System.Int32 FileNumber, System.Int64 Record) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void Unlock (System.Int32 FileNumber, System.Int64 FromRecord, System.Int64 ToRecord) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void FileWidth (System.Int32 FileNumber, System.Int32 RecordWidth) { throw new NotImplementedException (); }
+
+ [MonoTODO("Needs testing")]
+ public static System.Int32 FreeFile ()
+ {
+ int bucle=0;
+ bool found=false;
+ for (bucle=0;bucle<255;bucle++)
+ if (FHandle[bucle]==null)
+ {
+ found=true;
+ break;
+ }
+ if (!found)
+ throw new System.IO.IOException ("More than 255 files are in use",67);
+ else
+ return bucle+1;
+ }
+ [MonoTODO]
+ public static void Seek (System.Int32 FileNumber, System.Int64 Position) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Int64 Seek (System.Int32 FileNumber) { throw new NotImplementedException (); }
+
+ [MonoTODO("Needs testing")]
+ public static System.Boolean EOF ( System.Int32 FileNumber)
+ {
+ if (FileNumber<1 || FileNumber>255)
+ throw new System.IO.IOException (FileNumber.ToString() + " does not exists",52);
+ if ( FHandle[FileNumber - 1] == null)
+ throw new System.IO.IOException (FileNumber.ToString() + " does not exists",52);
+ if ( FHandle[FileNumber - 1].Length == FHandle[FileNumber - 1].Position)
+ return true;
+ else
+ return false;
+
+ }
+
+ [MonoTODO]
+ public static System.Int64 Loc (System.Int32 FileNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Int64 LOF (System.Int32 FileNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static Microsoft.VisualBasic.TabInfo TAB () { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static Microsoft.VisualBasic.TabInfo TAB (System.Int16 Column) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static Microsoft.VisualBasic.SpcInfo SPC (System.Int16 Count) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static Microsoft.VisualBasic.OpenMode FileAttr (System.Int32 FileNumber) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void Reset () { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void Rename (System.String OldPath, System.String NewPath) { throw new NotImplementedException (); }
+ // Events
+
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Financial.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Financial.cs
new file mode 100644
index 00000000000..613c49ea716
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Financial.cs
@@ -0,0 +1,48 @@
+//
+// Financial.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+
+using System;
+
+namespace Microsoft.VisualBasic
+{
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ sealed public class Financial {
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ [MonoTODO]
+ public static System.Double DDB (System.Double Cost, System.Double Salvage, System.Double Life, System.Double Period, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(2)] System.Double Factor) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Double FV (System.Double Rate, System.Double NPer, System.Double Pmt, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] System.Double PV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] Microsoft.VisualBasic.DueDate Due) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Double IPmt (System.Double Rate, System.Double Per, System.Double NPer, System.Double PV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] System.Double FV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] Microsoft.VisualBasic.DueDate Due) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Double IRR (ref System.Double[] ValueArray, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0.1)] ref System.Double Guess) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Double MIRR (ref System.Double[] ValueArray, ref System.Double FinanceRate, ref System.Double ReinvestRate) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Double NPer (System.Double Rate, System.Double Pmt, System.Double PV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] System.Double FV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] Microsoft.VisualBasic.DueDate Due) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Double NPV (System.Double Rate, ref System.Double[] ValueArray) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Double Pmt (System.Double Rate, System.Double NPer, System.Double PV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] System.Double FV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] Microsoft.VisualBasic.DueDate Due) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Double PPmt (System.Double Rate, System.Double Per, System.Double NPer, System.Double PV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] System.Double FV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] Microsoft.VisualBasic.DueDate Due) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Double PV (System.Double Rate, System.Double NPer, System.Double Pmt, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] System.Double FV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] Microsoft.VisualBasic.DueDate Due) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Double Rate (System.Double NPer, System.Double Pmt, System.Double PV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] System.Double FV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] Microsoft.VisualBasic.DueDate Due, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0.1)] System.Double Guess) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Double SLN (System.Double Cost, System.Double Salvage, System.Double Life) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Double SYD (System.Double Cost, System.Double Salvage, System.Double Life, System.Double Period) { throw new NotImplementedException (); }
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FirstDayOfWeek.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FirstDayOfWeek.cs
new file mode 100644
index 00000000000..05cf55c0c35
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FirstDayOfWeek.cs
@@ -0,0 +1,20 @@
+//
+// FirstDayOfWeek.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+namespace Microsoft.VisualBasic {
+ public enum FirstDayOfWeek : int {
+ System = 0,
+ Sunday = 1,
+ Monday = 2,
+ Tuesday = 3,
+ Wednesday = 4,
+ Thursday = 5,
+ Friday = 6,
+ Saturday = 7
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FirstWeekOfYear.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FirstWeekOfYear.cs
new file mode 100644
index 00000000000..035e5bd5feb
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FirstWeekOfYear.cs
@@ -0,0 +1,16 @@
+//
+// FirstWeekOfYear.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+namespace Microsoft.VisualBasic {
+ public enum FirstWeekOfYear : int {
+ System = 0,
+ Jan1 = 1,
+ FirstFourDays = 2,
+ FirstFullWeek = 3
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Globals.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Globals.cs
new file mode 100644
index 00000000000..2c89b994d4e
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Globals.cs
@@ -0,0 +1,30 @@
+//
+// Globals.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+
+using System;
+
+namespace Microsoft.VisualBasic
+{
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ sealed public class Globals {
+ // Declarations
+ // Constructors
+ // Properties
+ [MonoTODO]
+ public static System.String ScriptEngine { get { throw new NotImplementedException (); } }
+ [MonoTODO]
+ public static System.Int32 ScriptEngineMajorVersion { get { throw new NotImplementedException (); } }
+ [MonoTODO]
+ public static System.Int32 ScriptEngineMinorVersion { get { throw new NotImplementedException (); } }
+ [MonoTODO]
+ public static System.Int32 ScriptEngineBuildVersion { get { throw new NotImplementedException (); } }
+ // Methods
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Information.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Information.cs
new file mode 100644
index 00000000000..cb7e773d58d
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Information.cs
@@ -0,0 +1,61 @@
+//
+// Information.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+// Francesco Delfino (pluto@tipic.com
+//
+// (C) 2002 Chris J Breisch
+// 2003 Tipic, Inc. (http://www.tipic.com)
+//
+
+using System;
+
+namespace Microsoft.VisualBasic
+{
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ sealed public class Information {
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ [MonoTODO]
+ public static Microsoft.VisualBasic.ErrObject Err () {
+ return Microsoft.VisualBasic.CompilerServices.ProjectData.Err;
+ }
+ [MonoTODO]
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public static System.Int32 Erl () { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Boolean IsArray (System.Object VarName) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Boolean IsDate (System.Object Expression) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Boolean IsDBNull (System.Object Expression) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Boolean IsNothing (System.Object Expression) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Boolean IsError (System.Object Expression) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Boolean IsReference (System.Object Expression) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Boolean IsNumeric (System.Object Expression) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Int32 LBound (System.Array Array, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(1)] System.Int32 Rank) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Int32 UBound (System.Array Array, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(1)] System.Int32 Rank) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.String TypeName (System.Object VarName) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.String SystemTypeName (System.String VbName) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.String VbTypeName (System.String UrtName) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Int32 QBColor (System.Int32 Color) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Int32 RGB (System.Int32 Red, System.Int32 Green, System.Int32 Blue) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static Microsoft.VisualBasic.VariantType VarType (System.Object VarName) { throw new NotImplementedException (); }
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Interaction.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Interaction.cs
new file mode 100644
index 00000000000..ad17f86ceef
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Interaction.cs
@@ -0,0 +1,39 @@
+//
+// Interaction.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+namespace Microsoft.VisualBasic {
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Auto)]
+ sealed public class Interaction {
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ public static System.Int32 Shell (System.String Pathname, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(2)] Microsoft.VisualBasic.AppWinStyle Style, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] System.Boolean Wait, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int32 Timeout) { return 0;}
+ public static void AppActivate (System.Int32 ProcessId) { }
+ public static void AppActivate (System.String Title) { }
+ public static System.String Command () { return "";}
+ public static System.String Environ (System.Int32 Expression) { return "";}
+ public static System.String Environ (System.String Expression) { return "";}
+ public static void Beep () { }
+ public static System.String InputBox (System.String Prompt, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue("")] System.String Title, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue("")] System.String DefaultResponse, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int32 XPos, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int32 YPos) { return "";}
+ public static Microsoft.VisualBasic.MsgBoxResult MsgBox (System.Object Prompt, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] Microsoft.VisualBasic.MsgBoxStyle Buttons, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.Object Title) { return 0;}
+ public static System.Object CallByName (System.Object ObjectRef, System.String ProcName, Microsoft.VisualBasic.CallType UseCallType, params System.Object[] Args) { return null;}
+ public static System.Object Choose (System.Double Index, params System.Object[] Choice) { return null;}
+ public static System.Object IIf (System.Boolean Expression, System.Object TruePart, System.Object FalsePart) { return null;}
+ public static System.String Partition (System.Int64 Number, System.Int64 Start, System.Int64 Stop, System.Int64 Interval) { return "";}
+ public static System.Object Switch (params System.Object[] VarExpr) { return null;}
+ public static void DeleteSetting (System.String AppName, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.String Section, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.String Key) { }
+ public static System.String[,] GetAllSettings (System.String AppName, System.String Section) { return null;}
+ public static System.String GetSetting (System.String AppName, System.String Section, System.String Key, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue("")] System.String Default) { return "";}
+ public static void SaveSetting (System.String AppName, System.String Section, System.String Key, System.String Setting) { }
+ public static System.Object CreateObject (System.String ProgId, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue("")] System.String ServerName) { return null;}
+ public static System.Object GetObject ([System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.String PathName, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.String Class) { return null;}
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/BooleanType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/BooleanType.cs
new file mode 100644
index 00000000000..45183bd6c33
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/BooleanType.cs
@@ -0,0 +1,32 @@
+//
+// BooleanType.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+// Francesco Delfino (pluto@tipic.com)
+//
+// (C) 2002 Chris J Breisch
+// 2002 Tipic, Inc (http://www.tipic.com)
+//
+
+using System;
+
+namespace Microsoft.VisualBasic.CompilerServices
+{
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ sealed public class BooleanType {
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ public static System.Boolean FromString (System.String Value) { return System.Boolean.Parse(Value); }
+ public static System.Boolean FromObject (System.Object Value)
+ {
+ if ((object)Value == null) return false;
+ //if (Value.GetType() == typeof(string)) return FromString((string)Value);
+ else return System.Convert.ToBoolean(Value);
+ }
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ByteType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ByteType.cs
new file mode 100644
index 00000000000..9ba599d7bdc
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ByteType.cs
@@ -0,0 +1,33 @@
+//
+// ByteType.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+// Francesco Delfino (pluto@tipic.com)
+//
+// (C) 2002 Chris J Breisch
+// 2002 Tipic, Inc (http://www.tipic.com)
+//
+
+using System;
+
+namespace Microsoft.VisualBasic.CompilerServices
+{
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ sealed public class ByteType {
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ public static System.Byte FromString (System.String Value) { return System.Byte.Parse(Value); }
+
+ public static System.Byte FromObject (System.Object Value)
+ {
+ if ((object)Value == null) return 0;
+ else return System.Convert.ToByte(Value);
+ }
+
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/CharArrayType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/CharArrayType.cs
new file mode 100644
index 00000000000..0ff4c50c3b5
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/CharArrayType.cs
@@ -0,0 +1,27 @@
+//
+// CharArrayType.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+
+using System;
+
+namespace Microsoft.VisualBasic.CompilerServices
+{
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ sealed public class CharArrayType {
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ [MonoTODO]
+ public static System.Char[] FromString (System.String Value) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Char[] FromObject (System.Object Value) { throw new NotImplementedException (); }
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/CharType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/CharType.cs
new file mode 100644
index 00000000000..a493a84f45c
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/CharType.cs
@@ -0,0 +1,27 @@
+//
+// CharType.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+
+using System;
+
+namespace Microsoft.VisualBasic.CompilerServices
+{
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ sealed public class CharType {
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ [MonoTODO]
+ public static System.Char FromString (System.String Value) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Char FromObject (System.Object Value) { throw new NotImplementedException (); }
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DateType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DateType.cs
new file mode 100644
index 00000000000..348b4ce3dd8
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DateType.cs
@@ -0,0 +1,36 @@
+//
+// DateType.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+// Francesco Delfino (pluto@tipic.com)
+//
+// (C) 2002 Chris J Breisch
+// 2002 Tipic, Inc (http://www.tipic.com)
+//
+
+using System;
+
+namespace Microsoft.VisualBasic.CompilerServices
+{
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ sealed public class DateType {
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ public static System.DateTime FromString (System.String Value) { return System.DateTime.Parse(Value); }
+ public static System.DateTime FromString (System.String Value, System.Globalization.CultureInfo culture)
+ {
+ return System.DateTime.Parse (Value,culture);
+ }
+ public static System.DateTime FromObject (System.Object Value) {
+ if ((object)Value ==null)
+ return new DateTime(1,1,1);
+ //if (Value.GetType() == typeof(string)) return FromString((string)Value);
+ else return System.Convert.ToDateTime(Value);
+ }
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DecimalType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DecimalType.cs
new file mode 100644
index 00000000000..670f406f42b
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DecimalType.cs
@@ -0,0 +1,34 @@
+//
+// DecimalType.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+
+using System;
+
+namespace Microsoft.VisualBasic.CompilerServices
+{
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ sealed public class DecimalType {
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ [MonoTODO]
+ public static System.Decimal FromBoolean (System.Boolean Value) { throw new NotImplementedException (); }
+ public static System.Decimal FromString (System.String Value) { return System.Decimal.Parse(Value); }
+ [MonoTODO]
+ public static System.Decimal FromString (System.String Value, System.Globalization.NumberFormatInfo NumberFormat) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Decimal FromObject (System.Object Value) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Decimal FromObject (System.Object Value, System.Globalization.NumberFormatInfo NumberFormat) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Decimal Parse (System.String Value, System.Globalization.NumberFormatInfo NumberFormat) { throw new NotImplementedException (); }
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DoubleType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DoubleType.cs
new file mode 100644
index 00000000000..1d0e2b99fa3
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DoubleType.cs
@@ -0,0 +1,33 @@
+//
+// DoubleType.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+
+using System;
+
+namespace Microsoft.VisualBasic.CompilerServices
+{
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ sealed public class DoubleType {
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ public static System.Double FromString (System.String Value) { return System.Double.Parse(Value); }
+ [MonoTODO]
+ public static System.Double FromString (System.String Value, System.Globalization.NumberFormatInfo NumberFormat) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Double FromObject (System.Object Value) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Double FromObject (System.Object Value, System.Globalization.NumberFormatInfo NumberFormat) { throw new NotImplementedException (); }
+ public static System.Double Parse (System.String Value) { return System.Double.Parse(Value); }
+ [MonoTODO]
+ public static System.Double Parse (System.String Value, System.Globalization.NumberFormatInfo NumberFormat) { throw new NotImplementedException (); }
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ExceptionUtils.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ExceptionUtils.cs
new file mode 100644
index 00000000000..03442b7382f
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ExceptionUtils.cs
@@ -0,0 +1,20 @@
+//
+// ExceptionUtils.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+namespace Microsoft.VisualBasic.CompilerServices {
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Auto)]
+ sealed public class ExceptionUtils {
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/FlowControl.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/FlowControl.cs
new file mode 100644
index 00000000000..50f5ff3b23f
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/FlowControl.cs
@@ -0,0 +1,41 @@
+//
+// FlowControl.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+
+using System;
+
+namespace Microsoft.VisualBasic.CompilerServices
+{
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ sealed public class FlowControl {
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ [MonoTODO]
+ public static System.Boolean ForNextCheckR4 (System.Single count, System.Single limit, System.Single StepValue) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Boolean ForNextCheckR8 (System.Double count, System.Double limit, System.Double StepValue) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Boolean ForNextCheckDec (System.Decimal count, System.Decimal limit, System.Decimal StepValue) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Boolean ForLoopInitObj (System.Object Counter, System.Object Start, System.Object Limit, System.Object StepValue, ref System.Object LoopForResult, ref System.Object CounterResult) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Boolean ForNextCheckObj (System.Object Counter, System.Object LoopObj, ref System.Object CounterResult) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Collections.IEnumerator ForEachInArr (System.Array ary) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Collections.IEnumerator ForEachInObj (System.Object obj) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Boolean ForEachNextObj (ref System.Object obj, ref System.Collections.IEnumerator enumerator) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void CheckForSyncLockOnValueType (System.Object obj) { throw new NotImplementedException (); }
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/HostServices.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/HostServices.cs
new file mode 100644
index 00000000000..49145ede7e9
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/HostServices.cs
@@ -0,0 +1,24 @@
+//
+// HostServices.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+
+using System;
+
+namespace Microsoft.VisualBasic.CompilerServices
+{
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ sealed public class HostServices {
+ // Declarations
+ // Constructors
+ // Properties
+ [MonoTODO]
+ public static Microsoft.VisualBasic.CompilerServices.IVbHost VBHost { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } }
+ // Methods
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IVbHost.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IVbHost.cs
new file mode 100644
index 00000000000..abff24de804
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IVbHost.cs
@@ -0,0 +1,20 @@
+//
+// IVbHost.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+namespace Microsoft.VisualBasic.CompilerServices {
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public interface IVbHost {
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ System.String GetWindowTitle ();
+ // System.Windows.Forms.IWin32Window GetParentWindow ();
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IncompleteInitialization.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IncompleteInitialization.cs
new file mode 100644
index 00000000000..e22ac728bc1
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IncompleteInitialization.cs
@@ -0,0 +1,19 @@
+//
+// IncompleteInitialization.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+namespace Microsoft.VisualBasic.CompilerServices {
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ [MonoTODO]
+ sealed public class IncompleteInitialization : System.Exception, System.Runtime.Serialization.ISerializable {
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IntegerType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IntegerType.cs
new file mode 100644
index 00000000000..ba41771ab1c
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IntegerType.cs
@@ -0,0 +1,33 @@
+//
+// IntegerType.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+// Francesco Delfino (pluto@tipic.com)
+//
+// (C) 2002 Chris J Breisch
+// 2002 Tipic, Inc (http://www.tipic.com)
+//
+
+using System;
+
+namespace Microsoft.VisualBasic.CompilerServices
+{
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ sealed public class IntegerType {
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ public static System.Int32 FromString (System.String Value) { return System.Int32.Parse(Value); }
+
+ public static System.Int32 FromObject (System.Object Value)
+ {
+ if ((object)Value==null)
+ return 0;
+ else return System.Convert.ToInt32(Value);
+ }
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LateBinding.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LateBinding.cs
new file mode 100644
index 00000000000..22ce2f3faf3
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LateBinding.cs
@@ -0,0 +1,51 @@
+//
+// LateBinding.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+
+using System;
+
+namespace Microsoft.VisualBasic.CompilerServices
+{
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ sealed public class LateBinding {
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ [MonoTODO]
+ [System.Diagnostics.DebuggerHiddenAttribute]
+ [System.Diagnostics.DebuggerStepThroughAttribute]
+ public static System.Object LateGet (System.Object o, System.Type objType, System.String name, System.Object[] args, System.String[] paramnames, System.Boolean[] CopyBack) { throw new NotImplementedException (); }
+ [MonoTODO]
+ [System.Diagnostics.DebuggerStepThroughAttribute]
+ [System.Diagnostics.DebuggerHiddenAttribute]
+ public static void LateSetComplex (System.Object o, System.Type objType, System.String name, System.Object[] args, System.String[] paramnames, System.Boolean OptimisticSet, System.Boolean RValueBase) { throw new NotImplementedException (); }
+ [MonoTODO]
+ [System.Diagnostics.DebuggerStepThroughAttribute]
+ [System.Diagnostics.DebuggerHiddenAttribute]
+ public static void LateSet (System.Object o, System.Type objType, System.String name, System.Object[] args, System.String[] paramnames) { throw new NotImplementedException (); }
+ [MonoTODO]
+ [System.Diagnostics.DebuggerStepThroughAttribute]
+ [System.Diagnostics.DebuggerHiddenAttribute]
+ public static System.Object LateIndexGet (System.Object o, System.Object[] args, System.String[] paramnames) { throw new NotImplementedException (); }
+ [MonoTODO]
+ [System.Diagnostics.DebuggerHiddenAttribute]
+ [System.Diagnostics.DebuggerStepThroughAttribute]
+ public static void LateIndexSetComplex (System.Object o, System.Object[] args, System.String[] paramnames, System.Boolean OptimisticSet, System.Boolean RValueBase) { throw new NotImplementedException (); }
+ [MonoTODO]
+ [System.Diagnostics.DebuggerStepThroughAttribute]
+ [System.Diagnostics.DebuggerHiddenAttribute]
+ public static void LateIndexSet (System.Object o, System.Object[] args, System.String[] paramnames) { throw new NotImplementedException (); }
+ [MonoTODO]
+ [System.Diagnostics.DebuggerStepThroughAttribute]
+ [System.Diagnostics.DebuggerHiddenAttribute]
+ public static void LateCall (System.Object o, System.Type objType, System.String name, System.Object[] args, System.String[] paramnames, System.Boolean[] CopyBack) { throw new NotImplementedException (); }
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LongType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LongType.cs
new file mode 100644
index 00000000000..e90edd154c6
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LongType.cs
@@ -0,0 +1,26 @@
+//
+// LongType.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+
+using System;
+
+namespace Microsoft.VisualBasic.CompilerServices
+{
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ sealed public class LongType {
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ public static System.Int64 FromString (System.String Value) { return System.Int64.Parse(Value); }
+ [MonoTODO]
+ public static System.Int64 FromObject (System.Object Value) { throw new NotImplementedException (); }
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ObjectType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ObjectType.cs
new file mode 100644
index 00000000000..b5ea837a1cb
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ObjectType.cs
@@ -0,0 +1,60 @@
+//
+// ObjectType.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+// Francesco Delfino (pluto@tipic.com)
+//
+// (C) 2002 Chris J Breisch
+// 2002 Tipic, Inc (http://www.tipic.com)
+//
+
+using System;
+
+namespace Microsoft.VisualBasic.CompilerServices
+{
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ sealed public class ObjectType {
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ [MonoTODO]
+ public static System.Int32 ObjTst (System.Object o1, System.Object o2, System.Boolean TextCompare) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Object PlusObj (System.Object obj) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Object NegObj (System.Object obj) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Object NotObj (System.Object obj) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Object BitAndObj (System.Object obj1, System.Object obj2) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Object BitOrObj (System.Object obj1, System.Object obj2) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Object BitXorObj (System.Object obj1, System.Object obj2) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Object AddObj (System.Object o1, System.Object o2) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Object SubObj (System.Object o1, System.Object o2) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Object MulObj (System.Object o1, System.Object o2) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Object DivObj (System.Object o1, System.Object o2) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Object PowObj (System.Object obj1, System.Object obj2) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Object ModObj (System.Object o1, System.Object o2) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Object IDivObj (System.Object o1, System.Object o2) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Object XorObj (System.Object obj1, System.Object obj2) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Boolean LikeObj (System.Object vLeft, System.Object vRight, Microsoft.VisualBasic.CompareMethod CompareOption) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Object StrCatObj (System.Object vLeft, System.Object vRight) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Object GetObjectValuePrimitive (System.Object o) { throw new NotImplementedException (); }
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/OptionCompareAttribute.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/OptionCompareAttribute.cs
new file mode 100644
index 00000000000..ab0fbca18cb
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/OptionCompareAttribute.cs
@@ -0,0 +1,32 @@
+//
+// OptionCompareAttribute.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+// Martin Adoue (martin@cwanet.com)
+//
+// (C) 2002 Ximian Inc.
+//
+using System;
+using System.ComponentModel;
+using System.Runtime.InteropServices;
+
+namespace Microsoft.VisualBasic.CompilerServices {
+ [MonoTODO]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [AttributeUsage(AttributeTargets.Parameter)]
+ [StructLayoutAttribute(LayoutKind.Auto)]
+ sealed public class OptionCompareAttribute : Attribute {
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ // Events
+ public OptionCompareAttribute()
+ {
+ //FIXME: should this do something?
+ throw new NotImplementedException();
+ }
+ };
+
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/OptionTextAttribute.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/OptionTextAttribute.cs
new file mode 100644
index 00000000000..97ac0cc262f
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/OptionTextAttribute.cs
@@ -0,0 +1,20 @@
+//
+// OptionTextAttribute.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+namespace Microsoft.VisualBasic.CompilerServices {
+ [System.AttributeUsageAttribute(System.AttributeTargets.Class)]
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ [MonoTODO]
+ sealed public class OptionTextAttribute : System.Attribute {
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ProjectData.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ProjectData.cs
new file mode 100644
index 00000000000..173b1ac912a
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ProjectData.cs
@@ -0,0 +1,98 @@
+//
+// ProjectData.cs
+//
+// Authors:
+// Martin Adoue (martin@cwanet.com)
+// Chris J Breisch (cjbreisch@altavista.net)
+// Francesco Delfino (pluto@tipic.com)
+//
+// (C) 2002 Ximian Inc.
+// 2002 Tipic, Inc. (http://www.tipic.com)
+//
+
+using System;
+using System.ComponentModel;
+using System.Runtime.InteropServices;
+
+namespace Microsoft.VisualBasic.CompilerServices
+{
+ /// <summary>
+ /// FIXME: Summary description for ProjectData.
+ /// </summary>
+
+ [MonoTODO]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [StructLayout(LayoutKind.Auto)]
+ public class ProjectData{
+
+ internal static System.Exception projectError;
+ internal static int erl;
+ internal static Microsoft.VisualBasic.ErrObject pErr;
+
+ internal static Microsoft.VisualBasic.ErrObject Err
+ {
+ get
+ {
+ if (pErr==null)
+ pErr=new ErrObject();
+
+ return pErr;
+ }
+ set
+ {
+ pErr = value;
+ }
+ }
+
+ /// <summary>
+ /// FIXME: Summary description for ClearProjectError
+ /// </summary>
+ public static void ClearProjectError()
+ {
+ projectError = null;
+ erl = 0;
+ }
+
+ /// <summary>
+ /// FIXME: Summary description for SetProjectError
+ /// </summary>
+ /// <param name="ex">FIXME: Required. Summary description for ex</param>
+ [MonoTODO]
+ public static void SetProjectError(System.Exception ex)
+ {
+ SetProjectError(ex, 0);
+ }
+
+ /// <summary>
+ /// FIXME: Summary description for SetProjectError
+ /// </summary>
+ /// <param name="ex">FIXME: Required. Summary description for ex</param>
+ /// <param name="lErl">FIXME: Required. Summary description for lErl</param>
+ [MonoTODO]
+ public static void SetProjectError(System.Exception ex, int lErl)
+ {
+ projectError = ex;
+ erl = lErl;
+ Err.SetException (ex);
+ }
+
+ /*
+ [MonoTODO]
+ public static void EndApp()
+ {
+ //FIXME
+ }
+ */
+
+ /*
+ [MonoTODO]
+ protected static void Finalize()
+ {
+ //FIXME
+ }
+ */
+
+
+
+ }
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ShortType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ShortType.cs
new file mode 100644
index 00000000000..a06e424af7c
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ShortType.cs
@@ -0,0 +1,26 @@
+//
+// ShortType.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+
+using System;
+
+namespace Microsoft.VisualBasic.CompilerServices
+{
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ sealed public class ShortType {
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ public static System.Int16 FromString (System.String Value) { return System.Int16.Parse(Value); }
+ [MonoTODO]
+ public static System.Int16 FromObject (System.Object Value) { throw new NotImplementedException (); }
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/SingleType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/SingleType.cs
new file mode 100644
index 00000000000..134db71e4d4
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/SingleType.cs
@@ -0,0 +1,30 @@
+//
+// SingleType.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+
+using System;
+
+namespace Microsoft.VisualBasic.CompilerServices
+{
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ sealed public class SingleType {
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ public static System.Single FromString (System.String Value) { return System.Single.Parse(Value); }
+ [MonoTODO]
+ public static System.Single FromString (System.String Value, System.Globalization.NumberFormatInfo NumberFormat) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Single FromObject (System.Object Value) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Single FromObject (System.Object Value, System.Globalization.NumberFormatInfo NumberFormat) { throw new NotImplementedException (); }
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StandardModuleAttribute.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StandardModuleAttribute.cs
new file mode 100644
index 00000000000..0da5cc2b145
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StandardModuleAttribute.cs
@@ -0,0 +1,20 @@
+//
+// StandardModuleAttribute.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+namespace Microsoft.VisualBasic.CompilerServices {
+ [System.AttributeUsageAttribute(System.AttributeTargets.Class)]
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Auto)]
+ sealed public class StandardModuleAttribute : System.Attribute {
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StaticLocalInitFlag.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StaticLocalInitFlag.cs
new file mode 100644
index 00000000000..42fa6300a68
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StaticLocalInitFlag.cs
@@ -0,0 +1,20 @@
+//
+// StaticLocalInitFlag.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+namespace Microsoft.VisualBasic.CompilerServices {
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Auto)]
+ sealed public class StaticLocalInitFlag {
+ // Declarations
+ public System.Int16 State = (System.Int16)(0);
+ // Constructors
+ // Properties
+ // Methods
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StringType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StringType.cs
new file mode 100644
index 00000000000..5da897455e7
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StringType.cs
@@ -0,0 +1,94 @@
+//
+// StringType.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+// Francesco Delfino (pluto@tipic.com)
+//
+// (C) 2002 Chris J Breisch
+// 2002 Tipic, Inc. (http://www.tipic.com)
+//
+
+using System;
+
+namespace Microsoft.VisualBasic.CompilerServices
+{
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ sealed public class StringType {
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ public static System.String FromBoolean (System.Boolean Value) {
+ return Convert.ToString(Value);
+ }
+ public static System.String FromByte (System.Byte Value)
+ {
+ return Convert.ToString(Value);
+ }
+ public static System.String FromChar (System.Char Value)
+ {
+ return Convert.ToString(Value);
+ }
+ public static System.String FromShort (System.Int16 Value)
+ {
+ return Convert.ToString(Value);
+ }
+ public static System.String FromInteger (System.Int32 Value)
+ {
+ return Convert.ToString(Value);
+ }
+ public static System.String FromLong (System.Int64 Value)
+ {
+ return Convert.ToString(Value);
+ }
+ public static System.String FromSingle (System.Single Value)
+ {
+ return Convert.ToString(Value);
+ }
+ public static System.String FromDouble (System.Double Value)
+ {
+ return Convert.ToString(Value);
+ }
+ public static System.String FromSingle (System.Single Value, System.Globalization.NumberFormatInfo NumberFormat)
+ {
+ return Convert.ToString(Value,NumberFormat);
+ }
+ public static System.String FromDouble (System.Double Value, System.Globalization.NumberFormatInfo NumberFormat)
+ {
+ return Convert.ToString(Value,NumberFormat);
+ }
+ public static System.String FromDate (System.DateTime Value)
+ {
+ return Convert.ToString(Value);
+ }
+ public static System.String FromDecimal (System.Decimal Value)
+ {
+ return Convert.ToString(Value);
+ }
+ public static System.String FromDecimal (System.Decimal Value, System.Globalization.NumberFormatInfo NumberFormat)
+ {
+ return Convert.ToString(Value,NumberFormat);
+ }
+ public static System.String FromObject (System.Object Value)
+ {
+ if ((object)Value==null) return "";
+ else return Convert.ToString(Value);
+ }
+ [MonoTODO("Last boolean parameter ignored")]
+ public static System.Int32 StrCmp (System.String sLeft, System.String sRight, System.Boolean TextCompare)
+ {
+ return sLeft.CompareTo(sRight);
+ }
+ [MonoTODO]
+ public static System.Boolean StrLike (System.String Source, System.String Pattern, Microsoft.VisualBasic.CompareMethod CompareOption) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Boolean StrLikeBinary (System.String Source, System.String Pattern) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Boolean StrLikeText (System.String Source, System.String Pattern) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static void MidStmtStr (ref System.String sDest, ref System.Int32 StartPosition, ref System.Int32 MaxInsertLength, ref System.String sInsert) { throw new NotImplementedException (); }
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/TODOAttribute.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/TODOAttribute.cs
new file mode 100644
index 00000000000..fe572f886c7
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/TODOAttribute.cs
@@ -0,0 +1,39 @@
+//
+// TODOAttribute.cs
+//
+// Author:
+// Ravi Pratap (ravi@ximian.com)
+//
+// (C) Ximian, Inc. http://www.ximian.com
+//
+
+using System;
+
+namespace Microsoft.VisualBasic.CompilerServices {
+
+ /// <summary>
+ /// The TODO attribute is used to flag all incomplete bits in our class libraries
+ /// </summary>
+ ///
+ /// <remarks>
+ /// Use this to decorate any element which you think is not complete
+ /// </remarks>
+ [AttributeUsage (AttributeTargets.All, AllowMultiple=true)]
+ public class MonoTODOAttribute : Attribute {
+
+ private string comment;
+
+ public MonoTODOAttribute ()
+ {}
+
+ public MonoTODOAttribute (string comment)
+ {
+ this.comment = comment;
+ }
+
+ public string Comment
+ {
+ get { return comment; }
+ }
+ }
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/Utils.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/Utils.cs
new file mode 100644
index 00000000000..6d13fa195a2
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/Utils.cs
@@ -0,0 +1,31 @@
+//
+// Utils.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+
+using System;
+
+namespace Microsoft.VisualBasic.CompilerServices
+{
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ sealed public class Utils {
+ // Declarations
+ // Constructors
+ // Properties
+ // Methods
+ [MonoTODO]
+ public static void ThrowException (System.Int32 hr) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Object SetCultureInfo (System.Globalization.CultureInfo Culture) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.Array CopyArray (System.Array arySrc, System.Array aryDest) { throw new NotImplementedException (); }
+ [MonoTODO]
+ public static System.String MethodToString (System.Reflection.MethodBase Method) { throw new NotImplementedException (); }
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/MsgBoxResult.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/MsgBoxResult.cs
new file mode 100644
index 00000000000..2f2094c748b
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/MsgBoxResult.cs
@@ -0,0 +1,19 @@
+//
+// MsgBoxResult.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+namespace Microsoft.VisualBasic {
+ public enum MsgBoxResult : int {
+ OK = 1,
+ Cancel = 2,
+ Abort = 3,
+ Retry = 4,
+ Ignore = 5,
+ Yes = 6,
+ No = 7
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/MsgBoxStyle.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/MsgBoxStyle.cs
new file mode 100644
index 00000000000..91042bcdb93
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/MsgBoxStyle.cs
@@ -0,0 +1,32 @@
+//
+// MsgBoxStyle.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+namespace Microsoft.VisualBasic {
+ [System.FlagsAttribute]
+ public enum MsgBoxStyle : int {
+ ApplicationModal = 0,
+ DefaultButton1 = 0,
+ OKOnly = 0,
+ OKCancel = 1,
+ AbortRetryIgnore = 2,
+ YesNoCancel = 3,
+ YesNo = 4,
+ RetryCancel = 5,
+ Critical = 16,
+ Question = 32,
+ Exclamation = 48,
+ Information = 64,
+ DefaultButton2 = 256,
+ DefaultButton3 = 512,
+ SystemModal = 4096,
+ MsgBoxHelp = 16384,
+ MsgBoxSetForeground = 65536,
+ MsgBoxRight = 524288,
+ MsgBoxRtlReading = 1048576
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/OpenAccess.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/OpenAccess.cs
new file mode 100644
index 00000000000..0db6fd0ccae
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/OpenAccess.cs
@@ -0,0 +1,16 @@
+//
+// OpenAccess.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+namespace Microsoft.VisualBasic {
+ public enum OpenAccess : int {
+ Read = 1,
+ Write = 2,
+ ReadWrite = 3,
+ Default = -1
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/OpenMode.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/OpenMode.cs
new file mode 100644
index 00000000000..4374a0bccdc
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/OpenMode.cs
@@ -0,0 +1,17 @@
+//
+// OpenMode.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+namespace Microsoft.VisualBasic {
+ public enum OpenMode : int {
+ Input = 1,
+ Output = 2,
+ Random = 4,
+ Append = 8,
+ Binary = 32
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/OpenShare.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/OpenShare.cs
new file mode 100644
index 00000000000..02d828f8188
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/OpenShare.cs
@@ -0,0 +1,17 @@
+//
+// OpenShare.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+namespace Microsoft.VisualBasic {
+ public enum OpenShare : int {
+ LockReadWrite = 0,
+ LockWrite = 1,
+ LockRead = 2,
+ Shared = 3,
+ Default = -1
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/SpcInfo.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/SpcInfo.cs
new file mode 100644
index 00000000000..65b3d2bba5c
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/SpcInfo.cs
@@ -0,0 +1,20 @@
+//
+// SpcInfo.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+namespace Microsoft.VisualBasic {
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ [MonoTODO]
+ public struct SpcInfo {
+ // Declarations
+ public System.Int16 Count;
+ // Constructors
+ // Properties
+ // Methods
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Strings.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Strings.cs
new file mode 100644
index 00000000000..77466d775f8
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Strings.cs
@@ -0,0 +1,1124 @@
+//
+// Strings.cs
+//
+// Authors:
+// Martin Adoue (martin@cwanet.com)
+// Chris J Breisch (cjbreisch@altavista.net)
+// Francesco Delfino (pluto@tipic.com)
+// Daniel Campos (danielcampos@myway.com)
+// Rafael Teixeira (rafaelteixeirabr@hotmail.com)
+//
+// (C) 2002 Ximian Inc.
+// 2002 Tipic, Inc. (http://www.tipic.com)
+//
+
+using System;
+using System.Text;
+using System.ComponentModel;
+
+using System.Runtime.InteropServices;
+using Microsoft.VisualBasic.CompilerServices;
+
+namespace Microsoft.VisualBasic
+{
+ /// <summary>
+ /// The Strings module contains procedures used to perform string operations.
+ /// </summary>
+
+ [StandardModule]
+ [StructLayout(LayoutKind.Auto)]
+ public class Strings
+ {
+ private Strings()
+ {
+ //Do nothing. Nobody should be creating this.
+ }
+
+
+ /// <summary>
+ /// Returns an Integer value representing the character code corresponding to a character.
+ /// </summary>
+ /// <param name="String">Required. Any valid Char or String expression. If String is a String expression, only the first character of the string is used for input. If String is Nothing or contains no characters, an ArgumentException error occurs.</param>
+ [MonoTODO]
+ public static int Asc(char Char)
+ {
+ //FIXME: Check the docs, it says something about Locales, DBCS, etc.
+ return (int)Char;
+ }
+
+
+ /// <summary>
+ /// Returns an Integer value representing the character code corresponding to a character.
+ /// </summary>
+ /// <param name="String">Required. Any valid Char or String expression. If String is a String expression, only the first character of the string is used for input. If String is Nothing or contains no characters, an ArgumentException error occurs.</param>
+ [MonoTODO]
+ public static int Asc(string String)
+ {
+ if ((String == null) || (String.Length < 1))
+ throw new ArgumentException("Length of argument 'String' must be at least one.", "String");
+
+ //FIXME: Check the docs, it says something about Locales, DBCS, etc.
+ return (int) String.ToCharArray(0, 1)[0];
+ //why? check http://bugzilla.ximian.com/show_bug.cgi?id=23540
+ }
+
+
+ /// <summary>
+ /// Returns an Integer value representing the character code corresponding to a character.
+ /// </summary>
+ /// <param name="String">Required. Any valid Char or String expression. If String is a String expression, only the first character of the string is used for input. If String is Nothing or contains no characters, an ArgumentException error occurs.</param>
+ [MonoTODO("Needs testing")]
+ public static int AscW(char String)
+ {
+ /*
+ * AscW returns the Unicode code point for the input character.
+ * This can be 0 through 65535. The returned value is independent
+ * of the culture and code page settings for the current thread.
+ */
+
+ return (int) String;
+ }
+
+ /// <summary>
+ /// Returns an Integer value representing the character code corresponding to a character.
+ /// </summary>
+ /// <param name="String">Required. Any valid Char or String expression. If String is a String expression, only the first character of the string is used for input. If String is Nothing or contains no characters, an ArgumentException error occurs.</param>
+ [MonoTODO("Needs testing")]
+ public static int AscW(string String)
+ {
+ /*
+ * AscW returns the Unicode code point for the input character.
+ * This can be 0 through 65535. The returned value is independent
+ * of the culture and code page settings for the current thread.
+ */
+ if ((String == null) || (String.Length == 0))
+ throw new ArgumentException("Length of argument 'String' must be at leasr one.", "String");
+ return (int) String.ToCharArray(0, 1)[0];
+
+ }
+
+ /// <summary>
+ /// Returns the character associated with the specified character code.
+ /// </summary>
+ /// <param name="CharCode">Required. An Integer expression representing the code point, or character code, for the character. If CharCode is outside the range -32768 through 65535, an ArgumentException error occurs.</param>
+ [MonoTODO]
+ public static char Chr(int CharCode)
+ {
+
+ // According to docs (ms-help://MS.VSCC/MS.MSDNVS/vblr7/html/vafctchr.htm)
+ // Chr and ChrW should throw ArgumentException if ((CharCode < -32768) || (CharCode > 65535))
+ // Instead, VB.net throws an OverflowException. I'm following the implementation
+ // instead of the docs.
+
+ if ((CharCode < -32768) || (CharCode > 65535))
+ throw new OverflowException("Value was either too large or too small for a character.");
+
+ //FIXME: Check the docs, it says something about Locales, DBCS, etc.
+ return System.Convert.ToChar(CharCode);
+ }
+
+ /// <summary>
+ /// Returns the character associated with the specified character code.
+ /// </summary>
+ /// <param name="CharCode">Required. An Integer expression representing the code point, or character code, for the character. If CharCode is outside the range -32768 through 65535, an ArgumentException error occurs.</param>
+ [MonoTODO("Needs testing")]
+ public static char ChrW(int CharCode )
+ {
+ /*
+ * According to docs ()
+ * Chr and ChrW should throw ArgumentException if ((CharCode < -32768) || (CharCode > 65535))
+ * Instead, VB.net throws an OverflowException. I'm following the implementation
+ * instead of the docs
+ */
+ if ((CharCode < -32768) || (CharCode > 65535))
+ throw new OverflowException("Value was either too large or too small for a character.");
+
+ /*
+ * ChrW takes CharCode as a Unicode code point. The range is independent of the
+ * culture and code page settings for the current thread. Values from -32768 through
+ * -1 are treated the same as values in the range +32768 through +65535.
+ */
+ if (CharCode < 0)
+ CharCode += 0x10000;
+
+ return System.Convert.ToChar(CharCode);
+ }
+
+ /// <summary>
+ /// Returns a zero-based array containing a subset of a String array based on specified filter criteria.
+ /// </summary>
+ /// <param name="Source">Required. One-dimensional array of strings to be searched.</param>
+ /// <param name="Match">Required. String to search for.</param>
+ /// <param name="Include">Optional. Boolean value indicating whether to return substrings that include or exclude Match. If Include is True, the Filter function returns the subset of the array that contains Match as a substring. If Include is False, the Filter function returns the subset of the array that does not contain Match as a substring.</param>
+ /// <param name="Compare">Optional. Numeric value indicating the kind of string comparison to use. See Settings for values.</param>
+ [MonoTODO("Needs testing")]
+ public static string[] Filter(object[] Source,
+ string Match,
+ [Optional]
+ [DefaultValue(true)]
+ bool Include,
+ [OptionCompare] [Optional]
+ [DefaultValue(CompareMethod.Binary)]
+ CompareMethod Compare)
+ {
+
+ if (Source == null)
+ throw new ArgumentException("Argument 'Source' can not be null.", "Source");
+ if (Source.Rank > 1)
+ throw new ArgumentException("Argument 'Source' can have only one dimension.", "Source");
+
+ string[] strings;
+ strings = new string[Source.Length];
+
+ Source.CopyTo(strings, 0);
+ return Filter(strings, Match, Include, Compare);
+
+ }
+
+ /// <summary>
+ /// Returns a zero-based array containing a subset of a String array based on specified filter criteria.
+ /// </summary>
+ /// <param name="Source">Required. One-dimensional array of strings to be searched.</param>
+ /// <param name="Match">Required. String to search for.</param>
+ /// <param name="Include">Optional. Boolean value indicating whether to return substrings that include or exclude Match. If Include is True, the Filter function returns the subset of the array that contains Match as a substring. If Include is False, the Filter function returns the subset of the array that does not contain Match as a substring.</param>
+ /// <param name="Compare">Optional. Numeric value indicating the kind of string comparison to use. See Settings for values.</param>
+ public static string[] Filter(string[] Source,
+ string Match,
+ [Optional]
+ [DefaultValue(true)]
+ bool Include,
+ [Optional]
+ [DefaultValue(CompareMethod.Binary)]
+ CompareMethod Compare)
+ {
+
+ if (Source == null)
+ throw new ArgumentException("Argument 'Source' can not be null.", "Source");
+ if (Source.Rank > 1)
+ throw new ArgumentException("Argument 'Source' can have only one dimension.", "Source");
+
+ /*
+ * Well, I don't like it either. But I figured that two iterations
+ * on the array would be better than many aloocations. Besides, this
+ * way I can isolate the special cases.
+ * I'd love to hear from a different approach.
+ */
+
+ int count = Source.Length;
+ bool[] matches = new bool[count];
+ int matchesCount = 0;
+
+ for (int i = 0; i < count; i++)
+ {
+ if (InStr(1, Match, Source[i], Compare) != 0)
+ {
+ //found one more
+ matches[i] = true;
+ matchesCount ++;
+ }
+ else
+ {
+ matches[i] = false;
+ }
+ }
+
+ if (matchesCount == 0)
+ {
+ if (Include)
+ return new string[0];
+ else
+ return Source;
+ }
+ else
+ {
+ if (matchesCount == count)
+ {
+ if (Include)
+ return Source;
+ else
+ return new string[0];
+ }
+ else
+ {
+ string[] ret;
+ int j = 0;
+ if (Include)
+ ret = new string [matchesCount];
+ else
+ ret = new string [count - matchesCount];
+
+ for (int i=0; i < count; i++)
+ {
+ if ((matches[i] && Include) || !(matches[i] || Include))
+ {
+ ret[j] = Source[i];
+ j++;
+ }
+ }
+ return ret;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Returns a string formatted according to instructions contained in a format String expression.
+ /// </summary>
+ /// <param name="Expression">Required. Any valid expression.</param>
+ /// <param name="Style">Optional. A valid named or user-defined format String expression. </param>
+ [MonoTODO]
+ public static string Format(object Expression,
+ [Optional]
+ [DefaultValue("")]
+ string Style)
+ {
+ //FIXME
+ throw new NotImplementedException();
+ }
+
+
+ /// <summary>
+ /// Returns an expression formatted as a currency value using the currency symbol defined in the system control panel.
+ /// </summary>
+ /// <param name="Expression">Required. Expression to be formatted.</param>
+ /// <param name="NumDigitsAfterDecimal">Optional. Numeric value indicating how many places are displayed to the right of the decimal. Default value is –1, which indicates that the computer's regional settings are used.</param>
+ /// <param name="IncludeLeadingDigit">Optional. Tristate enumeration that indicates whether or not a leading zero is displayed for fractional values. See Settings for values.</param>
+ /// <param name="UseParensForNegativeNumbers">Optional. Tristate enumeration that indicates whether or not to place negative values within parentheses. See Settings for values.</param>
+ /// <param name="GroupDigits">Optional. Tristate enumeration that indicates whether or not numbers are grouped using the group delimiter specified in the computer's regional settings. See Settings for values.</param>
+ [MonoTODO]
+ public static string FormatCurrency(object Expression,
+ [Optional]
+ [DefaultValue(-1)]
+ int NumDigitsAfterDecimal,
+ [Optional]
+ [DefaultValue(TriState.UseDefault)]
+ TriState IncludeLeadingDigit,
+ [Optional]
+ [DefaultValue(TriState.UseDefault)]
+ TriState UseParensForNegativeNumbers,
+ [Optional]
+ [DefaultValue(TriState.UseDefault)]
+ TriState GroupDigits)
+ {
+ //FIXME
+ throw new NotImplementedException();
+ //throws InvalidCastException
+ //throws ArgumentException
+ }
+
+ /// <summary>
+ /// Returns an expression formatted as a date or time.
+ /// </summary>
+ /// <param name="Expression">Required. Date expression to be formatted. </param>
+ /// <param name="NamedFormat">Optional. Numeric value that indicates the date or time format used. If omitted, GeneralDate is used.</param>
+ [MonoTODO]
+ public static string FormatDateTime(DateTime Expression,
+ [Optional]
+ [DefaultValue(DateFormat.GeneralDate)]
+ DateFormat NamedFormat)
+ {
+ switch(NamedFormat)
+ {
+ case DateFormat.GeneralDate:
+ //FIXME: WTF should I do with it?
+ throw new NotImplementedException();
+ case DateFormat.LongDate:
+ return Expression.ToLongDateString();
+ case DateFormat.ShortDate:
+ return Expression.ToShortDateString();
+ case DateFormat.LongTime:
+ return Expression.ToLongTimeString();
+ case DateFormat.ShortTime:
+ return Expression.ToShortTimeString();
+ default:
+ throw new ArgumentException("Argument 'NamedFormat' must be a member of DateFormat", "NamedFormat");
+ }
+ }
+
+ /// <summary>
+ /// Returns an expression formatted as a number.
+ /// </summary>
+ /// <param name="Expression">Required. Expression to be formatted.</param>
+ /// <param name="NumDigitsAfterDecimal">Optional. Numeric value indicating how many places are displayed to the right of the decimal. Default value is –1, which indicates that the computer's regional settings are used.</param>
+ /// <param name="IncludeLeadingDigit">Optional. Tristate enumeration that indicates whether or not a leading zero is displayed for fractional values. See Settings for values.</param>
+ /// <param name="UseParensForNegativeNumbers">Optional. Tristate enumeration that indicates whether or not to place negative values within parentheses. See Settings for values.</param>
+ /// <param name="GroupDigits">Optional. Tristate enumeration that indicates whether or not numbers are grouped using the group delimiter specified in the computer's regional settings. See Settings for values.</param>
+ [MonoTODO]
+ public static string FormatNumber(object Expression,
+ [Optional]
+ [DefaultValue(-1)]
+ int NumDigitsAfterDecimal,
+ [Optional]
+ [DefaultValue(TriState.UseDefault)]
+ TriState IncludeLeadingDigit,
+ [Optional]
+ [DefaultValue(TriState.UseDefault)]
+ TriState UseParensForNegativeNumbers,
+ [Optional]
+ [DefaultValue(TriState.UseDefault)]
+ TriState GroupDigits)
+ {
+ //FIXME
+ throw new NotImplementedException();
+ //throws InvalidCastException
+ }
+
+ /// <summary>
+ /// Returns an expression formatted as a percentage (that is, multiplied by 100) with a trailing % character.
+ /// </summary>
+ /// <param name="Expression">Required. Expression to be formatted.</param>
+ /// <param name="NumDigitsAfterDecimal">Optional. Numeric value indicating how many places are displayed to the right of the decimal. Default value is –1, which indicates that the computer's regional settings are used.</param>
+ /// <param name="IncludeLeadingDigit">Optional. Tristate enumeration that indicates whether or not a leading zero is displayed for fractional values. See Settings for values.</param>
+ /// <param name="UseParensForNegativeNumbers">Optional. Tristate enumeration that indicates whether or not to place negative values within parentheses. See Settings for values.</param>
+ /// <param name="GroupDigits">Optional. Tristate enumeration that indicates whether or not numbers are grouped using the group delimiter specified in the computer's regional settings. See Settings for values.</param>
+ [MonoTODO]
+ public static string FormatPercent(object Expression,
+ [Optional]
+ [DefaultValue(-1)]
+ int NumDigitsAfterDecimal,
+ [Optional]
+ [DefaultValue(TriState.UseDefault)]
+ TriState IncludeLeadingDigit,
+ [Optional]
+ [DefaultValue(TriState.UseDefault)]
+ TriState UseParensForNegativeNumbers,
+ [Optional]
+ [DefaultValue(TriState.UseDefault)]
+ TriState GroupDigits)
+ {
+ //FIXME
+ throw new NotImplementedException();
+ //throws InvalidCastException
+ }
+
+ /// <summary>
+ /// Returns a Char value representing the character from the specified index in the supplied string.
+ /// </summary>
+ /// <param name="Str">Required. Any valid String expression.</param>
+ /// <param name="Index">Required. Integer expression. The (1-based) index of the character in Str to be returned.</param>
+ [MonoTODO("Needs testing")]
+ public static char GetChar(string Str,
+ int Index)
+ {
+
+ if ((Str == null) || (Str.Length == 0))
+ throw new ArgumentException("Length of argument 'Str' must be greater than zero.", "Sre");
+ if (Index < 1)
+ throw new ArgumentException("Argument 'Index' must be greater than or equal to 1.", "Index");
+ if (Index > Str.Length)
+ throw new ArgumentException("Argument 'Index' must be less than or equal to the length of argument 'String'.", "Index");
+
+ return Str.ToCharArray(Index -1, 1)[0];
+ }
+
+ /// <summary>
+ /// Returns an integer specifying the start position of the first occurrence of one string within another.
+ /// </summary>
+ /// <param name="Start">Required. Numeric expression that sets the starting position for each search. If omitted, search begins at the first character position. The start index is 1 based.</param>
+ /// <param name="String1">Required. String expression being searched.</param>
+ /// <param name="String2">Required. String expression sought.</param>
+ /// <param name="Compare">Optional. Specifies the type of string comparison. If Compare is omitted, the Option Compare setting determines the type of comparison. Specify a valid LCID (LocaleID) to use locale-specific rules in the comparison. </param>
+ [MonoTODO("Needs testing")]
+ public static int InStr(string String1,
+ string String2,
+ [OptionCompare]
+ [Optional]
+ [DefaultValue(CompareMethod.Binary)]
+ CompareMethod Compare)
+ {
+ return InStr(1, String1, String2, Compare);
+ }
+
+ /// <summary>
+ /// Returns an integer specifying the start position of the first occurrence of one string within another.
+ /// </summary>
+ /// <param name="Start">Required. Numeric expression that sets the starting position for each search. If omitted, search begins at the first character position. The start index is 1 based.</param>
+ /// <param name="String1">Required. String expression being searched.</param>
+ /// <param name="String2">Required. String expression sought.</param>
+ /// <param name="Compare">Optional. Specifies the type of string comparison. If Compare is omitted, the Option Compare setting determines the type of comparison. Specify a valid LCID (LocaleID) to use locale-specific rules in the comparison. </param>
+ [MonoTODO("Needs testing")]
+ public static int InStr(int Start,
+ string String1,
+ string String2,
+ [OptionCompare]
+ [Optional]
+ [DefaultValue(CompareMethod.Binary)]
+ CompareMethod Compare)
+ {
+ if (Start < 1)
+ throw new ArgumentException("Argument 'Start' must be non-negative.", "Start");
+
+ /*
+ * FIXME: ms-help://MS.VSCC/MS.MSDNVS/vblr7/html/vafctinstr.htm
+ * If Compare is omitted, the Option Compare setting determines the type of comparison. Specify
+ * a valid LCID (LocaleID) to use locale-specific rules in the comparison.
+ * How do I do this?
+ */
+
+ /*
+ * If InStr returns
+ *
+ * String1 is zero length or Nothing 0
+ * String2 is zero length or Nothing start
+ * String2 is not found 0
+ * String2 is found within String1 Position where match begins
+ * Start > String2 0
+ */
+
+ //FIXME: someone with a non US setup should test this.
+ switch (Compare)
+ {
+ case CompareMethod.Text:
+ return System.Globalization.CultureInfo.CurrentCulture.CompareInfo.IndexOf(String2, String1, Start - 1) + 1;
+
+ case CompareMethod.Binary:
+ return String1.IndexOf(String2, Start - 1) + 1;
+ default:
+ throw new System.ArgumentException("Argument 'Compare' must be CompareMethod.Binary or CompareMethod.Text.", "Compare");
+ }
+
+
+ }
+
+ /// <summary>
+ /// Returns the position of the first occurrence of one string within another, starting from the right side of the string.
+ /// </summary>
+ /// <param name="StringCheck">Required. String expression being searched.</param>
+ /// <param name="StringMatch">Required. String expression being searched for.</param>
+ /// <param name="Start">Optional. Numeric expression that sets the one-based starting position for each search, starting from the left side of the string. If Start is omitted, –1 is used, which means that the search begins at the last character position. Search then proceeds from right to left.</param>
+ /// <param name="Compare">Optional. Numeric value indicating the kind of comparison to use when evaluating substrings. If omitted, a binary comparison is performed. See Settings for values.</param>
+ [MonoTODO]
+ public static int InStrRev(string StringCheck,
+ string StringMatch,
+ string String2,
+ [Optional]
+ [DefaultValue(-1)]
+ int Start,
+ [OptionCompare]
+ [Optional]
+ [DefaultValue(CompareMethod.Binary)]
+ CompareMethod Compare)
+ {
+ if ((Start == 0) || (Start < -1))
+ throw new ArgumentException("Argument 'Start' must be greater than 0 or equal to -1", "Start");
+
+ //FIXME: Use LastIndexOf()
+ throw new NotImplementedException();
+ }
+
+ /// <summary>
+ /// Returns a string created by joining a number of substrings contained in an array.
+ /// </summary>
+ /// <param name="SourceArray">Required. One-dimensional array containing substrings to be joined.</param>
+ /// <param name="Delimiter">Optional. String used to separate the substrings in the returned string. If omitted, the space character (" ") is used. If Delimiter is a zero-length string (""), all items in the list are concatenated with no delimiters.</param>
+ [MonoTODO("Needs testing")]
+ public static string Join(string[] SourceArray,
+ [Optional]
+ [DefaultValue(" ")]
+ string Delimiter)
+ {
+ if (SourceArray == null)
+ throw new ArgumentException("Argument 'SourceArray' can not be null.", "SourceArray");
+ if (SourceArray.Rank > 1)
+ throw new ArgumentException("Argument 'SourceArray' can have only one dimension.", "SourceArray");
+
+ return string.Join(Delimiter, SourceArray);
+ }
+ /// <summary>
+ /// Returns a string created by joining a number of substrings contained in an array.
+ /// </summary>
+ /// <param name="SourceArray">Required. One-dimensional array containing substrings to be joined.</param>
+ /// <param name="Delimiter">Optional. String used to separate the substrings in the returned string. If omitted, the space character (" ") is used. If Delimiter is a zero-length string (""), all items in the list are concatenated with no delimiters.</param>
+ [MonoTODO("Needs testing")]
+ public static string Join(object[] SourceArray,
+ [Optional]
+ [DefaultValue(" ")]
+ string Delimiter)
+ {
+
+ if (SourceArray == null)
+ throw new ArgumentException("Argument 'SourceArray' can not be null.", "SourceArray");
+ if (SourceArray.Rank > 1)
+ throw new ArgumentException("Argument 'SourceArray' can have only one dimension.", "SourceArray");
+
+ string[] dest;
+ dest = new string[SourceArray.Length];
+
+ SourceArray.CopyTo(dest, 0);
+ return string.Join(Delimiter, dest);
+ }
+
+ /// <summary>
+ /// Returns a string or character converted to lowercase.
+ /// </summary>
+ /// <param name="Value">Required. Any valid String or Char expression.</param>
+ [MonoTODO("Needs testing")]
+ public static char LCase(char Value)
+ {
+ return char.ToLower(Value);
+ }
+
+ /// <summary>
+ /// Returns a string or character converted to lowercase.
+ /// </summary>
+ /// <param name="Value">Required. Any valid String or Char expression.</param>
+ [MonoTODO("Needs testing")]
+ public static string LCase(string Value)
+ {
+ if ((Value == null) || (Value.Length == 0))
+ return String.Empty; // VB.net does this.
+
+ return Value.ToLower();
+ }
+
+
+ /// <summary>
+ /// Returns a string containing a specified number of characters from the left side of a string.
+ /// </summary>
+ /// <param name="Str">Required. String expression from which the leftmost characters are returned.</param>
+ /// <param name="Length">Required. Integer expression. Numeric expression indicating how many characters to return. If 0, a zero-length string ("") is returned. If greater than or equal to the number of characters in Str, the entire string is returned.</param>
+ [MonoTODO]
+ public static string Left(string Str,
+ int Length)
+ {
+ if (Length < 0)
+ throw new ArgumentException("Argument 'Length' must be non-negative.", "Length");
+ if ((Str == null) || (Str.Length == 0))
+ return String.Empty; // VB.net does this.
+
+ return Str.Substring(0, Length);
+ }
+
+ /// <summary>
+ /// Returns an integer containing either the number of characters in a string or the number of bytes required to store a variable.
+ /// </summary>
+ /// <param name="Expression">Any valid String expression or variable name. If Expression is of type Object, the Len function returns the size as it will be written to the file.</param>
+ [MonoTODO("Needs testing")]
+ public static int Len(bool Expression)
+ {
+ return 2; //sizeof(bool)
+ }
+
+ /// <summary>
+ /// Returns an integer containing either the number of characters in a string or the number of bytes required to store a variable.
+ /// </summary>
+ /// <param name="Expression">Any valid String expression or variable name. If Expression is of type Object, the Len function returns the size as it will be written to the file.</param>
+ [MonoTODO("Needs testing")]
+ public static int Len(byte Expression)
+ {
+ return 1; //sizeof(byte)
+ }
+
+ /// <summary>
+ /// Returns an integer containing either the number of characters in a string or the number of bytes required to store a variable.
+ /// </summary>
+ /// <param name="Expression">Any valid String expression or variable name. If Expression is of type Object, the Len function returns the size as it will be written to the file.</param>
+ [MonoTODO("Needs testing")]
+ public static int Len(char Expression)
+ {
+ return 2; //sizeof(char)
+ }
+
+ /// <summary>
+ /// Returns an integer containing either the number of characters in a string or the number of bytes required to store a variable.
+ /// </summary>
+ /// <param name="Expression">Any valid String expression or variable name. If Expression is of type Object, the Len function returns the size as it will be written to the file.</param>
+ [MonoTODO("Needs testing")]
+ public static int Len(double Expression)
+ {
+ return 8; //sizeof(double)
+ }
+
+ /// <summary>
+ /// Returns an integer containing either the number of characters in a string or the number of bytes required to store a variable.
+ /// </summary>
+ /// <param name="Expression">Any valid String expression or variable name. If Expression is of type Object, the Len function returns the size as it will be written to the file.</param>
+ [MonoTODO("Needs testing")]
+ public static int Len(int Expression)
+ {
+ return 4; //sizeof(int)
+ }
+
+ /// <summary>
+ /// Returns an integer containing either the number of characters in a string or the number of bytes required to store a variable.
+ /// </summary>
+ /// <param name="Expression">Any valid String expression or variable name. If Expression is of type Object, the Len function returns the size as it will be written to the file.</param>
+ [MonoTODO("Needs testing")]
+ public static int Len(long Expression)
+ {
+ return 8; //sizeof(long)
+ }
+
+ /// <summary>
+ /// Returns an integer containing either the number of characters in a string or the number of bytes required to store a variable.
+ /// </summary>
+ /// <param name="Expression">Any valid String expression or variable name. If Expression is of type Object, the Len function returns the size as it will be written to the file.</param>
+ [MonoTODO]
+ public static int Len(object Expression)
+ {
+ // FIXME:
+ // With user-defined types and Object variables, the Len function returns the size as it will
+ // be written to the file. If an Object contains a String, it will return the length of the string.
+ // If an Object contains any other type, it will return the size of the object as it will be written
+ // to the file.
+ throw new NotImplementedException();
+ }
+
+ /// <summary>
+ /// Returns an integer containing either the number of characters in a string or the number of bytes required to store a variable.
+ /// </summary>
+ /// <param name="Expression">Any valid String expression or variable name. If Expression is of type Object, the Len function returns the size as it will be written to the file.</param>
+ [MonoTODO("Needs testing")]
+ public static int Len(short Expression)
+ {
+ return 2; //sizeof(short)
+ }
+
+ /// <summary>
+ /// Returns an integer containing either the number of characters in a string or the number of bytes required to store a variable.
+ /// </summary>
+ /// <param name="Expression">Any valid String expression or variable name. If Expression is of type Object, the Len function returns the size as it will be written to the file.</param>
+ [MonoTODO("Needs testing")]
+ public static int Len(Single Expression)
+ {
+ return 4; //sizeof(Single)
+ }
+
+ /// <summary>
+ /// Returns an integer containing either the number of characters in a string or the number of bytes required to store a variable.
+ /// </summary>
+ /// <param name="Expression">Any valid String expression or variable name. If Expression is of type Object, the Len function returns the size as it will be written to the file.</param>
+ [MonoTODO("Needs testing")]
+ public static int Len(string Expression)
+ {
+ return Expression.Length; //length of the string
+ }
+
+ /// <summary>
+ /// Returns an integer containing either the number of characters in a string or the number of bytes required to store a variable.
+ /// </summary>
+ /// <param name="Expression">Any valid String expression or variable name. If Expression is of type Object, the Len function returns the size as it will be written to the file.</param>
+ [MonoTODO("Needs testing")]
+ public static int Len(DateTime Expression)
+ {
+ return 8; //sizeof(DateTime)
+ }
+
+ /// <summary>
+ /// Returns an integer containing either the number of characters in a string or the number of bytes required to store a variable.
+ /// </summary>
+ /// <param name="Expression">Any valid String expression or variable name. If Expression is of type Object, the Len function returns the size as it will be written to the file.</param>
+ [MonoTODO("Needs testing")]
+ public static int Len(decimal Expression)
+ {
+ return 16; //sizeof(decimal)
+ }
+
+ /// <summary>
+ /// Returns a left-aligned string containing the specified string adjusted to the specified length.
+ /// </summary>
+ /// <param name="Source">Required. String expression. Name of string variable.</param>
+ /// <param name="Length">Required. Integer expression. Length of returned string.</param>
+ [MonoTODO("Needs testing")]
+ public static string LSet(string Source,
+ int Length)
+ {
+ if (Length < 0)
+ throw new ArgumentOutOfRangeException("Length", "Length must be must be non-negative.");
+ if (Source == null)
+ Source = String.Empty;
+
+ return Source.PadRight(Length);
+ }
+
+ /// <summary>
+ /// Returns a string containing a copy of a specified string with no leading spaces.
+ /// </summary>
+ /// <param name="Str">Required. Any valid String expression.</param>
+ [MonoTODO("Needs testing")]
+ public static string LTrim(string Str)
+ {
+ if ((Str == null) || (Str.Length == 0))
+ return String.Empty; // VB.net does this.
+
+ return Str.TrimStart(null);
+ }
+
+ /// <summary>
+ /// Returns a string containing a copy of a specified string with no trailing spaces.
+ /// </summary>
+ /// <param name="Str">Required. Any valid String expression.</param>
+ [MonoTODO("Needs testing")]
+ public static string RTrim(string Str)
+ {
+ if ((Str == null) || (Str.Length == 0))
+ return String.Empty; // VB.net does this.
+
+ return Str.TrimEnd(null);
+ }
+
+ /// <summary>
+ /// Returns a string containing a copy of a specified string with no leading or trailing spaces.
+ /// </summary>
+ /// <param name="Str">Required. Any valid String expression.</param>
+ [MonoTODO("Needs testing")]
+ public static string Trim(string Str)
+ {
+ if ((Str == null) || (Str.Length == 0))
+ return String.Empty; // VB.net does this.
+
+ return Str.Trim();
+ }
+
+ /// <summary>
+ /// Returns a string containing a specified number of characters from a string.
+ /// </summary>
+ /// <param name="Str">Required. String expression from which characters are returned.</param>
+ /// <param name="Start">Required. Integer expression. Character position in Str at which the part to be taken starts. If Start is greater than the number of characters in Str, the Mid function returns a zero-length string (""). Start is one based.</param>
+ /// <param name="Length">Required Integer expression. Number of characters to return. If there are fewer than Length characters in the text (including the character at position Start), all characters from the start position to the end of the string are returned.</param>
+ [MonoTODO("Verify if this is the correct behaviour for Length==0...[Rafael]")]
+ public static string Mid(string Str,
+ int Start,
+ int Length)
+ {
+
+ if (Length < 0)
+ throw new System.ArgumentException("Argument 'Length' must be greater or equal to zero.", "Length");
+ if (Start <= 0)
+ throw new System.ArgumentException("Argument 'Start' must be greater than zero.", "Start");
+ if ((Str == null) || (Str.Length == 0))
+ return String.Empty; // VB.net does this.
+
+ if ((Length == 0) || (Start > Str.Length))
+ return String.Empty;
+
+ if (Length > (Str.Length - Start))
+ Length = (Str.Length - Start) + 1;
+
+ return Str.Substring(Start - 1, Length);
+
+ }
+
+ /// <summary>
+ /// Returns a string containing all characters from a string beyond an start point.
+ /// </summary>
+ /// <param name="Str">Required. String expression from which characters are returned.</param>
+ /// <param name="Start">Required. Integer expression. Character position in Str at which the part to be taken starts. If Start is greater than the number of characters in Str, the Mid function returns a zero-length string (""). Start is one based.</param>
+ [MonoTODO("Needs testing")]
+ public static string Mid (string Str, int Start)
+ {
+ if (Start <= 0)
+ throw new System.ArgumentException("Argument 'Start' must be greater than zero.", "Start");
+ if ((Str == null) || (Str.Length == 0))
+ return String.Empty; // VB.net does this.
+
+ if (Start > Str.Length)
+ return String.Empty;
+
+ return Str.Substring(Start - 1);
+ }
+
+ /// <summary>
+ /// Returns a string in which a specified substring has been replaced with another substring a specified number of times.
+ /// </summary>
+ /// <param name="Expression">Required. String expression containing substring to replace.</param>
+ /// <param name="Find">Required. Substring being searched for.</param>
+ /// <param name="Replacement">Required. Replacement substring.</param>
+ /// <param name="Start">Optional. Position within Expression where substring search is to begin. If omitted, 1 is assumed.</param>
+ /// <param name="Count">Optional. Number of substring substitutions to perform. If omitted, the default value is –1, which means make all possible substitutions.</param>
+ /// <param name="Compare">Optional. Numeric value indicating the kind of comparison to use when evaluating substrings. See Settings for values.</param>
+ [MonoTODO("Needs testing")]
+ public static string Replace(string Expression,
+ string Find,
+ string Replacement,
+ [Optional]
+ [DefaultValue(1)]
+ int Start,
+ [Optional]
+ [DefaultValue(-1)]
+ int Count,
+ [OptionCompare]
+ [Optional]
+ [DefaultValue(CompareMethod.Binary)]
+ CompareMethod Compare)
+ {
+
+ if (Count < -1)
+ throw new ArgumentException("Argument 'Count' must be greater than or equal to -1.", "Count");
+ if (Start <= 0)
+ throw new ArgumentException("Argument 'Start' must be greater than zero.", "Start");
+
+ if ((Expression == null) || (Expression.Length == 0))
+ return String.Empty; // VB.net does this.
+ if ((Find == null) || (Find.Length == 0))
+ return Expression; // VB.net does this.
+ if (Replacement == null)
+ Replacement = String.Empty; // VB.net does this.
+
+ return Expression.Replace(Find, Replacement);
+ }
+
+ /// <summary>
+ /// Returns a string containing a specified number of characters from the right side of a string.
+ /// </summary>
+ /// <param name="Str">Required. String expression from which the rightmost characters are returned.</param>
+ /// <param name="Length">Required. Integer. Numeric expression indicating how many characters to return. If 0, a zero-length string ("") is returned. If greater than or equal to the number of characters in Str, the entire string is returned.</param>
+ [MonoTODO("Needs testing")]
+ public static string Right(string Str,
+ int Length)
+ {
+ if (Length < 0)
+ throw new ArgumentException("Argument 'Length' must be greater or equal to zero.", "Length");
+
+ return Str.Substring (Str.Length - Length);
+ }
+
+ /// <summary>
+ /// Returns a right-aligned string containing the specified string adjusted to the specified length.
+ /// </summary>
+ /// <param name="Source">Required. String expression. Name of string variable.</param>
+ /// <param name="Length">Required. Integer expression. Length of returned string.</param>
+ [MonoTODO("Needs testing")]
+ public static string RSet(string Source,
+ int Length)
+ {
+
+ if (Source == null)
+ Source = String.Empty;
+ if (Length < 0)
+ throw new ArgumentOutOfRangeException("Length", "Length must be non-negative.");
+
+ return Source.PadLeft(Length);
+ }
+
+ /// <summary>
+ /// Returns a string consisting of the specified number of spaces.
+ /// </summary>
+ /// <param name="Number">Required. Integer expression. The number of spaces you want in the string.</param>
+ [MonoTODO("Needs testing")]
+ public static string Space(int Number)
+ {
+ if (Number < 0)
+ throw new ArgumentException("Argument 'Number' must be greater or equal to zero.", "Number");
+
+ return new string((char) ' ', Number);
+ }
+
+ /// <summary>
+ /// Returns a zero-based, one-dimensional array containing a specified number of substrings.
+ /// </summary>
+ /// <param name="Expression">Required. String expression containing substrings and delimiters. If Expression is a zero-length string (""), the Split function returns an array with no elements and no data.</param>
+ /// <param name="Delimiter">Optional. Single character used to identify substring limits. If Delimiter is omitted, the space character (" ") is assumed to be the delimiter. If Delimiter is a zero-length string, a single-element array containing the entire Expression string is returned.</param>
+ /// <param name="Limit">Optional. Number of substrings to be returned; the default, –1, indicates that all substrings are returned.</param>
+ /// <param name="Compare">Optional. Numeric value indicating the comparison to use when evaluating substrings. See Settings for values.</param>
+ [MonoTODO]
+ public static string[] Split(string Expression,
+ [Optional]
+ [DefaultValue(" ")]
+ string Delimiter,
+ [Optional]
+ [DefaultValue(-1)]
+ int Limit,
+ [OptionCompare]
+ [Optional]
+ [DefaultValue(CompareMethod.Binary)]
+ CompareMethod Compare)
+ {
+
+
+ if (Expression == null)
+ return new string[0];
+ if ((Delimiter == null) || (Delimiter.Length == 0))
+ {
+ string [] ret = new string[0];
+ ret[0] = Expression;
+ return ret;
+ }
+ if (Limit == 0)
+ Limit = 1; // VB.net does this. I call it a bug.
+
+ /*
+ * FIXME: VB.net does NOT do this. It simply fails with AritmethicException.
+ * What should I do?
+ */
+ if (Limit < -1)
+ throw new ArgumentOutOfRangeException("Limit", "Argument 'Limit' must be -1 or greater than zero.");
+
+ switch (Compare)
+ {
+ case CompareMethod.Binary:
+ return Expression.Split(Delimiter.ToCharArray(0, 1), Limit);
+ case CompareMethod.Text:
+ //FIXME
+ throw new NotImplementedException();
+ default:
+ throw new System.ArgumentException("Argument 'Compare' must be CompareMethod.Binary or CompareMethod.Text.", "Compare");
+ }
+
+
+ }
+
+ /// <summary>
+ /// Returns -1, 0, or 1, based on the result of a string comparison.
+ /// </summary>
+ /// <param name="String1">Required. Any valid String expression.</param>
+ /// <param name="String2">Required. Any valid String expression.</param>
+ /// <param name="Compare">Optional. Specifies the type of string comparison. If compare is omitted, the Option Compare setting determines the type of comparison.</param>
+ [MonoTODO("Needs testing")]
+ public static int StrComp(string String1,
+ string String2,
+ [OptionCompare]
+ [Optional]
+ [DefaultValue(CompareMethod.Binary)]
+ CompareMethod Compare)
+ {
+
+ switch (Compare)
+ {
+ case CompareMethod.Binary:
+ return string.Compare(String1, String2, true);
+ case CompareMethod.Text:
+ //FIXME: someone with a non US setup should test this.
+ return System.Globalization.CultureInfo.CurrentCulture.CompareInfo.Compare(String1, String2);
+ default:
+ throw new System.ArgumentException("Argument 'Compare' must be CompareMethod.Binary or CompareMethod.Text", "Compare");
+ }
+
+ }
+
+ /// <summary>
+ /// Returns a string converted as specified.
+ /// </summary>
+ /// <param name="Str">Required. String expression to be converted.</param>
+ /// <param name="Conversion">Required. VbStrConv member. The enumeration value specifying the type of conversion to perform. </param>
+ /// <param name="LocaleID">Optional. The LocaleID value, if different from the system LocaleID value. (The system LocaleID value is the default.)</param>
+ [MonoTODO("Not impemented")]
+ public static string StrConv (string str,
+ VbStrConv Conversion,
+ [Optional]
+ [DefaultValue(0)]
+ int LocaleID)
+ {
+ //FIXME
+ throw new NotImplementedException();
+ //throws ArgumentException
+ }
+
+ /// <summary>
+ /// Returns a string or object consisting of the specified character repeated the specified number of times.
+ /// </summary>
+ /// <param name="Number">Required. Integer expression. The length to the string to be returned.</param>
+ /// <param name="Character">Required. Any valid Char, String, or Object expression. Only the first character of the expression will be used. If Character is of type Object, it must contain either a Char or a String value.</param>
+ [MonoTODO("Needs testing")]
+ public static string StrDup(int Number,
+ char Character)
+ {
+ if (Number < 0)
+ throw new ArgumentException("Argument 'Number' must be non-negative.", "Number");
+
+ return new string(Character, Number);
+ }
+ /// <summary>
+ /// Returns a string or object consisting of the specified character repeated the specified number of times.
+ /// </summary>
+ /// <param name="Number">Required. Integer expression. The length to the string to be returned.</param>
+ /// <param name="Character">Required. Any valid Char, String, or Object expression. Only the first character of the expression will be used. If Character is of type Object, it must contain either a Char or a String value.</param>
+ [MonoTODO("Needs testing")]
+ public static string StrDup(int Number,
+ string Character)
+ {
+ if (Number < 0)
+ throw new ArgumentException("Argument 'Number' must be greater or equal to zero.", "Number");
+ if ((Character == null) || (Character.Length == 0))
+ throw new ArgumentNullException("Character", "Length of argument 'Character' must be greater than zero.");
+
+ return new string(Character.ToCharArray()[0], Number);
+ }
+
+ /// <summary>
+ /// Returns a string or object consisting of the specified character repeated the specified number of times.
+ /// </summary>
+ /// <param name="Number">Required. Integer expression. The length to the string to be returned.</param>
+ /// <param name="Character">Required. Any valid Char, String, or Object expression. Only the first character of the expression will be used. If Character is of type Object, it must contain either a Char or a String value.</param>
+ [MonoTODO("Needs testing")]
+ public static object StrDup(int Number,
+ object Character)
+ {
+ if (Number < 0)
+ throw new ArgumentException("Argument 'Number' must be non-negative.", "Number");
+
+ if (Character is string)
+ {
+ string sCharacter = (string) Character;
+ if ((sCharacter == null) || (sCharacter.Length == 0))
+ throw new ArgumentNullException("Character", "Length of argument 'Character' must be greater than zero.");
+
+ return StrDup(Number, sCharacter);
+ }
+ else
+ {
+ if (Character is char)
+ {
+ return StrDup(Number, (char) Character);
+ }
+ else
+ {
+ // "If Character is of type Object, it must contain either a Char or a String value."
+ throw new ArgumentException("Argument 'Character' is not a valid value.", "Character");
+ }
+ }
+ }
+
+ /// <summary>
+ /// Returns a string in which the character order of a specified string is reversed.
+ /// </summary>
+ /// <param name="Expression">Required. String expression whose characters are to be reversed. If Expression is a zero-length string (""), a zero-length string is returned.</param>
+ public static string StrReverse(string Expression)
+ {
+ // patched by Daniel Campos
+ // danielcampos@myway.com
+ if (Expression != null)
+ {
+ if ( Expression.Length>0)
+ {
+ int counter=0;
+ char[] buf=new char[Expression.Length];
+
+ for (int backwardsCounter=Expression.Length - 1;
+ backwardsCounter>=0;
+ backwardsCounter--)
+ buf[counter++]=Expression[backwardsCounter];
+ return new string(buf);
+ }
+ else
+ return String.Empty;
+ }
+ else
+ return String.Empty;
+ }
+
+ /// <summary>
+ /// Returns a string or character containing the specified string converted to uppercase.
+ /// </summary>
+ /// <param name="Value">Required. Any valid String or Char expression.</param>
+ public static char UCase(char Value)
+ {
+ return char.ToUpper(Value);
+ }
+
+ /// <summary>
+ /// Returns a string or character containing the specified string converted to uppercase.
+ /// </summary>
+ /// <param name="Value">Required. Any valid String or Char expression.</param>
+ public static string UCase(string Value)
+ {
+ if ((Value == null) || (Value.Length == 0))
+ return String.Empty; // VB.net does this.
+
+ return Value.ToUpper();
+ }
+
+
+
+ }
+
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/TODOAttribute.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/TODOAttribute.cs
new file mode 100644
index 00000000000..a38969af212
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/TODOAttribute.cs
@@ -0,0 +1,39 @@
+//
+// TODOAttribute.cs
+//
+// Author:
+// Ravi Pratap (ravi@ximian.com)
+//
+// (C) Ximian, Inc. http://www.ximian.com
+//
+
+using System;
+
+namespace Microsoft.VisualBasic {
+
+ /// <summary>
+ /// The TODO attribute is used to flag all incomplete bits in our class libraries
+ /// </summary>
+ ///
+ /// <remarks>
+ /// Use this to decorate any element which you think is not complete
+ /// </remarks>
+ [AttributeUsage (AttributeTargets.All, AllowMultiple=true)]
+ public class MonoTODOAttribute : Attribute {
+
+ private string comment;
+
+ public MonoTODOAttribute ()
+ {}
+
+ public MonoTODOAttribute (string comment)
+ {
+ this.comment = comment;
+ }
+
+ public string Comment
+ {
+ get { return comment; }
+ }
+ }
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/TabInfo.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/TabInfo.cs
new file mode 100644
index 00000000000..d14dd2f0b03
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/TabInfo.cs
@@ -0,0 +1,23 @@
+//
+// TabInfo.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+using System.Runtime.InteropServices;
+using System.ComponentModel;
+
+namespace Microsoft.VisualBasic {
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [MonoTODO]
+ public struct TabInfo {
+ // Declarations
+ public System.Int16 Column;
+ // Constructors
+ // Properties
+ // Methods
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/TriState.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/TriState.cs
new file mode 100644
index 00000000000..9773ea3552e
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/TriState.cs
@@ -0,0 +1,19 @@
+//
+// TriState.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+namespace Microsoft.VisualBasic {
+ /// <summary>
+ /// When you call number-formatting functions, you can use the following enumeration
+ /// members in your code in place of the actual values.
+ /// </summary>
+ public enum TriState : int {
+ False = 0,
+ UseDefault = -2,
+ True = -1
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBFixedArrayAttribute.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBFixedArrayAttribute.cs
new file mode 100644
index 00000000000..dbc879b4e2e
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBFixedArrayAttribute.cs
@@ -0,0 +1,30 @@
+//
+// VBFixedArrayAttribute.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+
+using System;
+
+namespace Microsoft.VisualBasic
+{
+ [System.AttributeUsageAttribute(System.AttributeTargets.Field)]
+ sealed public class VBFixedArrayAttribute : System.Attribute {
+ // Declarations
+ // Constructors
+ [MonoTODO]
+ VBFixedArrayAttribute(System.Int32 UpperBound1) { throw new NotImplementedException (); }
+ [MonoTODO]
+ VBFixedArrayAttribute(System.Int32 UpperBound1, System.Int32 UpperBound2) { throw new NotImplementedException (); }
+ // Properties
+ [MonoTODO]
+ public System.Int32 Length { get { throw new NotImplementedException (); } }
+ [MonoTODO]
+ public System.Int32[] Bounds { get { throw new NotImplementedException (); } }
+ // Methods
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBFixedStringAttribute.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBFixedStringAttribute.cs
new file mode 100644
index 00000000000..c4de1009ebd
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBFixedStringAttribute.cs
@@ -0,0 +1,26 @@
+//
+// VBFixedStringAttribute.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+
+using System;
+
+namespace Microsoft.VisualBasic
+{
+ [System.AttributeUsageAttribute(System.AttributeTargets.Field)]
+ sealed public class VBFixedStringAttribute : System.Attribute {
+ // Declarations
+ // Constructors
+ [MonoTODO]
+ VBFixedStringAttribute(System.Int32 Length) { throw new NotImplementedException (); }
+ // Properties
+ [MonoTODO]
+ public System.Int32 Length { get { throw new NotImplementedException (); } }
+ // Methods
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBMath.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBMath.cs
new file mode 100644
index 00000000000..f7ab89abb93
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBMath.cs
@@ -0,0 +1,53 @@
+//
+// VBMath.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+// Francesco Delfino (pluto@tipic.com)
+//
+// (C) 2002 Chris J Breisch
+// (C) 2002 Tipic Inc
+//
+
+using System;
+
+namespace Microsoft.VisualBasic {
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ sealed public class VBMath {
+ // Declarations
+ // Constructors
+ // Properties
+ static Random rnd = new Random();
+ static float last = (float)rnd.NextDouble();
+ // Methods
+ public static float Rnd () {
+ last = (float)rnd.NextDouble();
+ return last;
+ }
+ public static float Rnd (float Number)
+ {
+ if (Number == 0.0)
+ {
+ return last;
+ }
+ else if (Number < 0.0 )
+ {
+ //fd: What does this mean?
+ //fd: ms-help://MS.VSCC/MS.MSDNVS/script56/html/vsstmRandomize
+ //fd: ms-help://MS.VSCC/MS.MSDNVS/script56/html/vsfctrnd.htm
+ Randomize(Number);
+ return Rnd();
+ }
+ return Rnd();
+ }
+ public static void Randomize () {
+ rnd = new Random();
+ }
+ [MonoTODO("Rethink the double => int conversion")]
+ public static void Randomize (double Number)
+ {
+ rnd = new Random((int)Number);
+ }
+ // Events
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VariantType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VariantType.cs
new file mode 100644
index 00000000000..7eab4e4c86a
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VariantType.cs
@@ -0,0 +1,32 @@
+//
+// VariantType.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
+namespace Microsoft.VisualBasic {
+ public enum VariantType : int {
+ Empty = 0,
+ Null = 1,
+ Short = 2,
+ Integer = 3,
+ Single = 4,
+ Double = 5,
+ Currency = 6,
+ Date = 7,
+ String = 8,
+ Object = 9,
+ Error = 10,
+ Boolean = 11,
+ Variant = 12,
+ DataObject = 13,
+ Decimal = 14,
+ Byte = 17,
+ Char = 18,
+ Long = 20,
+ UserDefinedType = 36,
+ Array = 8192
+ };
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VbStrConv.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VbStrConv.cs
new file mode 100644
index 00000000000..a61d2db79da
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VbStrConv.cs
@@ -0,0 +1,73 @@
+//
+// VbStrConv.cs
+//
+// Authors:
+// Martin Adoue (martin@cwanet.com)
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Ximian Inc.
+//
+
+using System;
+
+namespace Microsoft.VisualBasic
+{
+ /// <summary>
+ /// When you call the StrConv function, you can use the following enumeration
+ /// members in your code in place of the actual values.
+ /// </summary>
+ [System.FlagsAttribute]
+ public enum VbStrConv : int {
+ /// <summary>
+ /// Performs no conversion
+ /// </summary>
+ None = 0,
+ /// <summary>
+ /// Uses linguistic rules for casing, rather than File System (default). Valid with UpperCase and LowerCase only.
+ /// </summary>
+ LinguisticCasing = 1024,
+ /// <summary>
+ /// Converts the string to uppercase characters.
+ /// </summary>
+ UpperCase = 1,
+ /// <summary>
+ /// Converts the string to lowercase characters.
+ /// </summary>
+ LowerCase = 2,
+ /// <summary>
+ /// Converts the first letter of every word in string to uppercase.
+ /// </summary>
+ ProperCase = 3,
+ /// <summary>
+ /// Converts narrow (half-width) characters in the string to wide (full-width) characters. (Applies to Asian locales.)
+ /// </summary>
+ Wide = 4, //*
+ /// <summary>
+ /// Converts wide (full-width) characters in the string to narrow (half-width) characters. (Applies to Asian locales.)
+ /// </summary>
+ Narrow = 8, //*
+ /// <summary>
+ /// Converts Hiragana characters in the string to Katakana characters. (Applies to Japan only.)
+ /// </summary>
+ Katakana = 16, //**
+ /// <summary>
+ /// Converts Katakana characters in the string to Hiragana characters. (Applies to Japan only.)
+ /// </summary>
+ Hiragana = 32, //**
+ /// <summary>
+ /// Converts Traditional Chinese characters to Simplified Chinese. (Applies to Asian locales.)
+ /// </summary>
+ SimplifiedChinese =256, //*
+ /// <summary>
+ /// Converts Simplified Chinese characters to Traditional Chinese. (Applies to Asian locales.)
+ /// </summary>
+ TraditionalChinese = 512 //*
+ /*
+
+ * Applies to Asian locales.
+ ** Applies to Japan only.
+
+ */
+ }
+
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Test/.cvsignore b/mcs/class/Microsoft.VisualBasic/Test/.cvsignore
new file mode 100644
index 00000000000..6a7461313bb
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Test/.cvsignore
@@ -0,0 +1 @@
+*.dll
diff --git a/mcs/class/Microsoft.VisualBasic/Test/AllTests.cs b/mcs/class/Microsoft.VisualBasic/Test/AllTests.cs
new file mode 100644
index 00000000000..ba8e35d1604
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Test/AllTests.cs
@@ -0,0 +1,33 @@
+// MonoTests.AllTests, Microsoft.VisualBasic.dll
+//
+// Author:
+// Mario Martinez (mariom925@home.com)
+//
+// (C) Ximian, Inc. http://www.ximian.com
+//
+
+using NUnit.Framework;
+
+namespace MonoTests
+{
+ /// <summary>
+ /// Combines all unit tests for the Microsoft.VisualBasic.dll assembly
+ /// into one test suite.
+ /// </summary>
+ public class AllTests : TestCase
+ {
+ public AllTests(string name) : base(name) {}
+ public AllTests() : base("Microsoft.VisualBasic.AllTests") {}
+
+ public static ITest Suite {
+ get {
+ TestSuite suite = new TestSuite();
+ suite.AddTest (Microsoft.VisualBasic.CollectionTest.Suite);
+ suite.AddTest (Microsoft.VisualBasic.ConversionTest.Suite);
+ suite.AddTest (Microsoft.VisualBasic.DateAndTimeTest.Suite);
+
+ return suite;
+ }
+ }
+ }
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Test/ChangeLog b/mcs/class/Microsoft.VisualBasic/Test/ChangeLog
new file mode 100644
index 00000000000..b558398f96d
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Test/ChangeLog
@@ -0,0 +1,8 @@
+2002/10/28 Nick Drochak <ndrochak@gol.com>
+
+ * DateAndTimeTest.cs: Make tests pass on Windows with .NET
+
+2002-10-23 Nick Drochak <ndrochak@gol.com>
+
+ * DateAndTimeTest.cs: Try to set the culture for these tests and see
+ if that helps. All but one works on my machine.
diff --git a/mcs/class/Microsoft.VisualBasic/Test/CollectionTest.cs b/mcs/class/Microsoft.VisualBasic/Test/CollectionTest.cs
new file mode 100644
index 00000000000..457bc821b75
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Test/CollectionTest.cs
@@ -0,0 +1,535 @@
+// Collection.cs - NUnit Test Cases for Microsoft.VisualBasic.Collection
+//
+// Author:
+// Chris J. Breisch (cjbreisch@altavista.net)
+//
+// (C) Chris J. Breisch
+//
+
+using NUnit.Framework;
+using System;
+using Microsoft.VisualBasic;
+using System.Collections;
+
+namespace MonoTests.Microsoft.VisualBasic
+{
+
+ public class CollectionTest : TestCase
+ {
+
+ public CollectionTest() : base ("Microsoft.VisualBasic.Collection") {}
+ public CollectionTest(string name) : base(name) {}
+
+ protected override void SetUp() {}
+ protected override void TearDown() {}
+
+ public static ITest Suite {
+ get {
+ return new TestSuite(typeof(CollectionTest));
+ }
+ }
+
+ // Test Constructor
+ public void TestNew ()
+ {
+ Collection c;
+
+ c = new Collection();
+
+ AssertNotNull("#N01", c);
+ AssertEquals("#N02", 0, c.Count);
+ }
+
+ // Test Add method with Key == null
+ public void TestAddNoKey ()
+ {
+ Collection c;
+
+ c = new Collection();
+
+ c.Add(typeof(int), null, null, null);
+ c.Add(typeof(double), null, null, null);
+ c.Add(typeof(string), null, null, null);
+
+ AssertEquals("#ANK01", 3, c.Count);
+
+ // Collection class is 1-based
+ AssertEquals("#ANK02", typeof(string), c[3]);
+
+ }
+
+ // Test Add method with Key specified
+ public void TestAddKey ()
+ {
+ Collection c;
+
+ c = new Collection();
+
+ c.Add("Baseball", "Base", null, null);
+ c.Add("Football", "Foot", null, null);
+ c.Add("Basketball", "Basket", null, null);
+ c.Add("Volleyball", "Volley", null, null);
+
+ AssertEquals("#AK01", 4, c.Count);
+
+ // Collection class is 1-based
+ AssertEquals("#AK02", "Baseball", c[1]);
+ AssertEquals("#AK03", "Volleyball", c["Volley"]);
+
+ }
+
+ // Test Add method with Before specified and Key == null
+ public void TestAddBeforeNoKey ()
+ {
+ Collection c;
+
+ c = new Collection();
+
+ c.Add(typeof(int), null, null, null);
+ c.Add(typeof(double), null, 1, null);
+ c.Add(typeof(string), null, 2, null);
+ c.Add(typeof(object), null, 2, null);
+
+ AssertEquals("#ABNK01", 4, c.Count);
+
+ // Collection class is 1-based
+ AssertEquals("#ABNK02", typeof(int), c[4]);
+ AssertEquals("#ABNK03", typeof(double), c[1]);
+ AssertEquals("#ABNK04", typeof(object), c[2]);
+
+ }
+
+ // Test Add method with Before and Key
+ public void TestAddBeforeKey ()
+ {
+ Collection c;
+
+ c = new Collection();
+
+ c.Add("Baseball", "Base", null, null);
+ c.Add("Football", "Foot", 1, null);
+ c.Add("Basketball", "Basket", 1, null);
+ c.Add("Volleyball", "Volley", 3, null);
+
+ AssertEquals("#ABK01", 4, c.Count);
+ AssertEquals("#ABK02", "Basketball", c[1]);
+ AssertEquals("#ABK03", "Baseball", c[4]);
+ AssertEquals("#ABK04", "Volleyball", c["Volley"]);
+ AssertEquals("#ABK05", "Football", c["Foot"]);
+
+ }
+
+ // Test Add method with After specified and Key == null
+ public void TestAddAfterNoKey ()
+ {
+ Collection c;
+
+ c = new Collection();
+
+ c.Add(typeof(int), null, null, 0);
+ c.Add(typeof(double), null, null, 1);
+ c.Add(typeof(string), null, null, 1);
+ c.Add(typeof(object), null, null, 3);
+
+ AssertEquals("#AANK01", 4, c.Count);
+
+ // Collection class is 1-based
+ AssertEquals("#AANK02", typeof(object), c[4]);
+ AssertEquals("#AANK03", typeof(int), c[1]);
+ AssertEquals("#AANK04", typeof(string), c[2]);
+
+ }
+
+ // Test Add method with After and Key
+ public void TestAddAfterKey ()
+ {
+ Collection c;
+
+ c = new Collection();
+
+ c.Add("Baseball", "Base", null, 0);
+ c.Add("Football", "Foot", null, 1);
+ c.Add("Basketball", "Basket", null, 1);
+ c.Add("Volleyball", "Volley", null, 2);
+
+ AssertEquals("#AAK01", 4, c.Count);
+
+ // Collection class is 1-based
+ AssertEquals("#AAK02", "Baseball", c[1]);
+ AssertEquals("#AAK03", "Football", c[4]);
+ AssertEquals("#AAK04", "Basketball", c["Basket"]);
+ AssertEquals("#AAK05", "Volleyball", c["Volley"]);
+ }
+
+ // Test GetEnumerator method
+ public void TestGetEnumerator ()
+ {
+ Collection c;
+ IEnumerator e;
+ object[] o = new object[4] {typeof(int),
+ typeof(double), typeof(string), typeof(object)};
+ int i = 0;
+
+ c = new Collection();
+
+ c.Add(typeof(int), null, null, null);
+ c.Add(typeof(double), null, null, null);
+ c.Add(typeof(string), null, null, null);
+ c.Add(typeof(object), null, null, null);
+
+ e = c.GetEnumerator();
+
+ AssertNotNull("#GE01", e);
+
+ while (e.MoveNext()) {
+ AssertEquals("#GE02." + i.ToString(), o[i], e.Current);
+ i++;
+ }
+
+ e.Reset();
+ e.MoveNext();
+
+ AssertEquals("#GE03", o[0], e.Current);
+
+ }
+
+ // Test GetEnumerator method again, this time using foreach
+ public void Testforeach ()
+ {
+ Collection c;
+ object[] o = new object[4] {typeof(int),
+ typeof(double), typeof(string), typeof(object)};
+ int i = 0;
+
+ c = new Collection();
+
+ c.Add(typeof(int), null, null, null);
+ c.Add(typeof(double), null, null, null);
+ c.Add(typeof(string), null, null, null);
+ c.Add(typeof(object), null, null, null);
+
+
+ foreach (object item in c) {
+ AssertEquals("#fe01." + i.ToString(), o[i], item);
+ i++;
+ }
+
+ }
+
+ // Test Remove method with Index
+ public void TestRemoveNoKey ()
+ {
+ Collection c;
+
+ c = new Collection();
+
+ c.Add(typeof(int), null, null, null);
+ c.Add(typeof(double), null, null, null);
+ c.Add(typeof(string), null, null, null);
+ c.Add(typeof(object), null, null, null);
+
+ AssertEquals("#RNK01", 4, c.Count);
+
+ c.Remove(3);
+
+ AssertEquals("#RNK02", 3, c.Count);
+
+ // Collection class is 1-based
+ AssertEquals("#RNK03", typeof(object), c[3]);
+
+ c.Remove(1);
+
+ AssertEquals("#RNK04", 2, c.Count);
+ AssertEquals("#RNK05", typeof(double), c[1]);
+ AssertEquals("#RNK06", typeof(object), c[2]);
+
+ c.Remove(2);
+
+ AssertEquals("#RNK07", 1, c.Count);
+ AssertEquals("#RNK08", typeof(double), c[1]);
+
+ c.Remove(1);
+
+ AssertEquals("#RNK09", 0, c.Count);
+
+ }
+
+ // Test Remove method with Key
+ public void TestRemoveKey ()
+ {
+ Collection c;
+
+ c = new Collection();
+
+ c.Add("Baseball", "Base", null, null);
+ c.Add("Football", "Foot", null, null);
+ c.Add("Basketball", "Basket", null, null);
+ c.Add("Volleyball", "Volley", null, null);
+
+ AssertEquals("#RK01", 4, c.Count);
+
+ c.Remove("Foot");
+
+ AssertEquals("#RK02", 3, c.Count);
+ AssertEquals("#RK03", "Basketball", c["Basket"]);
+
+ // Collection class is 1-based
+ AssertEquals("#RK04", "Volleyball", c[3]);
+
+ c.Remove("Base");
+
+ AssertEquals("#RK05", 2, c.Count);
+ AssertEquals("#RK06", "Basketball", c[1]);
+ AssertEquals("#RK07", "Volleyball", c["Volley"]);
+
+ c.Remove(2);
+
+ AssertEquals("#RK08", 1, c.Count);
+ AssertEquals("#RK09", "Basketball", c[1]);
+ AssertEquals("#RK10", "Basketball", c["Basket"]);
+
+ c.Remove(1);
+
+ AssertEquals("#RK11", 0, c.Count);
+ }
+
+ // Test all the Exceptions we're supposed to throw
+ public void TestException ()
+ {
+ Collection c;
+ bool caughtException = false;
+
+ c = new Collection();
+
+ try {
+ // nothing in Collection yet
+ object o = c[0];
+ }
+ catch (Exception e) {
+ AssertEquals("#E01", typeof(IndexOutOfRangeException), e.GetType());
+ caughtException = true;
+ }
+
+ AssertEquals("#E02", true, caughtException);
+
+ c.Add("Baseball", "Base", null, null);
+ c.Add("Football", "Foot", null, null);
+ c.Add("Basketball", "Basket", null, null);
+ c.Add("Volleyball", "Volley", null, null);
+
+ caughtException = false;
+
+ try {
+ // only 4 elements
+ object o = c[5];
+ }
+ catch (Exception e) {
+ AssertEquals("#E03", typeof(IndexOutOfRangeException), e.GetType());
+ caughtException = true;
+ }
+
+ AssertEquals("#E04", true, caughtException);
+
+ caughtException = false;
+
+ try {
+ // Collection class is 1-based
+ object o = c[0];
+ }
+ catch (Exception e) {
+ AssertEquals("#E05", typeof(IndexOutOfRangeException), e.GetType());
+ caughtException = true;
+ }
+
+ AssertEquals("#E06", true, caughtException);
+
+ caughtException = false;
+
+ try {
+ // no member with Key == "Kick"
+ object o = c["Kick"];
+ }
+ catch (Exception e) {
+ // FIXME
+ // VB Language Reference says IndexOutOfRangeException
+ // here, but MS throws ArgumentException
+ // AssertEquals("#E07", typeof(IndexOutOfRangeException), e.GetType());
+ AssertEquals("#E07", typeof(ArgumentException), e.GetType());
+ caughtException = true;
+ }
+
+ AssertEquals("#E08", true, caughtException);
+
+ caughtException = false;
+
+ try {
+ // Even though Indexer is an object, really it's a string
+ object o = c[typeof(int)];
+ }
+ catch (Exception e) {
+ AssertEquals("#E09", typeof(ArgumentException), e.GetType());
+ caughtException = true;
+ }
+
+ AssertEquals("#E10", true, caughtException);
+
+ caughtException = false;
+
+ try {
+ // can't specify both Before and After
+ c.Add("Kickball", "Kick", "Volley", "Foot");
+ }
+ catch (Exception e) {
+ AssertEquals("#E11", typeof(ArgumentException), e.GetType());
+ caughtException = true;
+ }
+
+ AssertEquals("#E12", true, caughtException);
+
+ caughtException = false;
+
+ try {
+ // Key "Foot" already exists
+ c.Add("Kickball", "Foot", null, null);
+ }
+ catch (Exception e) {
+ AssertEquals("#E13", typeof(ArgumentException), e.GetType());
+ caughtException = true;
+ }
+
+ AssertEquals("#E14", true, caughtException);
+
+ caughtException = false;
+
+ try {
+ // Even though Before is object, it's really a string
+ c.Add("Dodgeball", "Dodge", typeof(int), null);
+ }
+ catch (Exception e) {
+ AssertEquals("#E15", typeof(InvalidCastException), e.GetType());
+ caughtException = true;
+ }
+
+ AssertEquals("#E16", true, caughtException);
+
+ caughtException = false;
+
+ try {
+ // Even though After is object, it's really a string
+ c.Add("Wallyball", "Wally", null, typeof(int));
+ }
+ catch (Exception e) {
+ AssertEquals("#E17", typeof(InvalidCastException), e.GetType());
+ caughtException = true;
+ }
+
+ AssertEquals("#E18", true, caughtException);
+
+ caughtException = false;
+
+ try {
+ // have to pass a legitimate value to remove
+ c.Remove(null);
+ }
+ catch (Exception e) {
+ AssertEquals("#E19", typeof(ArgumentException), e.GetType());
+ caughtException = true;
+ }
+
+ AssertEquals("#E20", true, caughtException);
+
+ caughtException = false;
+
+ try {
+ // no Key "Golf" exists
+ c.Remove("Golf");
+ }
+ catch (Exception e) {
+ AssertEquals("#E21", typeof(ArgumentException), e.GetType());
+ caughtException = true;
+ }
+
+ AssertEquals("#E22", true, caughtException);
+
+ caughtException = false;
+
+ try {
+ // no Index 10 exists
+ c.Remove(10);
+ }
+ catch (Exception e) {
+ AssertEquals("#E23", typeof(IndexOutOfRangeException), e.GetType());
+ caughtException = true;
+ }
+
+ AssertEquals("#E24", true, caughtException);
+
+ caughtException = false;
+
+ try {
+ IEnumerator e = c.GetEnumerator();
+
+ // Must MoveNext before Current
+ object item = e.Current;
+ }
+ catch (Exception e) {
+ // FIXME
+ // On-line help says InvalidOperationException here,
+ // but MS throws IndexOutOfRangeException
+ // AssertEquals("#E25", typeof(InvalidOperationException), e.GetType());
+ AssertEquals("#E25", typeof(IndexOutOfRangeException), e.GetType());
+ caughtException = true;
+ }
+
+ AssertEquals("#E26", true, caughtException);
+
+ caughtException = false;
+
+ try {
+ IEnumerator e = c.GetEnumerator();
+ e.MoveNext();
+
+ c.Add("Paintball", "Paint", null, null);
+
+ // Can't MoveNext if Collection has been modified
+ e.MoveNext();
+ }
+ catch (Exception e) {
+ // FIXME
+ // On-line help says this should throw an error. MS doesn't.
+ AssertEquals("#E27", typeof(InvalidOperationException), e.GetType());
+ caughtException = true;
+ }
+
+ // FIXME
+ // What to do about this? MS doesn't throw an error
+ // AssertEquals("#E28", true, caughtException);
+ AssertEquals("#E28", false, caughtException);
+
+ caughtException = false;
+
+ try {
+ IEnumerator e = c.GetEnumerator();
+ e.MoveNext();
+
+ c.Add("Racketball", "Racket", null, null);
+
+ // Can't Reset if Collection has been modified
+ e.Reset();
+ }
+ catch (Exception e) {
+ // FIXME
+ // On-line help says this should throw an error. MS doesn't.
+ AssertEquals("#E29", typeof(InvalidOperationException), e.GetType());
+ caughtException = true;
+ }
+
+ // FIXME
+ // What to do about this? MS doesn't throw an error
+ // AssertEquals("#E30", true, caughtException);
+ AssertEquals("#E30", false, caughtException);
+
+ caughtException = false;
+ }
+ }
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Test/ConversionTest.cs b/mcs/class/Microsoft.VisualBasic/Test/ConversionTest.cs
new file mode 100644
index 00000000000..991e6e82f61
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Test/ConversionTest.cs
@@ -0,0 +1,674 @@
+// Collection.cs - NUnit Test Cases for Microsoft.VisualBasic.Collection
+//
+// Author:
+// Chris J. Breisch (cjbreisch@altavista.net)
+//
+// (C) Chris J. Breisch
+//
+
+using NUnit.Framework;
+using System;
+using Microsoft.VisualBasic;
+
+namespace MonoTests.Microsoft.VisualBasic
+{
+
+ public class ConversionTest : TestCase
+ {
+
+ public ConversionTest() : base ("Microsoft.VisualBasic.Conversion") {}
+ public ConversionTest(string name) : base(name) {}
+
+ protected override void SetUp() {}
+ protected override void TearDown() {}
+
+ public static ITest Suite {
+ get {
+ return new TestSuite(typeof(ConversionTest));
+ }
+ }
+
+ public void TestErrorToStringEmpty() {
+ // FIXME : Do something here, but write the ErrorToString code first :-)
+ }
+
+ public void TestErrorToStringNumber() {
+ // FIXME : Do something here, but write the ErrorToString code first :-)
+ }
+
+ // Test the Fix function
+ public void TestFix() {
+ System.Single Sng;
+ System.Double Dbl;
+ System.Decimal Dec;
+ System.String S;
+ System.Object O;
+
+ AssertEquals("#F01", System.Int16.MaxValue, Conversion.Fix(System.Int16.MaxValue));
+ AssertEquals("#F02", System.Int16.MinValue, Conversion.Fix(System.Int16.MinValue));
+ AssertEquals("#F03", System.Int32.MaxValue, Conversion.Fix(System.Int32.MaxValue));
+ AssertEquals("#F04", System.Int32.MinValue, Conversion.Fix(System.Int32.MinValue));
+ AssertEquals("#F05", System.Int64.MaxValue, Conversion.Fix(System.Int64.MaxValue));
+ AssertEquals("#F06", System.Int64.MinValue, Conversion.Fix(System.Int64.MinValue));
+ AssertEquals("#F07", (System.Single)Math.Floor(System.Single.MaxValue), Conversion.Fix(System.Single.MaxValue));
+ AssertEquals("#F08", -1 * (System.Single)Math.Floor(-1 * System.Single.MinValue), Conversion.Fix(System.Single.MinValue));
+ AssertEquals("#F09", Math.Floor(System.Double.MaxValue), Conversion.Fix(System.Double.MaxValue));
+ AssertEquals("#F10", -1 * Math.Floor(-1 * System.Double.MinValue), Conversion.Fix(System.Double.MinValue));
+ AssertEquals("#F11", Decimal.Floor(System.Decimal.MaxValue), Conversion.Fix(System.Decimal.MaxValue));
+ AssertEquals("#F12", -1 * Decimal.Floor(-1 * System.Decimal.MinValue), Conversion.Fix(System.Decimal.MinValue));
+
+ Sng = 99.1F;
+
+ AssertEquals("#F13", 99F, Conversion.Fix(Sng));
+
+ Sng = 99.6F;
+
+ AssertEquals("#F14", 99F, Conversion.Fix(Sng));
+
+ Sng = -99.1F;
+
+ AssertEquals("#F15", -99F, Conversion.Fix(Sng));
+
+ Sng = -99.6F;
+
+ AssertEquals("#F16", -99F, Conversion.Fix(Sng));
+
+ Dbl = 99.1;
+
+ AssertEquals("#F17", 99D, Conversion.Fix(Dbl));
+
+ Dbl = 99.6;
+
+ AssertEquals("#F18", 99D, Conversion.Fix(Dbl));
+
+ Dbl = -99.1;
+
+ AssertEquals("#F19", -99D, Conversion.Fix(Dbl));
+
+ Dbl = -99.6;
+
+ AssertEquals("#F20", -99D, Conversion.Fix(Dbl));
+
+ Dec = 99.1M;
+
+ AssertEquals("#F21", 99M, Conversion.Fix(Dec));
+
+ Dec = 99.6M;
+
+ AssertEquals("#F22", 99M, Conversion.Fix(Dec));
+
+ Dec = -99.1M;
+
+ AssertEquals("#F23", -99M, Conversion.Fix(Dec));
+
+ Dec = -99.6M;
+
+ AssertEquals("#F24", -99M, Conversion.Fix(Dec));
+
+ Dbl = 99.1;
+ S = Dbl.ToString();
+
+ AssertEquals("#F25", 99D, Conversion.Fix(S));
+
+ Dbl = 99.6;
+ S = Dbl.ToString();
+
+ AssertEquals("#F26", 99D, Conversion.Fix(S));
+
+ Dbl = -99.1;
+ S = Dbl.ToString();
+
+ AssertEquals("#F27", -99D, Conversion.Fix(S));
+
+ Dbl = -99.6;
+ S = Dbl.ToString();
+
+ AssertEquals("#F28", -99D, Conversion.Fix(S));
+
+ Dbl = 99.1;
+ O = Dbl;
+
+ AssertEquals("#F29", 99D, Conversion.Fix(O));
+
+ Sng = 99.6F;
+ O = Sng;
+
+ AssertEquals("#F30", (System.Object)99F, Conversion.Fix(O));
+
+ Dbl = -99.1;
+ O = Dbl;
+
+ AssertEquals("#F31", -99D, Conversion.Fix(O));
+
+ Dec = -99.6M;
+ O = Dec;
+
+ AssertEquals("#F32", (System.Object)(-99M), Conversion.Fix(O));
+
+ O = typeof(int);
+
+ // test for Exceptions
+ bool caughtException = false;
+ try {
+ Conversion.Fix(O);
+ }
+ catch (Exception e) {
+ AssertEquals("#F33", typeof(ArgumentException), e.GetType());
+ caughtException = true;
+ }
+
+ AssertEquals("#F34", true, caughtException);
+
+ caughtException = false;
+ try {
+ Conversion.Fix(null);
+ }
+ catch (Exception e) {
+ AssertEquals("#F35", typeof(ArgumentNullException), e.GetType());
+ caughtException = true;
+ }
+
+ AssertEquals("#F36", true, caughtException);
+
+ }
+
+ // Test the Int function
+ public void TestInt() {
+ System.Single Sng;
+ System.Double Dbl;
+ System.Decimal Dec;
+ System.String S;
+ System.Object O;
+
+ AssertEquals("#I01", System.Int16.MaxValue, Conversion.Int(System.Int16.MaxValue));
+ AssertEquals("#I02", System.Int16.MinValue, Conversion.Int(System.Int16.MinValue));
+ AssertEquals("#I03", System.Int32.MaxValue, Conversion.Int(System.Int32.MaxValue));
+ AssertEquals("#I04", System.Int32.MinValue, Conversion.Int(System.Int32.MinValue));
+ AssertEquals("#I05", System.Int64.MaxValue, Conversion.Int(System.Int64.MaxValue));
+ AssertEquals("#I06", System.Int64.MinValue, Conversion.Int(System.Int64.MinValue));
+ AssertEquals("#I07", (System.Single)Math.Floor(System.Single.MaxValue), Conversion.Int(System.Single.MaxValue));
+ AssertEquals("#I08", (System.Single)Math.Floor(System.Single.MinValue), Conversion.Int(System.Single.MinValue));
+ AssertEquals("#I09", Math.Floor(System.Double.MaxValue), Conversion.Int(System.Double.MaxValue));
+ AssertEquals("#I10", Math.Floor(System.Double.MinValue), Conversion.Int(System.Double.MinValue));
+ AssertEquals("#I11", Decimal.Floor(System.Decimal.MaxValue), Conversion.Int(System.Decimal.MaxValue));
+ AssertEquals("#I12", Decimal.Floor(System.Decimal.MinValue), Conversion.Int(System.Decimal.MinValue));
+
+ Sng = 99.1F;
+
+ AssertEquals("#I13", 99F, Conversion.Int(Sng));
+
+ Sng = 99.6F;
+
+ AssertEquals("#I14", 99F, Conversion.Int(Sng));
+
+ Sng = -99.1F;
+
+ AssertEquals("#I15", -100F, Conversion.Int(Sng));
+
+ Sng = -99.6F;
+
+ AssertEquals("#I16", -100F, Conversion.Int(Sng));
+
+ Dbl = 99.1;
+
+ AssertEquals("#I17", 99D, Conversion.Int(Dbl));
+
+ Dbl = 99.6;
+
+ AssertEquals("#I18", 99D, Conversion.Int(Dbl));
+
+ Dbl = -99.1;
+
+ AssertEquals("#I19", -100D, Conversion.Int(Dbl));
+
+ Dbl = -99.6;
+
+ AssertEquals("#I20", -100D, Conversion.Int(Dbl));
+
+ Dec = 99.1M;
+
+ AssertEquals("#I21", 99M, Conversion.Int(Dec));
+
+ Dec = 99.6M;
+
+ AssertEquals("#I22", 99M, Conversion.Int(Dec));
+
+ Dec = -99.1M;
+
+ AssertEquals("#I23", -100M, Conversion.Int(Dec));
+
+ Dec = -99.6M;
+
+ AssertEquals("#I24", -100M, Conversion.Int(Dec));
+
+ Dbl = 99.1;
+ S = Dbl.ToString();
+
+ AssertEquals("#I25", 99D, Conversion.Int(S));
+
+ Dbl = 99.6;
+ S = Dbl.ToString();
+
+ AssertEquals("#I26", 99D, Conversion.Int(S));
+
+ Dbl = -99.1;
+ S = Dbl.ToString();
+
+ AssertEquals("#I27", -100D, Conversion.Int(S));
+
+ Dbl = -99.6;
+ S = Dbl.ToString();
+
+ AssertEquals("#I28", -100D, Conversion.Int(S));
+
+ Dbl = 99.1;
+ O = Dbl;
+
+ AssertEquals("#I29", 99D, Conversion.Int(O));
+
+ Sng = 99.6F;
+ O = Sng;
+
+ AssertEquals("#I30", 99F, Conversion.Int(O));
+
+ Dbl = -99.1;
+ O = Dbl;
+
+ AssertEquals("#I31", -100D, Conversion.Int(O));
+
+ Dec = -99.6M;
+ O = Dec;
+
+ AssertEquals("#I32", -100M, Conversion.Int(O));
+
+ // test the exceptions it's supposed to throw
+
+ O = typeof(int);
+ bool caughtException = false;
+
+ try {
+ Conversion.Fix(O);
+ }
+ catch (Exception e) {
+ AssertEquals("#I33", typeof(ArgumentException), e.GetType());
+ caughtException = true;
+ }
+
+ AssertEquals("#I34", true, caughtException);
+
+ caughtException = false;
+ try {
+ Conversion.Int(null);
+ }
+ catch (Exception e) {
+ AssertEquals("#I35", typeof(ArgumentNullException), e.GetType());
+ caughtException = true;
+ }
+
+ AssertEquals("#I36", true, caughtException);
+
+
+ }
+
+ // test the Hex function
+ public void TestHex() {
+ AssertEquals("#H01", "FF", Conversion.Hex(System.Byte.MaxValue));
+ AssertEquals("#H02", "0", Conversion.Hex(System.Byte.MinValue));
+ AssertEquals("#H03", "7FFF", Conversion.Hex(System.Int16.MaxValue));
+ AssertEquals("#H04", "8000", Conversion.Hex(System.Int16.MinValue));
+ AssertEquals("#H05", "7FFFFFFF", Conversion.Hex(System.Int32.MaxValue));
+ AssertEquals("#H06", "80000000", Conversion.Hex(System.Int32.MinValue));
+ AssertEquals("#H07", "7FFFFFFFFFFFFFFF", Conversion.Hex(System.Int64.MaxValue));
+ AssertEquals("#H08", "8000000000000000", Conversion.Hex(System.Int64.MinValue));
+
+ System.Byte UI8;
+ System.Int16 I16;
+ System.Int32 I32;
+ System.Int64 I64;
+ System.Object O;
+ System.String S;
+
+ UI8 = 15;
+ AssertEquals("#H09", "F", Conversion.Hex(UI8));
+
+ I16 = System.Byte.MaxValue;
+ AssertEquals("#H10", "FF", Conversion.Hex(I16));
+
+ I16 = (System.Int16)((I16 + 1) * -1);
+ AssertEquals("#H11", "FF00", Conversion.Hex(I16));
+
+ I16 = -2;
+ AssertEquals("#H12", "FFFE", Conversion.Hex(I16));
+
+ I32 = System.UInt16.MaxValue;
+ AssertEquals("#H13", "FFFF", Conversion.Hex(I32));
+
+ I32 = (I32 + 1) * -1;
+ AssertEquals("#H14", "FFFF0000", Conversion.Hex(I32));
+
+ I32 = -2;
+ AssertEquals("#H15", "FFFFFFFE", Conversion.Hex(I32));
+
+ I64 = System.UInt32.MaxValue;
+ AssertEquals("#H16", "FFFFFFFF", Conversion.Hex(I64));
+
+ I64 = (I64 + 1) * -1;
+ AssertEquals("#H17", "FFFFFFFF00000000", Conversion.Hex(I64));
+
+ I64 = -2;
+ AssertEquals("#H18", "FFFFFFFFFFFFFFFE", Conversion.Hex(I64));
+
+ I16 = System.Byte.MaxValue;
+ S = I16.ToString();
+ AssertEquals("#H19", "FF", Conversion.Hex(S));
+
+ I16 = (System.Int16)((I16 + 1) * -1);
+ S = I16.ToString();
+ AssertEquals("#H20", "FFFFFF00", Conversion.Hex(S));
+
+ I16 = -1;
+ S = I16.ToString();
+ AssertEquals("#H21", "FFFFFFFF", Conversion.Hex(S));
+
+ I32 = System.UInt16.MaxValue;
+ S = I32.ToString();
+ AssertEquals("#H22", "FFFF", Conversion.Hex(S));
+
+ I32 = (I32 + 1) * -1;
+ S = I32.ToString();
+ AssertEquals("#H23", "FFFF0000", Conversion.Hex(S));
+
+ I32 = -2;
+ S = I32.ToString();
+ AssertEquals("#H24", "FFFFFFFE", Conversion.Hex(S));
+
+ I64 = System.UInt32.MaxValue;
+ S = I64.ToString();
+ AssertEquals("#H25", "FFFFFFFF", Conversion.Hex(S));
+
+ I64 = (I64 + 1) * -1;
+ S = I64.ToString();
+ AssertEquals("#H26", "FFFFFFFF00000000", Conversion.Hex(S));
+
+ UI8 = System.Byte.MaxValue;
+ O = UI8;
+ AssertEquals("#H27", "FF", Conversion.Hex(O));
+
+ I16 = System.Byte.MaxValue;
+ O = I16;
+ AssertEquals("#H28", "FF", Conversion.Hex(O));
+
+ I16 = (System.Int16)((I16 + 1) * -1);
+ O = I16;
+ AssertEquals("#H29", "FF00", Conversion.Hex(O));
+
+ I16 = -2;
+ O = I16;
+ AssertEquals("#H30", "FFFE", Conversion.Hex(O));
+
+ I32 = System.UInt16.MaxValue;
+ O = I32;
+ AssertEquals("#H31", "FFFF", Conversion.Hex(O));
+
+ I32 = (I32 + 1) * -1;
+ O = I32;
+ AssertEquals("#H32", "FFFF0000", Conversion.Hex(O));
+
+ I32 = -2;
+ O = I32;
+ AssertEquals("#H33", "FFFFFFFE", Conversion.Hex(O));
+
+ I64 = System.UInt32.MaxValue;
+ O = I64;
+ AssertEquals("#H34", "FFFFFFFF", Conversion.Hex(O));
+
+ I64 = (I64 + 1) * -1;
+ O = I64;
+ AssertEquals("#H35", "FFFFFFFF00000000", Conversion.Hex(O));
+
+ I64 = -2;
+ O = I64;
+ // FIXME : MS doesn't pass this test
+ //AssertEquals("#H35", "FFFFFFFFFFFFFFFE", Conversion.Hex(O));
+
+ O = typeof(int);
+
+ bool caughtException = false;
+ try {
+ Conversion.Hex(O);
+ }
+ catch (Exception e) {
+ AssertEquals("#H36", typeof(ArgumentException), e.GetType());
+ caughtException = true;
+ }
+
+ AssertEquals("#H37", true, caughtException);
+
+ caughtException = false;
+
+ try {
+ Conversion.Hex(null);
+ }
+ catch (Exception e) {
+ AssertEquals("#H38", typeof(ArgumentNullException), e.GetType());
+ caughtException = true;
+ }
+
+ AssertEquals("#H39", true, caughtException);
+ }
+
+ // test the Oct function
+ public void TestOct() {
+ AssertEquals("#O01", "377", Conversion.Oct(System.Byte.MaxValue));
+ AssertEquals("#O02", "0", Conversion.Oct(System.Byte.MinValue));
+ AssertEquals("#O03", "77777", Conversion.Oct(System.Int16.MaxValue));
+ AssertEquals("#O04", "100000", Conversion.Oct(System.Int16.MinValue));
+ AssertEquals("#O05", "17777777777", Conversion.Oct(System.Int32.MaxValue));
+ AssertEquals("#O06", "20000000000", Conversion.Oct(System.Int32.MinValue));
+ AssertEquals("#O07", "777777777777777777777", Conversion.Oct(System.Int64.MaxValue));
+ //AssertEquals("#O08", "1000000000000000000000", Conversion.Oct(System.Int64.MinValue));
+
+ System.Byte UI8;
+ System.Int16 I16;
+ System.Int32 I32;
+ System.Int64 I64;
+ System.Object O;
+ System.String S;
+
+ UI8 = 15;
+ AssertEquals("#O09", "17", Conversion.Oct(UI8));
+
+ I16 = System.Byte.MaxValue;
+ AssertEquals("#O10", "377", Conversion.Oct(I16));
+
+ I16 = (System.Int16)((I16 + 1) * -1);
+ AssertEquals("#O11", "177400", Conversion.Oct(I16));
+
+ I16 = -2;
+ AssertEquals("#O12", "177776", Conversion.Oct(I16));
+
+ I32 = System.UInt16.MaxValue;
+ AssertEquals("#O13", "177777", Conversion.Oct(I32));
+
+ I32 = (I32 + 1) * -1;
+ AssertEquals("#O14", "37777600000", Conversion.Oct(I32));
+
+ I32 = -2;
+ AssertEquals("#O15", "37777777776", Conversion.Oct(I32));
+
+ I64 = System.UInt32.MaxValue;
+ AssertEquals("#O16", "37777777777", Conversion.Oct(I64));
+
+ I64 = (I64 + 1) * -1;
+ AssertEquals("#O17", "1777777777740000000000", Conversion.Oct(I64));
+
+ I64 = -2;
+ AssertEquals("#O18", "1777777777777777777776", Conversion.Oct(I64));
+
+ I16 = System.Byte.MaxValue;
+ S = I16.ToString();
+ AssertEquals("#O19", "377", Conversion.Oct(S));
+
+ I16 = (System.Int16)((I16 + 1) * -1);
+ S = I16.ToString();
+ AssertEquals("#O20", "37777777400", Conversion.Oct(S));
+
+ I16 = -2;
+ S = I16.ToString();
+ AssertEquals("#O21", "37777777776", Conversion.Oct(S));
+
+ I32 = System.UInt16.MaxValue;
+ S = I32.ToString();
+ AssertEquals("#O22", "177777", Conversion.Oct(S));
+
+ I32 = (I32 + 1) * -1;
+ S = I32.ToString();
+ AssertEquals("#O23", "37777600000", Conversion.Oct(S));
+
+ I32 = -2;
+ S = I32.ToString();
+ AssertEquals("#O24", "37777777776", Conversion.Oct(S));
+
+ I64 = System.UInt32.MaxValue;
+ S = I64.ToString();
+ AssertEquals("#O25", "37777777777", Conversion.Oct(S));
+
+ I64 = (I64 + 1) * -1;
+ S = I64.ToString();
+ AssertEquals("#O26", "1777777777740000000000", Conversion.Oct(S));
+
+ UI8 = System.Byte.MaxValue;
+ O = UI8;
+ AssertEquals("#O27", "377", Conversion.Oct(O));
+
+ I16 = System.Byte.MaxValue;
+ O = I16;
+ AssertEquals("#O28", "377", Conversion.Oct(O));
+
+ I16 = (System.Int16)((I16 + 1) * -1);
+ O = I16;
+ AssertEquals("#O29", "177400", Conversion.Oct(O));
+
+ I16 = -2;
+ O = I16;
+ AssertEquals("#O29", "177776", Conversion.Oct(O));
+
+ I32 = System.UInt16.MaxValue;
+ O = I32;
+ AssertEquals("#O30", "177777", Conversion.Oct(O));
+
+ I32 = (I32 + 1) * -1;
+ O = I32;
+ AssertEquals("#O31", "37777600000", Conversion.Oct(O));
+
+ I32 = -2;
+ O = I32;
+ AssertEquals("#O32", "37777777776", Conversion.Oct(O));
+
+ I64 = System.UInt32.MaxValue;
+ O = I64;
+ AssertEquals("#O33", "37777777777", Conversion.Oct(O));
+
+ I64 = (I64 + 1) * -1;
+ O = I64;
+ AssertEquals("#O34", "1777777777740000000000", Conversion.Oct(O));
+
+ I64 = -2;
+ O = I64;
+
+ // FIXME: MS doesn't pass this test
+ // AssertEquals("#O35", "1777777777777777777776", Conversion.Oct(O));
+
+ O = typeof(int);
+
+ bool caughtException = false;
+ try {
+ Conversion.Oct(O);
+ }
+ catch (Exception e) {
+ AssertEquals("#O36", typeof(ArgumentException), e.GetType());
+ caughtException = true;
+ }
+
+ AssertEquals("#O37", true, caughtException);
+
+ caughtException = false;
+
+ try {
+ Conversion.Oct(null);
+ }
+ catch (Exception e) {
+ AssertEquals("#O38", typeof(ArgumentNullException), e.GetType());
+ caughtException = true;
+ }
+
+ AssertEquals("#O39", true, caughtException);
+ }
+
+ // test the Str function
+ public void TestStr() {
+ AssertEquals("#S01", "-1", Conversion.Str(-1));
+ AssertEquals("#S02", " 1", Conversion.Str(1));
+
+ bool caughtException = false;
+ Object O = typeof(int);
+
+ try {
+ Conversion.Str(O);
+ }
+ catch (Exception e) {
+ AssertEquals("#S03", typeof(InvalidCastException), e.GetType());
+ caughtException = true;
+ }
+
+ AssertEquals("#S04", true, caughtException);
+
+ caughtException = false;
+
+ try {
+ Conversion.Str(null);
+ }
+ catch (Exception e) {
+ AssertEquals("#S05", typeof(ArgumentNullException), e.GetType());
+ caughtException = true;
+ }
+ }
+
+ // Test the Val function
+ public void TestVal() {
+ AssertEquals("#V01", 4, Conversion.Val('4'));
+ AssertEquals("#V02", -3542.76, Conversion.Val(" - 3 5 .4 2 7 6E+ 0 0 2 "));
+ AssertEquals("#V03", 255D, Conversion.Val("&HFF"));
+ AssertEquals("#V04", 255D, Conversion.Val("&o377"));
+
+ System.Object O = " - 3 5 .4 7 6E+ 0 0 3";
+
+ AssertEquals("#V05", -35476D, Conversion.Val(O));
+
+ bool caughtException;
+
+ caughtException = false;
+
+ try {
+ Conversion.Val("3E+9999999");
+ }
+ catch (Exception e) {
+ AssertEquals("#V06", typeof(OverflowException), e.GetType());
+ caughtException = true;
+ }
+
+ AssertEquals("#V07", true, caughtException);
+
+ caughtException = false;
+
+ try {
+ Conversion.Val(typeof(int));
+ }
+ catch (Exception e) {
+ AssertEquals("#V08", typeof(ArgumentException), e.GetType());
+ caughtException = true;
+ }
+ AssertEquals("#V09", true, caughtException);
+ }
+ }
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Test/DateAndTimeTest.cs b/mcs/class/Microsoft.VisualBasic/Test/DateAndTimeTest.cs
new file mode 100644
index 00000000000..0c8f38436f7
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Test/DateAndTimeTest.cs
@@ -0,0 +1,388 @@
+// Collection.cs - NUnit Test Cases for Microsoft.VisualBasic.Collection
+//
+// Author:
+// Chris J. Breisch (cjbreisch@altavista.net)
+//
+// (C) Chris J. Breisch
+//
+
+using NUnit.Framework;
+using System;
+using System.Threading;
+using System.Globalization;
+using Microsoft.VisualBasic;
+
+namespace MonoTests.Microsoft.VisualBasic
+{
+
+ public class DateAndTimeTest : TestCase {
+
+ private CultureInfo oldcult;
+
+ public DateAndTimeTest() : base ("Microsoft.VisualBasic.DateAndTime") {}
+ public DateAndTimeTest(string name) : base(name) {}
+
+ protected override void SetUp()
+ {
+ // the current culture determines the result of formatting
+ oldcult = Thread.CurrentThread.CurrentCulture;
+ Thread.CurrentThread.CurrentCulture = new CultureInfo ("");
+ }
+
+ protected override void TearDown ()
+ {
+ Thread.CurrentThread.CurrentCulture = oldcult;
+ }
+
+ public static ITest Suite {
+ get {
+ return new TestSuite(typeof(DateAndTimeTest));
+ }
+ }
+
+ public void TestDateString() {
+ string s = DateAndTime.DateString;
+ DateTime dtNow = DateTime.Today;
+ AssertEquals("#DS01", dtNow.ToShortDateString(), DateTime.Parse(s).ToShortDateString());
+
+ // TODO: Add a test for setting the date string too
+ }
+
+ public void TestToday() {
+ AssertEquals("#TO01", DateTime.Today, DateAndTime.Today);
+
+ // TODO: Add a test for setting Today
+ }
+
+ public void TestTimer() {
+ double secTimer = DateAndTime.Timer;
+ DateTime dtNow = DateTime.Now;
+ double secNow = dtNow.Hour * 3600 + dtNow.Minute * 60 + dtNow.Second + (dtNow.Millisecond + 1) / 1000D;
+ double secTimer2 = DateAndTime.Timer + .001;
+
+ // waste a little time
+ for (int i = 0; i < int.MaxValue; i++);
+
+ // get another timer
+ double secTimer3 = DateAndTime.Timer;
+
+ // should be same time within a reasonable tolerance
+ Assert("#TI01", secNow >= secTimer);
+ Assert("#TI02: SecTimer2=" + secTimer2 + " secNow=" + secNow, secTimer2 >= secNow);
+
+ // third timer should be greater than the first
+ Assert("#TI03", secTimer3 > secTimer);
+ }
+
+ public void TestNow() {
+ DateTime dtNow = DateTime.Now;
+ DateTime dtTest = DateAndTime.Now;
+ DateTime dtNow2 = DateTime.Now;
+
+ Assert("#N01", dtTest >= dtNow);
+ Assert("#N02", dtNow2 >= dtTest);
+ }
+
+ public void TestTimeOfDay() {
+ DateTime dtNow = DateTime.Now;
+ TimeSpan tsNow = new TimeSpan(dtNow.Hour, dtNow.Minute, dtNow.Second);
+ DateTime dtTest = DateAndTime.TimeOfDay;
+ TimeSpan tsTest = new TimeSpan(dtTest.Hour, dtTest.Minute, dtTest.Second);
+ DateTime dtNow2 = DateTime.Now;
+ TimeSpan tsNow2 = new TimeSpan(dtNow2.Hour, dtNow2.Minute, dtNow2.Second);
+
+ Assert("#TOD01", tsTest.Ticks >= tsNow.Ticks);
+ Assert("#TOD02", tsNow2.Ticks >= tsTest.Ticks);
+
+ // TODO: add a test case for setting time of day
+ }
+
+ public void TestTimeString() {
+ DateTime dtNow = DateTime.Now;
+ TimeSpan tsNow = new TimeSpan(dtNow.Hour, dtNow.Minute, dtNow.Second);
+ string s = DateAndTime.TimeString;
+ DateTime dtTest = DateTime.Parse(s);
+ TimeSpan tsTest = new TimeSpan(dtTest.Hour, dtTest.Minute, dtTest.Second);
+ DateTime dtNow2 = DateTime.Now;
+ TimeSpan tsNow2 = new TimeSpan(dtNow2.Hour, dtNow2.Minute, dtNow2.Second);
+
+ Assert("#TS01", tsTest.Ticks >= tsNow.Ticks);
+ Assert("#TS02", tsNow2.Ticks >= tsTest.Ticks);
+
+ // TODO: add a test case for setting TimeString
+ }
+
+ public void TestDateAdd() {
+ DateTime dtNow = DateTime.Now;
+
+ AssertEquals("#DA01", dtNow.AddYears(1), DateAndTime.DateAdd(DateInterval.Year, 1, dtNow));
+ AssertEquals("#DA02", dtNow.AddYears(-1), DateAndTime.DateAdd("yyyy", -1, dtNow));
+
+
+ bool caughtException = false;
+
+ try {
+ DateAndTime.DateAdd("foo", 1, dtNow);
+ }
+ catch (Exception e) {
+ AssertEquals("#DA03", e.GetType(), typeof(ArgumentException));
+ caughtException = true;
+ }
+
+ AssertEquals("#DA04", caughtException, true);
+
+ AssertEquals("#DA05", dtNow.AddMonths(6), DateAndTime.DateAdd(DateInterval.Quarter, 2, dtNow));
+ AssertEquals("#DA06", dtNow.AddMonths(-6), DateAndTime.DateAdd("q", -2, dtNow));
+
+ AssertEquals("#DA07", dtNow.AddMonths(3), DateAndTime.DateAdd(DateInterval.Month, 3, dtNow));
+ AssertEquals("#DA08", dtNow.AddMonths(-3), DateAndTime.DateAdd("m", -3, dtNow));
+
+ AssertEquals("#DA09", dtNow.AddDays(28), DateAndTime.DateAdd(DateInterval.WeekOfYear, 4, dtNow));
+ AssertEquals("#DA10", dtNow.AddDays(-28), DateAndTime.DateAdd("ww", -4, dtNow));
+
+ AssertEquals("#DA11", dtNow.AddDays(5), DateAndTime.DateAdd(DateInterval.Weekday, 5, dtNow));
+ AssertEquals("#DA12", dtNow.AddDays(-5), DateAndTime.DateAdd("w", -5, dtNow));
+
+ AssertEquals("#DA13", dtNow.AddDays(6), DateAndTime.DateAdd(DateInterval.DayOfYear, 6, dtNow));
+ AssertEquals("#DA14", dtNow.AddDays(-6), DateAndTime.DateAdd("y", -6, dtNow));
+
+ AssertEquals("#DA15", dtNow.AddDays(7), DateAndTime.DateAdd(DateInterval.Day, 7, dtNow));
+ AssertEquals("#DA16", dtNow.AddDays(-7), DateAndTime.DateAdd("d", -7, dtNow));
+
+ AssertEquals("#DA17", dtNow.AddHours(8), DateAndTime.DateAdd(DateInterval.Hour, 8, dtNow));
+ AssertEquals("#DA18", dtNow.AddHours(-8), DateAndTime.DateAdd(DateInterval.Hour, -8, dtNow));
+
+ AssertEquals("#DA19", dtNow.AddMinutes(9), DateAndTime.DateAdd(DateInterval.Minute, 9, dtNow));
+ AssertEquals("#DA20", dtNow.AddMinutes(-9), DateAndTime.DateAdd("n", -9, dtNow));
+
+ AssertEquals("#DA21", dtNow.AddSeconds(10), DateAndTime.DateAdd(DateInterval.Second, 10, dtNow));
+ AssertEquals("#DA22", dtNow.AddSeconds(-10), DateAndTime.DateAdd("s", -10, dtNow));
+
+ caughtException = false;
+
+ try {
+ DateAndTime.DateAdd(DateInterval.Year, int.MinValue, dtNow);
+ }
+ catch (Exception e) {
+ caughtException = true;
+ AssertEquals("#DA23", e.GetType(), typeof(Exception));
+ }
+
+ // AssertEquals("#DA24", caughtException, true);
+ }
+
+ public void TestDateDiff () {
+ DateTime dtNow = DateTime.Now;
+ DateTime dtOld = dtNow.AddYears(-1);
+
+ // TODO: Test this better
+ long diff = DateAndTime.DateDiff(DateInterval.Year, dtOld, dtNow, FirstDayOfWeek.System, FirstWeekOfYear.System);
+
+ AssertEquals("#DD01", dtNow, dtOld.AddYears((int)diff));
+
+ DateTime dtJan1 = new DateTime(2002, 1, 1);
+ DateTime dtDec31 = new DateTime(2001, 12, 31);
+
+ diff = DateAndTime.DateDiff(DateInterval.Year, dtDec31, dtJan1, FirstDayOfWeek.System, FirstWeekOfYear.System);
+
+ AssertEquals("#DD02", 1L, diff);
+
+ diff = DateAndTime.DateDiff(DateInterval.Quarter, dtDec31, dtJan1, FirstDayOfWeek.System, FirstWeekOfYear.System);
+
+ AssertEquals("#DD03", 1L, diff);
+
+ diff = DateAndTime.DateDiff(DateInterval.Month, dtDec31, dtJan1, FirstDayOfWeek.System, FirstWeekOfYear.System);
+
+ AssertEquals("#DD04", 1L, diff);
+
+ DateTime dtJan4 = new DateTime(2001, 1, 4); // This is a Thursday
+ DateTime dtJan9 = new DateTime(2001, 1, 9); // This is the next Tuesday
+
+
+ long WD = DateAndTime.DateDiff(DateInterval.Weekday, dtJan4, dtJan9, FirstDayOfWeek.System, FirstWeekOfYear.System);
+
+ AssertEquals ("#DD05", 0L, WD);
+
+ long WY = DateAndTime.DateDiff(DateInterval.WeekOfYear, dtJan4, dtJan9, FirstDayOfWeek.System, FirstWeekOfYear.System);
+
+ AssertEquals ("#DD06", 1L, WY);
+ }
+
+ public void TestDatePart () {
+ DateTime dtJan4 = new DateTime(2001, 1, 4);
+
+ // TODO: Test this better
+
+ AssertEquals("#DP01", 2001, DateAndTime.DatePart(DateInterval.Year, dtJan4, FirstDayOfWeek.System, FirstWeekOfYear.System));
+ AssertEquals("#DP02", 1, DateAndTime.DatePart(DateInterval.Quarter, dtJan4, FirstDayOfWeek.System, FirstWeekOfYear.System));
+ AssertEquals("#DP03", 1, DateAndTime.DatePart(DateInterval.Month, dtJan4, FirstDayOfWeek.System, FirstWeekOfYear.System));
+ AssertEquals("#DP04", 1, DateAndTime.DatePart(DateInterval.WeekOfYear, dtJan4, FirstDayOfWeek.System, FirstWeekOfYear.FirstFourDays));
+ AssertEquals("#DP05", 53, DateAndTime.DatePart(DateInterval.WeekOfYear, dtJan4, FirstDayOfWeek.System, FirstWeekOfYear.FirstFullWeek));
+ AssertEquals("#DP06", 1, DateAndTime.DatePart(DateInterval.WeekOfYear, dtJan4, FirstDayOfWeek.System, FirstWeekOfYear.Jan1));
+ AssertEquals("#DP07", 1, DateAndTime.DatePart(DateInterval.WeekOfYear, dtJan4, FirstDayOfWeek.System, FirstWeekOfYear.System));
+ AssertEquals("#DP08", 5, DateAndTime.DatePart(DateInterval.Weekday, dtJan4, FirstDayOfWeek.Friday, FirstWeekOfYear.FirstFourDays));
+ AssertEquals("#DP09", 5, DateAndTime.DatePart(DateInterval.Weekday, dtJan4, FirstDayOfWeek.Saturday, FirstWeekOfYear.FirstFourDays));
+ AssertEquals("#DP10", 5, DateAndTime.DatePart(DateInterval.Weekday, dtJan4, FirstDayOfWeek.Sunday, FirstWeekOfYear.FirstFourDays));
+ AssertEquals("#DP11", 5, DateAndTime.DatePart(DateInterval.Weekday, dtJan4, FirstDayOfWeek.Monday, FirstWeekOfYear.FirstFourDays));
+ AssertEquals("#DP12", 5, DateAndTime.DatePart(DateInterval.Weekday, dtJan4, FirstDayOfWeek.Tuesday, FirstWeekOfYear.FirstFourDays));
+ AssertEquals("#DP13", 5, DateAndTime.DatePart(DateInterval.Weekday, dtJan4, FirstDayOfWeek.Wednesday, FirstWeekOfYear.FirstFourDays));
+ AssertEquals("#DP14", 5, DateAndTime.DatePart(DateInterval.Weekday, dtJan4, FirstDayOfWeek.Thursday, FirstWeekOfYear.FirstFourDays));
+ AssertEquals("#DP15", 5, DateAndTime.DatePart(DateInterval.Weekday, dtJan4, FirstDayOfWeek.System, FirstWeekOfYear.FirstFourDays));
+
+
+ }
+
+ public void TestDateSerial () {
+ DateTime dtJan4 = new DateTime(2001, 1, 4);
+ DateTime dtSerial = DateAndTime.DateSerial(2001, 1, 4);
+
+ AssertEquals("#DS01", dtJan4, dtSerial);
+ }
+
+ public void TestTimeSerial () {
+ bool caughtException = false;
+
+ try {
+ DateAndTime.TimeSerial(0, -1440, -1);
+ }
+ catch (Exception e) {
+ AssertEquals("#TS01", e.GetType(), typeof(ArgumentOutOfRangeException));
+ caughtException = true;
+ }
+ AssertEquals("#TS02", true, caughtException);
+
+ AssertEquals("#TS03", new DateTime(1, 1, 1, 1, 1, 1), DateAndTime.TimeSerial(1, 1, 1));
+
+ }
+
+ public void TestDateValue () {
+ try {
+ DateAndTime.DateValue("This is not a date.");
+ }
+ catch (FormatException) {
+ /* do nothing. this is what we expect */
+ }
+ catch (Exception e) {
+ Fail ("Unexpected exception:" + e);
+ }
+ AssertEquals("#DV03", new DateTime(1969, 2, 12), DateAndTime.DateValue("February 12, 1969"));
+ }
+
+ public void TestTimeValue () {
+ try {
+ DateAndTime.TimeValue("This is not a time.");
+ }
+ catch (FormatException) {
+ /* do nothing. this is what we expect */
+ }
+ catch (Exception e) {
+ Fail ("Unexpected exception:" + e);
+ }
+ AssertEquals("#TV03", new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 16, 35, 17), DateAndTime.TimeValue("4:35:17 PM"));
+ }
+
+ public void TestYear () {
+ DateTime jan1 = new DateTime(2001, 1, 1, 1, 1, 1);
+ AssertEquals("#Y01", jan1.Year, DateAndTime.Year(jan1));
+ }
+
+ public void TestMonth () {
+ DateTime jan1 = new DateTime(2001, 1, 1, 1, 1, 1);
+ AssertEquals("#MO01", jan1.Month, DateAndTime.Month(jan1));
+ }
+
+ public void TestDay () {
+ DateTime jan1 = new DateTime(2001, 1, 1, 1, 1, 1);
+ AssertEquals("#D01", jan1.Day, DateAndTime.Day(jan1));
+ }
+
+ public void TestHour () {
+ DateTime jan1 = new DateTime(2001, 1, 1, 1, 1, 1);
+ AssertEquals("#H01", jan1.Hour, DateAndTime.Hour(jan1));
+ }
+
+ public void TestMinute () {
+ DateTime jan1 = new DateTime(2001, 1, 1, 1, 1, 1);
+ AssertEquals("#MI01", jan1.Minute, DateAndTime.Minute(jan1));
+ }
+
+ public void TestSecond () {
+ DateTime jan1 = new DateTime(2001, 1, 1, 1, 1, 1);
+ AssertEquals("#S01", jan1.Second, DateAndTime.Second(jan1));
+ }
+
+ public void TestWeekday () {
+ DateTime jan1 = new DateTime(2001, 1, 1, 1, 1, 1);
+ AssertEquals("#W01", (int)jan1.DayOfWeek + 1, DateAndTime.Weekday(jan1, FirstDayOfWeek.System));
+ }
+
+ public void TestMonthName () {
+ DateTime jan1 = new DateTime(2001, 1, 1, 1, 1, 1);
+ AssertEquals("#MN01", CultureInfo.CurrentCulture.DateTimeFormat.GetAbbreviatedMonthName(jan1.Month),
+ DateAndTime.MonthName(jan1.Month, true));
+ AssertEquals("#MN02", CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(jan1.Month),
+ DateAndTime.MonthName(jan1.Month, false));
+
+ bool caughtException = false;
+
+ try {
+ DateAndTime.MonthName(0, false);
+ }
+ catch (Exception e) {
+ AssertEquals("#MN03", typeof(ArgumentException), e.GetType());
+ caughtException = true;
+ }
+ AssertEquals("#MN04", true, caughtException);
+
+ caughtException = false;
+
+ try {
+ DateAndTime.MonthName(14, false);
+ }
+ catch (Exception e) {
+ AssertEquals("#MN05", typeof(ArgumentException), e.GetType());
+ caughtException = true;
+ }
+ AssertEquals("#MN06", true, caughtException);
+
+ //AssertEquals("#MN07", "", DateAndTime.MonthName(13, false));
+ }
+
+ public void TestWeekdayName () {
+ DateTime jan1 = new DateTime(2001, 1, 1, 1, 1, 1);
+ AssertEquals("#WN01", "Tue",
+ DateAndTime.WeekdayName((int)jan1.DayOfWeek + 1, true, FirstDayOfWeek.System));
+ AssertEquals("#WN02", "Tuesday",
+ DateAndTime.WeekdayName((int)jan1.DayOfWeek + 1, false, FirstDayOfWeek.System));
+
+ bool caughtException = false;
+
+ try {
+ DateAndTime.WeekdayName(0, false, FirstDayOfWeek.System);
+ }
+ catch (Exception e) {
+ AssertEquals("#WN03", typeof(ArgumentException), e.GetType());
+ caughtException = true;
+ }
+ AssertEquals("#WN04", true, caughtException);
+
+ caughtException = false;
+
+ try {
+ DateAndTime.WeekdayName(8, false, FirstDayOfWeek.System);
+ }
+ catch (Exception e) {
+ AssertEquals("#WN05", typeof(ArgumentException), e.GetType());
+ caughtException = true;
+ }
+ AssertEquals("#WN06", true, caughtException);
+
+ AssertEquals("#WN07", "Tuesday", DateAndTime.WeekdayName((int)jan1.DayOfWeek + 1, false, FirstDayOfWeek.System));
+ }
+
+
+
+
+
+ }
+}
diff --git a/mcs/class/Microsoft.VisualBasic/Test/Microsoft.VisualBasic_test.build b/mcs/class/Microsoft.VisualBasic/Test/Microsoft.VisualBasic_test.build
new file mode 100644
index 00000000000..3e205b08b8f
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/Test/Microsoft.VisualBasic_test.build
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+
+<!-- NAnt build file for System.Data_test.dll -->
+<!-- Target build (default) builds tests -->
+<!-- Target test runs tests -->
+
+<project name="System.Data_test" default="build">
+ <property name="debug" value="false"/>
+ <property name="nunit_home" value="..\..\..\nunit"/>
+
+ <target name="build">
+ </target>
+
+ <target name="assemblies">
+ <csc target="library" output="Microsoft.VisualBasic_test.dll" debug="${debug}">
+ <arg value="/nowarn:1595"/>
+ <sources>
+ <includes name="**/*.cs"/>
+ <excludes name="TheTests.cs"/>
+ </sources>
+ <references basedir="..\..\..\nunit">
+ <includes name="NUnitCore.dll"/>
+ </references>
+ <arg value="/noconfig"/> <!-- don't reference ms assemblies -->
+ <!--<arg value="/lib:../../lib/"/>-->
+
+ <!-- cor compare dies with these currently -->
+ <!--<arg value="/nostdlib"/>--> <!-- don't reference mscorlib -->
+ <!--<arg value="/r:corlib.dll"/>-->
+ <arg value="/r:System.dll"/>
+ <arg value="/r:.\Microsoft.VisualBasic.dll"/>
+ </csc>
+
+<!--
+ <csc target="exe" output="RunTests.Microsoft.VisualBasic.exe" debug="${debug}">
+ <sources>
+ <includes name="**/*.cs"/>
+ <excludes name="AllTests.cs"/>
+ </sources>
+ <references basedir="..\..\..\nunit">
+ <includes name="NUnitBase.dll"/>
+ </references>
+ <arg value="/nowarn:1595"/>
+ <arg value="/noconfig"/>
+ <arg value="/r:..\..\lib\corlib.dll"/>
+ <arg value="/r:..\..\lib\System.dll"/>
+ <arg value="/r:..\..\lib\Microsoft.VisualBasic.dll"/>
+ </csc>
+
+-->
+ </target>
+
+ <target name="test" depends="assemblies">
+ <exec program="..\..\..\nunit\NUnitConsole" commandline="MonoTests.AllTests,Microsoft.VisualBasic_test.dll" failonerror="false"/>
+ </target>
+
+ <target name="clean">
+ <delete file="Microsoft.VisualBasic.dll" failonerror="false"/>
+ <delete file="Microsoft.VisualBasic_test.dll" failonerror="false"/>
+ <delete file="corlib.dll" failonerror="false"/>
+ <delete file="System.dll" failonerror="false"/>
+ </target>
+</project>
diff --git a/mcs/class/Microsoft.VisualBasic/list b/mcs/class/Microsoft.VisualBasic/list
new file mode 100644
index 00000000000..a6c1c5261f4
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/list
@@ -0,0 +1,62 @@
+Microsoft.VisualBasic/AppWinStyle.cs
+Microsoft.VisualBasic/CallType.cs
+Microsoft.VisualBasic/Collection.cs
+Microsoft.VisualBasic/ComClassAttribute.cs
+Microsoft.VisualBasic/CompareMethod.cs
+Microsoft.VisualBasic/Constants.cs
+Microsoft.VisualBasic/ControlChars.cs
+Microsoft.VisualBasic/Conversion.cs
+Microsoft.VisualBasic/DateAndTime.cs
+Microsoft.VisualBasic/DateFormat.cs
+Microsoft.VisualBasic/DateInterval.cs
+Microsoft.VisualBasic/DueDate.cs
+Microsoft.VisualBasic/ErrObject.cs
+Microsoft.VisualBasic/FileAttribute.cs
+Microsoft.VisualBasic/FileSystem.cs
+Microsoft.VisualBasic/Financial.cs
+Microsoft.VisualBasic/FirstDayOfWeek.cs
+Microsoft.VisualBasic/FirstWeekOfYear.cs
+Microsoft.VisualBasic/Globals.cs
+Microsoft.VisualBasic/Information.cs
+Microsoft.VisualBasic/Interaction.cs
+Microsoft.VisualBasic/MsgBoxResult.cs
+Microsoft.VisualBasic/MsgBoxStyle.cs
+Microsoft.VisualBasic/OpenAccess.cs
+Microsoft.VisualBasic/OpenMode.cs
+Microsoft.VisualBasic/OpenShare.cs
+Microsoft.VisualBasic/SpcInfo.cs
+Microsoft.VisualBasic/Strings.cs
+Microsoft.VisualBasic/TODOAttribute.cs
+Microsoft.VisualBasic/TabInfo.cs
+Microsoft.VisualBasic/TriState.cs
+Microsoft.VisualBasic/VBFixedArrayAttribute.cs
+Microsoft.VisualBasic/VBFixedStringAttribute.cs
+Microsoft.VisualBasic/VBMath.cs
+Microsoft.VisualBasic/VariantType.cs
+Microsoft.VisualBasic/VbStrConv.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/BooleanType.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ByteType.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/CharArrayType.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/CharType.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DateType.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DecimalType.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DoubleType.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ExceptionUtils.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/FlowControl.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/HostServices.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IVbHost.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IncompleteInitialization.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IntegerType.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LateBinding.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LongType.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ObjectType.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/OptionCompareAttribute.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/OptionTextAttribute.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ProjectData.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ShortType.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/SingleType.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StandardModuleAttribute.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StaticLocalInitFlag.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StringType.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/TODOAttribute.cs
+Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/Utils.cs
diff --git a/mcs/class/Microsoft.VisualBasic/makefile.gnu b/mcs/class/Microsoft.VisualBasic/makefile.gnu
new file mode 100644
index 00000000000..c4767e1781b
--- /dev/null
+++ b/mcs/class/Microsoft.VisualBasic/makefile.gnu
@@ -0,0 +1,13 @@
+topdir = ../..
+
+LIBRARY = $(topdir)/class/lib/Microsoft.VisualBasic.dll
+
+LIB_LIST = list
+LIB_FLAGS = -r corlib -r System
+
+SOURCES_INCLUDE=*.cs
+SOURCES_EXCLUDE=./Test*
+
+export MONO_PATH_PREFIX = $(topdir)/class/lib:
+
+include $(topdir)/class/library.make