private static void Main() { Console.WriteLine(Environment.NewLine + @" SCCI protocol script console, v1.7"); Console.WriteLine(@" (C) Proton-Electrotex JSC, 2011-2019"); using (var dialog = new DialogEngine()) dialog.Run(); }
internal ExternalElementsHost(DialogEngine Dialog, JavascriptContext EngineContext) { m_Dialog = Dialog; m_DeviceObject = new DeviceFunctions(); var configFunctions = new ConfigFunctions(this); // Set parameters - external functions EngineContext.SetParameter(@"cls", new Action(Clr)); EngineContext.SetParameter(@"closew", new Action(CloseWindows)); EngineContext.SetParameter(@"exec", new Action <string, string>(Execute)); EngineContext.SetParameter(@"print", new Action <object>(Print)); EngineContext.SetParameter(@"p", new Action <object>(Print)); EngineContext.SetParameter(@"sleep", new Action <object>(Sleep)); EngineContext.SetParameter(@"save", new Action <string, IList <object> >(Save)); EngineContext.SetParameter(@"load", new Func <string, object[]>(Load)); EngineContext.SetParameter(@"loadtihex", new Func <string, object[]>(LoadTIHex)); EngineContext.SetParameter(@"loadbin", new Func <string, object[]>(LoadBin)); EngineContext.SetParameter(@"help", new Action(Help)); EngineContext.SetParameter(@"plot", new Action <IEnumerable <object>, double, double>(Plot)); EngineContext.SetParameter(@"plot2", new Action <IEnumerable <object>, IEnumerable <object>, double, double>(Plot)); EngineContext.SetParameter(@"plot3", new Action <IEnumerable <object>, IEnumerable <object>, IEnumerable <object>, double, double>(Plot)); EngineContext.SetParameter(@"plotXY", new Action <IEnumerable <object>, IEnumerable <object> >(PlotXY)); EngineContext.SetParameter(@"scatter", new Action <IEnumerable <object>, IEnumerable <object> >(PlotScatter)); EngineContext.SetParameter(@"scattern", new Action <IEnumerable <object>, IEnumerable <object>, string, string, string>(PlotScatterNamed)); EngineContext.SetParameter(@"reset", new Action(Reset)); EngineContext.SetParameter(@"include", new Action <string>(Include)); EngineContext.SetParameter(@"i", new Action <string>(Include)); EngineContext.SetParameter(@"quit", new Action(Quit)); EngineContext.SetParameter(@"uint", new Func <int, int, uint>(UInt32Wrap)); EngineContext.SetParameter(@"portlist", new Func <string>(GetPortList)); EngineContext.SetParameter(@"pp", new Action(PrintPortList)); EngineContext.SetParameter(@"anykey", new Func <bool>(GetAnyKey)); EngineContext.SetParameter(@"readkey", new Func <string>(ReadKey)); EngineContext.SetParameter(@"readline", new Func <string>(ReadLine)); EngineContext.SetParameter(@"create", new Func <string, object>(CreateInstance)); EngineContext.SetParameter(@"create1", new Func <string, object, object>(CreateInstance)); EngineContext.SetParameter(@"create2", new Func <string, object, object, object>(CreateInstance)); EngineContext.SetParameter(@"loadlib", new Func <string, string, object>(LoadDLL)); // Set parameters - external objects EngineContext.SetParameter(@"cin", Console.In); EngineContext.SetParameter(@"cout", Console.Out); EngineContext.SetParameter(@"cerr", Console.Error); EngineContext.SetParameter(@"cfg", configFunctions); EngineContext.SetParameter(@"dev", configFunctions.CreateDevice()); }