当前位置: 首页>>代码示例>>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;未经允许,请勿转载。