2014-08-15 12:31:33 +00:00
|
|
|
|
using System.Windows.Media;
|
|
|
|
|
using RainmeterStudio.Business;
|
2014-08-15 21:39:31 +00:00
|
|
|
|
using RainmeterStudio.Core.Model;
|
2014-07-29 16:42:52 +00:00
|
|
|
|
|
|
|
|
|
namespace RainmeterStudio.UI.ViewModel
|
|
|
|
|
{
|
2014-08-15 21:39:31 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// View model for document templates
|
|
|
|
|
/// </summary>
|
2014-07-29 16:42:52 +00:00
|
|
|
|
public class DocumentTemplateViewModel
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the document template
|
|
|
|
|
/// </summary>
|
2014-08-15 21:39:31 +00:00
|
|
|
|
public IDocumentTemplate Template { get; private set; }
|
2014-07-29 16:42:52 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the document template name
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string Name { get { return Template.Name; } }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the icon of this document template
|
|
|
|
|
/// </summary>
|
2014-08-15 12:31:33 +00:00
|
|
|
|
public ImageSource Icon
|
2014-07-29 16:42:52 +00:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2014-08-15 21:39:31 +00:00
|
|
|
|
return ResourceProvider.GetImage("DocumentTemplate_" + Name + "_Icon");
|
2014-07-29 16:42:52 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the display text
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string DisplayText
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2014-08-15 21:39:31 +00:00
|
|
|
|
return ResourceProvider.GetString("DocumentTemplate_" + Name + "_DisplayText");
|
2014-07-29 16:42:52 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the description of this document template
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string Description
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2014-08-15 21:39:31 +00:00
|
|
|
|
return ResourceProvider.GetString("DocumentTemplate_" + Name + "_Description");
|
2014-07-29 16:42:52 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Initializes the document template view model
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="template">The document template</param>
|
2014-08-15 21:39:31 +00:00
|
|
|
|
public DocumentTemplateViewModel(IDocumentTemplate template)
|
2014-07-29 16:42:52 +00:00
|
|
|
|
{
|
|
|
|
|
this.Template = template;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|