Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Database editor] Support for conditions in database table editors
- Loading branch information
Showing
16 changed files
with
345 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
WDE.DatabaseEditors/Data/Interfaces/IDatabaseTableModelGenerator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
WDE.DatabaseEditors/History/DatabaseEntityConditionsChangedHistoryAction.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using System.Collections.Generic; | ||
using WDE.Common.Database; | ||
using WDE.Common.History; | ||
using WDE.DatabaseEditors.Models; | ||
|
||
namespace WDE.DatabaseEditors.History | ||
{ | ||
public class DatabaseEntityConditionsChangedHistoryAction : IHistoryAction | ||
{ | ||
private readonly DatabaseEntity entity; | ||
private readonly IReadOnlyList<ICondition>? oldConditions; | ||
private readonly IReadOnlyList<ICondition>? newConditions; | ||
|
||
public DatabaseEntityConditionsChangedHistoryAction(DatabaseEntity entity, | ||
IReadOnlyList<ICondition>? oldConditions, IReadOnlyList<ICondition>? newConditions) | ||
{ | ||
this.entity = entity; | ||
this.oldConditions = oldConditions; | ||
this.newConditions = newConditions; | ||
} | ||
|
||
public void Undo() | ||
{ | ||
entity.Conditions = oldConditions; | ||
} | ||
|
||
public void Redo() | ||
{ | ||
entity.Conditions = newConditions; | ||
} | ||
|
||
public string GetDescription() | ||
{ | ||
return $"Entity {entity.Key} conditions changed"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.