Class MultipleChoiceSetting
- Namespace
- CADability
- Assembly
- CADability.dll
Wrappes an int value. The value represents a choice of severel predefined choices. It represents a setting defined by a name and a value. This setting can be displayed and modified in the control center. It is represented as a combo box. The label left of the combo box is given by the resourceId GetString(string), the values are
public class MultipleChoiceSetting : MultipleChoiceProperty, IPropertyEntry, IShowProperty, ISerializable, ISettingChanged, IJsonSerialize
- Inheritance
-
MultipleChoiceSetting
- Implements
- Inherited Members
Constructors
MultipleChoiceSetting()
protected MultipleChoiceSetting()
MultipleChoiceSetting(SerializationInfo, StreamingContext)
Constructor required by deserialization
protected MultipleChoiceSetting(SerializationInfo info, StreamingContext context)
Parameters
infoSerializationInfoSerializationInfo
contextStreamingContextStreamingContext
MultipleChoiceSetting(string, string)
Constructs a MultipleChoiceSetting object.
public MultipleChoiceSetting(string resourceId, string settingName)
Parameters
resourceIdstringthe string table id for the presentation of the setting in the PropertyExplorer (IControlCenter
settingNamestringthe name of the setting
MultipleChoiceSetting(string, string, string[])
Constructs a MultipleChoiceSetting object.
public MultipleChoiceSetting(string resourceId, string settingName, string[] values)
Parameters
resourceIdstringthe string table id for the presentation of the setting in the PropertyExplorer (IControlCenter
settingNamestringthe name of the setting
valuesstring[]the possible choices
Properties
CurrentSelection
public int CurrentSelection { get; set; }
Property Value
Methods
GetObjectData(IJsonWriteData)
public void GetObjectData(IJsonWriteData data)
Parameters
dataIJsonWriteData
GetObjectData(SerializationInfo, StreamingContext)
Writes the data of this object for the legacy binary serialization (ISerializable). Files are written in the JSON format (IJsonSerialize) now; the binary format is still read.
public void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
infoSerializationInforeceives the data
contextStreamingContextthe destination of the serialization
OnSelectionChanged(string)
Called when the user has picked a choice. Raises SelectionChangedEvent, stores the text in SelectedText and raises ValueChangedEvent. Derived classes override it to pass the selection on to the object they represent.
protected override void OnSelectionChanged(string selected)
Parameters
selectedstringThe selected text
SetObjectData(IJsonReadData)
public void SetObjectData(IJsonReadData data)
Parameters
dataIJsonReadData
SetSelection(int)
Sets the current selection by index without raising the events. Used to synchronize the entry with the object it represents.
public override void SetSelection(int toSelect)
Parameters
Events
SettingChangedEvent
Raised when the value has been changed. The handler receives the name of the setting and the new value.
public event SettingChangedDelegate SettingChangedEvent