Work on project editor

This commit is contained in:
2014-09-12 13:19:01 +03:00
parent b6d8730783
commit 51e0b0d612
16 changed files with 354 additions and 127 deletions

View File

@ -156,7 +156,7 @@ namespace RainmeterStudio.Business
throw new ArgumentException("Reference cannot be empty");
// Save
storage.Write(document.Reference.StoragePath, document);
storage.WriteDocument(document, document.Reference.StoragePath);
// Clear dirty flag
document.IsDirty = false;
@ -173,7 +173,7 @@ namespace RainmeterStudio.Business
var storage = FindStorage(document);
// Save
storage.Write(path, document);
storage.WriteDocument(document, path);
// Update reference
document.Reference = new Reference(Path.GetFileName(path), path);
@ -193,7 +193,7 @@ namespace RainmeterStudio.Business
var storage = FindStorage(document);
// Save
storage.Write(path, document);
storage.WriteDocument(document, path);
}
/// <summary>
@ -249,9 +249,9 @@ namespace RainmeterStudio.Business
IDocument document = null;
foreach (var storage in Storages)
if (storage.CanRead(path))
if (storage.CanReadDocument(path))
{
document = storage.Read(path);
document = storage.ReadDocument(path);
break;
}
@ -272,7 +272,7 @@ namespace RainmeterStudio.Business
IDocumentStorage storage = null;
foreach (var s in Storages)
if (s.CanWrite(document.GetType()))
if (s.CanWriteDocument(document.GetType()))
{
storage = s;
break;

View File

@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using RainmeterStudio.Core.Model;
using RainmeterStudio.Core.Storage;
using RainmeterStudio.Storage;
using RainmeterStudio.Editor.ProjectEditor;
namespace RainmeterStudio.Business
{
@ -88,7 +88,7 @@ namespace RainmeterStudio.Business
Close();
// Open using storage
ActiveProject = Storage.Load(path);
ActiveProject = Storage.Read(path);
ActiveProject.Path = path;
// Raise event
@ -106,7 +106,7 @@ namespace RainmeterStudio.Business
throw new InvalidOperationException("Cannot save a project that is not opened.");
// Save
Storage.Save(ActiveProject);
Storage.Write(ActiveProject);
}
/// <summary>