當前位置: 首頁>>代碼示例>>C#>>正文


C# App.InitializeComponent方法代碼示例

本文整理匯總了C#中System.App.InitializeComponent方法的典型用法代碼示例。如果您正苦於以下問題:C# App.InitializeComponent方法的具體用法?C# App.InitializeComponent怎麽用?C# App.InitializeComponent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.App的用法示例。


在下文中一共展示了App.InitializeComponent方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Main

        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();
        }
開發者ID:sk8tz,項目名稱:TradingDemo,代碼行數:25,代碼來源:BootStrap.cs

示例2: Program1

        private Program1()
        {
            m_app = new App();

            //this applies the XAML, e.g. StartupUri, Application.Resources
            m_app.InitializeComponent();
        }
開發者ID:ittray,項目名稱:LocalDemo,代碼行數:7,代碼來源:Program1.cs

示例3: Main

		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();
		}
開發者ID:ittray,項目名稱:LocalDemo,代碼行數:10,代碼來源:Program.cs

示例4: OnStartup

        // 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;
        }
開發者ID:deadtrickster,項目名稱:wpfklip,代碼行數:12,代碼來源:Program.cs

示例5: Main

 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);
 }
開發者ID:grathad,項目名稱:GBlason,代碼行數:13,代碼來源:MainWindow.xaml.cs

示例6: Main

        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();
        }
開發者ID:flq,項目名稱:SoftLattice,代碼行數:14,代碼來源:Program.cs

示例7: Main

 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.");
     }
 }
開發者ID:revenz,項目名稱:iLiam,代碼行數:49,代碼來源:EntryPoint.cs

示例8: Main

        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();
        }
開發者ID:chrishaly,項目名稱:RpcLite,代碼行數:15,代碼來源:Program.cs

示例9: Main

        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();
        }
開發者ID:WELL-E,項目名稱:TailBlazer,代碼行數:15,代碼來源:BootStrap.cs

示例10: RunApplication

        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
            }
        }
開發者ID:tiesont,項目名稱:AppDock,代碼行數:16,代碼來源:Program.cs

示例11: Main

        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;
        }
開發者ID:kazyx,項目名稱:SvgToXaml,代碼行數:17,代碼來源:Program.cs

示例12: Main

 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();
         }
     }
 }
開發者ID:njmube,項目名稱:SIQPOS,代碼行數:17,代碼來源:Program.cs

示例13: AppRunner

 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);
 }
開發者ID:flq,項目名稱:SoftLattice,代碼行數:18,代碼來源:AppRunner.cs

示例14: Main

		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();
		}
開發者ID:ittray,項目名稱:LocalDemo,代碼行數:18,代碼來源:Program4a.cs

示例15: Main

        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();
        }
開發者ID:mgnslndh,項目名稱:TailBlazer,代碼行數:22,代碼來源:BootStrap.cs


注:本文中的System.App.InitializeComponent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。