PageRenderTime 18ms CodeModel.GetById 9ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/Application/GUI/Controls/TrayNotification.xaml.cs

http://yet-another-music-application.googlecode.com/
C# | 113 lines | 58 code | 15 blank | 40 comment | 0 complexity | 12b1f7b8ee8f7f93a1fa055959563e9a MD5 | raw file
  1/**
  2 * TrayNotification.xaml.cs
  3 * 
  4 * The notification that is shown in the tray area.
  5 * 
  6 * * * * * * * * *
  7 * 
  8 * This code is part of the Stoffi Music Player Project.
  9 * Visit our website at: stoffiplayer.com
 10 *
 11 * This program is free software; you can redistribute it and/or
 12 * modify it under the terms of the GNU General Public License
 13 * as published by the Free Software Foundation; either version
 14 * 3 of the License, or (at your option) any later version.
 15 * 
 16 * See stoffiplayer.com/license for more information.
 17 **/
 18
 19using System;
 20using System.Collections.Generic;
 21using System.Linq;
 22using System.IO;
 23using System.Text;
 24using System.Windows;
 25using System.Windows.Controls;
 26using System.Windows.Data;
 27using System.Windows.Documents;
 28using System.Windows.Input;
 29using System.Windows.Media;
 30using System.Windows.Media.Imaging;
 31using System.Windows.Navigation;
 32using System.Windows.Shapes;
 33
 34namespace Stoffi
 35{
 36	/// <summary>
 37	/// Interaction logic for TrayNotification.xaml
 38	/// </summary>
 39	public partial class TrayNotification : UserControl
 40	{
 41		#region Members
 42
 43		private StoffiWindow ParentWindow;
 44
 45		#endregion
 46
 47		#region Constructors
 48
 49		/// <summary>
 50		/// 
 51		/// </summary>
 52		/// <param name="numberOfUpgrades"></param>
 53		/// <param name="parent"></param>
 54		public TrayNotification(StoffiWindow parent)
 55		{
 56			U.L(LogLevel.Debug, "TRAY NOTIFICATION", "Initialize");
 57			InitializeComponent();
 58			U.L(LogLevel.Debug, "TRAY NOTIFICATION", "Initialized");
 59			TrackInformation.Visibility = System.Windows.Visibility.Collapsed;
 60			NewUpgrades.Visibility = System.Windows.Visibility.Visible;
 61			UpgradeTitle.Text = "New Upgrade Available";
 62			UpgradeDescription.Text = "Found new upgrade";
 63			ParentWindow = parent;
 64		}
 65
 66		/// <summary>
 67		/// 
 68		/// </summary>
 69		/// <param name="track"></param>
 70		/// <param name="parent"></param>
 71		public TrayNotification(TrackData track, StoffiWindow parent)
 72		{
 73			ParentWindow = parent;
 74			InitializeComponent();
 75
 76			TrackArtist.Text = track.Artist;
 77			TrackTitle.Text = track.Title;
 78			AlbumArt.Source = FilesystemManager.GetImageTag(track);
 79		}
 80
 81		#endregion
 82
 83		#region Methods
 84
 85		#region Event handlers
 86
 87		/// <summary>
 88		/// 
 89		/// </summary>
 90		/// <param name="sender"></param>
 91		/// <param name="e"></param>
 92		private void Close_Click(object sender, RoutedEventArgs e)
 93		{
 94			ParentWindow.trayIcon.CloseBalloon();
 95		}
 96
 97		/// <summary>
 98		/// 
 99		/// </summary>
100		/// <param name="sender"></param>
101		/// <param name="e"></param>
102		private void Upgrade_Click(object sender, RoutedEventArgs e)
103		{
104			ParentWindow.trayIcon.CloseBalloon();
105			UpgradeManager.ForceDownload = true;
106			UpgradeManager.Probe(null, null);
107		}
108
109		#endregion
110
111		#endregion
112	}
113}