From 5daa72facc91fad3d43ae16d151d737eca3faadb Mon Sep 17 00:00:00 2001 From: sr55 Date: Fri, 21 Jan 2011 21:51:39 +0000 Subject: WinGui: - Add initial WPF project. (Uses MVVM, Caliburn 1.1) This may one day replace the WinForms code. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3762 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/HandBrakeWPF/App.xaml | 8 ++ win/C#/HandBrakeWPF/App.xaml.cs | 48 +++++++++ win/C#/HandBrakeWPF/HandBrakeWPF.csproj | 120 +++++++++++++++++++++ win/C#/HandBrakeWPF/Properties/AssemblyInfo.cs | 55 ++++++++++ .../HandBrakeWPF/Properties/Resources.Designer.cs | 71 ++++++++++++ win/C#/HandBrakeWPF/Properties/Resources.resx | 117 ++++++++++++++++++++ .../HandBrakeWPF/Properties/Settings.Designer.cs | 30 ++++++ win/C#/HandBrakeWPF/Properties/Settings.settings | 7 ++ win/C#/HandBrakeWPF/Settings.StyleCop | 1 + win/C#/HandBrakeWPF/ViewModels/MainViewModel.cs | 48 +++++++++ win/C#/HandBrakeWPF/Views/MainView.xaml | 8 ++ win/C#/HandBrakeWPF/Views/MainView.xaml.cs | 23 ++++ 12 files changed, 536 insertions(+) create mode 100644 win/C#/HandBrakeWPF/App.xaml create mode 100644 win/C#/HandBrakeWPF/App.xaml.cs create mode 100644 win/C#/HandBrakeWPF/HandBrakeWPF.csproj create mode 100644 win/C#/HandBrakeWPF/Properties/AssemblyInfo.cs create mode 100644 win/C#/HandBrakeWPF/Properties/Resources.Designer.cs create mode 100644 win/C#/HandBrakeWPF/Properties/Resources.resx create mode 100644 win/C#/HandBrakeWPF/Properties/Settings.Designer.cs create mode 100644 win/C#/HandBrakeWPF/Properties/Settings.settings create mode 100644 win/C#/HandBrakeWPF/Settings.StyleCop create mode 100644 win/C#/HandBrakeWPF/ViewModels/MainViewModel.cs create mode 100644 win/C#/HandBrakeWPF/Views/MainView.xaml create mode 100644 win/C#/HandBrakeWPF/Views/MainView.xaml.cs (limited to 'win/C#/HandBrakeWPF') diff --git a/win/C#/HandBrakeWPF/App.xaml b/win/C#/HandBrakeWPF/App.xaml new file mode 100644 index 000000000..903288b37 --- /dev/null +++ b/win/C#/HandBrakeWPF/App.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/win/C#/HandBrakeWPF/App.xaml.cs b/win/C#/HandBrakeWPF/App.xaml.cs new file mode 100644 index 000000000..ae8d6a357 --- /dev/null +++ b/win/C#/HandBrakeWPF/App.xaml.cs @@ -0,0 +1,48 @@ +/* App.xaml.cs $ + This file is part of the HandBrake source code. + Homepage: . + It may be used under the terms of the GNU General Public License. */ + +namespace HandBrakeWPF +{ + using Caliburn.PresentationFramework.ApplicationModel; + + using HandBrakeWPF.ViewModels; + + /// + /// Interaction logic for App.xaml + /// + public partial class App : CaliburnApplication + { + /* + * TODO: + * - Setup Castle Windsor support for services. + * + * + */ + + + /// + /// Initializes a new instance of the class. + /// + public App() + { + } + + /// + /// Create the Root View + /// + /// + /// A MainViewMOdel + /// + protected override object CreateRootModel() + { + var binder = (DefaultBinder)Container.GetInstance(); + + binder.EnableBindingConventions(); + binder.EnableMessageConventions(); + + return new MainViewModel(); + } + } +} diff --git a/win/C#/HandBrakeWPF/HandBrakeWPF.csproj b/win/C#/HandBrakeWPF/HandBrakeWPF.csproj new file mode 100644 index 000000000..a110b96cc --- /dev/null +++ b/win/C#/HandBrakeWPF/HandBrakeWPF.csproj @@ -0,0 +1,120 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {DADE66CB-0E12-4959-ADE5-0ACD31D27C59} + WinExe + Properties + HandBrakeWPF + HandBrakeWPF + v4.0 + Client + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\libraries\caliburn\Caliburn.Core.dll + + + ..\libraries\caliburn\Caliburn.ModelFramework.dll + + + ..\libraries\caliburn\Caliburn.PresentationFramework.dll + + + ..\libraries\caliburn\Microsoft.Practices.ServiceLocation.dll + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + + MainView.xaml + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + Designer + MSBuild:Compile + + + + + + + + \ No newline at end of file diff --git a/win/C#/HandBrakeWPF/Properties/AssemblyInfo.cs b/win/C#/HandBrakeWPF/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..0e7cf6f8c --- /dev/null +++ b/win/C#/HandBrakeWPF/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +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("HandBrake")] +[assembly: AssemblyDescription("A WPF MVVM based GUI for HandBrake.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("HandBrake Team")] +[assembly: AssemblyProduct("HandBrake")] +[assembly: AssemblyCopyright("Copyright © HandBrake Team 2011")] +[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 +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the 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.9.5.0")] +[assembly: AssemblyFileVersion("0.9.5.0")] diff --git a/win/C#/HandBrakeWPF/Properties/Resources.Designer.cs b/win/C#/HandBrakeWPF/Properties/Resources.Designer.cs new file mode 100644 index 000000000..b9eb47749 --- /dev/null +++ b/win/C#/HandBrakeWPF/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.1 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace HandBrakeWPF.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // 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", "4.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() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HandBrakeWPF.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/win/C#/HandBrakeWPF/Properties/Resources.resx b/win/C#/HandBrakeWPF/Properties/Resources.resx new file mode 100644 index 000000000..ffecec851 --- /dev/null +++ b/win/C#/HandBrakeWPF/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/win/C#/HandBrakeWPF/Properties/Settings.Designer.cs b/win/C#/HandBrakeWPF/Properties/Settings.Designer.cs new file mode 100644 index 000000000..ae1b86547 --- /dev/null +++ b/win/C#/HandBrakeWPF/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.1 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace HandBrakeWPF.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.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; + } + } + } +} diff --git a/win/C#/HandBrakeWPF/Properties/Settings.settings b/win/C#/HandBrakeWPF/Properties/Settings.settings new file mode 100644 index 000000000..8f2fd95d6 --- /dev/null +++ b/win/C#/HandBrakeWPF/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/win/C#/HandBrakeWPF/Settings.StyleCop b/win/C#/HandBrakeWPF/Settings.StyleCop new file mode 100644 index 000000000..7f55ce6c6 --- /dev/null +++ b/win/C#/HandBrakeWPF/Settings.StyleCop @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/win/C#/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/C#/HandBrakeWPF/ViewModels/MainViewModel.cs new file mode 100644 index 000000000..8008064f3 --- /dev/null +++ b/win/C#/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -0,0 +1,48 @@ +/* MainViewModel.cs $ + This file is part of the HandBrake source code. + Homepage: . + It may be used under the terms of the GNU General Public License. */ + +namespace HandBrakeWPF.ViewModels +{ + using Caliburn.Core; + + /// + /// HandBrakes Main Window + /// + public class MainViewModel : PropertyChangedBase + { + /// + /// HandBrakes Main Window Title + /// + private string windowName; + + /// + /// Initializes a new instance of the class. + /// + public MainViewModel() + { + this.WindowTitle = "HandBrake WPF Test Application"; + } + + /// + /// Gets or sets TestProperty. + /// + public string WindowTitle + { + get + { + return this.windowName; + } + + set + { + if (!object.Equals(this.windowName, value)) + { + this.windowName = value; + this.NotifyOfPropertyChange("TestProperty"); + } + } + } + } +} diff --git a/win/C#/HandBrakeWPF/Views/MainView.xaml b/win/C#/HandBrakeWPF/Views/MainView.xaml new file mode 100644 index 000000000..438192ea6 --- /dev/null +++ b/win/C#/HandBrakeWPF/Views/MainView.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/win/C#/HandBrakeWPF/Views/MainView.xaml.cs b/win/C#/HandBrakeWPF/Views/MainView.xaml.cs new file mode 100644 index 000000000..efb3e7d6e --- /dev/null +++ b/win/C#/HandBrakeWPF/Views/MainView.xaml.cs @@ -0,0 +1,23 @@ +/* MainView.xaml.cs $ + This file is part of the HandBrake source code. + Homepage: . + It may be used under the terms of the GNU General Public License. */ + +namespace HandBrakeWPF.Views +{ + using System.Windows; + + /// + /// Interaction logic for MainView.xaml + /// + public partial class MainView : Window + { + /// + /// Initializes a new instance of the class. + /// + public MainView() + { + InitializeComponent(); + } + } +} -- cgit v1.2.3