当前位置: 首页>>代码示例>>C#>>正文


C# App.Run方法代码示例

本文整理汇总了C#中System.App.Run方法的典型用法代码示例。如果您正苦于以下问题:C# App.Run方法的具体用法?C# App.Run怎么用?C# App.Run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.App的用法示例。


在下文中一共展示了App.Run方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

        static void Main(string[] args)
        {
            App app = new App();
            app.Run();

            Console.ReadLine();
        }
开发者ID:syrotkin,项目名称:algdesign,代码行数:7,代码来源:Program.cs

示例2: 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

示例3: Main

        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();
                }
            }
        }
开发者ID:jsulak,项目名称:Switcheroo,代码行数:28,代码来源:Program.cs

示例4: Main

 static void Main()
 {
     App app = new App();
     app.MainWindow = new MainWindow();
     app.MainWindow.Show();
     app.Run();
 }
开发者ID:siderevs,项目名称:ZippedImageViewer,代码行数:7,代码来源:Startup.cs

示例5: Main

        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
                    {

                    }
                }
            }
        }
开发者ID:cpm2710,项目名称:cellbank,代码行数:32,代码来源:Program.cs

示例6: Main

        static void Main(string[] args)
        {
            CLayer = new ControlLayer();
            MWindow = new MainWindow();

            App app = new App();
            app.Run(MWindow);
        }
开发者ID:yiend,项目名称:mnncs,代码行数:8,代码来源:Program.cs

示例7: Main

        static void Main()
        {
            App a = new App();

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

            a.Run(wnd);
        }
开发者ID:redfix,项目名称:Sinoptik,代码行数:8,代码来源:StartApp.cs

示例8: RunApp

        public void RunApp()
        {
            var app = new App();

            app.Run();

            app.Shutdown();
        }
开发者ID:TurmCoder,项目名称:Wunschzettel,代码行数:8,代码来源:ClientTest.cs

示例9: Main

 static void Main(string[] args)
 {
     App myApp = new App();
     lock (myApp)
     {
       myApp.Run(args);
     }
 }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:8,代码来源:Main.cs

示例10: Main

        static void Main(string[] args)
        {
            //Application.EnableVisualStyles();
            //Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(FrmMain);

            App myApp = new App();
            myApp.Run(args);
        }
开发者ID:nateo,项目名称:BeanCounter,代码行数:9,代码来源:Program.cs

示例11: StartApplication

        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));
        }
开发者ID:NomadPL,项目名称:Nomad,代码行数:10,代码来源:WpfMainApplication.cs

示例12: Main

 static void Main(string[] args)
 {
     if (args.Length == 0)
     {
         App app = new App();
         app.MainWindow = new Window1();
         app.MainWindow.Show();
         app.Run();
     }
 }
开发者ID:cyclops1982,项目名称:K2RolesImportExport,代码行数:10,代码来源:Startup.cs

示例13: 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

示例14: Main

 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);
 }
开发者ID:shayhibah,项目名称:WorkItApp,代码行数:11,代码来源:Program.cs

示例15: 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


注:本文中的System.App.Run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。