Chili.Opf3 Send comments on this topic.
DynamicType Class
See Also  Members   Example 
Chili.Opf3.DynamicProperties Namespace : DynamicType Class




A DynamicType is a collection of values - like an enumeration.

Syntax

Visual Basic (Declaration) 
Public NotInheritable Class DynamicType 
Visual Basic (Usage)Copy Code
Dim instance As DynamicType
C# 
public sealed class DynamicType 
Managed Extensions for C++ 
public __gc __sealed class DynamicType 
C++/CLI 
public ref class DynamicType sealed 

Example

The following example shows how to use a DynamicType in combination with a DynamicProperty.
C#Copy Code
// ... Other code 
 
DynamicType type = new DynamicType(); 
type.Values.Add("small"); 
type.Values.Add("medium"); 
type.Values.Add("large"); 
 
// Create a DynamicProperty using a DynamicType. 
DynamicProperty prop1 =  
    new DynamicProperty("Size", typeof(string), type); 
prop1.Value = "small"; 
 
// Throws an exception, since not in the DynamicType. 
prop1.Value = "bigger"; 
 
// ... Other code

Remarks

The advantage of a DynamicType is the possibility to create it on the fly. DynamicTypes are usually used in combination with DynamicProperties. When setting a DyanmicType as type of a DynamicProperty the DynamicProperty can only take values of the DynamicType as value.

Inheritance Hierarchy

System.Object
   Chili.Opf3.DynamicProperties.DynamicType

Requirements

Namespace: Chili.Opf3.DynamicProperties

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: Chili.Opf3 (in Chili.Opf3.dll)

See Also