From 48972dfb52059a5ee2f5c52debf3fcb98cc17e87 Mon Sep 17 00:00:00 2001 From: Tiberiu Chibici Date: Sat, 26 Jul 2014 13:49:11 +0300 Subject: [PATCH] Implemented project manager --- RainmeterStudio/Business/DocumentManager.cs | 4 +- RainmeterStudio/Business/ProjectManager.cs | 107 ++++++++- .../Documents/Text/TextEditorFactory.cs | 6 +- RainmeterStudio/Model/DocumentFormat.cs | 2 +- .../Model/IDocumentEditorFactory.cs | 4 +- .../Properties/Settings.Designer.cs | 11 + RainmeterStudio/RainmeterStudio.csproj | 20 +- RainmeterStudio/Resources/Icons.Designer.cs | 81 +++++++ RainmeterStudio/Resources/Icons.resx | 126 +++++++++++ RainmeterStudio/Resources/Strings.Designer.cs | 126 ++++++++++- RainmeterStudio/Resources/Strings.resx | 36 +++ .../UI/Controller/DocumentController.cs | 31 ++- .../UI/Controller/ProjectController.cs | 148 +++++++++++++ .../UI/Dialogs/CreateDocumentDialog.xaml.cs | 4 +- .../UI/Dialogs/CreateProjectDialog.xaml | 102 +++++++++ .../UI/Dialogs/CreateProjectDialog.xaml.cs | 207 ++++++++++++++++++ RainmeterStudio/UI/MainWindow.xaml | 41 ++-- RainmeterStudio/UI/MainWindow.xaml.cs | 24 +- 18 files changed, 1028 insertions(+), 52 deletions(-) create mode 100644 RainmeterStudio/Resources/Icons.Designer.cs create mode 100644 RainmeterStudio/Resources/Icons.resx create mode 100644 RainmeterStudio/UI/Controller/ProjectController.cs create mode 100644 RainmeterStudio/UI/Dialogs/CreateProjectDialog.xaml create mode 100644 RainmeterStudio/UI/Dialogs/CreateProjectDialog.xaml.cs diff --git a/RainmeterStudio/Business/DocumentManager.cs b/RainmeterStudio/Business/DocumentManager.cs index 62a38377..7e5eb36d 100644 --- a/RainmeterStudio/Business/DocumentManager.cs +++ b/RainmeterStudio/Business/DocumentManager.cs @@ -51,7 +51,7 @@ namespace RainmeterStudio.Business /// /// /// - public void Create(DocumentFormat format, string path) + public void Create(DocumentTemplate format, string path) { // Create document var document = format.Factory.CreateDocument(format, path); @@ -65,7 +65,7 @@ namespace RainmeterStudio.Business DocumentOpened(this, new DocumentOpenedEventArgs(editor)); } - public IEnumerable DocumentFormats + public IEnumerable DocumentFormats { get { diff --git a/RainmeterStudio/Business/ProjectManager.cs b/RainmeterStudio/Business/ProjectManager.cs index a29b6852..3a8bf75f 100644 --- a/RainmeterStudio/Business/ProjectManager.cs +++ b/RainmeterStudio/Business/ProjectManager.cs @@ -3,14 +3,117 @@ using System.Collections.Generic; using System.Linq; using System.Text; using RainmeterStudio.Model; +using RainmeterStudio.Storage; namespace RainmeterStudio.Business { public class ProjectManager { + #region Properties + + /// + /// Gets the currently opened project + /// public Project ActiveProject { get; protected set; } - public void Open() { } - public void Close() { } + /// + /// Gets the currently opened project's path + /// + public string ActiveProjectPath { get; protected set; } + + /// + /// Gets or sets the project storage + /// + protected ProjectStorage Storage { get; set; } + + #endregion + + #region Callbacks + + /// + /// Called when a project is opened or the active project closes. + /// + public event EventHandler ActiveProjectChanged; + + #endregion + + /// + /// Initializes the project manager + /// + /// Project storage + public ProjectManager(ProjectStorage storage) + { + Storage = storage; + ActiveProject = null; + } + + /// + /// Creates a new project + /// + /// Name of project + /// Path of project file + public void CreateProject(string name, string path) + { + // If there is an opened project, close it + if (ActiveProject != null) + Close(); + + // Create project object + ActiveProject = new Project(); + ActiveProject.Name = name; + + // Save to file + ActiveProjectPath = path; + SaveActiveProject(); + + // Raise event + if (ActiveProjectChanged != null) + ActiveProjectChanged(this, new EventArgs()); + } + + /// + /// Opens a project from disk + /// + /// + public void OpenProject(string path) + { + // If there is an opened project, close it + if (ActiveProject != null) + Close(); + + // Open using storage + ActiveProject = Storage.Load(path); + ActiveProjectPath = path; + + // Raise event + if (ActiveProjectChanged != null) + ActiveProjectChanged(this, new EventArgs()); + } + + /// + /// Saves the changes to the current project to disk + /// + public void SaveActiveProject() + { + // Safety check + if (ActiveProject == null) + throw new InvalidOperationException("Cannot save a project that is not opened."); + + // Save + Storage.Save(ActiveProjectPath, ActiveProject); + } + + /// + /// Closes an opened project + /// + public void Close() + { + ActiveProject = null; + ActiveProjectPath = null; + + // Raise event + if (ActiveProjectChanged != null) + ActiveProjectChanged(this, new EventArgs()); + } } } diff --git a/RainmeterStudio/Documents/Text/TextEditorFactory.cs b/RainmeterStudio/Documents/Text/TextEditorFactory.cs index b75dbead..bdef5786 100644 --- a/RainmeterStudio/Documents/Text/TextEditorFactory.cs +++ b/RainmeterStudio/Documents/Text/TextEditorFactory.cs @@ -19,11 +19,11 @@ namespace RainmeterStudio.Documents.Text } /// - public IEnumerable CreateDocumentFormats + public IEnumerable CreateDocumentFormats { get { - yield return new DocumentFormat() + yield return new DocumentTemplate() { Name = Resources.Strings.DocumentFormat_TextFile_Name, Category = Resources.Strings.Category_Utility, @@ -48,7 +48,7 @@ namespace RainmeterStudio.Documents.Text public IDocumentStorage Storage { get { return _storage; } } - public IDocument CreateDocument(DocumentFormat format, string path) + public IDocument CreateDocument(DocumentTemplate format, string path) { var document = new TextDocument(); document.FilePath = path; diff --git a/RainmeterStudio/Model/DocumentFormat.cs b/RainmeterStudio/Model/DocumentFormat.cs index b9522f80..f525ca6a 100644 --- a/RainmeterStudio/Model/DocumentFormat.cs +++ b/RainmeterStudio/Model/DocumentFormat.cs @@ -2,7 +2,7 @@ namespace RainmeterStudio.Model { - public class DocumentFormat + public class DocumentTemplate { public string Name { get; set; } public ImageSource Icon { get; set; } diff --git a/RainmeterStudio/Model/IDocumentEditorFactory.cs b/RainmeterStudio/Model/IDocumentEditorFactory.cs index a6205e9f..a1553509 100644 --- a/RainmeterStudio/Model/IDocumentEditorFactory.cs +++ b/RainmeterStudio/Model/IDocumentEditorFactory.cs @@ -16,7 +16,7 @@ namespace RainmeterStudio.Model /// /// Formats that will be used to populate the 'create document' dialog /// - IEnumerable CreateDocumentFormats { get; } + IEnumerable CreateDocumentFormats { get; } /// /// Creates a new editor object @@ -29,7 +29,7 @@ namespace RainmeterStudio.Model /// Creates a new document /// /// A new document - IDocument CreateDocument(DocumentFormat format, string path); + IDocument CreateDocument(DocumentTemplate format, string path); /// /// Gets the storage of this factory diff --git a/RainmeterStudio/Properties/Settings.Designer.cs b/RainmeterStudio/Properties/Settings.Designer.cs index c6767e20..43b346eb 100644 --- a/RainmeterStudio/Properties/Settings.Designer.cs +++ b/RainmeterStudio/Properties/Settings.Designer.cs @@ -22,5 +22,16 @@ namespace RainmeterStudio.Properties { return defaultInstance; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public global::System.Windows.Input.KeyGestureConverter asdf { + get { + return ((global::System.Windows.Input.KeyGestureConverter)(this["asdf"])); + } + set { + this["asdf"] = value; + } + } } } diff --git a/RainmeterStudio/RainmeterStudio.csproj b/RainmeterStudio/RainmeterStudio.csproj index 21268294..4a6c233f 100644 --- a/RainmeterStudio/RainmeterStudio.csproj +++ b/RainmeterStudio/RainmeterStudio.csproj @@ -40,6 +40,7 @@ + @@ -95,6 +96,11 @@ + + True + True + Icons.resx + True True @@ -104,11 +110,15 @@ + CreateDocumentDialog.xaml + + CreateProjectDialog.xaml + SkinsPanel.xaml @@ -124,6 +134,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -167,8 +181,12 @@ ResXFileCodeGenerator Resources.Designer.cs - + ResXFileCodeGenerator + Icons.Designer.cs + + + PublicResXFileCodeGenerator Strings.Designer.cs diff --git a/RainmeterStudio/Resources/Icons.Designer.cs b/RainmeterStudio/Resources/Icons.Designer.cs new file mode 100644 index 00000000..81c269ec --- /dev/null +++ b/RainmeterStudio/Resources/Icons.Designer.cs @@ -0,0 +1,81 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace RainmeterStudio.Resources { + using System; + + + /// + /// 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 Icons { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Icons() { + } + + /// + /// 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 (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RainmeterStudio.Resources.Icons", typeof(Icons).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; + } + } + + /// + /// Looks up a localized string similar to /Resources/Icons/page_white_star_16.png. + /// + internal static string DocumentCreateCommand_Icon { + get { + return ResourceManager.GetString("DocumentCreateCommand_Icon", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to /Resources/Icons/project_star_16.png. + /// + internal static string ProjectCreateCommand_Icon { + get { + return ResourceManager.GetString("ProjectCreateCommand_Icon", resourceCulture); + } + } + } +} diff --git a/RainmeterStudio/Resources/Icons.resx b/RainmeterStudio/Resources/Icons.resx new file mode 100644 index 00000000..776fcd5c --- /dev/null +++ b/RainmeterStudio/Resources/Icons.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + /Resources/Icons/page_white_star_16.png + + + /Resources/Icons/project_star_16.png + + \ No newline at end of file diff --git a/RainmeterStudio/Resources/Strings.Designer.cs b/RainmeterStudio/Resources/Strings.Designer.cs index c82b8218..10a61dac 100644 --- a/RainmeterStudio/Resources/Strings.Designer.cs +++ b/RainmeterStudio/Resources/Strings.Designer.cs @@ -22,7 +22,7 @@ namespace RainmeterStudio.Resources { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Strings { + public class Strings { private static global::System.Resources.ResourceManager resourceMan; @@ -36,7 +36,7 @@ namespace RainmeterStudio.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 { + public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RainmeterStudio.Resources.Strings", typeof(Strings).Assembly); @@ -51,7 +51,7 @@ namespace RainmeterStudio.Resources { /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { + public static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } @@ -63,16 +63,52 @@ namespace RainmeterStudio.Resources { /// /// Looks up a localized string similar to Utility. /// - internal static string Category_Utility { + public static string Category_Utility { get { return ResourceManager.GetString("Category_Utility", resourceCulture); } } + /// + /// Looks up a localized string similar to Browse. + /// + public static string Dialog_Browse { + get { + return ResourceManager.GetString("Dialog_Browse", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cancel. + /// + public static string Dialog_Cancel { + get { + return ResourceManager.GetString("Dialog_Cancel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Create. + /// + public static string Dialog_Create { + get { + return ResourceManager.GetString("Dialog_Create", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to OK. + /// + public static string Dialog_OK { + get { + return ResourceManager.GetString("Dialog_OK", resourceCulture); + } + } + /// /// Looks up a localized string similar to _File.... /// - internal static string DocumentCreateCommand_DisplayText { + public static string DocumentCreateCommand_DisplayText { get { return ResourceManager.GetString("DocumentCreateCommand_DisplayText", resourceCulture); } @@ -81,7 +117,7 @@ namespace RainmeterStudio.Resources { /// /// Looks up a localized string similar to Creates a new file. /// - internal static string DocumentCreateCommand_ToolTip { + public static string DocumentCreateCommand_ToolTip { get { return ResourceManager.GetString("DocumentCreateCommand_ToolTip", resourceCulture); } @@ -90,7 +126,7 @@ namespace RainmeterStudio.Resources { /// /// Looks up a localized string similar to Text Editor. /// - internal static string DocumentEditor_Text_Name { + public static string DocumentEditor_Text_Name { get { return ResourceManager.GetString("DocumentEditor_Text_Name", resourceCulture); } @@ -99,7 +135,7 @@ namespace RainmeterStudio.Resources { /// /// Looks up a localized string similar to Blank text file. /// - internal static string DocumentFormat_TextFile_Description { + public static string DocumentFormat_TextFile_Description { get { return ResourceManager.GetString("DocumentFormat_TextFile_Description", resourceCulture); } @@ -108,10 +144,82 @@ namespace RainmeterStudio.Resources { /// /// Looks up a localized string similar to Text file. /// - internal static string DocumentFormat_TextFile_Name { + public static string DocumentFormat_TextFile_Name { get { return ResourceManager.GetString("DocumentFormat_TextFile_Name", resourceCulture); } } + + /// + /// Looks up a localized string similar to _Project.... + /// + public static string ProjectCreateCommand_DisplayText { + get { + return ResourceManager.GetString("ProjectCreateCommand_DisplayText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Creates a new project. + /// + public static string ProjectCreateCommand_ToolTip { + get { + return ResourceManager.GetString("ProjectCreateCommand_ToolTip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Location:. + /// + public static string ProjectCreateDialog_Location { + get { + return ResourceManager.GetString("ProjectCreateDialog_Location", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Set location as default. + /// + public static string ProjectCreateDialog_LocationDefault { + get { + return ResourceManager.GetString("ProjectCreateDialog_LocationDefault", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Name:. + /// + public static string ProjectCreateDialog_Name { + get { + return ResourceManager.GetString("ProjectCreateDialog_Name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path:. + /// + public static string ProjectCreateDialog_Path { + get { + return ResourceManager.GetString("ProjectCreateDialog_Path", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Create directory for project. + /// + public static string ProjectCreateDialog_PathCreateFolder { + get { + return ResourceManager.GetString("ProjectCreateDialog_PathCreateFolder", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Create project. + /// + public static string ProjectCreateDialog_Title { + get { + return ResourceManager.GetString("ProjectCreateDialog_Title", resourceCulture); + } + } } } diff --git a/RainmeterStudio/Resources/Strings.resx b/RainmeterStudio/Resources/Strings.resx index e2d125c1..5c45a36e 100644 --- a/RainmeterStudio/Resources/Strings.resx +++ b/RainmeterStudio/Resources/Strings.resx @@ -120,6 +120,18 @@ Utility + + Browse + + + Cancel + + + Create + + + OK + _File... @@ -135,4 +147,28 @@ Text file + + _Project... + + + Creates a new project + + + Location: + + + Set location as default + + + Name: + + + Path: + + + Create directory for project + + + Create project + \ No newline at end of file diff --git a/RainmeterStudio/UI/Controller/DocumentController.cs b/RainmeterStudio/UI/Controller/DocumentController.cs index 6acaded3..083507a1 100644 --- a/RainmeterStudio/UI/Controller/DocumentController.cs +++ b/RainmeterStudio/UI/Controller/DocumentController.cs @@ -16,7 +16,25 @@ namespace RainmeterStudio.UI.Controller { #region Commands - public Command DocumentCreateCommand { get; private set; } + public Command _documentCreateCommand; + public Command DocumentCreateCommand + { + get + { + if (_documentCreateCommand == null) + { + _documentCreateCommand = new Command("DocumentCreateCommand", () => CreateWindow()) + { + DisplayText = Resources.Strings.DocumentCreateCommand_DisplayText, + Tooltip = Resources.Strings.DocumentCreateCommand_ToolTip, + Icon = new BitmapImage(new Uri(Resources.Icons.DocumentCreateCommand_Icon, UriKind.RelativeOrAbsolute)), + Shortcut = new KeyGesture(Key.N, ModifierKeys.Control) + }; + } + + return _documentCreateCommand; + } + } #endregion @@ -37,16 +55,9 @@ namespace RainmeterStudio.UI.Controller public DocumentController() { - DocumentCreateCommand = new Command("DocumentCreateCommand", () => CreateWindow()) - { - DisplayText = Resources.Strings.DocumentCreateCommand_DisplayText, - Tooltip = Resources.Strings.DocumentCreateCommand_ToolTip, - Icon = new BitmapImage(new Uri("/Resources/Icons/page_white_star_16.png", UriKind.RelativeOrAbsolute)), - Shortcut = new KeyGesture(Key.N, ModifierKeys.Control) - }; } - public void CreateWindow(DocumentFormat defaultFormat = null, string defaultPath = "") + public void CreateWindow(DocumentTemplate defaultFormat = null, string defaultPath = "") { // Show dialog var dialog = new CreateDocumentDialog() @@ -67,7 +78,7 @@ namespace RainmeterStudio.UI.Controller DocumentManager.Instance.Create(format, path); } - public void Create(DocumentFormat format, string path) + public void Create(DocumentTemplate format, string path) { // Call manager DocumentManager.Instance.Create(format, path); diff --git a/RainmeterStudio/UI/Controller/ProjectController.cs b/RainmeterStudio/UI/Controller/ProjectController.cs new file mode 100644 index 00000000..ab0646f3 --- /dev/null +++ b/RainmeterStudio/UI/Controller/ProjectController.cs @@ -0,0 +1,148 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Windows; +using System.Windows.Input; +using System.Windows.Media.Imaging; +using RainmeterStudio.Business; +using RainmeterStudio.Model; +using RainmeterStudio.UI.Dialogs; + +namespace RainmeterStudio.UI.Controller +{ + public class ProjectController + { + #region Properties + + /// + /// Gets the project manager + /// + protected ProjectManager Manager { get; private set; } + + /// + /// Gets or sets the owner window. Used for creating dialogs. + /// + public Window OwnerWindow { get; set; } + + /// + /// Gets the active project + /// + public Project ActiveProject + { + get + { + return Manager.ActiveProject; + } + } + + /// + /// Gets the active project path + /// + public string ActiveProjectPath + { + get + { + return Manager.ActiveProjectPath; + } + } + + #endregion + + #region Callbacks + + /// + /// Called when a project is opened or the active project closes. + /// + public event EventHandler ActiveProjectChanged + { + add + { + Manager.ActiveProjectChanged += value; + } + remove + { + Manager.ActiveProjectChanged -= value; + } + } + + #endregion + + #region Commands + + private Command _projectCreateCommand; + public Command ProjectCreateCommand + { + get + { + if (_projectCreateCommand == null) + { + _projectCreateCommand = new Command("ProjectCreateComand", () => CreateProject()) + { + DisplayText = Resources.Strings.ProjectCreateCommand_DisplayText, + Tooltip = Resources.Strings.ProjectCreateCommand_ToolTip, + Icon = new BitmapImage(new Uri(Resources.Icons.ProjectCreateCommand_Icon, UriKind.RelativeOrAbsolute)), + Shortcut = new KeyGesture(Key.N, ModifierKeys.Control | ModifierKeys.Shift) + }; + } + + return _projectCreateCommand; + } + } + + #endregion + + /// + /// Initializes the project controller + /// + /// Project manager + public ProjectController(ProjectManager manager) + { + Manager = manager; + } + + /// + /// Displays the 'create project' dialog and creates a new project + /// + public void CreateProject(string name = null, string path = null) + { + // Create dialog + var dialog = new CreateProjectDialog(); + dialog.Owner = OwnerWindow; + dialog.SelectedLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Rainmeter Studio Projects"); + + if (name != null) + dialog.Name = name; + + if (path != null) + dialog.SelectedPath = path; + + // Display + bool? res = dialog.ShowDialog(); + if (!res.HasValue || !res.Value) + return; + + string selectedPath = dialog.SelectedPath; + + // Call manager + Manager.CreateProject(name, selectedPath); // TODO + } + + /// + /// Displays an 'open file' dialog and opens an existing project + /// + /// + public void OpenProject(string path = null) + { + + } + + /// + /// Closes the active project + /// + public void CloseProject() + { + } + } +} diff --git a/RainmeterStudio/UI/Dialogs/CreateDocumentDialog.xaml.cs b/RainmeterStudio/UI/Dialogs/CreateDocumentDialog.xaml.cs index 8c2767bf..be5e69c2 100644 --- a/RainmeterStudio/UI/Dialogs/CreateDocumentDialog.xaml.cs +++ b/RainmeterStudio/UI/Dialogs/CreateDocumentDialog.xaml.cs @@ -24,11 +24,11 @@ namespace RainmeterStudio.UI.Dialogs /// /// Gets or sets the currently selected file format /// - public DocumentFormat SelectedFormat + public DocumentTemplate SelectedFormat { get { - return listFormats.SelectedItem as DocumentFormat; + return listFormats.SelectedItem as DocumentTemplate; } set { diff --git a/RainmeterStudio/UI/Dialogs/CreateProjectDialog.xaml b/RainmeterStudio/UI/Dialogs/CreateProjectDialog.xaml new file mode 100644 index 00000000..2c38e379 --- /dev/null +++ b/RainmeterStudio/UI/Dialogs/CreateProjectDialog.xaml @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - +