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
fletch
IGetAnchorSee Fletch
arrow
IGetAnchorSee 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
fletch
IGetAnchorSee Fletch
arrow
IGetAnchorSee Arrow
transformer
ITransformerSee 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
fletch
IGetAnchorThe fletch-side anchor to attach
arrow
IGetAnchorThe 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
fletch
IGetAnchorSee Fletch
arrow
IGetAnchorSee 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
fletch
IGetAnchorSee Fletch
arrow
IGetAnchorSee Arrow
Returns
Get(IGetAnchor, IGetAnchor)
Get existed Branch by fletchSource
and arrowSource
.
public static Branch Get(IGetAnchor fletchSource, IGetAnchor arrowSource)
Parameters
fletchSource
IGetAnchorfletch
arrowSource
IGetAnchorarrow
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
fletch
IGetAnchorThe fletch-side anchor.
arrow
IGetAnchorThe 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
fletch
IGetAnchorThe fletch-side anchor to attach
arrow
IGetAnchorThe arrow-side anchor to attach
transformer
ITransformerThe transformer to use for the branch
Returns
- Branch
The newly created branch if successful, null if the attachment fails