void RaiseEvent(ShellEvent e) { if (e != null) { e(this); } }
public static async Task SendCommand(string input) { ShellEventArgs args = new ShellEventArgs(input); if (ShellEvent != null) { await ShellEvent.Invoke(args); } if (!args.Handled) { await Command.ExeCommand(input); } }
async Task MainAsync() //! Main loop { foreach (string str in args) //? Execute launch commands { await Command.ExeCommand(str); } while (true) //? Main async loop { string input = Shell.Input(); ShellEventArgs args = new ShellEventArgs(input); if (ShellEvent != null) { await ShellEvent.Invoke(args); } if (!args.Handled) { await Command.ExeCommand(input); } } }
public ShellEventArgs(ShellEvent shellEvent, IntPtr windowHandle) { this.shellEvent = shellEvent; this.windowHandle = windowHandle; }