Exemple #1
0
 public Notification()
 {
     this.alert                = (string)null;
     this.IosNotification      = (IosNotification)null;
     this.AndroidNotification  = (AndroidNotification)null;
     this.WinphoneNotification = (WinphoneNotification)null;
 }
Exemple #2
0
 public Notification()
 {
     this.alert                = null;
     this.IosNotification      = null;
     this.AndroidNotification  = null;
     this.WinphoneNotification = null;
 }
Exemple #3
0
        public static Notification winphone(string alert)
        {
            WinphoneNotification winphoneNotification = new WinphoneNotification().setAlert(alert);
            Notification         notification         = new Notification().setAlert(alert);

            notification.WinphoneNotification = winphoneNotification;
            return(notification);
        }
Exemple #4
0
        public void testQuickAlert()
        {
            WinphoneNotification winphone = new WinphoneNotification().setAlert("aaa");
            JObject json = new JObject();

            json.Add("alert", JToken.FromObject("aaa"));
            Assert.AreEqual(json.ToString(Formatting.None), JsonConvert.SerializeObject(winphone, jSetting));
        }
Exemple #5
0
        public void testEmpty()
        {
            WinphoneNotification winphone = new WinphoneNotification();

            JObject json = new JObject();

            Assert.AreEqual(new JObject().ToString(Formatting.None), JsonConvert.SerializeObject(winphone, jSetting));
        }
Exemple #6
0
        public static Notification winphone(String alert)
        {
            var platformNotification = new WinphoneNotification().setAlert(alert);

            var notificaiton = new Notification().setAlert(alert);

            notificaiton.WinphoneNotification = platformNotification;
            return(notificaiton);
        }
Exemple #7
0
        public void testExtra()
        {
            WinphoneNotification winphone = new WinphoneNotification().AddExtra("key", "value").AddExtra("key2", 222);
            JObject json  = new JObject();
            JObject extra = new JObject();

            extra.Add("key", JToken.FromObject("value"));
            extra.Add("key2", JToken.FromObject(222));
            json.Add("extras", extra);
            Assert.AreEqual(json.ToString(Formatting.None), JsonConvert.SerializeObject(winphone, jSetting));
        }
Exemple #8
0
        private static WinphoneNotification GetWinphoneNotification(
            string content,
            Dictionary <string, string> keyValueParams)
        {
            var winphoneNotification = new WinphoneNotification();

            winphoneNotification.setAlert(content);
            foreach (var keyValueParam in keyValueParams)
            {
                winphoneNotification.AddExtra(keyValueParam.Key, keyValueParam.Value);
            }
            return(winphoneNotification);
        }
Exemple #9
0
 public Notification setWinphone(WinphoneNotification winphone)
 {
     this.WinphoneNotification = winphone;
     return(this);
 }