Projektdateien hinzufügen.

This commit is contained in:
Kevin Krüger
2023-07-24 12:00:34 +02:00
parent 656751e10b
commit 0d00a90942
210 changed files with 45049 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="VideoBrowserTestApp.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
<userSettings>
<VideoBrowserTestApp.Properties.Settings>
<setting name="LastTest" serializeAs="String">
<value/>
</setting>
</VideoBrowserTestApp.Properties.Settings>
</userSettings>
</configuration>

View File

@@ -0,0 +1,16 @@
<Application
x:Class="VideoBrowserTestApp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="Views\MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/Light.Blue.xaml" />
<ResourceDictionary Source="pack://application:,,,/Dragablz;component/Themes/Generic.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

View File

@@ -0,0 +1,11 @@
namespace VideoBrowserTestApp
{
using System.Windows;
/// <summary>
/// Interaction logic for App.xaml.
/// </summary>
public partial class App : Application
{
}
}

View File

@@ -0,0 +1,29 @@
namespace VideoBrowserTestApp.Helpers
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
/// <summary>
/// Defines the <see cref="ReflectionHelper" />.
/// </summary>
public static class ReflectionHelper
{
#region Methods
/// <summary>
/// The GetInstances.
/// </summary>
/// <typeparam name="T">.</typeparam>
/// <returns>The <see cref="IList{T}"/>.</returns>
public static IList<T> GetInstances<T>()
{
return (from t in Assembly.GetExecutingAssembly().GetTypes()
where t.BaseType == (typeof(T)) && t.GetConstructor(Type.EmptyTypes) != null
select (T)Activator.CreateInstance(t)).ToList();
}
#endregion Methods
}
}

View File

@@ -0,0 +1,38 @@
namespace VideoBrowserTestApp.Helpers
{
using MahApps.Metro.Controls;
using System.Windows;
/// <summary>
/// Defines the <see cref="WindowFactory" />.
/// </summary>
internal static class WindowFactory
{
#region Methods
/// <summary>
/// The Create.
/// </summary>
/// <param name="view">The view<see cref="FrameworkElement"/>.</param>
/// <param name="ownerWindow">The ownerWindow<see cref="Window"/>.</param>
/// <returns>The <see cref="MetroWindow"/>.</returns>
internal static MetroWindow Create(FrameworkElement view, Window ownerWindow)
{
var window = new MetroWindow { Content = view, MinWidth = 600, MinHeight = 400, SizeToContent = SizeToContent.WidthAndHeight, Owner = ownerWindow };
return window;
}
/// <summary>
/// The CreateAndShow.
/// </summary>
/// <param name="view">The view<see cref="FrameworkElement"/>.</param>
/// <param name="ownerWindow">The ownerWindow<see cref="Window"/>.</param>
internal static void CreateAndShow(FrameworkElement view, Window ownerWindow)
{
var window = new Window { Content = view, MinWidth = 600, MinHeight = 400, SizeToContent = SizeToContent.WidthAndHeight, Owner = ownerWindow };
window.Show();
}
#endregion Methods
}
}

View File

@@ -0,0 +1,51 @@
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("VideoBrowserTestApp")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VideoBrowserTestApp")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.7.0")]
[assembly: AssemblyFileVersion("0.1.7.0")]

View File

@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace VideoBrowserTestApp.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VideoBrowserTestApp.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,38 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace VideoBrowserTestApp.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.6.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string LastTest {
get {
return ((string)(this["LastTest"]));
}
set {
this["LastTest"] = value;
}
}
}
}

View File

@@ -0,0 +1,9 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="VideoBrowserTestApp.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="LastTest" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>

View File

@@ -0,0 +1,39 @@
namespace VideoBrowserTestApp.Tests
{
using System.Windows;
using VideoBrowser.ViewModels;
using VideoBrowser.Views;
using VideoBrowserTestApp.Helpers;
/// <summary>
/// Defines the <see cref="AboutViewTest" />.
/// </summary>
public class AboutViewTest : TestBase
{
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="AboutViewTest"/> class.
/// </summary>
public AboutViewTest() : base(nameof(AboutView))
{
}
#endregion Constructors
#region Methods
/// <summary>
/// The Test.
/// </summary>
/// <param name="testWindow">The testWindow<see cref="Window"/>.</param>
protected override void Test(Window testWindow)
{
var viewModel = new AboutViewModel();
var view = new AboutView { DataContext = viewModel };
WindowFactory.CreateAndShow(view, testWindow);
}
#endregion Methods
}
}

View File

@@ -0,0 +1,59 @@
namespace VideoBrowserTestApp.Tests
{
using System.Windows;
using VideoBrowser.Controls.CefSharpBrowser;
using VideoBrowser.Controls.CefSharpBrowser.ViewModels;
using VideoBrowser.Controls.CefSharpBrowser.Views;
using VideoBrowser.Helpers;
/// <summary>
/// Defines the <see cref="DefaultTabHostWindowTest" />.
/// </summary>
public class DefaultTabHostWindowTest : TestBase
{
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="DefaultTabHostWindowTest"/> class.
/// </summary>
public DefaultTabHostWindowTest() : base(nameof(DefaultTabHostWindow))
{
this.GlobalBrowserData = new GlobalBrowserData();
}
#endregion Constructors
#region Properties
/// <summary>
/// Gets the GlobalBrowserData.
/// </summary>
private GlobalBrowserData GlobalBrowserData { get; }
#endregion Properties
#region Methods
/// <summary>
/// The Test.
/// </summary>
/// <param name="testWindow">The testWindow<see cref="Window"/>.</param>
protected override void Test(Window testWindow)
{
var client = this.GlobalBrowserData.InterTabClient;
DefaultTabHostWindow window = null;
UIThreadHelper.Invoke(() =>
{
var viewModel = new DefaultTabHostViewModel(this.GlobalBrowserData);
var browserTabModel = viewModel.WebBrowserTabControlViewModel;
var tab = new WebBrowserHeaderedItemViewModel(this.GlobalBrowserData, browserTabModel.CefWindowData, null);
//browserTabModel.TabItems.Add(tab);
window = new DefaultTabHostWindow { DataContext = viewModel };
});
window.ShowDialog();
}
#endregion Methods
}
}

View File

@@ -0,0 +1,41 @@
namespace VideoBrowserTestApp.Tests
{
using System.Windows;
using VideoBrowser.Controls.CefSharpBrowser;
using VideoBrowser.ViewModels;
using VideoBrowser.Views;
using VideoBrowserTestApp.Helpers;
/// <summary>
/// Defines the <see cref="DownloadQueueViewTest" />.
/// </summary>
public class DownloadQueueViewTest : TestBase
{
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="DownloadQueueViewTest"/> class.
/// </summary>
public DownloadQueueViewTest() : base(nameof(DownloadQueueView))
{
}
#endregion Constructors
#region Methods
/// <summary>
/// The Test.
/// </summary>
/// <param name="testWindow">The testWindow<see cref="Window"/>.</param>
protected override void Test(Window testWindow)
{
var globalBrowserData = new GlobalBrowserData();
var viewModel = new DownloadQueueViewModel(globalBrowserData.DownloadItemModels);
var view = new DownloadQueueView { DataContext = viewModel };
WindowFactory.CreateAndShow(view, testWindow);
}
#endregion Methods
}
}

View File

@@ -0,0 +1,39 @@
namespace VideoBrowserTestApp.Tests
{
using System.Windows;
using VideoBrowser.Controls.CefSharpBrowser.ViewModels;
using VideoBrowser.Controls.CefSharpBrowser.Views;
using VideoBrowserTestApp.Helpers;
/// <summary>
/// Defines the <see cref="SettingsViewTest" />.
/// </summary>
public class SettingsViewTest : TestBase
{
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="SettingsViewTest"/> class.
/// </summary>
public SettingsViewTest() : base(nameof(SettingsView))
{
}
#endregion Constructors
#region Methods
/// <summary>
/// The Test.
/// </summary>
/// <param name="testWindow">The testWindow<see cref="Window"/>.</param>
protected override void Test(Window testWindow)
{
var viewModel = new SettingsViewModel();
var view = new SettingsView { DataContext = viewModel };
WindowFactory.CreateAndShow(view, testWindow);
}
#endregion Methods
}
}

View File

@@ -0,0 +1,60 @@
namespace VideoBrowserTestApp.Tests
{
using System.Windows;
using System.Windows.Input;
using VideoBrowser.Common;
/// <summary>
/// Defines the <see cref="TestBase" />.
/// </summary>
public abstract class TestBase : NotifyPropertyChanged
{
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="TestBase"/> class.
/// </summary>
/// <param name="name">The name<see cref="string"/>.</param>
protected TestBase(string name)
{
this.Name = name;
this.TestCommand = new RelayCommand(this.InternalTest, nameof(this.TestCommand));
}
#endregion Constructors
#region Properties
/// <summary>
/// Gets the Name.
/// </summary>
public string Name { get; }
/// <summary>
/// Gets the TestCommand.
/// </summary>
public ICommand TestCommand { get; }
#endregion Properties
#region Methods
/// <summary>
/// The Test.
/// </summary>
/// <param name="testWindow">The testWindow<see cref="Window"/>.</param>
protected abstract void Test(Window testWindow);
/// <summary>
/// The InternalTest.
/// </summary>
/// <param name="obj">The obj<see cref="object"/>.</param>
private void InternalTest(object obj)
{
Properties.Settings.Default.LastTest = this.Name;
this.Test(obj as Window);
}
#endregion Methods
}
}

View File

@@ -0,0 +1,47 @@
namespace VideoBrowserTestApp.Tests
{
using System.Windows;
using System.Windows.Controls;
using VideoBrowser.Controls.CefSharpBrowser.ViewModels;
using VideoBrowser.Core;
using VideoBrowser.ViewModels;
using VideoBrowser.Views;
using VideoBrowserTestApp.Helpers;
/// <summary>
/// Defines the <see cref="UrlEditorViewTest" />.
/// </summary>
public class UrlEditorViewTest : TestBase
{
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="UrlEditorViewTest"/> class.
/// </summary>
public UrlEditorViewTest() : base(nameof(UrlEditorView))
{
}
#endregion Constructors
#region Methods
/// <summary>
/// The Test.
/// </summary>
/// <param name="testWindow">The testWindow<see cref="Window"/>.</param>
protected override void Test(Window testWindow)
{
var urlReader = new UrlReader();
var settings = new SettingsViewModel();
var viewModelA = new UrlEditorViewModel(urlReader, settings) { IsVisible = true, FileName = "Youtube Video File Name", FileSize = "5 MB", Duration = "00:02:45" };
var viewModelB = new UrlEditorViewModel(urlReader, settings) { IsVisible = true, FileName = "Youtube Video File Name", FileSize = "1.4 MB", Duration = "00:02:45", IsBusy = true };
var stackPanel = new StackPanel();
stackPanel.Children.Add(new UrlEditorView { DataContext = viewModelA });
stackPanel.Children.Add(new UrlEditorView { DataContext = viewModelB });
WindowFactory.CreateAndShow(stackPanel, testWindow);
}
#endregion Methods
}
}

View File

@@ -0,0 +1,45 @@
namespace VideoBrowserTestApp.Tests
{
using System.Windows;
using VideoBrowser.Controls.CefSharpBrowser;
using VideoBrowser.Controls.CefSharpBrowser.ViewModels;
using VideoBrowser.Controls.CefSharpBrowser.Views;
using VideoBrowserTestApp.Helpers;
/// <summary>
/// Defines the <see cref="WebBrowserTabControlViewTest" />.
/// </summary>
public class WebBrowserTabControlViewTest : TestBase
{
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="WebBrowserTabControlViewTest"/> class.
/// </summary>
public WebBrowserTabControlViewTest() : base(nameof(WebBrowserTabControlView))
{
}
#endregion Constructors
#region Methods
/// <summary>
/// The Test.
/// </summary>
/// <param name="testWindow">The testWindow<see cref="Window"/>.</param>
protected override void Test(Window testWindow)
{
var globalBrowserData = new GlobalBrowserData();
var viewModel = new WebBrowserTabControlViewModel(globalBrowserData);
var cefWindowData = viewModel.CefWindowData;
var view = new WebBrowserTabControlView { DataContext = viewModel };
var window = WindowFactory.Create(view, testWindow);
viewModel.TabItems.Add(new WebBrowserHeaderedItemViewModel(globalBrowserData, cefWindowData, null));
cefWindowData.MainWindow = window; ;
window.ShowDialog();
}
#endregion Methods
}
}

View File

@@ -0,0 +1,158 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{78B417A3-4C48-45FF-91FB-66AF9436CD75}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>VideoBrowserTestApp</RootNamespace>
<AssemblyName>VideoBrowserTestApp</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<DelaySign>true</DelaySign>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="ControlzEx">
<HintPath>..\..\..\bin\ControlzEx.dll</HintPath>
</Reference>
<Reference Include="Dragablz, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\bin\Dragablz.dll</HintPath>
</Reference>
<Reference Include="MahApps.Metro">
<HintPath>..\..\..\bin\MahApps.Metro.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Xaml.Behaviors">
<HintPath>..\..\..\bin\Microsoft.Xaml.Behaviors.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="Views\MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Helpers\ReflectionHelper.cs" />
<Compile Include="Helpers\WindowFactory.cs" />
<Compile Include="Tests\AboutViewTest.cs" />
<Compile Include="Tests\DefaultTabHostWindowTest.cs" />
<Compile Include="Tests\DownloadQueueViewTest.cs" />
<Compile Include="Tests\SettingsViewTest.cs" />
<Compile Include="Tests\TestBase.cs" />
<Compile Include="Tests\UrlEditorViewTest.cs" />
<Compile Include="Tests\WebBrowserTabControlViewTest.cs" />
<Compile Include="ViewModels\MainWindowViewModel.cs" />
<Compile Include="Views\MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\VideoBrowser\VideoBrowser.csproj">
<Project>{2d8225bc-f5b6-4f29-a9e3-f4694d260597}</Project>
<Name>VideoBrowser</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,87 @@
namespace VideoBrowserTestApp.ViewModels
{
using System.Collections.Generic;
using System.Windows;
using System.Windows.Input;
using VideoBrowser.Common;
using VideoBrowserTestApp.Helpers;
using VideoBrowserTestApp.Tests;
/// <summary>
/// Defines the <see cref="MainWindowViewModel" />.
/// </summary>
public class MainWindowViewModel
{
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="MainWindowViewModel"/> class.
/// </summary>
internal MainWindowViewModel()
{
this.Tests = ReflectionHelper.GetInstances<TestBase>();
this.LoadedCommand = new RelayCommand(this.OnLoaded);
this.ClosedCommand = new RelayCommand(this.OnClosed);
}
#endregion Constructors
#region Properties
/// <summary>
/// Gets the ClosedCommand.
/// </summary>
public ICommand ClosedCommand { get; }
/// <summary>
/// Gets the LoadedCommand.
/// </summary>
public ICommand LoadedCommand { get; }
/// <summary>
/// Gets the Tests.
/// </summary>
public IList<TestBase> Tests { get; }
/// <summary>
/// Gets or sets the MainWindow.
/// </summary>
private Window MainWindow { get; set; }
#endregion Properties
#region Methods
/// <summary>
/// The OnClosed.
/// </summary>
/// <param name="obj">The obj<see cref="object"/>.</param>
private void OnClosed(object obj)
{
Properties.Settings.Default.Save();
}
/// <summary>
/// The OnLoaded.
/// </summary>
/// <param name="obj">The obj<see cref="object"/>.</param>
private void OnLoaded(object obj)
{
this.MainWindow = obj as Window;
var lastTest = Properties.Settings.Default.LastTest;
if (!string.IsNullOrEmpty(lastTest))
{
foreach (var test in this.Tests)
{
if (test.Name == lastTest)
{
test.TestCommand.Execute(this.MainWindow);
break;
}
}
}
}
#endregion Methods
}
}

View File

@@ -0,0 +1,37 @@
<mah:MetroWindow
x:Class="VideoBrowserTestApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:extension="clr-namespace:VideoBrowser.Extensions;assembly=VideoBrowser"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewmodels="clr-namespace:VideoBrowserTestApp.ViewModels"
x:Name="Window"
Title="VideoBrowserTestApp"
d:DataContext="{d:DesignInstance viewmodels:MainWindowViewModel}"
Closed="{extension:EventBinding Command={Binding ClosedCommand}}"
Loaded="{extension:EventBinding Command={Binding LoadedCommand},
CommandParameter={Binding RelativeSource={RelativeSource Self}}}"
SizeToContent="WidthAndHeight"
mc:Ignorable="d">
<Grid>
<ItemsControl ItemsSource="{Binding Tests}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button
Width="200"
Margin="4"
Command="{Binding TestCommand}"
CommandParameter="{Binding ElementName=Window}"
Content="{Binding Name}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</mah:MetroWindow>

View File

@@ -0,0 +1,23 @@
namespace VideoBrowserTestApp
{
using VideoBrowserTestApp.ViewModels;
/// <summary>
/// Interaction logic for MainWindow.xaml.
/// </summary>
public partial class MainWindow
{
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="MainWindow"/> class.
/// </summary>
public MainWindow()
{
this.InitializeComponent();
this.DataContext = new MainWindowViewModel();
}
#endregion Constructors
}
}