2004-01-06 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
[mono.git] / mcs / class / Microsoft.VisualBasic / Microsoft.VisualBasic / Information.cs
1 //
2 // Information.cs
3 //
4 // Author:
5 //   Chris J Breisch (cjbreisch@altavista.net) 
6 //   Francesco Delfino (pluto@tipic.com)
7 //   Rafael Teixeira (rafaelteixeirabr@hotmail.com)
8 //
9 // (C) 2002 Chris J Breisch
10 //     2003 Tipic, Inc. (http://www.tipic.com)
11 //     2004 Rafael Teixeira
12 //
13
14 using System;
15
16 namespace Microsoft.VisualBasic \r
17 {
18         [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute] 
19         sealed public class Information {
20                 // Declarations
21                 // Constructors
22                 // Properties
23                 // Methods
24                 [MonoTODO]
25                 public static Microsoft.VisualBasic.ErrObject Err () { 
26                         return Microsoft.VisualBasic.CompilerServices.ProjectData.Err;
27                 }
28                 [MonoTODO]
29                 [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] 
30                 public static System.Int32 Erl () { throw new NotImplementedException (); }
31                 [MonoTODO]
32                 public static System.Boolean IsArray (System.Object VarName) { throw new NotImplementedException (); }
33                 [MonoTODO]
34                 public static System.Boolean IsDate (System.Object Expression) { throw new NotImplementedException (); }
35                 [MonoTODO]
36                 public static System.Boolean IsDBNull (System.Object Expression) { throw new NotImplementedException (); }
37                 [MonoTODO]
38                 public static System.Boolean IsNothing (System.Object Expression) { throw new NotImplementedException (); }
39                 [MonoTODO]
40                 public static System.Boolean IsError (System.Object Expression) { throw new NotImplementedException (); }
41                 [MonoTODO]
42                 public static System.Boolean IsReference (System.Object Expression) { throw new NotImplementedException (); }
43
44                 public static System.Boolean IsNumeric (System.Object Expression) 
45                 { 
46                         if (Expression == null || Expression is DateTime)
47                                 return false;
48
49                         if (Expression is Int16 || Expression is Int32 || Expression is Int64 || Expression is Decimal ||
50                                 Expression is Single || Expression is Double)
51                                 return true;
52
53                         try {
54                                 if (Expression is string)
55                                         Double.Parse(Expression as string);
56                                 else
57                                         Double.Parse(Expression.ToString());
58                                 return true;
59                         } catch {} // just dismiss errors but return false
60
61                         return false;
62                 }
63
64                 [MonoTODO]
65                 public static System.Int32 LBound (System.Array Array, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(1)] System.Int32 Rank) { throw new NotImplementedException (); }
66                 [MonoTODO]
67                 public static System.Int32 UBound (System.Array Array, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(1)] System.Int32 Rank) { throw new NotImplementedException (); }
68                 [MonoTODO]
69                 public static System.String TypeName (System.Object VarName) { throw new NotImplementedException (); }
70                 [MonoTODO]
71                 public static System.String SystemTypeName (System.String VbName) { throw new NotImplementedException (); }
72                 [MonoTODO]
73                 public static System.String VbTypeName (System.String UrtName) { throw new NotImplementedException (); }
74                 [MonoTODO]
75                 public static System.Int32 QBColor (System.Int32 Color) { throw new NotImplementedException (); }
76                 [MonoTODO]
77                 public static System.Int32 RGB (System.Int32 Red, System.Int32 Green, System.Int32 Blue) { throw new NotImplementedException (); }
78                 [MonoTODO]
79                 public static Microsoft.VisualBasic.VariantType VarType (System.Object VarName) { throw new NotImplementedException (); }
80                 // Events
81         };
82 }