Class StringProperty
- Namespace
- CADability.UserInterface
- Assembly
- CADability.dll
Property page entry to edit a string, e.g. the name of an object or the text of a Text. The value is connected to a property of an object via reflection or via the OnGetValue and OnSetValue delegates; the text is taken as it is typed.
public class StringProperty : EditableProperty<string>, IPropertyEntry, IShowProperty, IConstructProperty, ISerializable
- Inheritance
-
StringProperty
- Implements
- Inherited Members
Constructors
StringProperty(object, string, string)
Creates the entry for a string property of ObjectWithProperty, which is accessed via reflection.
public StringProperty(object ObjectWithProperty, string PropertyName, string resourceId)
Parameters
ObjectWithPropertyobjectThe object holding the property
PropertyNamestringName of the string property of that object
resourceIdstringResource id of the label text
StringProperty(SerializationInfo, StreamingContext)
Constructor for the legacy binary deserialization (ISerializable); only the resource id is restored. Currently only needed by the debugger visualizer.
protected StringProperty(SerializationInfo info, StreamingContext context)
Parameters
infoSerializationInfoProvides the data
contextStreamingContextThe source of the deserialization
StringProperty(string, string)
Creates the entry with an initial value and no connected object. The entered text can be queried with GetString() or received via OnSetValue.
public StringProperty(string stringValue, string resourceId)
Parameters
Properties
NotifyOnLostFocusOnly
Obsolete: sets DeferUpdate, i.e. whether the text is passed on only when editing ends rather than with every keystroke.
[Obsolete("use DeferUpdate instead")]
public bool NotifyOnLostFocusOnly { set; }
Property Value
Methods
GetString()
Returns the current text, taken from the connected object (or OnGetValue) when there is one.
public string GetString()
Returns
- string
The current text
SetString(string)
Sets the text, passes it on to the connected object (or OnSetValue) and refreshes the entry.
public void SetString(string val)
Parameters
valstringThe new text
TextToValue(string, out string)
Converts the text to a value. Returns true if possible, false otherwise (maybe invalid characters or outside the limit)
protected override bool TextToValue(string text, out string val)
Parameters
Returns
ValueToText(string)
Returns the text representation of the value.
protected override string ValueToText(string val)
Parameters
valstring
Returns
Events
GetStringEvent
Obsolete: adding a handler sets OnGetValue to call it, removing one clears the delegate. Only a single handler is supported.
[Obsolete("use delegate StringProperty.OnGetValue instead")]
public event StringProperty.GetStringDelegate GetStringEvent
Event Type
SetStringEvent
Obsolete: adding a handler sets OnSetValue to call it, removing one clears the delegate. Only a single handler is supported.
[Obsolete("use delegate StringProperty.OnSetValue instead")]
public event StringProperty.SetStringDelegate SetStringEvent
Event Type
StringChangedEvent
Obsolete: adding a handler sets OnSetValue to call it (without the value; query GetString()), removing one clears the delegate. Only a single handler is supported.
[Obsolete("use delegate StringProperty.OnSetValue instead")]
public event StringProperty.StringChangedDelegate StringChangedEvent