Skip to content

Commit 7a3829e

Browse files
committed
Add logging of which commands are run
1 parent bb226b0 commit 7a3829e

25 files changed

+276
-51
lines changed

Showcase/Menu.Designer.cs

Lines changed: 210 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Operations/AddViewOperation.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public AddViewOperation(Design design)
4646
}
4747

4848
/// <inheritdoc/>
49-
public override void Redo()
49+
protected override void RedoImpl()
5050
{
5151
if (this.add == null)
5252
{
@@ -59,7 +59,7 @@ public override void Redo()
5959
}
6060

6161
/// <inheritdoc/>
62-
public override void Undo()
62+
protected override void UndoImpl()
6363
{
6464
if (this.add == null)
6565
{

src/Operations/CompositeOperation.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public CompositeOperation(params Operation[] operations)
3838
public IReadOnlyCollection<Operation> Operations => new ReadOnlyCollection<Operation>(this.operations);
3939

4040
/// <inheritdoc/>
41-
public override void Redo()
41+
protected override void RedoImpl()
4242
{
4343
foreach (var op in this.operations)
4444
{
@@ -47,7 +47,7 @@ public override void Redo()
4747
}
4848

4949
/// <inheritdoc/>
50-
public override void Undo()
50+
protected override void UndoImpl()
5151
{
5252
foreach (var op in this.operations)
5353
{

src/Operations/CopyOperation.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public override string ToString()
5757
/// Throws <see cref="NotSupportedException"/> as you cannot undo a copy.
5858
/// </summary>
5959
/// <exception cref="NotSupportedException">Thrown if method run.</exception>
60-
public override void Undo()
60+
protected override void UndoImpl()
6161
{
6262
throw new NotSupportedException();
6363
}
@@ -66,7 +66,7 @@ public override void Undo()
6666
/// Throws <see cref="NotSupportedException"/> as you cannot redo a copy.
6767
/// </summary>
6868
/// <exception cref="NotSupportedException">Thrown if method run.</exception>
69-
public override void Redo()
69+
protected override void RedoImpl()
7070
{
7171
throw new NotSupportedException();
7272
}

src/Operations/DeleteColorSchemeOperation.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ public DeleteColorSchemeOperation(Design design, NamedColorScheme toDelete)
3636
public NamedColorScheme ToDelete { get; }
3737

3838
/// <inheritdoc/>
39-
public override void Redo()
39+
protected override void RedoImpl()
4040
{
4141
this.Do();
4242
}
4343

4444
/// <inheritdoc/>
45-
public override void Undo()
45+
protected override void UndoImpl()
4646
{
4747
foreach (var u in this.users)
4848
{

src/Operations/DeleteViewOperation.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ public DeleteViewOperation(params Design[] delete)
4242
}
4343

4444
/// <inheritdoc/>
45-
public override void Redo()
45+
protected override void RedoImpl()
4646
{
4747
this.Do();
4848
}
4949

5050
/// <inheritdoc/>
51-
public override void Undo()
51+
protected override void UndoImpl()
5252
{
5353
for (int i = 0; i < this.delete.Length; i++)
5454
{

src/Operations/DragOperation.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public View? DropInto
140140
/// <summary>
141141
/// Moves all dragged views back to original positions.
142142
/// </summary>
143-
public override void Undo()
143+
protected override void UndoImpl()
144144
{
145145
foreach (var mem in this.mementos)
146146
{
@@ -149,7 +149,7 @@ public override void Undo()
149149
}
150150

151151
/// <inheritdoc/>
152-
public override void Redo()
152+
protected override void RedoImpl()
153153
{
154154
this.Do();
155155
}

src/Operations/Generics/AddOperation.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ public AddOperation(
4141
}
4242

4343
/// <inheritdoc/>
44-
public override void Undo()
44+
protected override void UndoImpl()
4545
{
4646
this.Remove(this.newItem);
4747
}
4848

4949
/// <inheritdoc/>
50-
public override void Redo()
50+
protected override void RedoImpl()
5151
{
5252
this.Add(this.newItem);
5353
}

src/Operations/Generics/MoveOperation.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ public override string ToString()
8080
}
8181

8282
/// <inheritdoc/>
83-
public override void Redo()
83+
protected override void RedoImpl()
8484
{
8585
this.Do();
8686
}
8787

8888
/// <inheritdoc/>
89-
public override void Undo()
89+
protected override void UndoImpl()
9090
{
9191
var list = this.ArrayGetter(this.View).ToList();
9292

src/Operations/Generics/RemoveOperation.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public RemoveOperation(
3333
}
3434

3535
/// <inheritdoc/>
36-
public override void Undo()
36+
protected override void UndoImpl()
3737
{
3838
// its not there anyways
3939
if (this.OperateOn == null)
@@ -48,7 +48,7 @@ public override void Undo()
4848
}
4949

5050
/// <inheritdoc/>
51-
public override void Redo()
51+
protected override void RedoImpl()
5252
{
5353
this.Do();
5454
}

0 commit comments

Comments
 (0)