Class ProfileElement
Represents an element of a Profile
public abstract class ProfileElement : BreakableModel, IBreakableModel, IDisposable, IPluginFeatureDependent
- Inheritance
-
objectCorePropertyChangedProfileElement
- Implements
- Derived
- Inherited Members
Properties
BrokenDisplayName
Gets the display name of this breakable model
public override string BrokenDisplayName { get; }
Property Value
Children
The element's children
public ReadOnlyCollection<ProfileElement> Children { get; }
Property Value
Disposed
Gets a boolean indicating whether the profile element is disposed
public bool Disposed { get; protected set; }
Property Value
EntityId
Gets the unique ID of this profile element
public Guid EntityId { get; }
Property Value
Name
The name which appears in the editor
public string? Name { get; set; }
Property Value
Order
The order in which this element appears in the update loop and editor
public int Order { get; }
Property Value
Parent
Gets the parent of this element
public ProfileElement? Parent { get; }
Property Value
Profile
Gets the profile this element belongs to
public Profile Profile { get; }
Property Value
Suspended
Gets or sets the suspended state, if suspended the element is skipped in render and update
public bool Suspended { get; set; }
Property Value
Methods
AddChild(ProfileElement, int?)
Adds a profile element to the Children collection, optionally at the given position (0-based)
public virtual void AddChild(ProfileElement child, int? order = null)
Parameters
childProfileElementThe profile element to add
orderint?The order where to place the child (0-based), defaults to the end of the collection
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Dispose(bool)
Disposes the profile element
protected virtual void Dispose(bool disposing)
Parameters
disposingbool
GetAllFolders()
Returns a flattened list of all child folders
public List<Folder> GetAllFolders()
Returns
GetAllLayers()
Returns a flattened list of all child layers
public List<Layer> GetAllLayers()
Returns
GetAllRenderElements()
Returns a flattened list of all child render elements
public List<RenderProfileElement> GetAllRenderElements()
Returns
GetFeatureDependencies()
Gets the plugin features this class depends on, may contain the same plugin feature twice if depending on it in multiple ways.
public abstract IEnumerable<PluginFeature> GetFeatureDependencies()
Returns
- IEnumerable<PluginFeature>
A List<T> of PluginFeature this class depends on.
GetNewFolderName(string)
Returns a name for a new folder according to any other folders with a default name similar to creating new folders in Explorer
public string GetNewFolderName(string baseName = "New folder")
Parameters
baseNamestring
Returns
- string
The resulting name i.e.
New folderorNew folder (2)
GetNewLayerName(string)
Returns a name for a new layer according to any other layers with a default name similar to creating new folders in Explorer
public string GetNewLayerName(string baseName = "New layer")
Parameters
baseNamestring
Returns
- string
The resulting name i.e.
New layerorNew layer (2)
OnChildAdded(ProfileElement)
Invokes the ChildAdded event
protected virtual void OnChildAdded(ProfileElement child)
Parameters
childProfileElement
OnChildRemoved(ProfileElement)
Invokes the ChildRemoved event
protected virtual void OnChildRemoved(ProfileElement child)
Parameters
childProfileElement
OnDescendentAdded(ProfileElement)
Invokes the DescendentAdded event
protected virtual void OnDescendentAdded(ProfileElement child)
Parameters
childProfileElement
OnDescendentRemoved(ProfileElement)
Invokes the DescendentRemoved event
protected virtual void OnDescendentRemoved(ProfileElement child)
Parameters
childProfileElement
RemoveChild(ProfileElement)
Removes a profile element from the Children collection
public virtual void RemoveChild(ProfileElement child)
Parameters
childProfileElementThe profile element to remove
Render(SKCanvas, SKPointI, ProfileElement?)
Renders the element
public abstract void Render(SKCanvas canvas, SKPointI basePosition, ProfileElement? editorFocus)
Parameters
canvasSKCanvasThe canvas to render upon.
basePositionSKPointIThe base position to use to translate relative positions to absolute positions.
editorFocusProfileElementAn optional element to focus on while rendering (other elements will not render).
Reset()
Resets the internal state of the element
public abstract void Reset()
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
Update(double)
Updates the element
public abstract void Update(double deltaTime)
Parameters
deltaTimedouble
Events
ChildAdded
Occurs when a child was added to the Children list
public event EventHandler<ProfileElementEventArgs>? ChildAdded
Event Type
ChildRemoved
Occurs when a child was removed from the Children list
public event EventHandler<ProfileElementEventArgs>? ChildRemoved
Event Type
DescendentAdded
Occurs when a child was added to the Children list of this element or any of it's descendents.
public event EventHandler<ProfileElementEventArgs>? DescendentAdded
Event Type
DescendentRemoved
Occurs when a child was removed from the Children list of this element or any of it's descendents.
public event EventHandler<ProfileElementEventArgs>? DescendentRemoved