private void Comments_Click(object sender, RoutedEventArgs e) { Menu.name = "Comments"; Frame.Navigate(typeof(WebPage)); //点击留言板按钮的统计 JYAnalytics.TrackEvent("Comments"); }
/// <summary> /// 在此页将要在 Frame 中显示时进行调用。 /// </summary> /// <param name="e">描述如何访问此页的事件数据。 /// 此参数通常用于配置页。</param> protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); //注意,应用从挂起恢复时不会调用此方法 //为了保证数据完整性,此方法可灵活放置在恢复页面的事件中(如页面onload事件),请确保和TrackPageEnd成对使用并避免重复调用 JYAnalytics.TrackPageStart("Help_Page"); }
private void QQLive_Click(object sender, RoutedEventArgs e) { Menu.name = "QQLive"; Frame.Navigate(typeof(ADPage)); //点击腾讯视频按钮的统计 JYAnalytics.TrackEvent("腾讯视频"); }
private void WangYiYun_Click(object sender, RoutedEventArgs e) { Menu.name = "WangYiYun"; Frame.Navigate(typeof(ADPage)); //点击网易云音乐按钮的统计 JYAnalytics.TrackEvent("网易云音乐"); }
private void PPTV_Click(object sender, RoutedEventArgs e) { Menu.name = "PPTV"; Frame.Navigate(typeof(ADPage)); //点击PPTV聚力按钮的统计 JYAnalytics.TrackEvent("PPTV聚力"); }
//音乐类 private void XiaMi_Click(object sender, RoutedEventArgs e) { Menu.name = "XiaMi"; Frame.Navigate(typeof(ADPage)); //点击虾米音乐按钮的统计 JYAnalytics.TrackEvent("虾米音乐"); }
private void QQMusic_Click(object sender, RoutedEventArgs e) { Menu.name = "QQMusic"; Frame.Navigate(typeof(ADPage)); //点击QQ音乐按钮的统计 JYAnalytics.TrackEvent("QQ音乐"); }
//下载类 private void Thunder_Click(object sender, RoutedEventArgs e) { Menu.name = "Thunder"; Frame.Navigate(typeof(ADPage)); //点击迅雷按钮的统计 JYAnalytics.TrackEvent("迅雷"); }
private void MangGuo_Click(object sender, RoutedEventArgs e) { Menu.name = "MangGuo"; Frame.Navigate(typeof(ADPage)); //点击芒果TV按钮的统计 JYAnalytics.TrackEvent("芒果TV"); }
private void KanKan_Click(object sender, RoutedEventArgs e) { Menu.name = "KanKan"; Frame.Navigate(typeof(ADPage)); //点击响巢看看按钮的统计 JYAnalytics.TrackEvent("响巢看看"); }
private void QQXuanFeng_Click(object sender, RoutedEventArgs e) { Menu.name = "QQXuanFeng"; Frame.Navigate(typeof(ADPage)); //点击QQ旋风按钮的统计 JYAnalytics.TrackEvent("QQ旋风"); }
private void BaoFeng_Click(object sender, RoutedEventArgs e) { Menu.name = "BaoFeng"; Frame.Navigate(typeof(ADPage)); //点击暴风影音按钮的统计 JYAnalytics.TrackEvent("暴风影音"); }
private void YouKu_Click(object sender, RoutedEventArgs e) { Menu.name = "YouKu"; Frame.Navigate(typeof(ADPage)); //点击优酷按钮的统计 JYAnalytics.TrackEvent("优酷"); }
private void KuWo_Click(object sender, RoutedEventArgs e) { Menu.name = "KuWo"; Frame.Navigate(typeof(ADPage)); //点击酷我按钮的统计 JYAnalytics.TrackEvent("酷我音乐"); }
//视频类 private void Iqiyi_Click(object sender, RoutedEventArgs e) { Menu.name = "Iqiyi"; Frame.Navigate(typeof(ADPage)); //点击爱奇艺按钮的统计 JYAnalytics.TrackEvent("爱奇艺"); }
private async void Ture_Click(object sender, RoutedEventArgs e) { //隐藏确认按钮,避免多次点击 Ture_Button.Visibility = Visibility.Collapsed; int Hours = 0; //点击设置推送按钮的统计 JYAnalytics.TrackEvent("Push"); if (on_off == "开") { try { for (int i = 1; i <= 7; i++) { Hours = Hours + 24; XmlDocument xdoc = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText01); var txtnodes = xdoc.GetElementsByTagName("text"); txtnodes[0].InnerText = "快来看看账号有没有更新吧!"; ScheduledToastNotification toast3 = new ScheduledToastNotification(xdoc, DateTimeOffset.Now.AddHours(Hours)); ToastNotificationManager.CreateToastNotifier().AddToSchedule(toast3); } } catch (Exception ex) { Windows.UI.Popups.MessageDialog messageDialog = new Windows.UI.Popups.MessageDialog("设置成功!"); await messageDialog.ShowAsync(); } } }
private void BaiduWenku_Click(object sender, RoutedEventArgs e) { Menu.name = "BaiduWenku"; Frame.Navigate(typeof(ADPage)); //点击百度云按钮的统计 JYAnalytics.TrackEvent("百度文库"); }
private void EveryPiano_Click(object sender, RoutedEventArgs e) { Menu.name = "EveryPiano"; Frame.Navigate(typeof(ADPage)); //点击人人钢琴按钮的统计 JYAnalytics.TrackEvent("人人钢琴"); }
private void LeShi_Click(object sender, RoutedEventArgs e) { Menu.name = "LeShi"; Frame.Navigate(typeof(ADPage)); //点击乐视视频按钮的统计 JYAnalytics.TrackEvent("乐视"); }
/// <summary> /// 在将要挂起应用程序执行时调用。 在不知道应用程序 /// 无需知道应用程序会被终止还是会恢复, /// 并让内存内容保持不变。 /// </summary> /// <param name="sender">挂起的请求的源。</param> /// <param name="e">有关挂起请求的详细信息。</param> private async void OnSuspending(object sender, SuspendingEventArgs e) { var deferral = e.SuspendingOperation.GetDeferral(); await JYAnalytics.StartTrackAsync(ApiHelper.JyAppkey); //TODO: 保存应用程序状态并停止任何后台活动 deferral.Complete(); }
/// <summary> /// 在将要挂起应用程序执行时调用。 在不知道应用程序 /// 无需知道应用程序会被终止还是会恢复, /// 并让内存内容保持不变。 /// </summary> /// <param name="sender">挂起的请求的源。</param> /// <param name="e">有关挂起请求的详细信息。</param> private async void OnSuspending(object sender, SuspendingEventArgs e) { var deferral = e.SuspendingOperation.GetDeferral(); //TODO: 保存应用程序状态并停止任何后台活动 await JYAnalytics.EndTrackAsync(); //需注意此处代码位置不可更改 deferral.Complete(); }
protected override void OnNavigatedFrom(NavigationEventArgs e) { //注意:以下几种情形不会调用此方法: //1.首页按“后退”键 //2.应用挂起时 //为了保证数据完整性,此方法可灵活放置在跳转页面(离开页面)或离开应用的事件中,请确保和TrackPageStart成对使用并避免重复调用 base.OnNavigatedFrom(e); JYAnalytics.TrackPageEnd("AD_Page"); }
/// <summary> /// 在此页将要在 Frame 中显示时进行调用。 /// </summary> /// <param name="e">描述如何访问此页的事件数据。 /// 此参数通常用于配置页。</param> protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); //注意,应用从挂起恢复时不会调用此方法 //为了保证数据完整性,此方法可灵活放置在恢复页面的事件中(如页面onload事件),请确保和TrackPageEnd成对使用并避免重复调用 JYAnalytics.TrackPageStart("AD_Page"); HttpRequestMessage httpRequestMessage = new HttpRequestMessage(HttpMethod.Post, new Uri("http://s.moreplay.cn/index.php?c=app&a=puyuetian_htmlpage:index&htmlname=info_page")); httpRequestMessage.Headers.Append("User-Agent", "Mozilla/5.0 (Linux;Android 6.0;zh-cn) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Edge/15.15063"); // ad.NavigateWithHttpRequestMessage( // httpRequestMessage); }
/// <summary> /// 在此页将要在 Frame 中显示时进行调用。 /// </summary> /// <param name="e">描述如何访问此页的事件数据。 /// 此参数通常用于配置页。</param> protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); //注意,应用从挂起恢复时不会调用此方法 //为了保证数据完整性,此方法可灵活放置在恢复页面的事件中(如页面onload事件),请确保和TrackPageEnd成对使用并避免重复调用 JYAnalytics.TrackPageStart("Main_Page"); HttpRequestMessage httpRequestMessage = new HttpRequestMessage(HttpMethod.Post, new Uri("http://s.moreplay.cn")); httpRequestMessage.Headers.Append("User-Agent", "Mozilla/5.0 (Linux; U; Android 6.0; zh-cn;) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 Chrome/37.0.0.0 Browser/7.6 Mobile Safari/537.36"); ad.NavigateWithHttpRequestMessage( httpRequestMessage); }
public static void SendToast(Exception ex, Type source) { if (ex == null) { throw new ArgumentNullException(nameof(ex)); } var sourceString = source?.ToString() ?? "null"; #if DEBUG Debug.WriteLine(ex, "Exception"); #else JYAnalytics.TrackError($"Exception {ex.HResult:X8}: {ex.GetType().ToString()} at {sourceString}"); HockeyClient.Current.TrackException(ex); #endif SendToast(ex.GetMessage(), source); }
public static IAsyncOperation <bool> RequestLogOn() { return(Run(async token => { var succeed = await new LogOnDialog().ShowAsync() == ContentDialogResult.Primary && !Client.Current.NeedLogOn; JYAnalytics.TrackEvent("LogOnRequested", $"Result: {(!succeed ? "Succeed" : "Failed")}"); Microsoft.AppCenter.Analytics.Analytics.TrackEvent("Log on requested", new Dictionary <string, string> { ["Result"] = (succeed ? "Succeed" : "Failed") }); UpdateUserInfo(succeed); if (succeed) { Settings.SettingCollection.Current.Apply(); } return succeed; })); }
private void Ture_Click(object sender, RoutedEventArgs e) { int Hours = 0; //点击设置推送按钮的统计 JYAnalytics.TrackEvent("Push"); for (int i = 1; i <= 7; i++) { Hours = Hours + 24; XmlDocument xdoc = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText01); var txtnodes = xdoc.GetElementsByTagName("text"); txtnodes[0].InnerText = "快来看看账号有没有更新吧!"; ScheduledToastNotification toast3 = new ScheduledToastNotification(xdoc, DateTimeOffset.Now.AddHours(Hours)); ToastNotificationManager.CreateToastNotifier().AddToSchedule(toast3); } }
protected override async void OnFileActivated(FileActivatedEventArgs args) { StartModel par = new StartModel() { StartType = StartTypes.File, Par3 = args.Files }; Frame rootFrame = Window.Current.Content as Frame; if (rootFrame == null) { rootFrame = new Frame(); Window.Current.Content = rootFrame; } if (rootFrame.Content == null) { rootFrame.Navigate(typeof(MainPage), par); } // 确保当前窗口处于活动状态 Window.Current.Activate(); rootFrame.Navigate(typeof(MainPage), par); await JYAnalytics.StartTrackAsync(ApiHelper.JyAppkey); }
/// <summary> /// 在应用程序由最终用户正常启动时进行调用。 /// 当启动应用程序以打开特定的文件或显示时使用 /// 搜索结果等 /// </summary> /// <param name="e">有关启动请求和过程的详细信息。</param> protected async override void OnLaunched(LaunchActivatedEventArgs e) { //初始化九幽数据统计插件,appkey(密钥)请登陆九幽后台获取:http://www.windows.sc,可以替换成你的appkey在demo中测试 //为保证数据的完整和准确性,请尽量在OnLaunched中优先调用此方法 await JYAnalytics.StartTrackAsync("6d97ca1a3adb2853dad982d20d37dc95"); //初始化更新和公告插件,appkey请登陆九幽开发者后台获取http://www.windows.sc await JYUpdateSDK.JYUpdateManager.UpdateInitialize("6d97ca1a3adb2853dad982d20d37dc95", false); #if DEBUG if (System.Diagnostics.Debugger.IsAttached) { this.DebugSettings.EnableFrameRateCounter = true; } #endif Frame rootFrame = Window.Current.Content as Frame; // 不要在窗口已包含内容时重复应用程序初始化, // 只需确保窗口处于活动状态 if (rootFrame == null) { // 创建要充当导航上下文的框架,并导航到第一页 rootFrame = new Frame(); // TODO: 将此值更改为适合您的应用程序的缓存大小 rootFrame.CacheSize = 1; if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) { // TODO: 从之前挂起的应用程序加载状态 } // 将框架放在当前窗口中 Window.Current.Content = rootFrame; } if (rootFrame.Content == null) { #if WINDOWS_PHONE_APP // 删除用于启动的旋转门导航。 if (rootFrame.ContentTransitions != null) { this.transitions = new TransitionCollection(); foreach (var c in rootFrame.ContentTransitions) { this.transitions.Add(c); } } rootFrame.ContentTransitions = null; rootFrame.Navigated += this.RootFrame_FirstNavigated; #endif // 当导航堆栈尚未还原时,导航到第一页, // 并通过将所需信息作为导航参数传入来配置 // 参数 if (!rootFrame.Navigate(typeof(SplashPage), e.Arguments)) { throw new Exception("Failed to create initial page"); } } // 确保当前窗口处于活动状态 Window.Current.Activate(); }
private void SouHu_Click(object sender, RoutedEventArgs e) { Menu.name = "SouHu"; Frame.Navigate(typeof(ADPage)); JYAnalytics.TrackEvent("搜狐视频"); }