Class CadOwnerRegistry
- Namespace
- OpenCAD2D
- Assembly
- OpenCAD2D.Core.dll
The owners a document knows, found by the name in an entity's CadOwnerTag, and asked before an owned entity changes.
public sealed class CadOwnerRegistry
- Inheritance
-
CadOwnerRegistry
- Inherited Members
Remarks
An entity with no tag is the presenter's own (Free). One whose tag names a registered owner gets the rule that owner gives. One whose tag names an owner not registered, as a model drawing opened where the drawing module is not loaded, is ReadOnly: there is nobody to record the edit, and the owner's next update would write over it.
An owner that throws is not let stop the presenter: its rule is taken as ReadOnly, its edit as refused, and the exception is written as a Warn line of GeometryHelperLog.
Properties
- Owners
Gets the owners registered, in the order of their names, character by character.
Methods
- Allows(CadEditRule, CadEditKind)
Says whether a rule lets an edit of a kind through: Free and Edit every kind, MoveOnly a Move only, ReadOnly none.
- FindOwner(DxfEntity)
Finds the registered owner an entity's tag names.
- GetEditRule(DxfEntity)
Says what the presenter may do to an entity: Free for one with no tag, ReadOnly for one whose owner is not registered, and otherwise what its owner answers.
- Register(ICadEntityOwner)
Registers an owner under its name.
- 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.
- Unregister(string)
Takes an owner out; its entities are read-only from then on.