當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。