rainmeter-studio/RainmeterStudio/Editor/ProjectEditor/ProjectEditorFactory.cs

39 lines
1.2 KiB
C#
Raw Normal View History

2014-09-12 10:19:01 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RainmeterStudio.Core;
2014-09-12 10:26:52 +00:00
using RainmeterStudio.Core.Editor;
2014-09-12 10:19:01 +00:00
using RainmeterStudio.Core.Model;
namespace RainmeterStudio.Editor.ProjectEditor
{
/// <summary>
/// Project editor factory
/// </summary>
[PluginExport]
public class ProjectEditorFactory : IDocumentEditorFactory
{
/// <summary>
/// Creates a new project editor
/// </summary>
/// <param name="document">The project document</param>
/// <returns>Created editor</returns>
public IDocumentEditor CreateEditor(IDocument document)
{
return new ProjectEditorUI((ProjectDocument)document);
}
/// <summary>
/// Checks if this editor can edit documents of given type
/// </summary>
/// <param name="type">Type</param>
/// <returns>True if the project editor can edit that kind of document</returns>
public bool CanEdit(Type type)
{
return (type.Equals(typeof(ProjectDocument)));
}
}
}