Exemple #1
0
        public static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                martin.Test.run();
                return;
            }

            string asm_name;

            if (args [0].StartsWith("--device="))
            {
                if (args.Length != 2)
                {
                    throw new RuntimeException("Device and assembly name expected.");
                }
                device_config = XobotDeviceConfig.getDevice(args [0].Substring(9));
                asm_name      = args [1];
            }
            else
            {
                if (args.Length != 1)
                {
                    throw new RuntimeException("Assembly name expected.");
                }
                device_config = XobotDeviceConfig.DEFAULT;
                asm_name      = args [0];
            }

            var asm = Assembly.LoadFrom(asm_name);

            if (asm == null)
            {
                throw new RuntimeException("Failed to load assembly");
            }

            Initialize();
            Run(asm);
        }
		public static void Main (string[] args)
		{
			if (args.Length == 0) {
				martin.Test.run ();
				return;
			}

			string asm_name;

			if (args [0].StartsWith ("--device=")) {
				if (args.Length != 2)
					throw new RuntimeException ("Device and assembly name expected.");
				device_config = XobotDeviceConfig.getDevice (args [0].Substring (9));
				asm_name = args [1];
			} else {
				if (args.Length != 1)
					throw new RuntimeException ("Assembly name expected.");
				device_config = XobotDeviceConfig.DEFAULT;
				asm_name = args [0];
			}

			var asm = Assembly.LoadFrom (asm_name);
			if (asm == null)
				throw new RuntimeException ("Failed to load assembly");

			Initialize ();
			Run (asm);
		}