public void updateScriptInfo(ScriptInformation information) { sInfo = information; lblScript.Dispatcher.BeginInvoke((Action)(() => lblScript.Content = scriptString + sInfo.attribute.name)); lblAuthor.Dispatcher.BeginInvoke((Action)(() => lblAuthor.Content = authorString + sInfo.attribute.author)); lblDesc.Dispatcher.BeginInvoke((Action)(() => lblDesc.Content = descString + sInfo.attribute.description)); }
/*private String assemblyName; private Type mainScript; private Type apiType; private ScriptAttributes attribute; private Assembly assembly;*/ public ScriptController(MacroMain mainController) { main = mainController; sInfo = new ScriptInformation(); sInfo.run = false; stopHotkey = new Hotkey_WPF(System.Windows.Forms.Keys.Q, false, true, false, false); stopHotkey.Pressed += (object sender, System.ComponentModel.HandledEventArgs e) => setScript(null); //stopHotkey.Register(main.window); }
public void setScript(String pathToAssembly) { Console.WriteLine("Stopping current script..."); sInfo.run = false; if (pathToAssembly != null) { Console.WriteLine("Setting up new script..."); sInfo = new ScriptInformation(); sInfo.assemblyPath = pathToAssembly; sInfo.assembly = Assembly.LoadFrom(sInfo.assemblyPath); Thread threadSearch = new Thread(new ThreadStart(Search)); threadSearch.Start(); } else { main.window.Dispatcher.BeginInvoke((Action)(() => Hooking.Manager.stopLLInput())); } }