Table of Contents

Method TryApply

Namespace
OpenCAD2D
Assembly
OpenCAD2D.Core.dll

TryApply(CadDocument, CadEdit)

Hands an edit of an owned entity to its owner, as the presenter does before it changes one: refused where the entity's rule does not allow the kind (Allows(CadEditRule, CadEditKind)), and otherwise the owner's answer. An entity whose rule is Free is edited by the presenter itself and not handed over: the answer for it is false, and so is the answer for a handle the document has no entity of.

public bool TryApply(CadDocument document, CadEdit edit)

Parameters

document CadDocument

The document the entity is in.

edit CadEdit

The edit.

Returns

bool

Whether the owner took the edit.

Exceptions

ArgumentNullException

Thrown when the document or the edit is null.