Class CanvasTracker
Used to track generic canvases and their states.
Inheritance
Inherited Members
Namespace: GameKit.Dependencies.Utilities.Types
Assembly: GameKit.Dependencies.dll
Syntax
public static class CanvasTracker
Properties
InputBlockingCanvases
Canvases which should block input.
Declaration
public static IReadOnlyList<object> InputBlockingCanvases { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Object> |
IsInputBlockingCanvasOpen
True if any blocking canvas is open.
Declaration
public static bool IsInputBlockingCanvasOpen { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
OpenCanvases
Canvases which are currently open, in the order they were opened.
Declaration
public static IReadOnlyList<object> OpenCanvases { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Object> |
Methods
AddOpenCanvas(Object, Boolean)
Adds a canvas to OpenCanvases if not already added.
Declaration
public static bool AddOpenCanvas(object canvas, bool addToBlocking)
Parameters
Type | Name | Description |
---|---|---|
System.Object | canvas | |
System.Boolean | addToBlocking | True to also add as an input blocking canvas. |
Returns
Type | Description |
---|---|
System.Boolean | True if the canvas was added, false if already added. |
ClearCollections()
Clears all collections.
Declaration
public static void ClearCollections()
IsInputBlockingCanvas(Object)
Returns if the canvas is an input blocking canvas.
Declaration
public static bool IsInputBlockingCanvas(object canvas)
Parameters
Type | Name | Description |
---|---|---|
System.Object | canvas |
Returns
Type | Description |
---|---|
System.Boolean |
IsLastInputBlockingCanvas(Object)
Returns true if is the last canvas blocking input or if no input blocking canvases are set as opened.
Declaration
public static bool IsLastInputBlockingCanvas(object canvas)
Parameters
Type | Name | Description |
---|---|---|
System.Object | canvas |
Returns
Type | Description |
---|---|
System.Boolean |
IsLastOpenCanvas(Object)
Returns true if is the last canvas opened or if no canvases are set as opened.
Declaration
public static bool IsLastOpenCanvas(object canvas)
Parameters
Type | Name | Description |
---|---|---|
System.Object | canvas |
Returns
Type | Description |
---|---|
System.Boolean |
IsOpenCanvas(Object)
Returns true if canvas is an open canvas.
Declaration
public static bool IsOpenCanvas(object canvas)
Parameters
Type | Name | Description |
---|---|---|
System.Object | canvas |
Returns
Type | Description |
---|---|
System.Boolean |
RemoveNullReferences()
Removes null references of canvases. This can be used as clean-up if you were unable to remove a canvas properly. Using this method regularly could be expensive if there are hundreds of open canvases.
Declaration
public static void RemoveNullReferences()
RemoveOpenCanvas(Object)
Removes a canvas from OpenCanvases.
Declaration
public static bool RemoveOpenCanvas(object canvas)
Parameters
Type | Name | Description |
---|---|---|
System.Object | canvas |
Returns
Type | Description |
---|---|
System.Boolean | True if the canvas was removed, false if it was not added. |