Chili.Opf3 Send comments on this topic.
IPopulateHelperExtended Interface
See Also  Members   Example
Chili.Opf3 Namespace : IPopulateHelperExtended Interface




This interface that is implemented by objects that are populated manually.

Syntax

Visual Basic (Declaration) 
Public Interface IPopulateHelperExtended 
   Inherits IPopulateHelper 
Visual Basic (Usage)Copy Code
Dim instance As IPopulateHelperExtended
C# 
public interface IPopulateHelperExtended : IPopulateHelper  
Managed Extensions for C++ 
public __gc __interface IPopulateHelperExtended : public IPopulateHelper  
C++/CLI 
public interface class IPopulateHelperExtended : public IPopulateHelper  

Example

The following example shows how to implement the interface.
C#Copy Code
            [Persistent("USER")] 
public class User : IPopulateHelperExtended 

    public bool PropertyIsHandled(string propertyName) 
    { 
        switch(propertyName) 
        { 
            case "Name": 
            case "ID": 
            // ... Other properties. 
                return true; 
            default: 
                return false; 
        } 
    } 
 
    public object this[string propertyName] 
    { 
        get 
        { 
            switch(propertyName) 
            { 
                case "Name": 
                    return Name; 
                // ... Other properties. 
                default: 
                    throw new Exception(); 
            } 
        } 
        set 
        { 
            switch(propertyName) 
            { 
                case "Name": 
                    Name = value; 
                    break; 
                // ... Other properties. 
                default: 
                    throw new Exception(); 
            } 
        } 
    } 
  
    // ... Other properties and code. 

    

Remarks

This interface is implemented by classes that won't let the framework automatically populate them with data or retrieve data from them via reflection.

If the framework encounters a persistent object that implements this interface it gives the content of the field from the storage (in combination with the name of the property that is mapped to that field) as value to the class. The class itself has to populate the property in an appropriate way.

Attention: Throw an exception if something goes wrong while manually populating the object. This will solve problems like loss of data etc.

Requirements

Namespace: Chili.Opf3

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