public static void Main() { ApplicationThread applicationThread = new ApplicationThread(); StartKMteller(applicationThread); StartConsole(applicationThread); Start(applicationThread); }
static void Main() { ApplicationThread applicationThread = new ApplicationThread(); StartConsole(applicationThread); StartWinForm(applicationThread); Start(applicationThread); }
public static void Main(string[] args) { ApplicationThread applicationThread = new ApplicationThread(); StartKMteller(applicationThread); StartWinForm(applicationThread); Start(applicationThread); }
public static void Start(ApplicationThread applicationThread) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Form1 form = new Form1(); form.ApplicationThread = applicationThread; Application.Run(form); }
static void StartConsole(ApplicationThread applicationThread) { Assembly assembly = Assembly.LoadFrom("MVCPattern.Console.exe"); Type type = assembly.GetType("MVCPattern.Console.Console"); MethodInfo consoleMethod = type.GetMethod("Start"); consoleStart consoleStart = (consoleStart)consoleMethod.CreateDelegate(typeof(consoleStart)); Thread consoleThread = new Thread(() => consoleStart(applicationThread)); consoleThread.Start(); }
static void StartWinForm(ApplicationThread applicationThread) { Assembly assembly = Assembly.LoadFrom("MVCPattern.WinForm.exe"); Type type = assembly.GetType("MVCPattern.WinForm.WinForm"); MethodInfo winFormMethod = type.GetMethod("Start"); winFormStart winFormStart = (winFormStart)winFormMethod.CreateDelegate(typeof(winFormStart)); Thread winThread = new Thread(() => winFormStart(applicationThread)); winThread.Start(); }
static void StartKMteller(ApplicationThread applicationThread) { Assembly assembly = Assembly.LoadFrom("MVCPattern.KMTeller.exe"); Type type = assembly.GetType("MVCPattern.KMTeller.Program"); MethodInfo winFormMethod = type.GetMethod("Start"); kmTellerStart kmTellerStart = (kmTellerStart)winFormMethod.CreateDelegate(typeof(kmTellerStart)); Thread winThread = new Thread(() => kmTellerStart(applicationThread)); winThread.Start(); }
public static void Start(ApplicationThread applicationThread) { ConsoleThread consoleThread = new ConsoleThread(); consoleThread.ApplicationThread = applicationThread; Thread oThread = new Thread(new ThreadStart(consoleThread.ReadLine)); oThread.Start(); oThread.Join(); }
private GameApplication() { Terrain = new TerrainApplication(); ConnectionManager = new ConnectionManagerApplication(); SocketController = new SocketControllerApplication("127.0.0.1", 8080); //registra comunicação com o terreno foreach (var action in Terrain.SocketMessageTypes) { SocketController.RegisterMessageType(action); } var updateChunksProcess = new ApplicationThread(100); //update thread event updateChunksProcess.OnRun += (obj) => { string error; if (!Terrain.UpdateChunks(out error)) { Log(error); } }; updateThreads.Add(updateChunksProcess); var updateBlocksProcess = new ApplicationThread(100); //update thread event updateBlocksProcess.OnRun += (obj) => { string error; if (!Terrain.UpdateBlocks(out error)) { Log(error); } }; updateThreads.Add(updateBlocksProcess); var updateApplication = new ApplicationThread(100); //update thread event updateApplication.OnRun += (obj) => { string error; if (!Terrain.UpdateBlocks(out error)) { Log(error); } }; updateThreads.Add(updateApplication); }
public GameApplication() { Terrain = new TerrainApplication(); SocketController = new SocketControllerApplication("127.0.0.1", 8080); foreach (var action in Terrain.SocketMessageTypes) { SocketController.RegisterMessageType(action); } var updateApplication = new ApplicationThread(100); //update thread event updateApplication.OnRun += (obj) => { string updateError; if (!Update(out updateError)) { Log(updateError); } }; updateThreads.Add(updateApplication); }
public PerThreadScopedStorage(ApplicationThread current_thread) { this.current_thread = current_thread; }