mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Added project templates, work on document template
This commit is contained in:
@ -7,6 +7,7 @@ using RainmeterStudio.Core.Documents;
|
||||
using RainmeterStudio.Core.Model.Events;
|
||||
using RainmeterStudio.UI.Dialogs;
|
||||
using RainmeterStudio.UI.ViewModel;
|
||||
using RainmeterStudio.Core.Model;
|
||||
|
||||
namespace RainmeterStudio.UI.Controller
|
||||
{
|
||||
@ -60,7 +61,7 @@ namespace RainmeterStudio.UI.Controller
|
||||
DocumentCreateCommand = new Command("DocumentCreateCommand", () => CreateWindow());
|
||||
}
|
||||
|
||||
public void CreateWindow(DocumentTemplate defaultFormat = null, string defaultPath = "")
|
||||
public void CreateWindow(IDocumentTemplate defaultFormat = null, string defaultPath = "")
|
||||
{
|
||||
// Show dialog
|
||||
var dialog = new CreateDocumentDialog(this)
|
||||
@ -81,7 +82,7 @@ namespace RainmeterStudio.UI.Controller
|
||||
DocumentManager.Create(format.Template);
|
||||
}
|
||||
|
||||
public void Create(DocumentTemplate format)
|
||||
public void Create(IDocumentTemplate format)
|
||||
{
|
||||
// Call manager
|
||||
DocumentManager.Create(format);
|
||||
|
@ -1,10 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using System.Linq;
|
||||
using Microsoft.Win32;
|
||||
using RainmeterStudio.Business;
|
||||
using RainmeterStudio.Core.Model;
|
||||
using RainmeterStudio.UI.Dialogs;
|
||||
using RainmeterStudio.UI.ViewModel;
|
||||
|
||||
namespace RainmeterStudio.UI.Controller
|
||||
{
|
||||
@ -44,6 +47,17 @@ namespace RainmeterStudio.UI.Controller
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the project templates
|
||||
/// </summary>
|
||||
public IEnumerable<ProjectTemplateViewModel> ProjectTemplates
|
||||
{
|
||||
get
|
||||
{
|
||||
return Manager.ProjectTemplates.Select(pt => new ProjectTemplateViewModel(pt));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Callbacks
|
||||
@ -91,7 +105,7 @@ namespace RainmeterStudio.UI.Controller
|
||||
public void CreateProject(string name = null, string path = null)
|
||||
{
|
||||
// Create dialog
|
||||
var dialog = new CreateProjectDialog();
|
||||
var dialog = new CreateProjectDialog(this);
|
||||
dialog.Owner = OwnerWindow;
|
||||
dialog.SelectedLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Rainmeter Studio Projects");
|
||||
|
||||
|
Reference in New Issue
Block a user