Пример #1
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();
        }
Пример #2
0
        private Program1()
        {
            m_app = new App();

            //this applies the XAML, e.g. StartupUri, Application.Resources
            m_app.InitializeComponent();
        }
Пример #3
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();
		}
Пример #4
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;
        }
Пример #5
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);
 }
Пример #6
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();
        }
Пример #7
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.");
     }
 }
Пример #8
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();
        }
Пример #9
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();
        }
Пример #10
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
            }
        }
Пример #11
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;
        }
Пример #12
0
 public static void Main()
 {
     bool otherEPOSIsNotRunning = false;
     AppMutex = new Mutex(false, APPLICATION_NAME, out otherEPOSIsNotRunning);
     if (AppMutex.WaitOne(0, false))
     {
         LoginView loginView = new LoginView();
         loginView.ShowDialog();
         if (loginView.DialogResult.Equals(true))
         {
             loginView.Close();
             App app = new App();
             app.InitializeComponent();
             app.Run();
         }
     }
 }
Пример #13
0
 public AppRunner()
 {
     appThread = new Thread(delegate()
     {
         try
         {
             app = new App();
             app.Properties["override"] = info;
             app.InitializeComponent();
             app.Run();
         }
         catch (Exception x)
         {
             capturedException = x;
         }
     });
     appThread.SetApartmentState(ApartmentState.STA);
 }
Пример #14
0
		static void Main()
		{
			App app = new App
			{
				ShutdownMode = ShutdownMode.OnExplicitShutdown
			};
			app.InitializeComponent(); 
			SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext());

			Program4a p = new Program4a();
			p.ExitRequested += (sender, e) =>
			{
				app.Shutdown();
			};
			Task programStart = p.StartAsync();

			app.Run();
		}
Пример #15
0
        public static void Main(string[] args)
        {
            var app = new App { ShutdownMode = ShutdownMode.OnLastWindowClose };
            app.InitializeComponent();

            var tempWindowToGetDispatcher = new Window();

            var container = new Container(x => x.AddRegistry<AppRegistry>());
            container.Configure(x => x.For<Dispatcher>().Add(tempWindowToGetDispatcher.Dispatcher));
            container.GetInstance<StartupController>();

            var factory = container.GetInstance<WindowFactory>();
            var window = factory.Create(args);
            tempWindowToGetDispatcher.Close();

            var layoutServce = container.GetInstance<ILayoutService>();

            var appStatePublisher = container.GetInstance<IApplicationStatePublisher>();
            app.Exit += (sender, e) => appStatePublisher.Publish(ApplicationState.ShuttingDown);
            window.Show();
            app.Run();
        }
Пример #16
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 tabSet = new TabSet();
            var mainWindow = new MainWindow
            {
                DataContext = tabSet
            };
            container.Configure(x => x.For<Dispatcher>().Add(mainWindow.Dispatcher));
            tabSet.Contents.Add(new HeaderedItemViewModel
            {
                Header = "TRADES",
                Content = container.GetInstance<LiveTradesViewer>()
            });
            tabSet.Contents.Add(new HeaderedItemViewModel
            {
                Header = "MARKET",
                Content = container.GetInstance<MarketDataViewer>()
            });
            tabSet.Contents.Add(new HeaderedItemViewModel
            {
                Header = "ABOUT",
                Content = container.GetInstance<About>()
            });
            mainWindow.Show();

            //run start up jobs
            var priceUpdater = container.GetInstance<TradePriceUpdateJob>();
            var tradeGenerator = container.GetInstance<TradeGeneratorJob>();

            app.Run();

            priceUpdater.Dispose();
        }
Пример #17
0
 public static void Main(string[] args)
 {            
     var app = new App {ShutdownMode = ShutdownMode.OnLastWindowClose};
     app.InitializeComponent();
     
     new BasicExampleMainWindow
     {
         DataContext = new BasicExampleMainModel()
     }.Show();                                      
         
     var boundExampleModel = new BoundExampleModel(
         new HeaderedItemViewModel { Header = "Fixed", Content = "There is a dragablz:DragablzItemsControl.FixedItemCount of 1, so this header is fixed!" },
         new HeaderedItemViewModel { Header = "MDI Demo", Content = new MdiExample() },
         new HeaderedItemViewModel { Header = "Layout Info", Content = new LayoutManagementExample { DataContext = new LayoutManagementExampleViewModel()} },
         new HeaderedItemViewModel { Header = new CustomHeaderViewModel { Header = "Header"}, Content = "This tab illustrates how an individual header can be customised, without having to change the DragablzItem tab header template." },                
         new HeaderedItemViewModel { Header = "Tues", Content = "Tuesday's child is full of grace" }//,
         //new HeaderedItemViewModel { Header = "Wed", Content = "Wednesday's child is full of woe" }//,
         //new HeaderedItemViewModel { Header = "Thu", Content = "Thursday's child has far to go" },
         //new HeaderedItemViewModel { Header = "Fri", Content = "Friday's child loving and giving" }//,
         //new HeaderedItemViewModel { Header = "Sat", Content = "Saturday's child works hard for a living" },
         //new HeaderedItemViewModel { Header = "Sun", Content = "Sunday's child is awkwardly not fitting into this demo" }                 
         );            
     boundExampleModel.ToolItems.Add(
         new HeaderedItemViewModel { Header = "January", Content = "Welcome to the January tool/float item." });
     boundExampleModel.ToolItems.Add(
         new HeaderedItemViewModel { Header = "July", Content = "Welcome to the July tool/float item." });             
                
     new BoundExampleWindow()
     {
         DataContext = boundExampleModel
     }.Show();
     
     new QuickStartWindow().Show();
     
     app.Run();
 }
        public void DisponibilizaPratoAoCliente(string pedido)
        {
            //Inicialização de variaveis para a entrega
            bool bombaLigada;
            bool pistaoAcionado;
            bool poteAcoplado;
            bool motorLigado;
            bool giroRealizado;
            bool pedidoRecebido;

            //Verifica se o pedido é nulo
            if (pedido != null || pedido != "")
            {
                Console.WriteLine();
                Console.WriteLine("--- Iniciando Controle de Entrega de Pedido ---");
                //Liga a bomba hidraulica
                bombaLigada = LigaBomba();
                //Liga o motor que irá realizar o giro da garra
                motorLigado = LigaMotorParaGiroDaGarra();
                //Checa se a bomba foi ligada
                if (bombaLigada)
                {
                    //Aciona o pistão que empurra o pote ate a garra
                    pistaoAcionado = AcionaPistaoComGarra();
                    if (pistaoAcionado)
                    {
                        //Acopla os potes enviados pelo pistão ate a garra
                        poteAcoplado = AcoplaPotesNaGarra();
                        if (poteAcoplado)
                        {
                            //realiza o giro para posicionar o pote na garra e receber a massa e toppins da frigideira
                            giroRealizado = RealizaGiroDoMotor(motorLigado);
                            //Recebe a massa e toppings da frigideira
                            pedidoRecebido = RecebePedidoPreparadoDaFrigideira(pedido);
                            giroRealizado = false;
                            if (pedidoRecebido)
                            {
                                //Realiza mais um giro para disponibilizar o pote com o pedido para o cliente
                                giroRealizado = RealizaGiroDoMotor(motorLigado);
                                //Libera o pedido da garra, para o cliente
                                LiberaGarraComPedido(giroRealizado);

                            }
                        }
                    }
                }
                Console.WriteLine("Enviando Pedido Para Tela");

                //Escreve um arquivo txt com o pedido para ser exibido em tela
                EntregaReader.EscreverEntrega(pedido);

                //Cria um novo domínio pois WPFs não podem possuir mais de uma instancia no mesmo dominio
                var domain = AppDomain.CreateDomain(Guid.NewGuid().ToString());
                
                //Delega a ação no novo dominio
                CrossAppDomainDelegate action = () =>
                {
                    //Cria uma thread pois o WPF trabalha com STAthreads
                    var thread = new Thread(() =>
                    {
                        //Cria um novo objeto do tipo WPF controleDeEntrega
                        App ped = new App();
                        ped.InitializeComponent();
                        ped.Run();
                    });
                    //Indica o tipo de thread
                    thread.SetApartmentState(ApartmentState.STA);
                    //Inicia a thread
                    thread.Start();
                };
                //Chama a nova ação do novo dominio, inicia o ShellViewModel do Controle de Entrega
                domain.DoCallBack(action);

                Console.WriteLine("--- Finalizando o Controle de Entrega de Pedido ---");
            }
        }
Пример #19
0
        public static void Main()
        {
            _messageProvider = new BasicMessageProvider();//enable basic message provider

            //open settings
            _settings = Settings.Load();
            _competition = Competition.Load();

            //start wpf application thread
            var application = new App();
            application.Exit += Application_Exit;
            application.InitializeComponent();
            application.Run();
        }
Пример #20
0
		public void FixtureSetup()
		{
			_app = new App();
			_app.InitializeComponent();
		}