예제 #1
0
        public Camera(ScriptEngine scriptEngine, IApplicationContext context)
        {
            _scriptEngine = scriptEngine;
            _context = context;

            Size = 200;
        }
예제 #2
0
        public static object RunTest(String address, String entryPoint, String fileName, string reportath, string resourcePath)
        {
            object result = null;

            if (File.Exists(fileName))
            {
                using (Stream scriptStream = File.OpenRead(fileName))
                {
                    Engine = BitMobile.Script.ScriptEngine.LoadScript(scriptStream, entryPoint, DateTime.Now);

                    Console console = new Console(reportath, Engine);
                    Engine.AddVariable("Console", console);
                    Engine.AddVariable("Device", new Device(address, console, resourcePath));
                    Engine.AddVariable("Stopwatch", new Stopwatch());
                    Engine.AddVariable("Dialog", new Dialog(address, console));

                    result = Engine.CallFunction(entryPoint);
                }
                return(result);
            }
            else
            {
                throw new Exception("Test file does not exist");
            }
        }
예제 #3
0
        public Console(string reportPath, BitMobile.Script.ScriptEngine engine)
        {
            _reportPath = reportPath;
            _engine = engine;

            CommandPause = 1000;
        }
예제 #4
0
        public Console(string reportPath, BitMobile.Script.ScriptEngine engine)
        {
            _reportPath = reportPath;
            _engine     = engine;

            CommandPause = 1000;
        }
예제 #5
0
		public static ScriptEngine LoadScript(System.IO.Stream scriptStream, String name, DateTime lastWriteTime)
		{
            if (scripts.ContainsKey(name))
            {
                if (scriptsTime[name] < lastWriteTime)
                {
                    scripts.Remove(name);
                    scriptsTime.Remove(name);
                }
            }

			if(scripts.ContainsKey(name))
				return scripts[name];
			else
			{
				ScriptEngine engine = new ScriptEngine();
				scripts.Add(name,engine);
                scriptsTime.Add(name, lastWriteTime);

				if(scriptStream!=null)
					engine.Run(new System.IO.StreamReader(scriptStream));

				return engine;
			}
		}
예제 #6
0
        public Gallery(IApplicationContext context, ScriptEngine engine)
        {
            _context = context;
            _scriptEngine = engine;

            Size = 200;
        }
예제 #7
0
        public FileSystem(ScriptEngine scriptEngine, IApplicationContext context)
        {
            _scriptEngine = scriptEngine;
            _context = context;

            ReadFsLog();
        }
예제 #8
0
        public static ScriptEngine LoadScript(System.IO.Stream scriptStream, String name, BitMobile.Debugger.IDebugger debugger)
        {
            if (scripts.ContainsKey(name))
                return scripts[name];
            else
            {
                ScriptEngine engine = new ScriptEngine(name, debugger);
                scripts.Add(name, engine);

                if (scriptStream != null)
                    engine.Run(new System.IO.StreamReader(scriptStream));

                return engine;
            }
        }
예제 #9
0
        public static object RunTest(String address, String entryPoint, String fileName, string reportath, string resourcePath)
        {
            object result = null;

            if (File.Exists(fileName))
            {
                using (Stream scriptStream = File.OpenRead(fileName))
                {
                    Engine = BitMobile.Script.ScriptEngine.LoadScript(scriptStream, entryPoint, DateTime.Now);

                    Console console = new Console(reportath, Engine);
                    Engine.AddVariable("Console", console);
                    Engine.AddVariable("Device", new Device(address, console, resourcePath));
                    Engine.AddVariable("Stopwatch", new Stopwatch());
                    Engine.AddVariable("Dialog", new Dialog(address, console));

                    result = Engine.CallFunction(entryPoint);
                }
                return result;
            }
            else
                throw new Exception("Test file does not exist");
        }
예제 #10
0
 public BarcodeScanner(ScriptEngine scriptEngine, IApplicationContext context)
 {
     _scriptEngine = scriptEngine;
     _context = context;
 }
예제 #11
0
 public Console(ScriptEngine scriptEngine, IApplicationContext context)
 {
     _scriptEngine = scriptEngine;
     _context = context;
 }
예제 #12
0
 public MethodInvoker(ScriptEngine engine)
 {
     _engine = engine;
 }
예제 #13
0
 public void Init(ScriptEngine scriptEngine)//, GlobalEventsController globalEventsController)
 {
     this.scriptEngine = scriptEngine;
 }
예제 #14
0
		public void SetContext (object context)
		{
			this.context = (ScriptEngine)context;
		}