API Reference
Class
ChangePreview
The what-if pattern: show the changes an action would make, then ask before making them. A typed confirmation guards destructive changes. Returns the decision; the caller acts only on true.
Inheritance
- Object
- ChangePreview
Methods
public static Boolean Ask(ChangeSet changes, ChangePreviewOptions? options = null, CancellationToken cancellationToken = default) #Returns:
BooleanAsks for confirmation of changes already shown (a typed confirmation for destructive ones).
Parameters
- changes ConsoleMonster.Changes.ChangeSet
- The changes.
- options ConsoleMonster.Changes.ChangePreviewOptions? = null
- Options, or null.
- cancellationToken System.Threading.CancellationToken = default
- Cancels the prompt.
Returns
True when the user approved; false when declined or when there is nothing to change.
public static Boolean Confirm(ChangeSet changes, ChangePreviewOptions? options = null, CancellationToken cancellationToken = default) #Returns:
BooleanShows the preview and asks for confirmation.
Parameters
- changes ConsoleMonster.Changes.ChangeSet
- The changes.
- options ConsoleMonster.Changes.ChangePreviewOptions? = null
- Options, or null.
- cancellationToken System.Threading.CancellationToken = default
- Cancels the prompt.
Returns
True when the user approved; false when declined or when there is nothing to change.
public static Void Show(ChangeSet changes, ChangePreviewOptions? options = null) #Returns:
VoidShows the preview only (the what-if half), with a note when there is nothing to change.
Parameters
- changes ConsoleMonster.Changes.ChangeSet
- The changes.
- options ConsoleMonster.Changes.ChangePreviewOptions? = null
- Options, or null.
Inherited Methods
public virtual Boolean Equals(Object? obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object?