mirror of
https://github.com/greenshot/greenshot
synced 2025-08-21 14:03:23 -07:00
Mainly code cleanup, added a lot of comments. Also making sure the element which was selected while being removed is re-selected again when undo is used. Not really happy with the solution as the the container should handle this somehow itself without work-around, for now it should be enough.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2311 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
3d62f9c279
commit
46e9ea0e59
10 changed files with 246 additions and 60 deletions
|
@ -39,7 +39,7 @@ namespace Greenshot.Memento {
|
|||
public void Dispose() {
|
||||
}
|
||||
|
||||
public LangKey ActionKey {
|
||||
public LangKey ActionLanguageKey {
|
||||
get {
|
||||
return LangKey.none;
|
||||
}
|
||||
|
@ -52,9 +52,12 @@ namespace Greenshot.Memento {
|
|||
public IMemento Restore() {
|
||||
// Before
|
||||
drawableContainer.Invalidate();
|
||||
// Store the selected state, as it's overwritten by the RemoveElement
|
||||
bool selected = drawableContainer.Selected;
|
||||
|
||||
DeleteElementMemento oldState = new DeleteElementMemento(surface, drawableContainer);
|
||||
surface.RemoveElement(drawableContainer, false);
|
||||
drawableContainer.Selected = true;
|
||||
|
||||
// After
|
||||
drawableContainer.Invalidate();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue