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


C# NotificationEventArgs类代码示例

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


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


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