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


C# StartKind类代码示例

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


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

示例1: OnStartAsync

        // runs only when not restored from state
        public async override Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
        {
            // Handle toast activation
            if (args is ToastNotificationActivatedEventArgs)
            {
                var toastActivationArgs = args as ToastNotificationActivatedEventArgs;

                // Parse the query string
                QueryString arguments = QueryString.Parse(toastActivationArgs.Argument);

                // See what action is being requested 
                switch (arguments["action"])
                {
                    case "openurl":
                        var url = arguments["url"];
                        await Launcher.LaunchUriAsync(new Uri(url));
                        break;
                    case "showtemperature":
                        var temperature = arguments["temperature"];
                        NavigationService.Navigate(typeof(Views.NotificationsPage), temperature);
                        break;
                    case "gettingfar":
                        var distance = arguments["distance"];
                        NavigationService.Navigate(typeof(Views.NotificationsPage), distance);
                        break;
                }
            }

            if (NavigationService.CurrentPageType != typeof(Views.MainPage))
                NavigationService.Navigate(typeof(Views.MainPage));
        }
开发者ID:gk-8,项目名称:Beacon-Insights,代码行数:32,代码来源:App.xaml.cs

示例2: OnStartAsync

        // runs only when not restored from state
        public override async Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
        {

            // set hamburger menu to full screen mode on Mobile devices.
            if (DeviceUtils.Current().IsPhone())
                Views.Shell.HamburgerMenu.IsFullScreen = true;

            if (!AuthHelper.IsCachedCredentialsAvailable())
            {
                Debug.WriteLine("App.OnStartAsync() : no cached credentials available, loading login page...");
                NavigationService.Navigate(typeof(Views.LoginPage));
            }
            else
            {
                Debug.WriteLine("App.OnStartAsync() : cached credentials found, bypassing login page...");
                await AuthHelper.AuthenticateAsync();
                if (Settings.IsAlreadyConfigured)
                {
                    Debug.WriteLine("App.OnStartAsync() : already set up, skipping to MainPage...");
                    NavigationService.Navigate(typeof(Views.MainPage));
                }
                else
                {
                    Debug.WriteLine("App.OnStartAsync() : not configured, starting setup wizard...");
                    NavigationService.Navigate(typeof(Views.SetupWizardHomePage));
                }
            }
            
            
            
        }
开发者ID:SupernovaApps,项目名称:PetrolheadUWP,代码行数:32,代码来源:App.xaml.cs

示例3: OnStartAsync

        public override async Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
        {
            // long-running startup tasks go here

            NavigationService.Navigate(typeof(Views.MainPage));
            await Task.CompletedTask;
        }       
开发者ID:ericsnap,项目名称:Template10,代码行数:7,代码来源:App.xaml.cs

示例4: OnStartAsync

		// runs only when not restored from state
		public override Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
		{
			// navigate to first page
			NavigationService.Navigate(typeof(Views.MainPage));

			return Task.CompletedTask;
		}
开发者ID:CodingNinjaOctocat,项目名称:Template10,代码行数:8,代码来源:App.xaml.cs

示例5: OnStartAsync

        public override Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
        {
            // long-running startup tasks go here
            db = new DataService();

            db.createDB();

            foreach (var device in db.DevicesTable)
            {
                IDevice dev = DeviceTypeFactory.MakeDevice(device.FirmwareName, device);

                dev.DeviceDetails.Status = DeviceStatus.Missing;

                devices.Add(dev);
            }

            NavigationService.Navigate(typeof(Views.MainPage));

            ssdpClient.Search();
            wifiClient.Search();

            searchTimer.Tick += SearchTimer_Tick;
            searchTimer.Interval = new TimeSpan(0, 1, 0);
            searchTimer.Start();


            return Task.CompletedTask;
        }
开发者ID:mikehole,项目名称:internet-of-esp-things,代码行数:28,代码来源:App.xaml.cs

示例6: OnStartAsync

        public override async Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
        {
            GoogleAnalytics.EasyTracker.GetTracker().SendEvent("Lifecycle", startKind.ToString(), null, 0);
            bool isNewLaunch = args.PreviousExecutionState == ApplicationExecutionState.NotRunning;
            if (isNewLaunch)
            {
                await InitLibrary();

                var nav = new MergedNavigationService(NavigationService);
                nav.Configure(ViewModelLocator.SplashPageKey, typeof(Pages.SplashScreen));
                nav.Configure(ViewModelLocator.FrontPageKey, typeof(FrontPage));
                nav.Configure(ViewModelLocator.SubGalleryPageKey, typeof(SubGalleryPage));
                nav.Configure(ViewModelLocator.SubredditBrowserPageKey, typeof(SubredditBrowserPage));
                nav.Configure(ViewModelLocator.BrowserPageKey, typeof(BrowserPage));
                if (!SimpleIoc.Default.IsRegistered<GalaSoft.MvvmLight.Views.INavigationService>())
                    SimpleIoc.Default.Register<GalaSoft.MvvmLight.Views.INavigationService>(() => nav);
                SimpleIoc.Default.Register<IViewModelLocator>(() => ViewModelLocator.GetInstance());
                SimpleIoc.Default.Register<RemoteDeviceHelper>();
            }
            JObject navigationParam = new JObject();
            navigationParam["isNewLaunch"] = isNewLaunch;
            if (args is ProtocolActivatedEventArgs)
            {
                var protoArgs = args as ProtocolActivatedEventArgs;
                if (args.Kind == ActivationKind.Protocol)
                    navigationParam["url"] = protoArgs.Uri.AbsoluteUri;
            }
            Portable.Helpers.StateHelper.SessionState["LaunchData"] = navigationParam;
            SimpleIoc.Default.GetInstance<GalaSoft.MvvmLight.Views.INavigationService>().NavigateTo(ViewModelLocator.SplashPageKey);
        }
开发者ID:akshay2000,项目名称:MonocleGiraffe,代码行数:30,代码来源:App.xaml.cs

示例7: OnStartAsync

        public override Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
        {
            if (args.Kind == ActivationKind.VoiceCommand)
            {
                var result = (args as VoiceCommandActivatedEventArgs).Result;
                var properties = result.SemanticInterpretation.Properties
                    .ToDictionary(x => x.Key, x => x.Value);

                var command = result.RulePath.First();
                if (command.Equals("FreeTextCommand"))
                {
                    // get spoken text
                    var text = properties.First(x => x.Key.Equals("textPhrase")).Value[0];

                    // remember to handle response appropriately
                    var mode = properties.First(x => x.Key.Equals("commandMode")).Value;
                    if (mode.Equals("voice")) { /* okay to speak */ }
                    else { /* not okay to speak */ }

                    // update value
                    ViewModels.MainPageViewModel.Instance.Value = text;
                }
                else { /* unexpected command */ }
            }
            else
            {
                NavigationService.Navigate(typeof(Views.MainPage));
            }
			return Task.CompletedTask;
		}
开发者ID:Kryptryx,项目名称:Template10,代码行数:30,代码来源:App.xaml.cs

示例8: OnStartAsync

 public override async Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
 {
     CoreApp.Initialize(Services.LocationServices.LocationService.Current, Services.DataServices.ProtoDataService.Current);
     await Task.Delay(500);
     NavigationService.Navigate(typeof(Views.MainPage));
     await Task.CompletedTask;
 }
开发者ID:RareNCool,项目名称:Renttracker,代码行数:7,代码来源:App.xaml.cs

示例9: OnStartAsync

        // runs only when not restored from state
        public override async Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
        {
            await Task.Delay(50);

            if (_settings.FirstRun)
            {
                Window.Current.Activate();
            }
            else
            {
                NavigationService.Navigate(typeof(Views.MainPage));
            }

            if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
            {
                var statusBar = StatusBar.GetForCurrentView();

                if (statusBar != null)
                {
                    statusBar.BackgroundOpacity = 1;
                    statusBar.BackgroundColor = (Color)Application.Current.Resources["AccentColour"];
                    statusBar.ForegroundColor = Colors.White;
                }
            }
        }
开发者ID:alexhardwicke,项目名称:Auth,代码行数:26,代码来源:App.xaml.cs

示例10: OnStartAsync

        public override async Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
        {
            await ViewModelController.RefreshLibrary();
            await ViewModelController.RefreshCollections();

            NavigationService.Navigate(typeof(Views.MainPage));
            await Task.CompletedTask;
        }
开发者ID:RareNCool,项目名称:EPubReader,代码行数:8,代码来源:App.xaml.cs

示例11: OnStartAsync

        /// <summary>
        /// The OnStartAsync implementation.
        /// </summary>
        /// <remarks>
        /// Runs only when not restored from a state.
        /// </remarks>
        /// <param name="startKind">The kind of App start.</param>
        /// <param name="args">The arguments from the activation.</param>
        /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
        public override async Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
        {
            // Perform any long-running load
            await Task.Delay(0);

            // Navigate to the first page inside the shell
            this.NavigationService.Navigate(Pages.Main);
        }
开发者ID:cryssis,项目名称:DungeonMasterVault,代码行数:17,代码来源:App.xaml.cs

示例12: OnStartAsync

        // runs only when not restored from state
        public override async Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
        {
            // perform long-running load
            await Task.Delay(0);

            // navigate to first page
            NavigationService.Navigate(typeof(Views.MainPage));
        }
开发者ID:timothius2005,项目名称:Template10,代码行数:9,代码来源:App.xaml.cs

示例13: OnStartAsync

 public override async Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
 {
     string arguments = string.Empty;
     if (DetermineStartCause(args) == AdditionalKinds.JumpListItem)
     {
         arguments = (args as LaunchActivatedEventArgs).Arguments;
         FileReceived?.Invoke(this, arguments);
     }
     NavigationService.Navigate(typeof(Views.MainPage), arguments);
 }
开发者ID:ericsnap,项目名称:Template10,代码行数:10,代码来源:App.xaml.cs

示例14: OnStartAsync

        public override Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
        {
            if ((args.Kind == ActivationKind.Launch) && ((args as LaunchActivatedEventArgs)?.PrelaunchActivated ?? false))
            {
                // update pre-launch live tile
            }

            // start the user experience
            NavigationService.Navigate(typeof(Views.MainPage));
            return Task.FromResult<object>(null);
        }
开发者ID:dinhchitrung,项目名称:Template10,代码行数:11,代码来源:App.xaml.cs

示例15: OnStartAsync

        // runs only when not restored from state
        public override async Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
        {
            // perform long-running load
            await Task.Delay(0);

            // navigate to first page
            if (SettingsService.Instance.UserInteractionMode == false)
                NavigationService.Navigate(typeof(Views.MainPageHandleld));
            else
                NavigationService.Navigate(typeof(Views.MainPageTeam));
        }
开发者ID:gsantopaolo,项目名称:BingImageSearchSample,代码行数:12,代码来源:App.xaml.cs


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