static void Main(string[] args) { var type = typeof(Program); var name = Application.ProductName.ToLower(); try { using (var m = new Cube.Ipc.Messenger <IEnumerable <string> >(name)) { if (!m.IsServer) { m.Publish(args); } else { Logger.Configure(); Logger.Info(type, Assembly.GetExecutingAssembly()); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm(args) { Activator = m }); } } } catch (Exception err) { Logger.Error(type, err); } }
static void Main(string[] args) { var name = Application.ProductName.ToLower(); using (var bootstrap = new Cube.Ipc.Messenger <IEnumerable <string> >(name)) { if (!bootstrap.IsServer) { bootstrap.Publish(args); return; } InitLog(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var form = new MainForm(); form.Activator = bootstrap; Application.Run(form); } }
static void Main(string[] args) { var app = System.Windows.Forms.Application.ProductName; using (var m = new Cube.Ipc.Messenger <IEnumerable <string> >(app)) { if (!m.IsServer) { m.Publish(args); } else { System.Windows.Forms.Application.EnableVisualStyles(); System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false); var view = new MainForm { Activator = m }; System.Windows.Forms.Application.Run(view); } } }