• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Windows.StartupEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



StartupEventArgs类属于System.Windows命名空间,在下文中一共展示了StartupEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OnStartup

        protected override void OnStartup(StartupEventArgs e)
        {
            try
            {
                AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
                Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException;

                SoftphoneEngine model = new SoftphoneEngine();

                MainWindow_1 window = new MainWindow_1(model);
                window.Show();
            }
            catch (Exception ex)
            {
                StringBuilder sb = new StringBuilder();
                sb.Append("Could not initialize softphone: \r\n");
                sb.Append(ex.Message);
                sb.Append("\r\n");
                sb.Append(ex.InnerException);
                sb.Append(ex.StackTrace);
                MessageBox.Show(sb.ToString());
                Application.Current.Shutdown();
            }

            base.OnStartup(e);
        }
开发者ID:linkinheroes,项目名称:OzekiDemoSoftphoneWPF,代码行数:26,代码来源:App.xaml.cs


示例2: Application_Startup

 private void Application_Startup(object sender, StartupEventArgs e)
 {
     //Application.Current.Resources.MergedDictionaries.Clear();
     //ResourceDictionary resource = (ResourceDictionary)Application.LoadComponent(
     //        new Uri("Dictionary1.xaml", UriKind.Relative));
     //Application.Current.Resources.MergedDictionaries.Add(resource);
 }
开发者ID:srdgame,项目名称:wpf_test,代码行数:7,代码来源:App.xaml.cs


示例3: Application_Startup

        private void Application_Startup(object sender, StartupEventArgs e)
        {
            // Global exception handling
            Current.DispatcherUnhandledException += AppDispatcherUnhandledException;

            string procName = Process.GetCurrentProcess().ProcessName;
            // get the list of all processes by that name

            Process[] processes = Process.GetProcessesByName(procName);

            if (processes.Length > 1)
            {
                MessageBox.Show(TranslationStrings.LabelApplicationAlreadyRunning);
                Shutdown(-1);
                return;
            }

            ThemeManager.AddAccent("Astro", new Uri("pack://application:,,,/CameraControl;component/Resources/AstroAccent.xaml"));
            ThemeManager.AddAppTheme("Black", new Uri("pack://application:,,,/CameraControl;component/Resources/AstroTheme.xaml"));

            ServiceProvider.Branding = Branding.LoadBranding();
            if (ServiceProvider.Branding.ShowStartupScreen)
            {
                _startUpWindow=new StartUpWindow();
                _startUpWindow.Show();
            }

            Task.Factory.StartNew(InitApplication);
        }
开发者ID:btugade,项目名称:digiCamControl,代码行数:29,代码来源:App.xaml.cs


示例4: OnStartup

        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            CommandingBootstrapper bootstrapper = new CommandingBootstrapper();
            bootstrapper.Run();
        }
开发者ID:eslahi,项目名称:prism,代码行数:7,代码来源:App.xaml.cs


示例5: OnStartup

        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            MainWindow window = new MainWindow();

            // Create the ViewModel to which
            // the main window binds.
            var viewModel = new ViewModel.MainWindowViewModel();

            // When the ViewModel asks to be closed,
            // close the window.
            EventHandler handler = (sender, e2) =>
            {
                window.Close();
            };

            viewModel.RequestClose += handler;
            viewModel.RequestClosed += (sender, e3) =>
                {
                    viewModel.RequestClose -= handler;
                };

            // Allow all controls in the window to
            // bind to the ViewModel by setting the
            // DataContext, which propagates down
            // the element tree.
            window.DataContext = viewModel;

            window.Show();
        }
开发者ID:Leonoo,项目名称:CleanEstimate,代码行数:31,代码来源:App.xaml.cs


示例6: OnStartup

        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            //for install plugin command when wox didn't start up
            //we shouldn't init MainWindow, just intall plugin and exit.
            if (e.Args.Length > 0 && e.Args[0].ToLower() == "installplugin")
            {
                var path = e.Args[1];
                if (!File.Exists(path))
                {
                    MessageBox.Show("Plugin " + path + " didn't exist");
                    return;
                }
                PluginInstaller.Install(path);
                Environment.Exit(0);
                return;
            }

            window = new MainWindow();
            if (e.Args.Length == 0 || e.Args[0].ToLower() != "hidestart")
            {
                window.ShowApp();
            }

            window.ParseArgs(e.Args);
        }
开发者ID:Rovak,项目名称:Wox,代码行数:27,代码来源:App.xaml.cs


示例7: OnStartup

        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            linkIO = LinkIOImp.Instance;

            if (!Directory.Exists(Data.NineFolder))
            {
                Directory.CreateDirectory(Data.NineFolder);
            }

            currentWindow = new MainWindow();
#if START_ON_MAINPAGE
            // Connect user as a Teacher
            new UserConnection().Connection.Execute(0);

            // If a Lesson exists, go to MainPage
            var nineFiles = Directory.GetFiles(Data.NineFolder.ToString(), "*.nine", SearchOption.AllDirectories);
            if (nineFiles.Length > 0)
            {
                FileStream serializedLesson = new FileStream(nineFiles[0], FileMode.Open);
                Data.Instance.Lesson = (Lessons.Lesson)(new BinaryFormatter()).Deserialize(serializedLesson);
                serializedLesson.Close();
                Catalog.Instance.NavigateTo("MainPage");
            }
            // Else go to HomePage (to create a Lesson)
            else
            {
                Catalog.Instance.NavigateTo("HomePage");
            }
#else
            Catalog.Instance.NavigateTo("UserConnectionPage");
#endif
            currentWindow.Show();

        }
开发者ID:aragoubi,项目名称:Nine,代码行数:35,代码来源:App.xaml.cs


示例8: Application_Startup

        private void Application_Startup(object sender, StartupEventArgs e)
        {

            Csla.DataPortal.ProxyTypeName = "Csla.DataPortalClient.WcfProxy, Csla";
            Csla.DataPortalClient.WcfProxy.DefaultUrl = "http://localhost:3390/ChildGrandChildWeb/WcfPortal.svc";
            this.RootVisual = new Page();
        }
开发者ID:nschonni,项目名称:csla-svn,代码行数:7,代码来源:App.xaml.cs


示例9: OnStartup

        protected override void OnStartup(StartupEventArgs e)
        {
            PlatformService.Instance = this;
            Config config = Config.Load();

            if(!config.UseWebServices) {
                string connectionString = String.Format("Server = {0}; Database = {1}; Uid = {2};",
                    config.DatabaseServer, config.DatabaseName, config.DatabaseUser);
                IDatabase db = null;
                try {
                    db = new MYSQLDatabase(connectionString);
                } catch(Exception ex) {
                    PlatformService.Instance.ShowErrorMessage(
                        "Could not connect to database '" + connectionString + "'\n\n" + ex.Message,
                        "Database connection failure");
                    Environment.Exit(-1);
                }
                SharedServices.Init(db);
            }
            else
            {
                var client = new RestClient(config.WebServiceBase);
                SharedServices.Init(client);
            }

            base.OnStartup(e);
        }
开发者ID:Ethon,项目名称:mcflurry_simulator,代码行数:27,代码来源:App.xaml.cs


示例10: OnStartup

 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     string langPath = "/lang/zh.xaml";
     App.Current.Resources.MergedDictionaries.Clear();
     App.Current.Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = new Uri(langPath, UriKind.RelativeOrAbsolute) });
 }
开发者ID:dalinhuang,项目名称:loosoft,代码行数:7,代码来源:App.xaml.cs


示例11: App_OnStartup

 private void App_OnStartup(object sender, StartupEventArgs e)
 {
     Updater.Run();
     ErrorSelectionWindow = new ErrorSelectionWindow();
     ErrorSelectionWindow.Show();
     ErrorSelectionWindow.Topmost = true;
 }
开发者ID:MaddoPls,项目名称:Leaguesharp,代码行数:7,代码来源:App.xaml.cs


示例12: OnApplicationStartup

        /// <summary>
        /// Handles the Startup event of the Application control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.StartupEventArgs"/> instance containing the event data.</param>
        private void OnApplicationStartup(object sender, StartupEventArgs e)
        {
            Catel.Windows.StyleHelper.CreateStyleForwardersForDefaultStyles();

            var serviceLocator = ServiceLocator.Default;
            serviceLocator.RegisterType<IViewLocator, ViewLocator>();
            var viewLocator = serviceLocator.ResolveType<IViewLocator>();
            viewLocator.NamingConventions.Add("[UP].Views.[VM]");
            viewLocator.NamingConventions.Add("[UP].Views.LogicInBehavior.[VM]");
            viewLocator.NamingConventions.Add("[UP].Views.LogicInBehavior.[VM]View");
            viewLocator.NamingConventions.Add("[UP].Views.LogicInBehavior.[VM]Window");
            viewLocator.NamingConventions.Add("[UP].Views.LogicInViewBase.[VM]");
            viewLocator.NamingConventions.Add("[UP].Views.LogicInViewBase.[VM]View");
            viewLocator.NamingConventions.Add("[UP].Views.LogicInViewBase.[VM]Window");

            serviceLocator.RegisterType<IViewModelLocator, ViewModelLocator>();
            var viewModelLocator = serviceLocator.ResolveType<IViewModelLocator>();
            viewModelLocator.NamingConventions.Add("Catel.Examples.AdvancedDemo.ViewModels.[VW]ViewModel");

            // Register several different external IoC containers for demo purposes
            IoCHelper.MefContainer = new CompositionContainer();
            IoCHelper.UnityContainer = new UnityContainer();
            serviceLocator.RegisterExternalContainer(IoCHelper.MefContainer);
            serviceLocator.RegisterExternalContainer(IoCHelper.UnityContainer);

            RootVisual = new MainPage();
        }
开发者ID:nix63,项目名称:Catel.Examples,代码行数:32,代码来源:App.xaml.cs


示例13: OnStartup

        /// <summary>
        /// Raises the <see cref="E:System.Windows.Application.Startup"/> event.
        /// </summary>
        /// <param name="e">A <see cref="T:System.Windows.StartupEventArgs"/> that contains the event data.</param>
        protected override void OnStartup(StartupEventArgs e)
        {
#if DEBUG
            Catel.Logging.LogManager.AddDebugListener(true);

            var logPath = Path.Combine(GetType().Assembly.GetDirectory(), "debug.log");
            LogManager.AddListener(new FileLogListener(logPath, 25 * 1024));
#endif

            //var consoleLogListener = new ConsoleLogListener();
            //consoleLogListener.IgnoreCatelLogging = true;
            //LogManager.AddListener(consoleLogListener);

            Console.WriteLine(typeof(ILicenseService));

            StyleHelper.CreateStyleForwardersForDefaultStyles();

            var serviceLocator = ServiceLocator.Default;
            var languageService = serviceLocator.ResolveType<ILanguageService>();

            //languageService.PreferredCulture = new CultureInfo("nl-NL");
            //languageService.FallbackCulture = new CultureInfo("en-US");

            languageService.PreloadLanguageSources();

            base.OnStartup(e);
        }
开发者ID:llenroc,项目名称:Orc.LicenseManager,代码行数:31,代码来源:App.xaml.cs


示例14: OnStartup

        protected override void OnStartup(StartupEventArgs e)
        {
            var handle = IntPtr.Zero;
            var className = new StringBuilder(1024);
            for(;;)
            {
                handle = WinApi.FindWindowEx(IntPtr.Zero, handle, null, "LyncMsg");
                if (handle == IntPtr.Zero)
                    break;

                if (WinApi.GetClassName(handle, className, 1024) <= 0)
                    continue;

                if (className.ToString().IndexOf("[LyncMsg.exe") >= 0)
                    break;
            }

            if (handle == IntPtr.Zero)
            {
                base.OnStartup(e);
                return;
            }
            if (WinApi.IsWindowVisible(handle) && (WinApi.IsIconic(handle) || WinApi.GetForegroundWindow() != handle))
                WinApi.SwitchToThisWindow(handle, true);
            else
                WinApi.ShowWindow(handle, WinApi.WindowShowStyle.SwShow);
            Current.Shutdown();
        }
开发者ID:hufuman,项目名称:lyncmsg,代码行数:28,代码来源:App.xaml.cs


示例15: Application_Startup

        private void Application_Startup(object sender, StartupEventArgs e)
        {
            try
            {
                // Deployed applications must be licensed at the Basic level or greater (https://developers.arcgis.com/licensing).
                // To enable Basic level functionality set the Client ID property before initializing the ArcGIS Runtime.
                // ArcGISRuntimeEnvironment.ClientId = "<Your Client ID>";

                // Initialize the ArcGIS Runtime before any components are created.
                ArcGISRuntimeEnvironment.Initialize();

                // Standard level functionality can be enabled once the ArcGIS Runtime is initialized.                
                // To enable Standard level functionality you must either:
                // 1. Allow the app user to authenticate with ArcGIS Online or Portal for ArcGIS then call the set license method with their license info.
                // ArcGISRuntimeEnvironment.License.SetLicense(LicenseInfo object returned from an ArcGIS Portal instance)
                // 2. Call the set license method with a license string obtained from Esri Customer Service or your local Esri distributor.
                // ArcGISRuntimeEnvironment.License.SetLicense("<Your License String or Strings (extensions) Here>");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "ArcGIS Runtime initialization failed.");

                // Exit application
                this.Shutdown();
            }
        }
开发者ID:rvinc66,项目名称:ArcGISRuntimeBook,代码行数:26,代码来源:App.xaml.cs


示例16: Application_Startup

 private void Application_Startup(object sender, StartupEventArgs e)
 {
     if (e.Args.Length > 0)
     {
         this.Properties["GamePath"] = e.Args[0];
     }
 }
开发者ID:vlad-zapp,项目名称:3diModManager,代码行数:7,代码来源:App.xaml.cs


示例17: App_Startup

 void App_Startup(object sender, StartupEventArgs e)
 {
     Window = new MainWindow();
     SubscribeToWindowEvents();
     MainWindow = Window;
     Window.Show();
 }
开发者ID:paulomouat,项目名称:spikes,代码行数:7,代码来源:App.xaml.cs


示例18: OnStartup

        /// <summary>
        /// Override the startup behavior to handle files dropped on the app icon.
        /// </summary>
        /// <param name="e">
        /// The StartupEventArgs.
        /// </param>
        protected override void OnStartup(StartupEventArgs e)
        {
            OperatingSystem OS = Environment.OSVersion;
            if ((OS.Platform == PlatformID.Win32NT) && (OS.Version.Major == 5 && OS.Version.Minor <= 1))
            {
                MessageBox.Show("Windows XP and earlier are no longer supported. Version 0.9.9 was the last version to support these versions. ", "Notice", MessageBoxButton.OK, MessageBoxImage.Warning);
                Application.Current.Shutdown();
                return;
            }

            if (e.Args.Any(f => f.Equals("--reset")))
            {
                HandBrakeApp.ResetToDefaults();
                Application.Current.Shutdown();
                return;
            }

            if (e.Args.Any(f => f.Equals("--auto-start-queue")))
            {
                StartupOptions.AutoRestartQueue = true;
            }

            base.OnStartup(e);

            // If we have a file dropped on the icon, try scanning it.
            string[] args = e.Args;
            if (args.Any() && (File.Exists(args[0]) || Directory.Exists(args[0])))
            {
                IMainViewModel mvm = IoC.Get<IMainViewModel>();
                mvm.StartScan(args[0], 0);
            }
        }
开发者ID:2wayne,项目名称:HandBrake,代码行数:38,代码来源:App.xaml.cs


示例19: OnStartup

        protected override void OnStartup(StartupEventArgs e)
        {
            if (AppDomain.CurrentDomain.SetupInformation.ActivationArguments != null &&
                AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData != null &&
                AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData.Length > 0)
            {
                try
                {
                    string fname = AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData[0];

                    // It comes in as a URI; this helps to convert it to a path.
                    var uri = new Uri(fname);
                    fname = uri.LocalPath;

                    Properties["OpenFile"] = fname;
                }
                catch (Exception ex)
                {
                    // For some reason, this couldn't be read as a URI.
                    // Do what you must...
                }
            }

            BCCL.MvvmLight.Threading.TaskFactoryHelper.Initialize();
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            base.OnStartup(e);
        }
开发者ID:skulldownz,项目名称:Terraria-Map-Editor,代码行数:27,代码来源:App.xaml.cs


示例20: OnStartup

 private void OnStartup(object sender, StartupEventArgs e)
 {
     // Create the ViewModel and expose it using the View's DataContext
     Views.MainView view = new Views.MainView();
     view.DataContext = new ViewModels.MainViewModel();
     view.Show();
 }
开发者ID:walterscarborough,项目名称:distributed-test-environment,代码行数:7,代码来源:App.xaml.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Windows.Style类代码示例发布时间:2022-05-26
下一篇:
C# Windows.SplashScreen类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap