Class UserData
A table, that associates names with objects.
Its purpose is to attach any kind of (user) information to existing CADability objects.
Many objects of the CADability namespace provide a UserData property, by means of which
you can connect any object to it. If the object is serializable, it will be serialized
together with the CADability object. If it implements IClonable it will be cloned when the
containing object is cloned. If it implements IShowProperty it will be displayed
together with the object in the ControlCenter. If it implements IMultiObjectUserData
it will be displayed as a common property when multiple objects are displayed in the ControlCenter
Inheritance
System.Object
UserData
Implements
System.Runtime.Serialization.ISerializable
System.Collections.Generic.IDictionary<System.String, System.Object>
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String, System.Object>>
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.Object>>
System.Collections.IDictionary
System.Collections.ICollection
System.Collections.IEnumerable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: CADability.dll
Syntax
[Serializable]
public class UserData : ISerializable, IDictionary<string, object>, ICollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IDictionary, ICollection, IEnumerable, IJsonSerialize
Constructors
|
Improve this Doc
View Source
UserData()
Declaration
|
Improve this Doc
View Source
UserData(SerializationInfo, StreamingContext)
Constructor required by deserialization
Declaration
protected UserData(SerializationInfo info, StreamingContext context)
Parameters
| Type |
Name |
Description |
| System.Runtime.Serialization.SerializationInfo |
info |
SerializationInfo
|
| System.Runtime.Serialization.StreamingContext |
context |
StreamingContext
|
Properties
|
Improve this Doc
View Source
AllItems
Gets an array of the names of all entries
Declaration
public string[] AllItems { get; }
Property Value
| Type |
Description |
| System.String[] |
|
|
Improve this Doc
View Source
Count
Declaration
public int Count { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
|
Improve this Doc
View Source
IsFixedSize
Declaration
public bool IsFixedSize { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
IsReadOnly
Declaration
public bool IsReadOnly { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
IsSynchronized
Declaration
public bool IsSynchronized { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
Item[Object]
Declaration
public object this[object key] { get; set; }
Parameters
| Type |
Name |
Description |
| System.Object |
key |
|
Property Value
| Type |
Description |
| System.Object |
|
|
Improve this Doc
View Source
Item[String]
Indexer to read or write values to a given name
Declaration
public object this[string Name] { get; set; }
Parameters
| Type |
Name |
Description |
| System.String |
Name |
|
Property Value
| Type |
Description |
| System.Object |
|
|
Improve this Doc
View Source
Keys
Declaration
public ICollection Keys { get; }
Property Value
| Type |
Description |
| System.Collections.ICollection |
|
|
Improve this Doc
View Source
SyncRoot
Declaration
public object SyncRoot { get; }
Property Value
| Type |
Description |
| System.Object |
|
|
Improve this Doc
View Source
Values
Declaration
public ICollection Values { get; }
Property Value
| Type |
Description |
| System.Collections.ICollection |
|
Methods
|
Improve this Doc
View Source
Add(UserData)
Add all entries given in the parameter to this UserData
Declaration
public void Add(UserData userData)
Parameters
| Type |
Name |
Description |
| UserData |
userData |
entries to add
|
|
Improve this Doc
View Source
Add(Object, Object)
Declaration
public void Add(object key, object value)
Parameters
| Type |
Name |
Description |
| System.Object |
key |
|
| System.Object |
value |
|
|
Improve this Doc
View Source
Add(String, Object)
Adds or replaces the named entry of the Userdata
Declaration
public void Add(string Name, object Data)
Parameters
| Type |
Name |
Description |
| System.String |
Name |
eindeutige Bezeichnung des Objektes
|
| System.Object |
Data |
das zusätzliche Objekt
|
|
Improve this Doc
View Source
Clear()
Declaration
|
Improve this Doc
View Source
Clone()
Returns a clone of the UserData object. The containe dictionary of string-object pairs is cloned so the result is
independant from this object. The values are also cloned if they implement the System.ICloneable interface.
If the value of an entry implements CADability.IManageUserData, CADability.IManageUserData.Clone will be called.
Declaration
Returns
| Type |
Description |
| UserData |
The cloned UserData
|
|
Improve this Doc
View Source
Contains(Object)
Declaration
public bool Contains(object key)
Parameters
| Type |
Name |
Description |
| System.Object |
key |
|
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
Contains(String)
Declaration
public bool Contains(string key)
Parameters
| Type |
Name |
Description |
| System.String |
key |
|
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
ContainsData(String)
Checks whether an entry with the provided name exists.
Declaration
public bool ContainsData(string Name)
Parameters
| Type |
Name |
Description |
| System.String |
Name |
Name to check
|
Returns
| Type |
Description |
| System.Boolean |
true if the entry exists
|
|
Improve this Doc
View Source
CopyTo(Array, Int32)
Declaration
public void CopyTo(Array array, int index)
Parameters
| Type |
Name |
Description |
| System.Array |
array |
|
| System.Int32 |
index |
|
|
Improve this Doc
View Source
GetData(String)
Returns the entry with the provided name. The result may be null if the entry doesn't exist.
The result must be casted to the required type.
Declaration
public object GetData(string Name)
Parameters
| Type |
Name |
Description |
| System.String |
Name |
Name of the entry
|
Returns
| Type |
Description |
| System.Object |
|
|
Improve this Doc
View Source
GetEnumerator()
Declaration
public IDictionaryEnumerator GetEnumerator()
Returns
| Type |
Description |
| System.Collections.IDictionaryEnumerator |
|
|
Improve this Doc
View Source
GetObjectData(SerializationInfo, StreamingContext)
Implements System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)
Declaration
public void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
| Type |
Name |
Description |
| System.Runtime.Serialization.SerializationInfo |
info |
The System.Runtime.Serialization.SerializationInfo to populate with data.
|
| System.Runtime.Serialization.StreamingContext |
context |
The destination (System.Runtime.Serialization.StreamingContext) for this serialization.
|
|
Improve this Doc
View Source
Remove(Object)
Declaration
public void Remove(object key)
Parameters
| Type |
Name |
Description |
| System.Object |
key |
|
|
Improve this Doc
View Source
Remove(String)
Declaration
public void Remove(string key)
Parameters
| Type |
Name |
Description |
| System.String |
key |
|
|
Improve this Doc
View Source
RemoveUserData(String)
Removes the entry with the provided name
Declaration
public void RemoveUserData(string Name)
Parameters
| Type |
Name |
Description |
| System.String |
Name |
Name of the entry to be removed.
|
Events
|
Improve this Doc
View Source
UserDataAddedEvent
Declaration
public event UserData.UserDataAddedDelegate UserDataAddedEvent
Event Type
|
Improve this Doc
View Source
UserDataRemovedEvent
Declaration
public event UserData.UserDataRemovedDelegate UserDataRemovedEvent
Event Type
Explicit Interface Implementations
|
Improve this Doc
View Source
IJsonSerialize.GetObjectData(IJsonWriteData)
Declaration
void IJsonSerialize.GetObjectData(IJsonWriteData data)
Parameters
|
Improve this Doc
View Source
IJsonSerialize.SetObjectData(IJsonReadData)
Declaration
void IJsonSerialize.SetObjectData(IJsonReadData data)
Parameters
|
Improve this Doc
View Source
ICollection<KeyValuePair<String, Object>>.Add(KeyValuePair<String, Object>)
Declaration
void ICollection<KeyValuePair<string, object>>.Add(KeyValuePair<string, object> item)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.KeyValuePair<System.String, System.Object> |
item |
|
|
Improve this Doc
View Source
ICollection<KeyValuePair<String, Object>>.Clear()
Declaration
void ICollection<KeyValuePair<string, object>>.Clear()
|
Improve this Doc
View Source
ICollection<KeyValuePair<String, Object>>.Contains(KeyValuePair<String, Object>)
Declaration
bool ICollection<KeyValuePair<string, object>>.Contains(KeyValuePair<string, object> item)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.KeyValuePair<System.String, System.Object> |
item |
|
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
ICollection<KeyValuePair<String, Object>>.CopyTo(KeyValuePair<String, Object>[], Int32)
Declaration
void ICollection<KeyValuePair<string, object>>.CopyTo(KeyValuePair<string, object>[] array, int arrayIndex)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.KeyValuePair<System.String, System.Object>[] |
array |
|
| System.Int32 |
arrayIndex |
|
|
Improve this Doc
View Source
ICollection<KeyValuePair<String, Object>>.Count
Declaration
int ICollection<KeyValuePair<string, object>>.Count { get; }
Returns
| Type |
Description |
| System.Int32 |
|
|
Improve this Doc
View Source
ICollection<KeyValuePair<String, Object>>.IsReadOnly
Declaration
bool ICollection<KeyValuePair<string, object>>.IsReadOnly { get; }
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
ICollection<KeyValuePair<String, Object>>.Remove(KeyValuePair<String, Object>)
Declaration
bool ICollection<KeyValuePair<string, object>>.Remove(KeyValuePair<string, object> item)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.KeyValuePair<System.String, System.Object> |
item |
|
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
IDictionary<String, Object>.Add(String, Object)
Declaration
void IDictionary<string, object>.Add(string key, object value)
Parameters
| Type |
Name |
Description |
| System.String |
key |
|
| System.Object |
value |
|
|
Improve this Doc
View Source
IDictionary<String, Object>.ContainsKey(String)
Declaration
bool IDictionary<string, object>.ContainsKey(string key)
Parameters
| Type |
Name |
Description |
| System.String |
key |
|
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
IDictionary<String, Object>.Item[String]
Declaration
object IDictionary<string, object>.this[string key] { get; set; }
Parameters
| Type |
Name |
Description |
| System.String |
key |
|
Returns
| Type |
Description |
| System.Object |
|
|
Improve this Doc
View Source
IDictionary<String, Object>.Keys
Declaration
ICollection<string> IDictionary<string, object>.Keys { get; }
Returns
| Type |
Description |
| System.Collections.Generic.ICollection<System.String> |
|
|
Improve this Doc
View Source
IDictionary<String, Object>.Remove(String)
Declaration
bool IDictionary<string, object>.Remove(string key)
Parameters
| Type |
Name |
Description |
| System.String |
key |
|
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
IDictionary<String, Object>.TryGetValue(String, out Object)
Declaration
bool IDictionary<string, object>.TryGetValue(string key, out object value)
Parameters
| Type |
Name |
Description |
| System.String |
key |
|
| System.Object |
value |
|
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
IDictionary<String, Object>.Values
Declaration
ICollection<object> IDictionary<string, object>.Values { get; }
Returns
| Type |
Description |
| System.Collections.Generic.ICollection<System.Object> |
|
|
Improve this Doc
View Source
IEnumerable<KeyValuePair<String, Object>>.GetEnumerator()
Declaration
IEnumerator<KeyValuePair<string, object>> IEnumerable<KeyValuePair<string, object>>.GetEnumerator()
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<System.String, System.Object>> |
|
|
Improve this Doc
View Source
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
| Type |
Description |
| System.Collections.IEnumerator |
|
Implements
System.Runtime.Serialization.ISerializable
System.Collections.Generic.IDictionary<TKey, TValue>
System.Collections.Generic.ICollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IDictionary
System.Collections.ICollection
System.Collections.IEnumerable