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())); }
/// <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); }
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 }
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)); } }); }
private async void OnNotificationReceived(object sender, NotificationEventArgs httpNotificationEventArgs) { await Task.Run(() => { _messageService.FetchMessages(); _messageService.FetchContacts(); }); _messenger.Publish(new ContentReceivedMessage(this)); }
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(); }
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); }
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); }
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); }
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); }
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); } }); } } } }); }
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); } }
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("==============================================="); }
void channel_ShellToastNotificationReceived(object sender, NotificationEventArgs e) { //MessageBox.Show("Toast Received"); }
void eventHandler(Object data) { MyEvent ev = data as MyEvent; if (ev != null) { NotificationEventArgs e = ev.e_; switch (ev.operation_) { case 0: //insert { System.Console.WriteLine("Inserted: " + e.EntityName + "(" + e.RecID.ToString() + "):" + (e.ConfObject == null ? "no object" : e.ConfObject.ToString())); ActiveConnection ac = e.ConfObject as ActiveConnection; if (ac != null) { System.Console.WriteLine("AttachedData(" + ac.AttachedData.Count.ToString() + "):"); foreach (KeyValuePair <String, String> kvp in ac.AttachedData) { System.Console.WriteLine(kvp.Key + "=" + kvp.Value); } } if (e.EntityName == "REGISTRATION") { DN dn = e.ConfObject as DN; foreach (RegistrarRecord rr in dn.GetRegistrarContactsEx()) { System.Console.WriteLine(rr.ToString() + "\nExpites=" + rr.Expires.ToString()); } } } break; case 1: { System.Console.WriteLine("Updated: " + e.EntityName + "(" + e.RecID.ToString() + "):" + (e.ConfObject == null ? "no object" : e.ConfObject.ToString())); ActiveConnection ac = e.ConfObject as ActiveConnection; if (ac != null) { System.Console.WriteLine("AttachedData(" + ac.AttachedData.Count.ToString() + "):"); foreach (KeyValuePair <String, String> kvp in ac.AttachedData) { System.Console.WriteLine(kvp.Key + "=" + kvp.Value); } } if (e.EntityName == "REGISTRATION") { DN dn = e.ConfObject as DN; foreach (RegistrarRecord rr in dn.GetRegistrarContactsEx()) { System.Console.WriteLine(rr.ToString() + "\nExpites=" + rr.Expires.ToString()); } } } break; case 2: { System.Console.WriteLine("Deleted: " + e.EntityName + "(" + e.RecID.ToString() + "):" + (e.ConfObject == null ? "no object" : e.ConfObject.ToString())); ActiveConnection ac = e.ConfObject as ActiveConnection; if (ac != null) { System.Console.WriteLine("AttachedData(" + ac.AttachedData.Count.ToString() + "):"); foreach (KeyValuePair <String, String> kvp in ac.AttachedData) { System.Console.WriteLine(kvp.Key + "=" + kvp.Value); } } if (e.EntityName == "REGISTRATION") { DN dn = e.ConfObject as DN; foreach (RegistrarRecord rr in dn.GetRegistrarContactsEx()) { System.Console.WriteLine(rr.ToString() + "\nExpites=" + rr.Expires.ToString()); } } } break; default: break; } } }
private void OnNotificationReceived(NotificationEventArgs e) { switch (e.NotificationType) { case ConsoleNotificationType.GameLoaded: CheatCodes.ApplyCheats(); this.BeginInvoke((Action)(() => { UpdateDebuggerMenu(); ctrlRecentGames.Visible = false; SaveStateManager.UpdateStateMenu(mnuLoadState, false); SaveStateManager.UpdateStateMenu(mnuSaveState, true); RomInfo romInfo = EmuApi.GetRomInfo(); this.Text = "Mesen-S - " + romInfo.GetRomName(); if (DebugWindowManager.HasOpenedWindow) { DebugWorkspaceManager.GetWorkspace(); } })); break; case ConsoleNotificationType.BeforeEmulationStop: this.Invoke((Action)(() => { DebugWindowManager.CloseAll(); })); break; case ConsoleNotificationType.GameResumed: this.BeginInvoke((Action)(() => { //Ensure mouse is hidden when game is resumed CursorManager.OnMouseMove(ctrlRenderer); })); break; case ConsoleNotificationType.EmulationStopped: this.BeginInvoke((Action)(() => { this.Text = "Mesen-S"; UpdateDebuggerMenu(); ShowGameScreen(GameScreenMode.RecentGames); ResizeRecentGames(); if (_displayManager.ExclusiveFullscreen) { _displayManager.SetFullscreenState(false); } })); break; case ConsoleNotificationType.ResolutionChanged: this.BeginInvoke((Action)(() => { _displayManager.UpdateViewerSize(); })); break; case ConsoleNotificationType.ExecuteShortcut: this.BeginInvoke((Action)(() => { _shortcuts.ExecuteShortcut((EmulatorShortcut)e.Parameter); })); break; case ConsoleNotificationType.MissingFirmware: this.Invoke((Action)(() => { MissingFirmwareMessage msg = (MissingFirmwareMessage)Marshal.PtrToStructure(e.Parameter, typeof(MissingFirmwareMessage)); FirmwareHelper.RequestFirmwareFile(msg); })); break; } }
private new void OnCurrentAsycudaDocumentChanged(object sender, NotificationEventArgs <AsycudaDocument> e) { Task.Run(() => { LoadDataFromAdoc(QuerySpace.CoreEntities.ViewModels.BaseViewModel.Instance.CurrentAsycudaDocumentSetEx, e.Data).Wait(); }); }
public void OnUpdate(NotificationEventArgs e) { UpdateEvent?.Invoke(this, e); }
private void OnNotification(object sender, NotificationEventArgs e) { if (!string.IsNullOrEmpty(e.ID)) _Subscriptions.Remove(StringUtils.GuidDecode(e.ID)); }
private void SendNotification(object sender, NotificationEventArgs e) { Task mailTask = MailSenderService.SendMailAsync(e.mailTo, e.mailTitle, e.mailContent, e.remindLogId); }
private void Notification_UpdateEvent(object sender, NotificationEventArgs e) { Update(); }
private void SendWcfCommandHelper_WcfNotification(object sender, NotificationEventArgs e) { OnNotification(new NotificationEventArgs(e.Notification)); }
protected virtual void OnNotification(NotificationEventArgs e) { Notification?.Invoke(this, e); }
private void emailSubscriptionConnection_OnNotificationEvent(object sender, NotificationEventArgs args) { try { foreach (var notificationEvent in args.Events) { if (notificationEvent is ItemEvent) // event was an item event { var itemEvent = (ItemEvent)notificationEvent; var message = EmailMessage.Bind(EmailHelper.InstanceOf.GetEmailService, itemEvent.ItemId, EmailHelper.EmailProperties ); var parentFolder = itemEvent.ParentFolderId; switch (itemEvent.EventType) { case EventType.Status: break; case EventType.NewMail: var newMailThread = new System.Threading.Thread(x => ProcessNewMail(message)); newMailThread.Start(); break; case EventType.Deleted: break; case EventType.Modified: break; case EventType.Moved: // break; case EventType.Copied: //EmailHelper.InstanceOf.RewriteSender(message); break; case EventType.Created: break; case EventType.FreeBusyChanged: break; default: throw new Exception("Invalid value for EventType"); } } else // the event was a folder event { var folderEvent = (FolderEvent)notificationEvent; switch (folderEvent.EventType) { case EventType.Status: //break; case EventType.NewMail: //break; case EventType.Deleted: //break; case EventType.Modified: //break; case EventType.Moved: //break; case EventType.Copied: //break; case EventType.Created: //break; case EventType.FreeBusyChanged: break; default: throw new Exception("Invalid value for EventType"); } } } } catch (Exception exception) { eventLog.WriteEntry(string.Format("{0}\r\nSource: {1}\r\nStack: {2}", exception.Message, exception.Source, exception.StackTrace), EventLogEntryType.Error); } }
internal void OnEntryPreviousItemsChanged(object sender, NotificationEventArgs e) { _EntryPreviousItems.Refresh(); NotifyPropertyChanged(x => this.EntryPreviousItems); }
private void Current_OnNotificationReceived(object sender, NotificationEventArgs e) { RefreshEventsAsync(); }
/// <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"]; }
private void OnCloseNotice(Object sender, NotificationEventArgs e) { Window.GetWindow(this).Close(); }
internal void OnPackageTypesChanged(object sender, NotificationEventArgs e) { _PackageTypes.Refresh(); NotifyPropertyChanged(x => this.PackageTypes); }
internal void OnAsycudaDocumentSetEntryDataChanged(object sender, NotificationEventArgs e) { _AsycudaDocumentSetEntryData.Refresh(); NotifyPropertyChanged(x => this.AsycudaDocumentSetEntryData); }
private void OnSearchNotice(Object sender, NotificationEventArgs e) { MainSearchWindow searchWindow = new MainSearchWindow(); searchWindow.Show(); }
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 ) {} }
private void _updaterClient_Notification(object sender, NotificationEventArgs e) { this.listBox1.Items.Add(string.Format("[{0}]\t{1}", e.NotificationDate, e.Message)); }
void channel_ShellToastNotificationReceived(object sender, NotificationEventArgs e) { if (e.Collection != null && e.Collection.Count > 0) { var entry = e.Collection.FirstOrDefault().Value; var message = e.Collection.ElementAt(1).Value; Deployment.Current.Dispatcher.BeginInvoke(() => { message = entry + "~~" + message; Uri notificationUrl = new Uri("/View/Notification.xaml?contentVal=" + message, UriKind.RelativeOrAbsolute); PhoneApplicationFrame fram = (Application.Current.RootVisual as PhoneApplicationFrame); if (fram != null) fram.Navigate(notificationUrl); }); } }
internal void OnSalesDataAllocationsChanged(object sender, NotificationEventArgs e) { _SalesDataAllocations.Refresh(); NotifyPropertyChanged(x => this.SalesDataAllocations); }
public MyEvent(int operation, NotificationEventArgs e) { operation_ = operation; e_ = e; }
private void OnAsycudaDocumentSetEntryDataFilterExpressionChanged(object sender, NotificationEventArgs e) { AsycudaDocumentSetEntryData.Refresh(); SelectedAsycudaDocumentSetEntryData.Clear(); NotifyPropertyChanged(x => SelectedAsycudaDocumentSetEntryData); BeginSendMessage(MessageToken.SelectedAsycudaDocumentSetEntryDataChanged, new NotificationEventArgs(MessageToken.SelectedAsycudaDocumentSetEntryDataChanged)); }
private void OnNotificationReceived(NotificationEventArgs e) { switch (e.NotificationType) { case ConsoleNotificationType.GameLoaded: { if (_cpuType == CpuType.Sa1) { CoprocessorType coprocessor = EmuApi.GetRomInfo().CoprocessorType; if (coprocessor != CoprocessorType.SA1) { this.Invoke((MethodInvoker)(() => { this.Close(); })); return; } } if (ConfigManager.Config.Debug.Debugger.BreakOnPowerCycleReset) { DebugApi.Step(_cpuType, 1, StepType.PpuStep); } BreakpointManager.SetBreakpoints(); DebugState state = DebugApi.GetState(); this.BeginInvoke((MethodInvoker)(() => { //Refresh workspace here as well as frmMain to ensure workspace //is up-to-date no matter which form is notified first. DebugWorkspaceManager.GetWorkspace(); bool isPowerCycle = e.Parameter.ToInt32() != 0; if (!isPowerCycle) { DebugWorkspaceManager.AutoImportSymbols(); } LabelManager.RefreshLabels(); DebugApi.RefreshDisassembly(_cpuType); UpdateDebugger(state, null); })); break; } case ConsoleNotificationType.GameReset: if (ConfigManager.Config.Debug.Debugger.BreakOnPowerCycleReset) { DebugApi.Step(_cpuType, 1, StepType.PpuStep); } break; case ConsoleNotificationType.PpuFrameDone: this.BeginInvoke((MethodInvoker)(() => { UpdateContinueAction(); })); break; case ConsoleNotificationType.CodeBreak: { BreakEvent evt = (BreakEvent)Marshal.PtrToStructure(e.Parameter, typeof(BreakEvent)); RefreshDebugger(evt); break; } } }
static void pushChannel_ShellToastNotificationReceived(object sender, NotificationEventArgs e) { ZumoWP8PushTests.toastPushesReceived.Enqueue(e); }
internal void NotifyReceived(NotificationEventArgs e) { OnNotificationReceived?.Invoke(this, e); }
private void UpdateThread() { foreach ( Feed feed in updating_queue ) { Updating = true; bool update = false; //try { NotificationEventArgs fargs = new NotificationEventArgs(); fargs.Message = String.Format(StringCatalog.UpdatingFeed, feed.Name); Gtk.Application.Invoke(this, fargs, OnNotify); update = feed.Update(); if ( update ) { NotificationEventArgs args = new NotificationEventArgs(); args.Message = feed.Name+" has new items."; args.Title = feed.Name; Gtk.Application.Invoke(this, args, OnNotify); } else { NotificationEventArgs args = new NotificationEventArgs(); args.Message = feed.Name+" has no new items."; Gtk.Application.Invoke(this, args, new EventHandler(OnNotify)); } //} catch ( NullReferenceException ) {} } }
void dictionary_Notification(object sender, NotificationEventArgs e) { Dispatcher.Invoke(new Action(delegate() { listBox1.Items.Add(e.Sender + " " + e.Value.ToString()); })); }
private void httpChannel_ShellToastNotificationReceived(object sender, NotificationEventArgs e) { Deployment.Current.Dispatcher.BeginInvoke((ThreadStart)( () => {OnNotificationReceived(e);}) ); }
/// <summary> /// Processes a new notification. /// </summary> public void NotificationReceived(NotificationEventArgs e) { // get the changes. List <MonitoredItemNotification> changes = new List <MonitoredItemNotification>(); foreach (MonitoredItemNotification change in e.NotificationMessage.GetDataChanges(false)) { if (m_monitoredItem != null) { if (m_monitoredItem.ClientHandle != change.ClientHandle) { continue; } } else { if (m_subscription.FindItemByClientHandle(change.ClientHandle) == null) { continue; } } changes.Add(change); } // check if nothing more to do. if (changes.Count == 0) { return; } int offset = changes.Count; if (m_showHistory) { // fill in earlier changes. foreach (ListViewItem listItem in ItemsLV.Items) { MonitoredItemNotification change = listItem.Tag as MonitoredItemNotification; if (change == null) { continue; } if (m_monitoredItem != null) { if (m_monitoredItem.ClientHandle != change.ClientHandle) { continue; } } changes.Add(change); if (changes.Count >= MaxChangeCount) { break; } } // ensure the newest changes appear first. changes.Reverse(); } UpdateChanges(changes, offset); AdjustColumns(); }
// Parse out the information that was part of the message. void PushChannel_ShellToastNotificationReceived(object sender, NotificationEventArgs e) { Debug.WriteLine("Nhận được thông báo"); //DELETE AFTER FINISH 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) { //Lấy chuỗi thông báo từ Notification notificationReceivedString = e.Collection[key]; } } // Display a dialog of all the fields in the toast. //Dispatcher.BeginInvoke(() => MessageBox.Show(message.ToString())); Dispatcher.BeginInvoke(() => { //notificationReceivedString = e.Collection.Keys.; //MessageBox.Show(notificationReceivedString); if (notificationReceivedString != string.Empty) { //Hàm này để lấy ra chuỗi Json trong một String gửi qua notification int a = notificationReceivedString.IndexOf("json="); int b = notificationReceivedString.IndexOf("}"); int c = notificationReceivedString.IndexOf("notiType="); string tmpStirng = notificationReceivedString.Substring(a + 5, b - a - 4); //Cái này để lấy kiểu notificationType = notificationReceivedString.Substring(c + 9, notificationReceivedString.Length - c - 9); notificationReceivedString = tmpStirng; //Sau đó chạy thông báo ShowNotification(); } }); }
private void OnDeleteVerifiedNotice(object sender, NotificationEventArgs eventArgs) { MessageBox.Show("Order has been deleted", "Order Deleted", MessageBoxButton.OK, MessageBoxImage.Information); }
private void pushChannel_ShellToastNotificationReceived(object sender, NotificationEventArgs e) { if (SubscriptionReceived != null) { SubscriptionReceived(this, null); } }
private void OnErrorNotice(object sender, NotificationEventArgs<Exception> eventArgs) { MessageBox.Show(eventArgs.Data.Message, "Error"); }
static void pushChannel_ShellToastNotificationReceived(object sender, NotificationEventArgs e) { ZumoWP8PushTests.toastPushesReceived.Enqueue(e); }
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); }
void ShellToastNotificationReceived(object sender, NotificationEventArgs e) { mVoice.Dispatcher.BeginInvoke(() => { mVoice.RefreshInbox(); }); }
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])); } } }); }
public void 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]; } } BmobDebug.Log(message.ToString()); }
private void OnCurrentAsycudaSalesAllocationsExChanged(object sender, NotificationEventArgs <AsycudaSalesAllocationsEx> e) { vloader.FilterExpression = string.Format("Item_Id = {0}", e.Data.PreviousItem_Id.ToString()); PreviousDocumentItems.Refresh(); }
// In-app toast private async void ToastNotificationReceived( object sender, NotificationEventArgs args) { if(Configuration == null) return; if(Configuration.ToastNotification != null) await Configuration.ToastNotification(args); else { Mvx.TaggedTrace(MvxTraceLevel.Warning, "WindowsPhone Notifications", "No ToastNotification method was provided, using default MessageBox"); await Configuration.DefaultToastNotification(args); } }
private void OnCodeSearchNotice(Object sender, NotificationEventArgs e) { CodeSearchWindow searchWindow = new CodeSearchWindow(); searchWindow.ShowDialog(); }
private void OnNotification(object sender, NotificationEventArgs e) { _CachedLookups = null; }
private void OnAuthenticatedNotice(Object sender, NotificationEventArgs e) { _logInWindow.Close(); }
void OnToastNotification(object sender, NotificationEventArgs e) { if (e.Collection != null) { Dictionary<string, string> collection = (Dictionary<string, string>)e.Collection; foreach (string elementName in collection.Keys) { Debug.WriteLine(elementName + " : " + collection[elementName]); } } }
private void OnMessageNotice(object sender, NotificationEventArgs e) { MessageBox.Show(e.Message, "Error", MessageBoxButton.OK); }