using System.Reflection;
using System.Collections;
using System.Diagnostics;
+using System.Runtime.InteropServices;
+using Microsoft.VisualBasic.CompilerServices;
+
+#if ONLY_1_1
+using DefaultParameterValueAttribute = Microsoft.VisualBasic.CompilerServices.__DefaultParameterValueAttribute;
+#endif
+
//using Windows.Drawing;
//using System.Windows.Forms;
-using Microsoft.VisualBasic.CompilerServices;
-
namespace Microsoft.VisualBasic {
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Auto)]
+ [StandardModule]
+ [StructLayoutAttribute(LayoutKind.Auto)]
sealed public class Interaction {
+
+ private Interaction (){}
+
// Declarations
// Constructors
// Properties
// Methods
//[MonoTODO]
- 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)
- {
+ public static int Shell (string Pathname,
+ [Optional, __DefaultParameterValue(2)] AppWinStyle Style,
+ [Optional, DefaultParameterValue(false)] bool Wait,
+ [Optional, DefaultParameterValue(-1)] int Timeout)
+ {
Process prcs = new Process();
ProcessWindowStyle PWinStyle = 0;
}
[MonoTODO]
- 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)
+ public static System.String InputBox (System.String Prompt,
+ [Optional, DefaultParameterValue("")] System.String Title,
+ [Optional, DefaultParameterValue("")] System.String DefaultResponse,
+ [Optional, DefaultParameterValue(-1)] System.Int32 XPos,
+ [Optional, DefaultParameterValue(-1)] System.Int32 YPos)
{
throw new NotImplementedException ();
}
}
[MonoTODO]
- 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 void DeleteSetting (System.String AppName,
+ [Optional, DefaultParameterValue(null)] System.String Section,
+ [Optional, DefaultParameterValue(null)] System.String Key)
{
throw new NotImplementedException ();
}
}
[MonoTODO]
- public static System.String GetSetting (System.String AppName, System.String Section, System.String Key, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue("")] System.String Default)
+ public static System.String GetSetting (System.String AppName,
+ System.String Section,
+ System.String Key,
+ [Optional, DefaultParameterValue("")] System.String Default)
{
throw new NotImplementedException ();
}
}
[MonoTODO]
- public static System.Object CreateObject (System.String ProgId, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue("")] System.String ServerName)
+ public static System.Object CreateObject (System.String ProgId,
+ [Optional, DefaultParameterValue("")] System.String ServerName)
{
throw new NotImplementedException ();
}
[MonoTODO]
- 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)
+ public static System.Object GetObject ([Optional, DefaultParameterValue(null)] System.String PathName,
+ [Optional, DefaultParameterValue(null)] System.String Class)
{
throw new NotImplementedException ();
}
- public static Object CallByName (Object objRef, String name, CallType userCallType, Object[] args)
+ public static Object CallByName (Object objRef, String name, CallType userCallType, params Object[] args)
{
- Object retVal = null;
Type[] argsType = null;
+ if (userCallType != CallType.Method &&
+ userCallType != CallType.Get &&
+ userCallType != CallType.Set &&
+ userCallType != CallType.Let)
+ throw new ArgumentException (Utils.GetResourceString("Argument_InvalidValue1", "CallType"));
-
- if(args != null && args.Length != 0) {
+ if(args != null) {
argsType = new Type[args.Length];
for(int i = 0; i < args.Length; i++)
argsType[i] = args[i].GetType();
}
+ /*else
+ argsType = new Type[0];*/
Type objType = objRef.GetType();
MethodInfo methodInfo = null;
if(userCallType == CallType.Method) {
- Console.WriteLine("Method");
+ //Console.WriteLine("Method");
methodInfo = objType.GetMethod(name, argsType);
}
else if(userCallType == CallType.Get) {
- Console.WriteLine("GetMethod");
+ //Console.WriteLine("GetMethod");
methodInfo = objType.GetProperty(name).GetGetMethod();
}
else if(userCallType == CallType.Set) {
- Console.WriteLine("SetMethod");
+ //Console.WriteLine("SetMethod");
methodInfo = objType.GetProperty(name).GetSetMethod();
}
}
- public static System.Object Choose (System.Double Index, System.Object[] Choice)
+ public static System.Object Choose (System.Double Index, params System.Object[] Choice)
{
int i;
public static System.String Environ (System.Int32 Expression)
{
int index = 0;
- Exception e;
// Console.WriteLine("Coming Here"+Expression);
string [] args = Environment.GetCommandLineArgs ();
if (args != null && args.Length > 1) {
- return string.Join (" ", args, 2, args.Length - 1);
+ return string.Join (" ", args, 1, args.Length - 1);
} else {
return "";
}
}
[MonoTODO]
- 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)
+ public static MsgBoxResult MsgBox (object Prompt,
+ [Optional, __DefaultParameterValue(0)]MsgBoxStyle Buttons,
+ [Optional, DefaultParameterValue(null)] object Title)
{
throw new NotImplementedException ();
/* //MessageButtons msgBoxButtons = 0;