Click or drag to resize

ControlBase Class

Base class all controls inherit from.
Inheritance Hierarchy
SystemObject
  AxiomCore2.ControlsControlBase
    More

Namespace: AxiomCore2.Controls
Assembly: Canary.Axiom.Session (in Canary.Axiom.Session.exe) Version: 25.6.0.25344+3070493948bf7d32a86bd3e9a8bcf4cc9a5b1929
Syntax
C#
public abstract class ControlBase : IControlBase, 
	IDisposable

The ControlBase type exposes the following members.

Properties
 NameDescription
Public propertyKind Kind of control.
Public propertyName Control name that is unique within the owning screen. Name of control must conform to the regex pattern [a-zA-Z0-9], as only letters and numbers are valid characters.
Public propertyParent Parent of the control.
Public propertyScreen Screen the control resides in.
Public propertyTemplateId Id used to find sibling controls within a template. All siblings will have the same id. Default value is null.
Top
Methods
 NameDescription
Public methodAncestorsT Get ancestor controls that implement generic control interface defined by T.
Protected methodGetPropertyT(String) 
Public methodStatic memberGetPropertyT(Object, String) FOR SCRIPT USE ONLY: Get property of a ControlBase object.
Public methodStatic memberHasProperty FOR SCRIPT USE ONLY: Check if object is a ControlBase with specified property.
Protected methodSetProperty(Object, String) 
Public methodStatic memberSetProperty(Object, String, Object, UpdateBehavior) FOR SCRIPT USE ONLY: Set property of a ControlBase object.
Public methodStatic memberTryGetPropertyT FOR SCRIPT USE ONLY: Try to get a property from ControlBase object.
Public methodStatic memberTrySetProperty FOR SCRIPT USE ONLY: Try to set property of ControlBase object.
Top
Fields
 NameDescription
Protected field_kind 
Protected field_name 
Protected field_parent 
Protected field_screen 
Top
Example

Since all controls inherit from the BaseControl class, We can use the following static methods to get/set properties without casting to a specific control type.

Check if control has property.

C#
object sender; // control
bool hasHeight = ControlBase.HasProperty(sender, "Height");

Get property of control. NOTE: exception will be thrown if control does not have specified property.

C#
object sender; // control
int height = ControlBase.GetProperty<int>(sender, "Height");

Set property of control. NOTE: exception will be thrown if control cannot set specified property.

C#
object sender; // control
ControlBase.SetProperty(sender, "Height", 100);

Try to get property of control. NOTE: no exceptions will be thrown.

C#
object sender; // control
int height;
bool result = ControlBase.TryGetProperty(sender, "Height", out height);

Try to set property of control. NOTE: no exceptions will be thrown.

C#
object sender; // control
int height = 100;
bool result = ControlBase.TrySetProperty(sender, "Height", height);
See Also
Inheritance Hierarchy