static void Main(string[] args) { App app = new App(); app.Run(); Console.ReadLine(); }
public static void Main(string[] args) { var app = new App { ShutdownMode = ShutdownMode.OnLastWindowClose }; app.InitializeComponent(); var container = new Container(x=> x.AddRegistry<AppRegistry>()); var factory = container.GetInstance<TraderWindowFactory>(); var window = factory.Create(true); container.Configure(x => x.For<Dispatcher>().Add(window.Dispatcher)); //run start up jobs var priceUpdater = container.GetInstance<TradePriceUpdateJob>(); window.Show(); app.Resources.Add(SystemParameters.ClientAreaAnimationKey, null); app.Resources.Add(SystemParameters.MinimizeAnimationKey, null); app.Resources.Add(SystemParameters.UIEffectsKey, null); app.Run(); }
static void Main() { using (var mutex = new Mutex(false, mutex_id)) { var hasHandle = false; try { try { hasHandle = mutex.WaitOne(5000, false); if (hasHandle == false) return; //another instance exist } catch (AbandonedMutexException) { // Log the fact the mutex was abandoned in another process, it will still get aquired } App app = new App(); app.MainWindow = new MainWindow(); app.Run(); } finally { if (hasHandle) mutex.ReleaseMutex(); } } }
static void Main() { App app = new App(); app.MainWindow = new MainWindow(); app.MainWindow.Show(); app.Run(); }
static void Main(string[] args) { if (args.Length == 0) { App app = new App(); app.MainWindow = new MainWindow(); app.MainWindow.Show(); app.Run(); } else { InitializeParameterSet(); // now we came into command line mode. if (args[0] == "/?" || args[0] == "/h") { PrintHelp(); } else { ParseParameter(args); if (!ParasAllSet()) { PrintHelp(); } else { } } } }
static void Main(string[] args) { CLayer = new ControlLayer(); MWindow = new MainWindow(); App app = new App(); app.Run(MWindow); }
static void Main() { App a = new App(); View.MainWindow wnd = new View.MainWindow(); a.Run(wnd); }
public void RunApp() { var app = new App(); app.Run(); app.Shutdown(); }
static void Main(string[] args) { App myApp = new App(); lock (myApp) { myApp.Run(args); } }
static void Main(string[] args) { //Application.EnableVisualStyles(); //Application.SetCompatibleTextRenderingDefault(false); //Application.Run(FrmMain); App myApp = new App(); myApp.Run(args); }
private void StartApplication() { _app = new App(); var regionManager = new RegionManager(new RegionFactory(new IRegionAdapter[] { new TabControlAdapter() })); _locator.Register(regionManager); _app.Run(new MainWindow(_locator, _resetEvent)); }
static void Main(string[] args) { if (args.Length == 0) { App app = new App(); app.MainWindow = new Window1(); app.MainWindow.Show(); app.Run(); } }
static void Main() { App app = new App(); //this applies the XAML, e.g. StartupUri, Application.Resources app.InitializeComponent(); //shows the Window specified by StartupUri app.Run(); }
public static void Main() { IController controller = new MyController(); IModel model = new MyModel(controller); controller.setModel(model); IView view = new MainWindow(); view.setController(controller); controller.setView(view); App app = new App(); app.Run((MainWindow)view); }
// called on first run. protected override bool OnStartup(Microsoft.VisualBasic.ApplicationServices.StartupEventArgs e) { app = new App(); app.InitializeComponent(); MainWindow mainWindow = new MainWindow(); CapturedItemsListController.Create(mainWindow); app.Run(mainWindow); return false; }
public static void Main(string[] args) { if (args != null && args.Length > 0 && args[0] == "saveSystemPath") { BatchMode.SavePathFromTempFile(); } else { var app = new App(); app.Run(new MainWindow()); } }
static void RunApp(Container container) { try { App app = new App(); var mainWindow = container.GetInstance<MainWindow>(); app.Run(mainWindow); } catch(Exception ex) { //TODO: log it } }
public static void Main() { bool onlyInstance; var mutex = new Mutex(true, "UniqueGBlasonInstance", out onlyInstance); if (!onlyInstance) { return; } var app = new App(); app.InitializeComponent(); app.Run(); GC.KeepAlive(mutex); }
public static void Main(string[] arguments) { App myApp = new App(); MainWindow win = new MainWindow(); if (arguments.Length > 0) win.TargetUrl = new Uri(arguments[0]); if (!win.IsSingle()) Environment.Exit(0); Environment.ExitCode = myApp.Run(win); }
public static void Main(string[] args) { App app = new App(); System.Uri resourceLocater = new System.Uri("/Environment;component/app.xaml", System.UriKind.Relative); System.Windows.Application.LoadComponent(app, resourceLocater); using (ISplashScreen splashScreen = SplashScreenManager.CreateSplashScreen()) { splashScreen.SetContentObject(typeof(CustomSplashScreen)); // Perform loading Thread.Sleep(1000); } if (File.Exists(DataManager.iniPath)) { DataManager.LoadFromIniFile(); try { if (DataManager.AskOnStartup) { Config config = new Config(DataManager.ResourceFolder, DataManager.AskOnStartup, DataManager.settingsDictionary, DataManager.iniPath, app); config.ShowDialog(); } else { //MainWindow mainWindow = new MainWindow(); Wizard wizard = new Wizard(); app.Run(wizard); //app.Run(mainWindow); } } catch (Exception ex) { MessageBox.Show(string.Format("Explore.ini in \n {0} \n contains incorrect value", DataManager.iniPath), "Explore", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { DataManager.CreateDefaultIni(); MessageBox.Show("File .ini created. The application must be restarted", "Explore", MessageBoxButtons.OK, MessageBoxIcon.Question); Application.Exit(); return; } }
public static void Main(string[] args) { if (mutex.WaitOne(TimeSpan.Zero, true)) { App app = new App(); app.Run(); mutex.ReleaseMutex(); } else { System.Windows.MessageBox.Show("Solo una instancia de aplicación","Valida Backup FTP"); } }
public static void Main(string[] args) { if(mutex.WaitOne(TimeSpan.Zero, true)) { var app = new App(); app.Run(); mutex.ReleaseMutex(); } else { NativeMethods.PostMessage( (IntPtr)NativeMethods.HWND_BROADCAST, NativeMethods.WM_SHOWGITTOOLS, IntPtr.Zero, IntPtr.Zero); } }
public static void Main(string[] args) { var a = new App(); if (args != null) { var info = CreateStartupInfo(args); if (info != null) a.Properties["override"] = info; } a.InitializeComponent(); a.Run(); }
public static void Main(string[] args) { #if (DEBUG) args = "want to play minecraft".Split(' '); #endif availableGames = ConfigurationManager.AppSettings.AllKeys.Where(x => x.StartsWith("game-")).ToDictionary(x => x.Substring(5).Replace("-", " "), x => ConfigurationManager.AppSettings[x]); availableWatches = ConfigurationManager.AppSettings.AllKeys.Where(x => x.StartsWith("watch-")).ToDictionary(x => x.Substring(6).Replace("-", " "), x => ConfigurationManager.AppSettings[x]); int result = 10; if (ConfigurationManager.AppSettings["required"] != null) { int.TryParse(ConfigurationManager.AppSettings["required"], out result); } MainWindow.Required = result; if ((args != null) && (args.Length != 0)) { string str = string.Join(" ", args).ToLower(); if (str.StartsWith("want to play ")) { GameName = str.Substring("want to play ".Length); if (!availableGames.ContainsKey(GameName)) { Console.WriteLine("I do not know the game: " + str.Substring("want to play ".Length).Replace(" ", "-")); return; } } else if (str.StartsWith("want to watch ")) { WatchName = str.Substring("want to watch ".Length); if (!availableWatches.ContainsKey(WatchName)) { Console.WriteLine("I do not know the watch: " + str.Substring("want to watch ".Length).Replace(" ", "-")); return; } } else { Console.WriteLine("You must enter: I want to play [GAMENAME]"); Console.WriteLine("You must enter: I want to watch [WATCHNAME]"); return; } App app1 = new App(); app1.InitializeComponent(); app1.Run(); } else { Console.WriteLine("Liam, you must enter a game."); } }
public static void Main(string[] args) { if (args.Length == 2 && args[0] == "addver") { Console.WriteLine("addver"); //var file = @"D:\git-repo\git-hub\RpcLite-chrishaly\src\Aolyn\Aolyn.Data.Npgsql\Properties\AssemblyInfo.cs"; //AddAssemblyVersion(file); AddAssemblyVersion(args[1]); return; } var app = new App(); app.InitializeComponent(); app.Run(); }
public static void Main(string[] args) { var app = new App { ShutdownMode = ShutdownMode.OnLastWindowClose }; app.InitializeComponent(); var container = new Container(x=> x.AddRegistry<AppRegistry>()); var factory = container.GetInstance<WindowFactory>(); var window = factory.Create(); container.Configure(x => x.For<Dispatcher>().Add(window.Dispatcher)); //run start up jobs window.Show(); app.Run(); }
private static void RunApplication(Container container) { try { var app = new App(); var mainWindow = container.GetInstance<MainWindow>(); // InitializeComponent() must be called, or global resources (those defined in App.xaml) will not be loaded app.InitializeComponent(); app.Run(mainWindow); } catch (Exception ex) { //Log the exception and exit } }
public static void Main(string[] arguments) { var app = new App(); var resource = Resources.Simple_Styles_Default; using (var stringReader = new StringReader(resource)) using (var reader = XmlReader.Create(stringReader)) { app.Resources = (ResourceDictionary)XamlReader.Load(reader); } var window = new UI.MainWindow(); using (new AssemblyTester(window)) { app.Run(window); } }
static int Main(string[] args) { AppDomain.CurrentDomain.AssemblyResolve += OnResolveAssembly; int exitCode = 0; if (args.Length > 0) { RunConsole(args); } else { //normale WPF-Applikationslogik var app = new App(); app.InitializeComponent(); app.Run(); } return exitCode; }
private void FragebogenAnzeigen( dynamic jsonObject ) { // Liste an Fragen mit Antwortmöglichkeiten erstellen //var fragen = jsonObject.payload.Fragen as List<Befragung.Frage>; // TODO: Wir bauen uns erstmal ne dummy Liste, bis das json funktioniert. var fragen = new List<Befragung.Frage>(); fragen.Add(FrageErstellen("1", 3)); fragen.Add(FrageErstellen("2", 2)); // Liste in Befragung setzen var befragen = new Befragen(this) {Fragen = fragen}; // Befragung anzeigen var app = new App(); app.Run( befragen ); }