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

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

Control

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

Count

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

Names

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

VisibleButtons

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

Indexers

this[]

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

Methods

Add

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

AddAnchored

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

Close

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

CloseAll

#
Close all remaining buttons.
public void CloseAll()

FindByName

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

FindByPoint

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

Hide

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

IsDefined

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

ModifyAnchor

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

ModifyColour

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

ModifyIcon

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

ModifyInfo

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

Show

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

StateCount

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