public NotifyMessageViewModel(NotifyMessage content, AnimatedLocation location, Action closedAction)
 {
     this._content = content;
     this._location = location;
     this._closedAction = closedAction;
 }
Ejemplo n.º 2
0
        void rssDataDownloaded(object sender, DownloadStringCompletedEventArgs e)
        {
            XmlReader reader = XmlReader.Create(new StringReader(e.Result));
            SyndicationFeed downloadFeed = SyndicationFeed.Load(reader);
            if (downloadFeed != null &&
                downloadFeed.LastUpdatedTime > Settings.Default.lastUpdated)
            {
                // we have a new cheevo!
                var newCheevos =
                    from item in downloadFeed.Items
                    where item.PublishDate > Settings.Default.lastUpdated
                    select item;

                foreach (var cheevo in newCheevos)
                {
                    string name = cheevo.Title.Text;
                    var icon = OfficeCheevosClient.Properties.Resources.cheevo;

                    var msg = new NotifyMessage(
                        DefaultCheevoBackground,
                        name, DefaultCheevoIcon, () => System.Windows.Forms.MessageBox.Show(""));
                    var t = new Thread(() =>
                                       Dispatcher.Invoke(DispatcherPriority.Normal, new Action<NotifyMessage>(AddCheevo), msg));
                    t.Start();
                }
            }

            Settings.Default.lastUpdated = downloadFeed.LastUpdatedTime.DateTime;
            Settings.Default.Save();
        }
Ejemplo n.º 3
0
 private void AddCheevo(NotifyMessage msg)
 {
     notifyMessageMgr.EnqueueMessage(msg);
 }
Ejemplo n.º 4
0
 private void button1_Click(object sender, RoutedEventArgs e)
 {
     var msg = new NotifyMessage(DefaultCheevoBackground, "Show popup on screen (100pts)", DefaultCheevoIcon, () => System.Windows.Forms.MessageBox.Show(""));
     notifyMessageMgr.EnqueueMessage(msg);
 }
Ejemplo n.º 5
0
 public void EnqueueMessage(NotifyMessage msg)
 {
     QueuedMessages.Enqueue(msg);
     Start();
 }