ControlPanelItem(Visual, String, String, String, Boolean, Boolean, String) Constructor |
Constructs a new control panel item.
Namespace: Demo3D.ControlPanelAssembly: Demo3D.Core (in Demo3D.Core.dll) Version: 19.00.00
Syntaxpublic ControlPanelItem(
Visual controlVisual,
string name,
string control,
string propertyName = null,
bool canRead = true,
bool canWrite = true,
string panelName = null
)
Parameters
- controlVisual Visual
- The visual that's bound to the control.
- name String
- The name of the control.
- control String
- Widget for displaying the control. Must match the list of supported controls.
- propertyName String (Optional)
- The name of the property on controlVisual (or null to use name).
- canRead Boolean (Optional)
- True if it's meaningful to read the value of the property.
- canWrite Boolean (Optional)
- True if the control can write a value to the property.
- panelName String (Optional)
- Control panel name (or null).
Example
[Auto] void ControlPanelItems(Visual sender, ControlPanelItemsResults items)
{
items.Add(new ControlPanelItem(sender, "ControlName", Control.Lamp, ControlProperty.Create(sender, "IsMotorOn")));
items.Add(new ControlPanelItem(sender, "ControlName", Control.PushableLamp, new ControlProperty[] {
ControlProperty.Create(sender, "IsMotorOn"),
ControlProperty.Create(sender, "IsLiftMotorOn")
}));
items.Add(new ControlPanelItem(sender, "ControlName", "Lamp(LampColor=Red)", ControlProperty.Create(sender, "IsMotorOn")));
items.Add(new ControlPanelItem(sender, "ControlName", "PushableLamp(ManualRelease=true, LampColor=Red)", new ControlProperty[] {
ControlProperty.Create(sender, "IsMotorOn"),
ControlProperty.Create(sender, "IsLiftMotorOn")
}));
items.Add(new ControlPanelItem(sender, "ControlName", Control.Lamp, "IsMotorOn"));
}
See Also