2
0
Equbuxu 3 жил өмнө
parent
commit
1df2b55d5b

+ 7 - 2
src/PixiEditor.ChangeableDocument/Changes/Change.cs

@@ -3,28 +3,33 @@
 internal abstract class Change : IDisposable
 {
     /// <summary>
-    /// Check's if the layer is mergeable with the <paramref name="other"/> change. Returns false if not overridden
+    /// Checks if this change can be combined with the <paramref name="other"/> change. Returns false if not overridden
     /// </summary>
     /// <param name="other"></param>
     /// <returns></returns>
     public virtual bool IsMergeableWith(Change other) => false;
+
     /// <summary>
     /// Initializes and validates the changes parameter. Called before Apply and ApplyTemporarily
     /// </summary>
     /// <param name="target">The document the change will be applied on</param>
     /// <returns><see cref="Success"/> if all parameters are valid, otherwise <see cref="Error"/></returns>
     public abstract OneOf<Success, Error> InitializeAndValidate(Document target);
+
     /// <summary>
     /// Applies the change to the <paramref name="target"/>
     /// </summary>
-    /// <param name="firstApply">True if this is the first time Apply was called, always true if ignoreInUndo is true</param>
+    /// <param name="target">The document to apply the change to</param>
+    /// <param name="firstApply">True if this is the first time Apply was called</param>
     /// <param name="ignoreInUndo">Should this change be undoable using <see cref="Revert"/></param>
     /// <returns>Either nothing, a single change info, or a collection of change infos</returns>
     public abstract OneOf<None, IChangeInfo, List<IChangeInfo>> Apply(Document target, bool firstApply, out bool ignoreInUndo);
+
     /// <summary>
     /// Reverts the <paramref name="target"/> to the state before <see cref="Apply"/> was called. Not executed if ignoreInUndo was set in <see cref="Apply"/>
     /// </summary>
     /// <returns>Either nothing, a single change info, or a collection of change infos</returns>
     public abstract OneOf<None, IChangeInfo, List<IChangeInfo>> Revert(Document target);
+
     public virtual void Dispose() { }
 };

+ 1 - 1
src/PixiEditor.ChangeableDocument/Changes/Drawing/ShiftLayer_UpdateableChange.cs

@@ -14,7 +14,7 @@ internal class ShiftLayer_UpdateableChange : UpdateableChange
 
     public override OneOf<Success, Error> InitializeAndValidate(Document target)
     {
-        if (target.HasMember(layerGuid))
+        if (target.HasMember<Layer>(layerGuid))
             return new Success();
         return new Error();
     }

+ 0 - 5
src/PixiEditor.ChangeableDocument/Changes/UpdateableChange.cs

@@ -2,10 +2,5 @@
 
 internal abstract class UpdateableChange : Change
 {
-    /// <summary>
-    /// Applies the change temporarily
-    /// </summary>
-    /// <param name="target">The document the change will be applied on</param>
-    /// <returns>Either nothing, a single change info, or a collection of change infos</returns>
     public abstract OneOf<None, IChangeInfo, List<IChangeInfo>> ApplyTemporarily(Document target);
 }