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

C# NotificationEventArgs类代码示例

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

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



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

示例1: PushChannel_ShellToastNotificationReceived

        private void PushChannel_ShellToastNotificationReceived(object sender, NotificationEventArgs e)
        {
            StringBuilder message = new StringBuilder();
            string relativeUri = string.Empty;

            message.AppendFormat("Received Toast {0}:\n", DateTime.Now.ToShortTimeString());

            // Parse out the information that was part of the message.
            foreach (string key in e.Collection.Keys)
            {
                message.AppendFormat("{0}: {1}\n", key, e.Collection[key]);

                if (string.Compare(
                    key,
                    "wp:Param",
                    System.Globalization.CultureInfo.InvariantCulture,
                    System.Globalization.CompareOptions.IgnoreCase) == 0)
                {
                    relativeUri = e.Collection[key];
                }
            }

            // Display a dialog of all the fields in the toast.
            Dispatcher.BeginInvoke(() => MessageBox.Show(message.ToString()));
        }
开发者ID:solondon,项目名称:VisualStudio2013andNETCookbookCode,代码行数:25,代码来源:MainPage.xaml.cs


示例2: PushJson

 /// <summary>
 /// Extract the JSON dictionary used to send this push.
 /// </summary>
 /// <param name="args">The args parameter passed to a push received event.</param>
 /// <returns>The JSON dictionary used to send this push.</returns>
 public static IDictionary<string, object> PushJson(NotificationEventArgs args) {
   string launchString = null;
   if (!args.Collection.TryGetValue("wp:Param", out launchString)) {
     return new Dictionary<string, object>();
   }
   return PushJson(launchString);
 }
开发者ID:cnbcyln,项目名称:Parse-SDK-dotNET,代码行数:12,代码来源:ParsePush.Phone.cs


示例3: PushChannel_ShellToastNotificationReceived

        private void PushChannel_ShellToastNotificationReceived(object sender, NotificationEventArgs e)
        {
            string message = String.Empty;
            string relativeUri = string.Empty;

            foreach (string key in e.Collection.Keys)
            {
                if (string.Compare(
                    key,
                    "wp:Param",
                    System.Globalization.CultureInfo.InvariantCulture,
                    System.Globalization.CompareOptions.IgnoreCase) == 0)
                {
                    relativeUri = e.Collection[key];
                }
            }

            message = $"{e.Collection["wp:Text1"]} diz: {e.Collection["wp:Text2"]}";

            Dispatcher.BeginInvoke(() => {
                if (MessageBox.Show(message, "Nova mensagem", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
                {
                    NavigationService.Navigate(new Uri(relativeUri, UriKind.Relative));
                }
            });
        }
开发者ID:felipemfp,项目名称:me-nota,代码行数:26,代码来源:PainelPage.xaml.cs


示例4: NotifyObserver

 public void NotifyObserver(HttpSessionState currentSession, bool isFinised)
 {
     const string message = "finished.";
     if (NotifyLogger != null) NotifyLogger(message); //+ "\n"
     var args = new NotificationEventArgs(currentSession, message, isFinised);
     OnAsyncNotificationEvent(args);//for web
 }
开发者ID:Letractively,项目名称:henoch,代码行数:7,代码来源:SubjectBase.cs


示例5: HttpChannelToastNotificationReceived

 public void HttpChannelToastNotificationReceived(object sender, NotificationEventArgs e)
 {
     var sb = new StringBuilder();
     foreach (var kvp in e.Collection)
     {
         sb.Append(string.Format("Key:{0} Value:{1}, ", kvp.Key, kvp.Value));
     }
     result = sb.ToString();
 }
开发者ID:timfel,项目名称:meet4xmas,代码行数:9,代码来源:NotificationTest.cs


示例6: OnNotificationReceived

	    private async void OnNotificationReceived(object sender, NotificationEventArgs httpNotificationEventArgs)
	    {
		    await Task.Run(() =>
		    {
			    _messageService.FetchMessages();
				_messageService.FetchContacts();
			});
            _messenger.Publish(new ContentReceivedMessage(this));
        }
开发者ID:QRyptoWire,项目名称:qrypto-wire,代码行数:9,代码来源:PhoneService.cs


示例7: httpChannel_ShellToastNotificationReceived

 void httpChannel_ShellToastNotificationReceived(object sender, NotificationEventArgs e)
 {
     string msg = string.Empty;
     foreach (var key in e.Collection.Keys)
     {
         msg += key + " : " + e.Collection[key] + Environment.NewLine;
     }
     Dispatcher.BeginInvoke(() =>
     msgTextBlock.Text = msg);
 }
开发者ID:peepo3663,项目名称:WindowsPhone8,代码行数:10,代码来源:MainPage.xaml.cs


示例8: channel_ShellToastNotificationReceived

        private void channel_ShellToastNotificationReceived(object sender, NotificationEventArgs e)
        {
            string message = "";
            foreach (var text in e.Collection.Values)
            {
                message += text + "\r\n";
            }

            Dispatcher.BeginInvoke(() => output.Text += message);
        }
开发者ID:follesoe,项目名称:WP7Demos,代码行数:10,代码来源:PushNotification.xaml.cs


示例9: PushChannel_ShellToastNotificationReceived

 private void PushChannel_ShellToastNotificationReceived(object sender, NotificationEventArgs e)
 {
     string message = e.Collection["wp:Text1"];
     IDictionary<string, string> data = null;
     if (e.Collection.ContainsKey("wp:Param") && e.Collection["wp:Param"] != null)
     {
         data = UrlQueryParser.ParseQueryString(e.Collection["wp:Param"]);
     }
     OnPushNotification(message, data);
 }
开发者ID:lholmquist,项目名称:aerogear-cordova-push,代码行数:10,代码来源:MpnsRegistration.cs


示例10: channel_ShellToastNotificationReceived

        void channel_ShellToastNotificationReceived(object sender, NotificationEventArgs e)
        {
            string title, content, parameter;
             e.Collection.TryGetValue("wp:Text1", out title);
             e.Collection.TryGetValue("wp:Text2", out content);
             e.Collection.TryGetValue("wp:Param", out parameter);

             string message = string.Format("Toast notification received.\nTitle: {0}\nContent: {1}\nParameter: {2}\n\n{3}",
             title, content, parameter, DateTime.Now);

             Dispatcher.BeginInvoke(() => notificationMessage.Text = message);
        }
开发者ID:timothybinkley,项目名称:Windows-Phone-8-In-Action,代码行数:12,代码来源:MainPage.xaml.cs


示例11: PushChannel_ShellToastNotificationReceived

        void PushChannel_ShellToastNotificationReceived(object sender, NotificationEventArgs e)
        {
            StringBuilder message = new StringBuilder();
            string relativeUri = string.Empty;

            Toast toast = new Toast();
            if (e.Collection.ContainsKey("wp:Text1"))
            {
                toast.Title = e.Collection["wp:Text1"];
            }
            if (e.Collection.ContainsKey("wp:Text2"))
            {
                toast.Subtitle = e.Collection["wp:Text2"];
            }
            if (e.Collection.ContainsKey("wp:Param"))
            {
                toast.Param = e.Collection["wp:Param"];
            }

            PluginResult result = new PluginResult(PluginResult.Status.OK, toast);

            Deployment.Current.Dispatcher.BeginInvoke(() =>
            {
                PhoneApplicationFrame frame = Application.Current.RootVisual as PhoneApplicationFrame;
                if (frame != null)
                {
                    PhoneApplicationPage page = frame.Content as PhoneApplicationPage;
                    if (page != null)
                    {
                        CordovaView cView = page.FindName("CordovaView") as CordovaView; // was: PGView
                        if (cView != null)
                        {
                            cView.Browser.Dispatcher.BeginInvoke((ThreadStart)delegate()
                            {
                                try
                                {
                                    cView.Browser.InvokeScript("execScript", this.toastCallback + "(" + result.Message + ")");
                                }
                                catch (Exception ex)
                                {
                                    Debug.WriteLine("ERROR: Exception in InvokeScriptCallback :: " + ex.Message);
                                }

                            });
                        }
                    }
                }
            });
        }
开发者ID:patilpreetam,项目名称:sanjib-svn-projects,代码行数:49,代码来源:PushPlugin.cs


示例12: pushChannel_ShellToastNotificationReceived

        private void pushChannel_ShellToastNotificationReceived(object sender, NotificationEventArgs e)
        {
            foreach (var key in e.Collection.Keys)
            {
                Debug.WriteLine("Key: " + key);
            }

            if (e.Collection.ContainsKey("wp:Param"))
            {
                IDictionary<string, string> parameters = ParseQueryString(e.Collection["wp:Param"]);
                string subscriptionId = parameters["subscriptionId"];
                string devicePin = parameters["devicePin"];

                SubscriptionNotificationManager.SendNewSubscriptionReceivedEvents(subscriptionId, devicePin);
            }
        }
开发者ID:tomasmcguinness,项目名称:AzureManager,代码行数:16,代码来源:App.xaml.cs


示例13: pushChannel_ShellToastNotificationReceived

		private void pushChannel_ShellToastNotificationReceived(object sender, NotificationEventArgs e)
		{
			if (SubscriptionReceived != null)
			{
				SubscriptionReceived(this, null);
			}
		}
开发者ID:tomasmcguinness,项目名称:AzureManager,代码行数:7,代码来源:AddSubscriptionViewModel.cs


示例14: httpChannel_ShellToastNotificationReceived

        void httpChannel_ShellToastNotificationReceived(object sender, NotificationEventArgs e)
        {
            App.Trace("===============================================");
            App.Trace("Toast/Tile notification arrived:");

            string msg = e.Collection["wp:Text2"];

            App.Trace(msg);
            UpdateStatus("Toast/Tile message: " + msg);

            App.Trace("===============================================");
        }
开发者ID:xiaya1986,项目名称:PushNotificationExercise,代码行数:12,代码来源:PushHandler.cs


示例15: httpChannel_ShellToastNotificationReceived

 void httpChannel_ShellToastNotificationReceived(object sender, NotificationEventArgs e)
 {
     Dispatcher.BeginInvoke(() =>
     {
         Debug.WriteLine("Toast Notification Message Received: ");
         if (e.Collection != null)
         {
             Dictionary<string, string> collection = (Dictionary<string, string>)e.Collection;
             
             foreach (string elementName in collection.Keys)
             {
                 Debug.WriteLine(string.Format("Key: {0}, Value:{1}\r\n", elementName, collection[elementName]));
             }
         }
     });
 }
开发者ID:BinaryWasteland,项目名称:ClientContactInformation-WP7,代码行数:16,代码来源:Settings.xaml.cs


示例16: CurrentChannel_ShellToastNotificationReceived

        private void CurrentChannel_ShellToastNotificationReceived(object sender, NotificationEventArgs e)
        {
            var nodeValues = e.Collection;

            var title = nodeValues.ContainsKey("wp:Text1") ? nodeValues["wp:Text1"] : string.Empty;
            var message = nodeValues.ContainsKey("wp:Text2") ? nodeValues["wp:Text2"] : string.Empty;

            var notification = new NotificationResult { Title = title, Message = message };
            if (nodeValues.ContainsKey("wp:Param"))
            {
                var queryDict = ParseQueryString(nodeValues["wp:Param"]);
                foreach (var entry in queryDict)
                {
                    if (entry.Key == TITLE_PARAMETER_KEY)
                    {
                        notification.Title = entry.Value; // prefer the title found in parameters
                    }
                    else if (entry.Key == MESSAGE_PARAMETER_KEY)
                    {
                        notification.Message = entry.Value; // prefer the message found in parameters
                    }
                    else
                    {
                        notification.AdditionalData.Add(entry.Key, entry.Value);
                    }
                }
                notification.AdditionalData.Add(FOREGROUND_ADDITIONAL_DATA, true);
            }

            NotifyNotification(notification);
        }
开发者ID:webratio,项目名称:phonegap-plugin-push,代码行数:31,代码来源:PushPlugin.cs


示例17: OnNotification

 private void OnNotification(object sender, NotificationEventArgs e)
 {
     if (!string.IsNullOrEmpty(e.ID))
         _Subscriptions.Remove(StringUtils.GuidDecode(e.ID));
 }
开发者ID:CreatorDev,项目名称:DeviceServer,代码行数:5,代码来源:DALSubscriptions.cs


示例18: httpChannel_ShellToastNotificationReceived

        /// <summary>
        /// Event signaled when a toast notification arrives
        /// </summary>
        /// <param name="sender">The sending object</param>
        /// <param name="e">The event arguments</param>
        private void httpChannel_ShellToastNotificationReceived(object sender, NotificationEventArgs e)
        {
            Trace("===============================================");
            Trace("Toast notification arrived:");

            if ((NotificationFlag & NotificationFlagType.Toast) != NotificationFlagType.Toast)
            {
                Trace("Toast notifications not active");
                Trace("===============================================");
                return;
            }

            foreach (var key in e.Collection.Keys)
            {
                string msg = e.Collection[key];

                Trace(key + ": " + msg);
                UpdateStatus("Toast/Tile message: " + msg);
            }

            Trace("===============================================");

            //
            // Display the toast text notifications
            //

            if (e.Collection.ContainsKey("wp:Text1"))
                this.NotifyData.Text1 = e.Collection["wp:Text1"];
            if (e.Collection.ContainsKey("wp:Text2"))
                this.NotifyData.Text2 = e.Collection["wp:Text2"];
        }
开发者ID:Reagankm,项目名称:onebusaway-windows-phone,代码行数:36,代码来源:TripService.cs


示例19: pushChannel_ShellToastNotificationReceived

 static void pushChannel_ShellToastNotificationReceived(object sender, NotificationEventArgs e)
 {
     ZumoWP8PushTests.toastPushesReceived.Enqueue(e);
 }
开发者ID:nchejara,项目名称:azure-mobile-services,代码行数:4,代码来源:ZumoWP8PushTests.cs


示例20: UpdateFeedThread

        private void UpdateFeedThread()
        {
            try {
                NotificationEventArgs fargs = new NotificationEventArgs();
                fargs.Message = "Updating feed: "+updating_feed.Name;
                Gtk.Application.Invoke(this, fargs, OnNotify);

                bool update = updating_feed.Update();

                if ( update ) {
                    NotificationEventArgs args = new NotificationEventArgs();
                    args.Message = updating_feed.Name+" has new items.";
                    Gtk.Application.Invoke(this, args, OnNotify);
                } else {
                    NotificationEventArgs args = new NotificationEventArgs();
                    args.Message = updating_feed.Name+" has no new items.";
                    Gtk.Application.Invoke(this, args, new EventHandler(OnNotify));
                }
            } catch ( NullReferenceException ) {}
        }
开发者ID:wfarr,项目名称:newskit,代码行数:20,代码来源:Summa.Core.Updater.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# NotificationType类代码示例发布时间:2022-05-24
下一篇:
C# Notification类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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