mirror of
				https://github.com/chibicitiberiu/rainmeter-studio.git
				synced 2024-02-24 04:33:31 +00:00 
			
		
		
		
	Work on project editor
This commit is contained in:
		@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user