private void TrackChanged(object sender, EventArgs args) { NowPlayingService nowPlaying = ServiceManager.Get <NowPlayingService>(); PubSubItem itemElement = new PubSubItem(m_Account.Client.Document); itemElement.SetAttribute("id", "current"); Tune tune = new Tune(m_Account.Client.Document); itemElement.AppendChild(tune); if (nowPlaying.IsPlaying) { tune.Artist = nowPlaying.CurrentTrackArtist; tune.Length = nowPlaying.CurrentTrackLength; tune.Rating = nowPlaying.CurrentTrackRating; tune.Source = nowPlaying.CurrentTrackSource; tune.Title = nowPlaying.CurrentTrackTitle; tune.Track = nowPlaying.CurrentTrackNumber; tune.Uri = nowPlaying.CurrentTrackUri; } m_Account.GetFeature <PersonalEventing>().Publish(Namespace.Tune, itemElement); }
public void PublishMood(string mood, string reason) { XmlDocument doc = m_Account.Client.Document; PubSubItem itemElement = new PubSubItem(doc); itemElement.SetAttribute("id", "current"); doc.AppendChild(itemElement); Mood moodElement = new Mood(doc, mood); moodElement.Text = reason; itemElement.AppendChild(moodElement); m_Account.GetFeature<PersonalEventing>().Publish(Namespace.Mood, itemElement); }
public void PublishMood(string mood, string reason) { XmlDocument doc = m_Account.Client.Document; PubSubItem itemElement = new PubSubItem(doc); itemElement.SetAttribute("id", "current"); doc.AppendChild(itemElement); Mood moodElement = new Mood(doc, mood); moodElement.Text = reason; itemElement.AppendChild(moodElement); m_Account.GetFeature <PersonalEventing>().Publish(Namespace.Mood, itemElement); }
private void TrackChanged(object sender, EventArgs args) { NowPlayingService nowPlaying = ServiceManager.Get<NowPlayingService>(); PubSubItem itemElement = new PubSubItem(m_Account.Client.Document); itemElement.SetAttribute("id", "current"); Tune tune = new Tune(m_Account.Client.Document); itemElement.AppendChild(tune); if (nowPlaying.IsPlaying) { tune.Artist = nowPlaying.CurrentTrackArtist; tune.Length = nowPlaying.CurrentTrackLength; tune.Rating = nowPlaying.CurrentTrackRating; tune.Source = nowPlaying.CurrentTrackSource; tune.Title = nowPlaying.CurrentTrackTitle; tune.Track = nowPlaying.CurrentTrackNumber; tune.Uri = nowPlaying.CurrentTrackUri; } m_Account.GetFeature<PersonalEventing>().Publish(Namespace.Tune, itemElement); }