This interface is implemented if a persistent wants to create persistent types
depending on the content of the current data record.
Syntax
| Visual Basic (Declaration) | |
|---|
Public Interface IPersistentTypeSelector |
| C# | |
|---|
public interface IPersistentTypeSelector |
| Managed Extensions for C++ | |
|---|
public __gc __interface IPersistentTypeSelector |
| C++/CLI | |
|---|
public interface class IPersistentTypeSelector |
Example
The following sample shows the usage of this interface.
| C# | Copy Code |
|---|
[Persistent("USERS")] public class User : IPersistentTypeSelector { // ... Properties and fields of the persistent. private Type FetchPersistentType(IDataRecord dataRecord) { if (e.DataRecord["Type"] == "1") { // Switch the type of the persistent that is created to User1. return typeof(User1); } else if ((bool)e.DataRecord["Ignore"]) { // Tell the framework to ignore this item. return null; } // Have a persistent of type User created. return typeof(User); } } // This class inherits from User. public class User1 : User { // ... Properties and fields of the object. } |
Remarks
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