Esempio n. 1
0
        public void WP7ClearCounter(Profile profile)
        {
            var session = Session;

            using (var tx = session.BeginGetTransaction())
            {
                var res = session.QueryOver <WP7PushNotification>().Where(x => x.ProfileId == profile.GlobalId);
                foreach (var device in res.List())
                {
                    device.Counter = 0;
                    pushNotificationService.SendLiveTile(device.URI, "WP7TileImage.png", null, device.Counter);
                }

                tx.Commit();
            }
        }
Esempio n. 2
0
        //public  void SendSystemMessage(string message, Profile sender, Profile receiver, MessageType type)
        //{
        //    Log.WriteInfo("sendSystemMessage. Sender:{0}, Receiver:{1},Type:{2}", sender.UserName, receiver.UserName, type);
        //    var session = Session;
        //    Message msg = new Message();
        //    msg.Sender = sender;
        //    msg.Receiver = receiver;
        //    msg.Content = message;
        //    msg.MessageType = type;
        //    msg.CreatedDate = DateTime.UtcNow;
        //    msg.Priority = MessagePriority.System;
        //    session.Save(msg);

        //    pushNotificationService.SendLiveTile(session, receiver, true);
        //}

        public void NewSendSystemMessage(string message, string subject, Profile sender, Profile receiver)
        {
            Log.WriteInfo("sendSystemMessage. Sender:{0}, Receiver:{1}", sender.UserName, receiver.UserName);
            var     session = Session;
            Message msg     = new Message();

            msg.Sender      = sender;
            msg.Receiver    = receiver;
            msg.Content     = message;
            msg.Topic       = subject;
            msg.CreatedDate = DateTime.UtcNow;
            msg.Priority    = MessagePriority.System;
            session.Save(msg);

            receiver.DataInfo.MessageHash = Guid.NewGuid();
            pushNotificationService.SendLiveTile(session, receiver, true);
        }