FloatingButtonCollection

References
public sealed class FloatingButtonCollection
Utility class for storing and maintaining collections of floating buttons. You don't technically need this class but it's a lot easier than doing all the maintenance/bookkeeping yourself.

Properties

Buttons

#
public IEnumerable<FloatingButton> Buttons { get; }
Enumerate over all active buttons.

Control

#
public IFlexControl Control { get; }
Gets the control associated with this collection.

Count

#
public int Count { get; }
Gets the number of floating buttons in this collection.

Names

#
public IEnumerable<string> Names { get; }
Enumerate over all button names. This method ignores those buttons which are in states FloatingState.Closing or FloatingState.Closed.

VisibleButtons

#
public IEnumerable<FloatingButton> VisibleButtons { get; }
Enumerate over all visible buttons.

Indexers

this[]

#
public FloatingButton this[string name] { get; }
Gets a specific button by name. This accessor will throw if the name is not recognized.
name (string)Name of button to retrieve.
Button associated with name.

Methods

Add

#
public void Add(FloatingPosition position, string name, string info = null, Color? colour = null, IIcon icon = null, FloatingButtonHandler click = null, FloatingButtonHandler mouseDown = null, FloatingButtonHandler mouseUp = null)
Add a fixed button to this collection.
position (FloatingPosition)Position, may not be FloatingPosition.Anchored.
name (string)Name of button.
info (string = null)Info text for button.
colour (Color? = null)Fill colour of button.
icon (IIcon = null)Icon of button.
click (FloatingButtonHandler = null)Event handler for clicks.
mouseDown (FloatingButtonHandler = null)Mouse down handler.
mouseUp (FloatingButtonHandler = null)Mouse up handler.

AddAnchored

#
public void AddAnchored(PointF anchor, string name, string info = null, Color? colour = null, IIcon icon = null, FloatingButtonHandler click = null, FloatingButtonHandler mouseDown = null, FloatingButtonHandler mouseUp = null)
Add an anchored button to this collection.
anchor (PointF)Location of button.
name (string)Name of button.
info (string = null)Info text for button.
colour (Color? = null)Fill colour of button.
icon (IIcon = null)Icon of button.
click (FloatingButtonHandler = null)Event handler for clicks.
mouseDown (FloatingButtonHandler = null)Mouse down handler.
mouseUp (FloatingButtonHandler = null)Mouse up handler.

Close

#
public void Close(params string[] names)
Close some specific buttons. This will also remove the button from this collection.
names (params string[])Names of buttons.

CloseAll

#
public void CloseAll()
Close all remaining buttons.

FindByName

#
public FloatingButton FindByName(string name)
Try and retrieve a specific button by name.
name (string)Name of button to retrieve.
Button or null.

FindByPoint

#
public FloatingButton FindByPoint(PointF point)
Try and retrieve a button underneath a specific point.
point (PointF)Point in control coordinates (NOT! content coordinates).
Button underneath point.

Hide

#
public void Hide(params string[] names)
Hide some specific buttons.
names (params string[])Names of buttons.

IsDefined

#
public bool IsDefined(string name)
Gets whether a specific name has been defined.
name (string)Name to test for.
True if name if defined.

ModifyAnchor

#
public void ModifyAnchor(string name, PointF anchor, bool immediate)
Assign a new anchor to a button.
name (string)Name of button.
anchor (PointF)New anchor.
immediate (bool)If true, anchor will be set right away.

ModifyColour

#
public void ModifyColour(string name, Color colour)
Assign a new colour to a button.
name (string)Name of button.
colour (Color)New colour.

ModifyIcon

#
public void ModifyIcon(string name, IIcon icon)
Assign a new icon to a button.
name (string)Name of button.
icon (IIcon)New icon.

ModifyInfo

#
public void ModifyInfo(string name, string buttonInfo)
Change the Info field on a button.
name (string)Name of button within collection.
buttonInfo (string)Button info to assign.

Show

#
public void Show(params string[] names)
Show some specific buttons.
names (params string[])Names of buttons.

StateCount

#
public int StateCount(FloatingState state)
Count the number of buttons in a specific state.
state (FloatingState)State.
Number of buttons currently in that state.