mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 13:33:27 -07:00
This commit is contained in:
parent
15db5a1a3f
commit
8aca1c8282
4 changed files with 21 additions and 4 deletions
|
@ -93,6 +93,11 @@ namespace Greenshot.Base.Interfaces.Drawing
|
|||
/// </summary>
|
||||
IList<IAdorner> Adorners { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Is confirm/cancel possible for this container
|
||||
/// </summary>
|
||||
bool IsConfirmable { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Adjust UI elements to the supplied DPI settings
|
||||
/// </summary>
|
||||
|
|
|
@ -264,9 +264,18 @@ namespace Greenshot.Editor.Drawing
|
|||
Invalidate();
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IDrawableContainer"/>
|
||||
/// <summary>
|
||||
/// <inheritdoc />
|
||||
/// <para/>
|
||||
/// Make sure this container is not undoable
|
||||
/// </summary>
|
||||
public override bool IsUndoable => false;
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc />
|
||||
/// <para/>
|
||||
/// See dedicated confirm method <see cref="Surface.ConfirmCrop(bool)"/>
|
||||
/// </summary>
|
||||
public override bool IsConfirmable => true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -480,9 +480,12 @@ namespace Greenshot.Editor.Drawing
|
|||
g.DrawRectangle(pen, rect);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IDrawableContainer"/>
|
||||
/// <inheritdoc/>
|
||||
public virtual bool IsUndoable => true;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public virtual bool IsConfirmable => false;
|
||||
|
||||
/// <summary>
|
||||
/// Make a following bounds change on this drawablecontainer undoable!
|
||||
/// </summary>
|
||||
|
|
|
@ -2108,7 +2108,7 @@ namespace Greenshot.Editor.Drawing
|
|||
{
|
||||
// create new collection so that we can iterate safely (selectedElements might change due with confirm/cancel)
|
||||
List<IDrawableContainer> selectedDCs = new List<IDrawableContainer>(selectedElements);
|
||||
foreach (IDrawableContainer dc in selectedDCs)
|
||||
foreach (IDrawableContainer dc in selectedDCs.Where(c => c.IsConfirmable))
|
||||
{
|
||||
throw new NotImplementedException($"No confirm/cancel defined for Container type {dc.GetType()}");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue