From 767cdc1f6f6a63ce997fc9476911e2c361f9d402 Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Wed, 20 Feb 2013 20:33:05 -0500 Subject: Pushing missing changes --- MediaBrowser.Installer/Code/DownloadAnimation.xaml | 39 +++++++ .../Code/DownloadAnimation.xaml.cs | 68 ++++++++++++ .../Code/Images/computer_256.png | Bin 0 -> 15143 bytes .../Code/Images/internet-globe.jpg | Bin 0 -> 9125 bytes MediaBrowser.Installer/Code/ModelExtensions.cs | 20 ++++ MediaBrowser.Installer/Code/PackageInfo.cs | 119 +++++++++++++++++++++ MediaBrowser.Installer/Code/PackageType.cs | 21 ++++ MediaBrowser.Installer/Code/PackageVersionClass.cs | 21 ++++ MediaBrowser.Installer/Code/PackageVersionInfo.cs | 73 +++++++++++++ 9 files changed, 361 insertions(+) create mode 100644 MediaBrowser.Installer/Code/DownloadAnimation.xaml create mode 100644 MediaBrowser.Installer/Code/DownloadAnimation.xaml.cs create mode 100644 MediaBrowser.Installer/Code/Images/computer_256.png create mode 100644 MediaBrowser.Installer/Code/Images/internet-globe.jpg create mode 100644 MediaBrowser.Installer/Code/ModelExtensions.cs create mode 100644 MediaBrowser.Installer/Code/PackageInfo.cs create mode 100644 MediaBrowser.Installer/Code/PackageType.cs create mode 100644 MediaBrowser.Installer/Code/PackageVersionClass.cs create mode 100644 MediaBrowser.Installer/Code/PackageVersionInfo.cs (limited to 'MediaBrowser.Installer/Code') diff --git a/MediaBrowser.Installer/Code/DownloadAnimation.xaml b/MediaBrowser.Installer/Code/DownloadAnimation.xaml new file mode 100644 index 0000000000..ebcec37f2d --- /dev/null +++ b/MediaBrowser.Installer/Code/DownloadAnimation.xaml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MediaBrowser.Installer/Code/DownloadAnimation.xaml.cs b/MediaBrowser.Installer/Code/DownloadAnimation.xaml.cs new file mode 100644 index 0000000000..8fa8908166 --- /dev/null +++ b/MediaBrowser.Installer/Code/DownloadAnimation.xaml.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using System.Windows.Threading; + +namespace MediaBrowser.Installer.Code +{ + /// + /// Interaction logic for DownloadAnimation.xaml + /// + public partial class DownloadAnimation : UserControl + { + private int _i; + private readonly double _startPos; + private readonly DispatcherTimer _timer; + + public DownloadAnimation() + { + _i = 0; + InitializeComponent(); + + // Store start position of sliding canvas + _startPos = Canvas.GetLeft(SlidingCanvas); + + // Create animation timer + _timer = new DispatcherTimer {Interval = TimeSpan.FromMilliseconds(100)}; + _timer.Tick += TimerTick; + } + + public void StartAnimation() + { + _timer.Start(); + } + + public void StopAnimation() + { + _timer.Stop(); + } + + private void TimerTick(object sender, EventArgs e) + { + _i++; + + if (_i < 16) + { + // Move SlidingCanvas containing the three colored dots 14 units to the right + Canvas.SetLeft(SlidingCanvas, Canvas.GetLeft(SlidingCanvas) + 14); + } + else + { + // Move SlidingCanvas back to its starting position and reset counter + _i = 0; + Canvas.SetLeft(SlidingCanvas, _startPos); + } + } + } +} diff --git a/MediaBrowser.Installer/Code/Images/computer_256.png b/MediaBrowser.Installer/Code/Images/computer_256.png new file mode 100644 index 0000000000..42f3c22fa7 Binary files /dev/null and b/MediaBrowser.Installer/Code/Images/computer_256.png differ diff --git a/MediaBrowser.Installer/Code/Images/internet-globe.jpg b/MediaBrowser.Installer/Code/Images/internet-globe.jpg new file mode 100644 index 0000000000..26d064d7bf Binary files /dev/null and b/MediaBrowser.Installer/Code/Images/internet-globe.jpg differ diff --git a/MediaBrowser.Installer/Code/ModelExtensions.cs b/MediaBrowser.Installer/Code/ModelExtensions.cs new file mode 100644 index 0000000000..5a3051164c --- /dev/null +++ b/MediaBrowser.Installer/Code/ModelExtensions.cs @@ -0,0 +1,20 @@ + +namespace MediaBrowser.Installer.Code +{ + /// + /// Class ModelExtensions + /// + static class ModelExtensions + { + /// + /// Values the or default. + /// + /// The STR. + /// The def. + /// System.String. + public static string ValueOrDefault(this string str, string def = "") + { + return string.IsNullOrEmpty(str) ? def : str; + } + } +} diff --git a/MediaBrowser.Installer/Code/PackageInfo.cs b/MediaBrowser.Installer/Code/PackageInfo.cs new file mode 100644 index 0000000000..adfe54dd63 --- /dev/null +++ b/MediaBrowser.Installer/Code/PackageInfo.cs @@ -0,0 +1,119 @@ +using System; +using System.Collections.Generic; + +namespace MediaBrowser.Installer.Code +{ + /// + /// Class PackageInfo + /// + public class PackageInfo + { + /// + /// Gets or sets the name. + /// + /// The name. + public string name { get; set; } + + /// + /// Gets or sets the short description. + /// + /// The short description. + public string shortDescription { get; set; } + + /// + /// Gets or sets the overview. + /// + /// The overview. + public string overview { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is premium. + /// + /// true if this instance is premium; otherwise, false. + public bool isPremium { get; set; } + + /// + /// Gets or sets the rich desc URL. + /// + /// The rich desc URL. + public string richDescUrl { get; set; } + + /// + /// Gets or sets the thumb image. + /// + /// The thumb image. + public string thumbImage { get; set; } + + /// + /// Gets or sets the preview image. + /// + /// The preview image. + public string previewImage { get; set; } + + /// + /// Gets or sets the type. + /// + /// The type. + public PackageType type { get; set; } + + /// + /// Gets or sets the target filename. + /// + /// The target filename. + public string targetFilename { get; set; } + + /// + /// Gets or sets the owner. + /// + /// The owner. + public string owner { get; set; } + + /// + /// Gets or sets the category. + /// + /// The category. + public string category { get; set; } + + /// + /// Gets or sets the catalog tile color. + /// + /// The owner. + public string tileColor { get; set; } + + /// + /// Gets or sets the feature id of this package (if premium). + /// + /// The feature id. + public string featureId { get; set; } + + /// + /// Gets or sets the registration info for this package (if premium). + /// + /// The registration info. + public string regInfo { get; set; } + + /// + /// Gets or sets the price for this package (if premium). + /// + /// The price. + public float price { get; set; } + + /// + /// Gets or sets whether or not this package is registered. + /// + /// True if registered. + public bool isRegistered { get; set; } + + /// + /// Gets or sets the expiration date for this package. + /// + /// Expiration Date. + public DateTime expDate { get; set; } + + /// + /// Gets or sets the versions. + /// + /// The versions. + public List versions { get; set; } + } +} diff --git a/MediaBrowser.Installer/Code/PackageType.cs b/MediaBrowser.Installer/Code/PackageType.cs new file mode 100644 index 0000000000..964025a73c --- /dev/null +++ b/MediaBrowser.Installer/Code/PackageType.cs @@ -0,0 +1,21 @@ +namespace MediaBrowser.Installer.Code +{ + /// + /// Enum PackageType + /// + public enum PackageType + { + /// + /// All + /// + All, + /// + /// The system + /// + System, + /// + /// The user installed + /// + UserInstalled + } +} \ No newline at end of file diff --git a/MediaBrowser.Installer/Code/PackageVersionClass.cs b/MediaBrowser.Installer/Code/PackageVersionClass.cs new file mode 100644 index 0000000000..d046e5c602 --- /dev/null +++ b/MediaBrowser.Installer/Code/PackageVersionClass.cs @@ -0,0 +1,21 @@ +namespace MediaBrowser.Installer.Code +{ + /// + /// Enum PackageVersionClass + /// + public enum PackageVersionClass + { + /// + /// The release + /// + Release = 0, + /// + /// The beta + /// + Beta = 1, + /// + /// The dev + /// + Dev = 2 + } +} \ No newline at end of file diff --git a/MediaBrowser.Installer/Code/PackageVersionInfo.cs b/MediaBrowser.Installer/Code/PackageVersionInfo.cs new file mode 100644 index 0000000000..d26c217caf --- /dev/null +++ b/MediaBrowser.Installer/Code/PackageVersionInfo.cs @@ -0,0 +1,73 @@ +using System; +using System.Runtime.Serialization; + +namespace MediaBrowser.Installer.Code +{ + /// + /// Class PackageVersionInfo + /// + public class PackageVersionInfo + { + /// + /// Gets or sets the name. + /// + /// The name. + public string name { get; set; } + + /// + /// Gets or sets the version STR. + /// + /// The version STR. + public string versionStr { get; set; } + + /// + /// The _version + /// + private Version _version; + /// + /// Gets or sets the version. + /// Had to make this an interpreted property since Protobuf can't handle Version + /// + /// The version. + public Version version + { + get { return _version ?? (_version = new Version(versionStr.ValueOrDefault("0.0.0.1"))); } + } + + /// + /// Gets or sets the classification. + /// + /// The classification. + public PackageVersionClass classification { get; set; } + + /// + /// Gets or sets the description. + /// + /// The description. + public string description { get; set; } + + /// + /// Gets or sets the required version STR. + /// + /// The required version STR. + public string requiredVersionStr { get; set; } + + /// + /// Gets or sets the source URL. + /// + /// The source URL. + public string sourceUrl { get; set; } + + /// + /// Gets or sets the source URL. + /// + /// The source URL. + public Guid checksum { get; set; } + + /// + /// Gets or sets the target filename. + /// + /// The target filename. + public string targetFilename { get; set; } + } +} -- cgit v1.2.3