Exemple #1
0
        async void channel_PushNotificationReceived(Windows.Networking.PushNotifications.PushNotificationChannel sender, Windows.Networking.PushNotifications.PushNotificationReceivedEventArgs args)
        {
            if (args.ToastNotification.Content.InnerText.Contains("Event"))
            {
                //args.Cancel = true;

            }
            else
            {
                args.Cancel = true;
                await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                {
                    ChatPublic c = new ChatPublic();

                c.Message = args.ToastNotification.Content.InnerText;
                // c.Name = args.ToastNotification.Content.InnerText.Substring(index + 4, args.ToastNotification.Content.InnerText.Length - index + 5);
               test.Insert(0, c);
               

                });

                

            }
        }
Exemple #2
0
        private async void Send_Click(object sender, RoutedEventArgs e)
        {
            if (message.Text != "")
            {
                ChatPublic c = new ChatPublic();
                var        networkProfiles  = Windows.Networking.Connectivity.NetworkInformation.GetConnectionProfiles();
                var        adapter          = networkProfiles.First <Windows.Networking.Connectivity.ConnectionProfile>().NetworkAdapter;//takes the first network adapter
                string     networkAdapterId = adapter.NetworkAdapterId.ToString();


                c.Name       = networkAdapterId;
                c.Message    = message.Text;
                message.Text = "";
                c.CreatedAt  = DateTime.Now;
                await App.MobileService.GetTable <ChatPublic>().InsertAsync(c);
            }
        }
Exemple #3
0
        private async void Send_Click(object sender, RoutedEventArgs e)
        {
            if (message.Text != "")
            {
                ChatPublic c = new ChatPublic();
                var networkProfiles = Windows.Networking.Connectivity.NetworkInformation.GetConnectionProfiles();
                var adapter = networkProfiles.First<Windows.Networking.Connectivity.ConnectionProfile>().NetworkAdapter;//takes the first network adapter
                string networkAdapterId = adapter.NetworkAdapterId.ToString();


                c.Name = networkAdapterId;
                c.Message = message.Text;
                message.Text = "";
                c.CreatedAt = DateTime.Now;
                await App.MobileService.GetTable<ChatPublic>().InsertAsync(c);
            }
        }
Exemple #4
0
 private async void Send_Click(object sender, RoutedEventArgs e)
 {
     ChatPublic c = new ChatPublic();
     c.Name = "Test";
     c.Message = message.Text;
     c.CreatedAt = DateTime.Today;
     await App.MobileService.GetTable<ChatPublic>().InsertAsync(c);
 }