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




Contains DynamicProperties that are used to save semi-structured data in the storage.

Object Model

Syntax

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

Example

The following example shows how to use the DynamicPropertiesContainer in your application.
C#Copy Code
            [Persistent("USER")] 
public class User 

    private DynamicPropertiesCollection _dyn =  
        new DynamicPropertiesCollection(); 
 
    [Field("DYN_PROPS")] 
    public DynamicPropertiesCollection DynProps 
    { 
        get { return _dynProps; } 
        set { _dynProps = value; } 
    } 
 
    // ... Other properties and code 

 
// ... Other code 
 
// Create a new User object. 
User user = new User(); 
 
// Create the DynamicProperty and set a value. 
DynamicProperty prop = new DynamicProperty("PLZ", typeof(string)); 
prop.Value = "1234"; 
 
// Add the DynamicProperty to the container. 
user.DynProps.Add(prop); 
 
// ... Other code 
 
// Persist the object. 
context.PersistChanges(user); 
 
// Get the DynamicProperty with the name "PLZ" 
// and get the value as string. 
PLZLabel.Text = user.DynProps["PLZ"].ToString();

Remarks

This class contains a set of DynamicProperties allowing to extend dynamically an entity in the storage. The DynamicPropertiesContainer is set as type of property in the persistent object and that property is then mapped (using the FieldAttribute) to a field in the storage that can contain xml strings.

DynamicProperties are saved to that field as xml string and restored after load. This feature allows to extend the entity dynamically. The user of the final program can theirfore add new fields to extend the functionality of the program.

Inheritance Hierarchy

System.Object
   Chili.Opf3.DynamicProperties.DynamicPropertiesCollection

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