ContentUndoHelper

Content undo helper to be used with "using {}" to enclose a block of changes.

Constructors

ContentUndoHelper

#Since v6.0 Obsolete v8.0
public ContentUndoHelper(RhinoDoc doc, string description)
obsoletePrefer the one without the description.
DEPRECATED: Constructs a ContentUndoHelper object inside a using block to handle undo when modifying a RenderContent or - alternatively - create the ContentUndoHelper and explicitly call Dispose when you are done.
doc (RhinoDoc)
description (string)Unused: Undo description (which appears in the UI when undo is run)

ContentUndoHelper

#Since v8.0
public ContentUndoHelper(RhinoDoc doc)
Constructs a ContentUndoHelper object inside a using block to handle undo when modifying a RenderContent or - alternatively - create the ContentUndoHelper and explicitly call Dispose when you are done.
doc (RhinoDoc)

Finalizer

~ContentUndoHelper

#
~ContentUndoHelper()

Methods

AddContent

#Since v6.0
public bool AddContent(RenderContent content, RenderContent parent)
Call this *after* adding a content. Undo will cause the content to be deleted.
content (RenderContent)Content you just added to the ContentList.
parent (RenderContent)is the content that will become the parent of the new content, or null if the new content is being added at the top level (i.e., not a child).
true if the content was added.

Dispose

#Since v6.0
public void Dispose()

Dispose

#
protected virtual void Dispose(bool isDisposing)
isDisposing (bool)

ModifyContent

#Since v6.0
public bool ModifyContent(RenderContent content)
Call this before modifying or deleting a content. Undo will cause the content to be restored.
content (RenderContent)Content you are about to modify.
true if the content was modified.

TweakContent

#Since v6.0
public bool TweakContent(RenderContent content, string parameterName)
Call this before tweaking a single content parameter. Undo will cause the parameter to be restored.
content (RenderContent)The render content
parameterName (string)The parameter name you are about to change.
true if the content was tweaked.