2014-07-26 07:12:56 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using RainmeterStudio.Business;
|
|
|
|
|
using RainmeterStudio.Model;
|
|
|
|
|
|
|
|
|
|
namespace RainmeterStudio.Documents.Text
|
|
|
|
|
{
|
2014-07-29 16:42:52 +00:00
|
|
|
|
/*public class TextEditorFactory : IDocumentEditorFactory
|
2014-07-26 07:12:56 +00:00
|
|
|
|
{
|
|
|
|
|
private TextStorage _storage = new TextStorage();
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
public string EditorName
|
|
|
|
|
{
|
|
|
|
|
get { return Resources.Strings.DocumentEditor_Text_Name; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
2014-07-26 10:49:11 +00:00
|
|
|
|
public IEnumerable<DocumentTemplate> CreateDocumentFormats
|
2014-07-26 07:12:56 +00:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2014-07-26 10:49:11 +00:00
|
|
|
|
yield return new DocumentTemplate()
|
2014-07-26 07:12:56 +00:00
|
|
|
|
{
|
|
|
|
|
Name = Resources.Strings.DocumentFormat_TextFile_Name,
|
|
|
|
|
Category = Resources.Strings.Category_Utility,
|
|
|
|
|
DefaultExtension = ".txt",
|
|
|
|
|
Description = Resources.Strings.DocumentFormat_TextFile_Description,
|
2014-07-27 13:21:06 +00:00
|
|
|
|
Icon = new System.Windows.Media.Imaging.BitmapImage(new Uri(Resources.Icons.DocumentTemplate_Text, UriKind.RelativeOrAbsolute)),
|
2014-07-26 07:12:56 +00:00
|
|
|
|
Factory = this
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IDocumentEditor CreateEditor(IDocument document)
|
|
|
|
|
{
|
|
|
|
|
TextDocument textDocument = document as TextDocument;
|
|
|
|
|
|
|
|
|
|
if (textDocument == null)
|
|
|
|
|
throw new ArgumentException("Cannot edit provided document.");
|
|
|
|
|
|
|
|
|
|
return new TextEditor(textDocument);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IDocumentStorage Storage { get { return _storage; } }
|
|
|
|
|
|
2014-07-26 10:49:11 +00:00
|
|
|
|
public IDocument CreateDocument(DocumentTemplate format, string path)
|
2014-07-26 07:12:56 +00:00
|
|
|
|
{
|
|
|
|
|
var document = new TextDocument();
|
|
|
|
|
document.FilePath = path;
|
|
|
|
|
|
|
|
|
|
return document;
|
|
|
|
|
}
|
2014-07-29 16:42:52 +00:00
|
|
|
|
}*/
|
2014-07-26 07:12:56 +00:00
|
|
|
|
}
|