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:
@ -1,15 +1,18 @@
|
||||
using System.Windows.Media;
|
||||
using RainmeterStudio.Business;
|
||||
using RainmeterStudio.Core.Documents;
|
||||
using RainmeterStudio.Core.Model;
|
||||
|
||||
namespace RainmeterStudio.UI.ViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// View model for document templates
|
||||
/// </summary>
|
||||
public class DocumentTemplateViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the document template
|
||||
/// </summary>
|
||||
public DocumentTemplate Template { get; private set; }
|
||||
public IDocumentTemplate Template { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the document template name
|
||||
@ -23,7 +26,7 @@ namespace RainmeterStudio.UI.ViewModel
|
||||
{
|
||||
get
|
||||
{
|
||||
return ResourceProvider.GetImage("Template_" + Name + "_Icon");
|
||||
return ResourceProvider.GetImage("DocumentTemplate_" + Name + "_Icon");
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,7 +37,7 @@ namespace RainmeterStudio.UI.ViewModel
|
||||
{
|
||||
get
|
||||
{
|
||||
return ResourceProvider.GetString("Template_" + Name + "_DisplayText");
|
||||
return ResourceProvider.GetString("DocumentTemplate_" + Name + "_DisplayText");
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,7 +48,7 @@ namespace RainmeterStudio.UI.ViewModel
|
||||
{
|
||||
get
|
||||
{
|
||||
return ResourceProvider.GetString("Template_" + Name + "_Description");
|
||||
return ResourceProvider.GetString("DocumentTemplate_" + Name + "_Description");
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,7 +56,7 @@ namespace RainmeterStudio.UI.ViewModel
|
||||
/// Initializes the document template view model
|
||||
/// </summary>
|
||||
/// <param name="template">The document template</param>
|
||||
public DocumentTemplateViewModel(DocumentTemplate template)
|
||||
public DocumentTemplateViewModel(IDocumentTemplate template)
|
||||
{
|
||||
this.Template = template;
|
||||
}
|
||||
|
74
RainmeterStudio/UI/ViewModel/ProjectTemplateViewModel.cs
Normal file
74
RainmeterStudio/UI/ViewModel/ProjectTemplateViewModel.cs
Normal file
@ -0,0 +1,74 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Media;
|
||||
using RainmeterStudio.Business;
|
||||
using RainmeterStudio.Core.Model;
|
||||
|
||||
namespace RainmeterStudio.UI.ViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// View model for project templates
|
||||
/// </summary>
|
||||
public class ProjectTemplateViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the project template
|
||||
/// </summary>
|
||||
public IProjectTemplate Template { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the template
|
||||
/// </summary>
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return Template.Name;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the display text
|
||||
/// </summary>
|
||||
public string DisplayText
|
||||
{
|
||||
get
|
||||
{
|
||||
return ResourceProvider.GetString("ProjectTemplate_" + Name + "_DisplayText");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the description
|
||||
/// </summary>
|
||||
public string Description
|
||||
{
|
||||
get
|
||||
{
|
||||
return ResourceProvider.GetString("ProjectTemplate_" + Name + "_Description");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the icon
|
||||
/// </summary>
|
||||
public ImageSource Icon
|
||||
{
|
||||
get
|
||||
{
|
||||
return ResourceProvider.GetImage("ProjectTemplate_" + Name + "_Icon");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the project template view model
|
||||
/// </summary>
|
||||
/// <param name="template">A project template</param>
|
||||
public ProjectTemplateViewModel(IProjectTemplate template)
|
||||
{
|
||||
Template = template;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user