This interface is implemented by a storage that does not support all simple types of the .NET framework.
Syntax
| Visual Basic (Declaration) | |
|---|
Public Interface ICustomDataTypesStorage
Inherits IStorage |
| C# | |
|---|
public interface ICustomDataTypesStorage : IStorage |
| Managed Extensions for C++ | |
|---|
public __gc __interface ICustomDataTypesStorage : public IStorage |
| C++/CLI | |
|---|
public interface class ICustomDataTypesStorage : public IStorage |
Example
Firebird does, for example, not support the .NET type Boolean. Therefore a field with type integer is used
in the database. By implementing this interface the integer from the database is converted to an boolean
(during load of the object). When saving the object the boolean of the object is converted back to an integer.
| C# | Copy Code |
|---|
object ICustomDataTypesStorage.ChangeFromDataType(object obj, Type targetType) { if (!(obj is bool) && targetType == typeof(bool)) return Convert.ToBoolean(obj); return obj; } object ICustomDataTypesStorage.ChangeToDataType(object obj) { if (obj is bool) return Convert.ToInt32((bool)obj); return obj; } |
Remarks
Requirements
Namespace: Chili.Opf3.Storages
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