aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Installer/Code
diff options
context:
space:
mode:
authorLukePulverenti <luke.pulverenti@gmail.com>2013-02-20 20:33:05 -0500
committerLukePulverenti <luke.pulverenti@gmail.com>2013-02-20 20:33:05 -0500
commit767cdc1f6f6a63ce997fc9476911e2c361f9d402 (patch)
tree49add55976f895441167c66cfa95e5c7688d18ce /MediaBrowser.Installer/Code
parent845554722efaed872948a9e0f7202e3ef52f1b6e (diff)
Pushing missing changes
Diffstat (limited to 'MediaBrowser.Installer/Code')
-rw-r--r--MediaBrowser.Installer/Code/DownloadAnimation.xaml39
-rw-r--r--MediaBrowser.Installer/Code/DownloadAnimation.xaml.cs68
-rw-r--r--MediaBrowser.Installer/Code/Images/computer_256.pngbin0 -> 15143 bytes
-rw-r--r--MediaBrowser.Installer/Code/Images/internet-globe.jpgbin0 -> 9125 bytes
-rw-r--r--MediaBrowser.Installer/Code/ModelExtensions.cs20
-rw-r--r--MediaBrowser.Installer/Code/PackageInfo.cs119
-rw-r--r--MediaBrowser.Installer/Code/PackageType.cs21
-rw-r--r--MediaBrowser.Installer/Code/PackageVersionClass.cs21
-rw-r--r--MediaBrowser.Installer/Code/PackageVersionInfo.cs73
9 files changed, 361 insertions, 0 deletions
diff --git a/MediaBrowser.Installer/Code/DownloadAnimation.xaml b/MediaBrowser.Installer/Code/DownloadAnimation.xaml
new file mode 100644
index 000000000..ebcec37f2
--- /dev/null
+++ b/MediaBrowser.Installer/Code/DownloadAnimation.xaml
@@ -0,0 +1,39 @@
+<UserControl x:Class="MediaBrowser.Installer.Code.DownloadAnimation"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ mc:Ignorable="d" Height="257.143" Width="502.041">
+ <UserControl.Resources>
+ <Style TargetType="Ellipse">
+ <Setter Property="Fill" Value="LightGray" />
+ <Setter Property="Width" Value="8" />
+ <Setter Property="Height" Value="8" />
+ </Style>
+ </UserControl.Resources>
+ <Canvas Height="58" Width="275">
+ <Ellipse Canvas.Left="56" Canvas.Top="23" />
+ <Ellipse Canvas.Left="70" Canvas.Top="23" />
+ <Ellipse Canvas.Left="84" Canvas.Top="23" />
+ <Ellipse Canvas.Left="98" Canvas.Top="23" />
+ <Ellipse Canvas.Left="112" Canvas.Top="23" />
+ <Ellipse Canvas.Left="126" Canvas.Top="23" />
+ <Ellipse Canvas.Left="140" Canvas.Top="23" />
+ <Ellipse Canvas.Left="154" Canvas.Top="23" />
+ <Ellipse Canvas.Left="168" Canvas.Top="23" />
+ <Ellipse Canvas.Left="182" Canvas.Top="23" />
+ <Ellipse Canvas.Left="196" Canvas.Top="23" />
+ <Ellipse Canvas.Left="210" Canvas.Top="23" />
+ <Canvas Canvas.Left="10" Canvas.Top="19"
+ Name="SlidingCanvas" Height="17" Width="46">
+ <Ellipse Canvas.Left="4" Canvas.Top="4" Fill="Orange" />
+ <Ellipse Canvas.Left="18" Canvas.Top="4" Fill="Orange" />
+ <Ellipse Canvas.Left="32" Canvas.Top="4" Fill="Orange" />
+ </Canvas>
+ <Image Canvas.Left="-49" Canvas.Top="-19"
+ Source="/MediaBrowser.Server.Installer;component/Code/Images/internet-globe.jpg" Stretch="None" Height="94" Width="100" RenderTransformOrigin="0.341,0.403" />
+ <Image Canvas.Left="224" Canvas.Top="-25"
+ Source="Images\computer_256.png" Height="100" Width="100" Stretch="None" />
+ </Canvas>
+
+</UserControl>
diff --git a/MediaBrowser.Installer/Code/DownloadAnimation.xaml.cs b/MediaBrowser.Installer/Code/DownloadAnimation.xaml.cs
new file mode 100644
index 000000000..8fa890816
--- /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
+{
+ /// <summary>
+ /// Interaction logic for DownloadAnimation.xaml
+ /// </summary>
+ 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 000000000..42f3c22fa
--- /dev/null
+++ b/MediaBrowser.Installer/Code/Images/computer_256.png
Binary files differ
diff --git a/MediaBrowser.Installer/Code/Images/internet-globe.jpg b/MediaBrowser.Installer/Code/Images/internet-globe.jpg
new file mode 100644
index 000000000..26d064d7b
--- /dev/null
+++ b/MediaBrowser.Installer/Code/Images/internet-globe.jpg
Binary files differ
diff --git a/MediaBrowser.Installer/Code/ModelExtensions.cs b/MediaBrowser.Installer/Code/ModelExtensions.cs
new file mode 100644
index 000000000..5a3051164
--- /dev/null
+++ b/MediaBrowser.Installer/Code/ModelExtensions.cs
@@ -0,0 +1,20 @@
+
+namespace MediaBrowser.Installer.Code
+{
+ /// <summary>
+ /// Class ModelExtensions
+ /// </summary>
+ static class ModelExtensions
+ {
+ /// <summary>
+ /// Values the or default.
+ /// </summary>
+ /// <param name="str">The STR.</param>
+ /// <param name="def">The def.</param>
+ /// <returns>System.String.</returns>
+ 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 000000000..adfe54dd6
--- /dev/null
+++ b/MediaBrowser.Installer/Code/PackageInfo.cs
@@ -0,0 +1,119 @@
+using System;
+using System.Collections.Generic;
+
+namespace MediaBrowser.Installer.Code
+{
+ /// <summary>
+ /// Class PackageInfo
+ /// </summary>
+ public class PackageInfo
+ {
+ /// <summary>
+ /// Gets or sets the name.
+ /// </summary>
+ /// <value>The name.</value>
+ public string name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the short description.
+ /// </summary>
+ /// <value>The short description.</value>
+ public string shortDescription { get; set; }
+
+ /// <summary>
+ /// Gets or sets the overview.
+ /// </summary>
+ /// <value>The overview.</value>
+ public string overview { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is premium.
+ /// </summary>
+ /// <value><c>true</c> if this instance is premium; otherwise, <c>false</c>.</value>
+ public bool isPremium { get; set; }
+
+ /// <summary>
+ /// Gets or sets the rich desc URL.
+ /// </summary>
+ /// <value>The rich desc URL.</value>
+ public string richDescUrl { get; set; }
+
+ /// <summary>
+ /// Gets or sets the thumb image.
+ /// </summary>
+ /// <value>The thumb image.</value>
+ public string thumbImage { get; set; }
+
+ /// <summary>
+ /// Gets or sets the preview image.
+ /// </summary>
+ /// <value>The preview image.</value>
+ public string previewImage { get; set; }
+
+ /// <summary>
+ /// Gets or sets the type.
+ /// </summary>
+ /// <value>The type.</value>
+ public PackageType type { get; set; }
+
+ /// <summary>
+ /// Gets or sets the target filename.
+ /// </summary>
+ /// <value>The target filename.</value>
+ public string targetFilename { get; set; }
+
+ /// <summary>
+ /// Gets or sets the owner.
+ /// </summary>
+ /// <value>The owner.</value>
+ public string owner { get; set; }
+
+ /// <summary>
+ /// Gets or sets the category.
+ /// </summary>
+ /// <value>The category.</value>
+ public string category { get; set; }
+
+ /// <summary>
+ /// Gets or sets the catalog tile color.
+ /// </summary>
+ /// <value>The owner.</value>
+ public string tileColor { get; set; }
+
+ /// <summary>
+ /// Gets or sets the feature id of this package (if premium).
+ /// </summary>
+ /// <value>The feature id.</value>
+ public string featureId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the registration info for this package (if premium).
+ /// </summary>
+ /// <value>The registration info.</value>
+ public string regInfo { get; set; }
+
+ /// <summary>
+ /// Gets or sets the price for this package (if premium).
+ /// </summary>
+ /// <value>The price.</value>
+ public float price { get; set; }
+
+ /// <summary>
+ /// Gets or sets whether or not this package is registered.
+ /// </summary>
+ /// <value>True if registered.</value>
+ public bool isRegistered { get; set; }
+
+ /// <summary>
+ /// Gets or sets the expiration date for this package.
+ /// </summary>
+ /// <value>Expiration Date.</value>
+ public DateTime expDate { get; set; }
+
+ /// <summary>
+ /// Gets or sets the versions.
+ /// </summary>
+ /// <value>The versions.</value>
+ public List<PackageVersionInfo> versions { get; set; }
+ }
+}
diff --git a/MediaBrowser.Installer/Code/PackageType.cs b/MediaBrowser.Installer/Code/PackageType.cs
new file mode 100644
index 000000000..964025a73
--- /dev/null
+++ b/MediaBrowser.Installer/Code/PackageType.cs
@@ -0,0 +1,21 @@
+namespace MediaBrowser.Installer.Code
+{
+ /// <summary>
+ /// Enum PackageType
+ /// </summary>
+ public enum PackageType
+ {
+ /// <summary>
+ /// All
+ /// </summary>
+ All,
+ /// <summary>
+ /// The system
+ /// </summary>
+ System,
+ /// <summary>
+ /// The user installed
+ /// </summary>
+ 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 000000000..d046e5c60
--- /dev/null
+++ b/MediaBrowser.Installer/Code/PackageVersionClass.cs
@@ -0,0 +1,21 @@
+namespace MediaBrowser.Installer.Code
+{
+ /// <summary>
+ /// Enum PackageVersionClass
+ /// </summary>
+ public enum PackageVersionClass
+ {
+ /// <summary>
+ /// The release
+ /// </summary>
+ Release = 0,
+ /// <summary>
+ /// The beta
+ /// </summary>
+ Beta = 1,
+ /// <summary>
+ /// The dev
+ /// </summary>
+ 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 000000000..d26c217ca
--- /dev/null
+++ b/MediaBrowser.Installer/Code/PackageVersionInfo.cs
@@ -0,0 +1,73 @@
+using System;
+using System.Runtime.Serialization;
+
+namespace MediaBrowser.Installer.Code
+{
+ /// <summary>
+ /// Class PackageVersionInfo
+ /// </summary>
+ public class PackageVersionInfo
+ {
+ /// <summary>
+ /// Gets or sets the name.
+ /// </summary>
+ /// <value>The name.</value>
+ public string name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the version STR.
+ /// </summary>
+ /// <value>The version STR.</value>
+ public string versionStr { get; set; }
+
+ /// <summary>
+ /// The _version
+ /// </summary>
+ private Version _version;
+ /// <summary>
+ /// Gets or sets the version.
+ /// Had to make this an interpreted property since Protobuf can't handle Version
+ /// </summary>
+ /// <value>The version.</value>
+ public Version version
+ {
+ get { return _version ?? (_version = new Version(versionStr.ValueOrDefault("0.0.0.1"))); }
+ }
+
+ /// <summary>
+ /// Gets or sets the classification.
+ /// </summary>
+ /// <value>The classification.</value>
+ public PackageVersionClass classification { get; set; }
+
+ /// <summary>
+ /// Gets or sets the description.
+ /// </summary>
+ /// <value>The description.</value>
+ public string description { get; set; }
+
+ /// <summary>
+ /// Gets or sets the required version STR.
+ /// </summary>
+ /// <value>The required version STR.</value>
+ public string requiredVersionStr { get; set; }
+
+ /// <summary>
+ /// Gets or sets the source URL.
+ /// </summary>
+ /// <value>The source URL.</value>
+ public string sourceUrl { get; set; }
+
+ /// <summary>
+ /// Gets or sets the source URL.
+ /// </summary>
+ /// <value>The source URL.</value>
+ public Guid checksum { get; set; }
+
+ /// <summary>
+ /// Gets or sets the target filename.
+ /// </summary>
+ /// <value>The target filename.</value>
+ public string targetFilename { get; set; }
+ }
+}