Пример #1
0
        static void Main(string[] args)
        {
            App app = new App();
            app.Run();

            Console.ReadLine();
        }
Пример #2
0
        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();
        }
Пример #3
0
        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();
                }
            }
        }
Пример #4
0
 static void Main()
 {
     App app = new App();
     app.MainWindow = new MainWindow();
     app.MainWindow.Show();
     app.Run();
 }
Пример #5
0
        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
                    {

                    }
                }
            }
        }
Пример #6
0
        static void Main(string[] args)
        {
            CLayer = new ControlLayer();
            MWindow = new MainWindow();

            App app = new App();
            app.Run(MWindow);
        }
Пример #7
0
        static void Main()
        {
            App a = new App();

            View.MainWindow wnd = new View.MainWindow();

            a.Run(wnd);
        }
Пример #8
0
        public void RunApp()
        {
            var app = new App();

            app.Run();

            app.Shutdown();
        }
Пример #9
0
 static void Main(string[] args)
 {
     App myApp = new App();
     lock (myApp)
     {
       myApp.Run(args);
     }
 }
Пример #10
0
        static void Main(string[] args)
        {
            //Application.EnableVisualStyles();
            //Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(FrmMain);

            App myApp = new App();
            myApp.Run(args);
        }
Пример #11
0
        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));
        }
Пример #12
0
 static void Main(string[] args)
 {
     if (args.Length == 0)
     {
         App app = new App();
         app.MainWindow = new Window1();
         app.MainWindow.Show();
         app.Run();
     }
 }
Пример #13
0
		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();
		}
Пример #14
0
 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);
 }
Пример #15
0
        // 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;
        }
Пример #16
0
		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());
			}
		}
Пример #17
0
 static void RunApp(Container container)
 {
     try
     {
         App app = new App();
         var mainWindow = container.GetInstance<MainWindow>();
         app.Run(mainWindow);
     }
     catch(Exception ex)
     {
         //TODO: log it
     }
 }
Пример #18
0
 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);
 }
Пример #19
0
        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);
        }
Пример #20
0
        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");
            }
        }
Пример #22
0
 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);
     }
 }
Пример #23
0
        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();
        }
Пример #24
0
 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.");
     }
 }
Пример #25
0
        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();
        }
Пример #26
0
        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();
        }
Пример #27
0
        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
            }
        }
Пример #28
0
        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);
            }
        }
Пример #29
0
        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;
        }
Пример #30
0
        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 );
        }