Class Branch
The linkage between two Anchor objects.
public class Branch
- Inheritance
-
Branch
- Inherited Members
- Extension Methods
Properties
Arrow
Anchor from arrow side.
public Anchor Arrow { get; }
Property Value
Fletch
Anchor from fletch side.
public Anchor Fletch { get; }
Property Value
Guid
GUID.
public Guid Guid { get; }
Property Value
IsBreak
Is break.
public bool IsBreak { get; }
Property Value
Name
Gets or sets the name of the branch.
public string Name { get; set; }
Property Value
Step
If the Transformer is IDynamicRegular, the property is delegated from IDynamicRegular.Step; otherwise, the getter returns NAN and setter does nothing.
public double Step { get; set; }
Property Value
Transformer
Transformer.
public ITransformer Transformer { get; set; }
Property Value
Methods
Attach(IGetAnchor, IGetAnchor)
Attempts to attach two anchors.
public static Branch Attach(IGetAnchor fletch, IGetAnchor arrow)
Parameters
fletchIGetAnchorSee Fletch
arrowIGetAnchorSee Arrow
Returns
- Branch
branch
Attach(IGetAnchor, IGetAnchor, ITransformer)
Attempts to attach two anchors with a specified transformer.
public static Branch Attach(IGetAnchor fletch, IGetAnchor arrow, ITransformer transformer)
Parameters
fletchIGetAnchorSee Fletch
arrowIGetAnchorSee Arrow
transformerITransformerSee Transformer
Returns
- Branch
branch
AttachIfAbsence(IGetAnchor, IGetAnchor)
Attempts to attach two anchors if they are not already connected. If the anchors are already connected, returns null instead of throwing an exception.
public static Branch AttachIfAbsence(IGetAnchor fletch, IGetAnchor arrow)
Parameters
fletchIGetAnchorThe fletch-side anchor to attach
arrowIGetAnchorThe arrow-side anchor to attach
Returns
- Branch
The newly created branch if successful, null if the anchors are already connected
Detach()
Break the branch.
public void Detach()
Detach(IGetAnchor, IGetAnchor)
Break the branch from Get(IGetAnchor, IGetAnchor).
public static void Detach(IGetAnchor fletch, IGetAnchor arrow)
Parameters
fletchIGetAnchorSee Fletch
arrowIGetAnchorSee Arrow
Exceptions
- InvalidOperationException
The exception is throwed if the Branch is not existed.
DetachIfExisted(IGetAnchor, IGetAnchor)
Break the branch from Get(IGetAnchor, IGetAnchor).
public static bool DetachIfExisted(IGetAnchor fletch, IGetAnchor arrow)
Parameters
fletchIGetAnchorSee Fletch
arrowIGetAnchorSee Arrow
Returns
Get(IGetAnchor, IGetAnchor)
Get existed Branch by fletchSource and arrowSource.
public static Branch Get(IGetAnchor fletchSource, IGetAnchor arrowSource)
Parameters
fletchSourceIGetAnchorfletch
arrowSourceIGetAnchorarrow
Returns
- Branch
The branch. If branch not exist, return null.
IsExisted(IGetAnchor, IGetAnchor)
Checks if a branch exists between two anchors.
public static bool IsExisted(IGetAnchor fletch, IGetAnchor arrow)
Parameters
fletchIGetAnchorThe fletch-side anchor.
arrowIGetAnchorThe arrow-side anchor.
Returns
- bool
True if a branch exists between the anchors, false otherwise.
ToLinkString()
Get brief link description.
public string ToLinkString()
Returns
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
TryAttach(IGetAnchor, IGetAnchor, ITransformer)
Attempts to attach two anchors with a specified transformer. If the attachment fails, returns null instead of throwing an exception.
public static Branch TryAttach(IGetAnchor fletch, IGetAnchor arrow, ITransformer transformer)
Parameters
fletchIGetAnchorThe fletch-side anchor to attach
arrowIGetAnchorThe arrow-side anchor to attach
transformerITransformerThe transformer to use for the branch
Returns
- Branch
The newly created branch if successful, null if the attachment fails