Table of Contents

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

info SerializationInfo

SerializationInfo

context StreamingContext

StreamingContext

MultipleChoiceSetting(string, string)

Constructs a MultipleChoiceSetting object.

public MultipleChoiceSetting(string resourceId, string settingName)

Parameters

resourceId string

the string table id for the presentation of the setting in the PropertyExplorer (IControlCenter

settingName string

the name of the setting

MultipleChoiceSetting(string, string, string[])

Constructs a MultipleChoiceSetting object.

public MultipleChoiceSetting(string resourceId, string settingName, string[] values)

Parameters

resourceId string

the string table id for the presentation of the setting in the PropertyExplorer (IControlCenter

settingName string

the name of the setting

values string[]

the possible choices

Properties

CurrentSelection

public int CurrentSelection { get; set; }

Property Value

int

Methods

GetObjectData(IJsonWriteData)

public void GetObjectData(IJsonWriteData data)

Parameters

data IJsonWriteData

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

info SerializationInfo

receives the data

context StreamingContext

the 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

selected string

The selected text

SetObjectData(IJsonReadData)

public void SetObjectData(IJsonReadData data)

Parameters

data IJsonReadData

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

toSelect int

Index into Choices; a negative or invalid index clears the selection

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

Event Type

SettingChangedDelegate