Click or drag to resize

ControlPanelItem Constructor (Visual, String, String, ControlProperty, String)

Constructs a new control panel item.

Namespace:  Demo3D.ControlPanel
Assembly:  Demo3D.Core (in Demo3D.Core.dll) Version: 15.0.2.11458
Syntax
C#
public ControlPanelItem(
	Visual controlVisual,
	string name,
	string control,
	ControlProperty[] properties,
	string panelName = null
)

Parameters

controlVisual
Type: Demo3D.VisualsVisual
The visual that's bound to the control.
name
Type: SystemString
The name of the control.
control
Type: SystemString
Widget for displaying the control. Must match the list of supported controls.
properties
Type: Demo3D.ControlPanelControlProperty
Property value accessors.
panelName (Optional)
Type: SystemString
Control panel name (or null).
Examples
C#
// Create a new control panel item, and add to the grid on reset.
[Auto] void ControlPanelItems(Visual sender, ControlPanelItemsResults items)
{
    // A lamp indicating if IsMotorOn is true.
    items.Add(new ControlPanelItem(sender, "ControlName", Control.Lamp, ControlProperty.Create(sender, "IsMotorOn")));

    // A pushable lamp with IsPushed and IsOn bound to two seperate properties.
    items.Add(new ControlPanelItem(sender, "ControlName", Control.PushableLamp, new ControlProperty[] {
        ControlProperty.Create(sender, "IsMotorOn"),
        ControlProperty.Create(sender, "IsLiftMotorOn")
    }));

    // A red lamp indicating if IsMotorOn is true.
    items.Add(new ControlPanelItem(sender, "ControlName", "Lamp(LampColor=Red)", ControlProperty.Create(sender, "IsMotorOn")));

    // A red pushable lamp with IsPushed and IsOn bound to two seperate properties.
    items.Add(new ControlPanelItem(sender, "ControlName", "PushableLamp(ManualRelease=true, LampColor=Red)", new ControlProperty[] {
        ControlProperty.Create(sender, "IsMotorOn"),
        ControlProperty.Create(sender, "IsLiftMotorOn")
    }));

    //A red lamp indicating if IsMotorOn is true.
    items.Add(new ControlPanelItem(sender, "ControlName", Control.Lamp, "IsMotorOn"));
}
See Also