CadOwnerRegistry
from OpenCAD2D import CadOwnerRegistry
class CadOwnerRegistry(System.Object) ยท CadOwnerRegistry in the .NET reference
The owners a document knows, found by the name in an entity's CadOwnerTag, and asked before an owned entity changes.
Constructors
__init__
def __init__(self) -> None
Properties and fields
Owners
@property
def Owners(self) -> System.Collections.Generic.IReadOnlyList[ICadEntityOwner]
Gets the owners registered, in the order of their names, character by character.
Methods
Allows
@staticmethod
def Allows(rule: CadEditRule, kind: CadEditKind) -> bool
Says whether a rule lets an edit of a kind through: CadEditRule.Free and CadEditRule.Edit every kind, CadEditRule.MoveOnly a CadEditKind.Move only, CadEditRule.ReadOnly none.
FindOwner
def FindOwner(self, entity: DxfEntity) -> ICadEntityOwner
Finds the registered owner an entity's tag names.
GetEditRule
def GetEditRule(self, entity: DxfEntity) -> CadEditRule
Says what the presenter may do to an entity: CadEditRule.Free for one with no tag, CadEditRule.ReadOnly for one whose owner is not registered, and otherwise what its owner answers.
Register
def Register(self, owner: ICadEntityOwner) -> None
Registers an owner under its name.
TryApply
def TryApply(self, document: CadDocument, edit: CadEdit) -> bool
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 (CadOwnerRegistry.Allows), and otherwise the owner's answer. An entity whose rule is CadEditRule.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
def Unregister(self, name: str) -> bool
Takes an owner out; its entities are read-only from then on.