Hi,
As you suggested i wrote custom type converter, complied under .net framework 2.0 and placed dll into TypeConverter folder of llblgen pro.
I am not getting my type converter into list of "TypeConverter to use" under entities. I tried to debug my code, but its not hitting break point. Please guide me on this..
My Code:
Public Class DoubleConverter
Inherits System.ComponentModel.TypeConverter
' Overrides the CanConvertFrom method of TypeConverter.
' The ITypeDescriptorContext interface provides the context for the
' conversion. Typically, this interface is used at design time to
' provide information about the design-time container.
Public Overloads Overrides Function CanConvertFrom(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal sourceType As Type) As Boolean
If sourceType Is GetType(Double) Then
Return True
End If
Return MyBase.CanConvertFrom(context, sourceType)
End Function
Public Overrides Function CanConvertTo(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal destinationType As System.Type) As Boolean
If destinationType Is GetType(Double) Then
Return True
End If
Return MyBase.CanConvertTo(context, destinationType)
End Function
' Overrides the ConvertFrom method of TypeConverter.
Public Overloads Overrides Function ConvertFrom(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal culture As System.Globalization.CultureInfo, ByVal value As Object) As Object
If TypeOf value Is Double Then
Return Convert.ToInt32(value)
End If
Return MyBase.ConvertFrom(context, culture, value)
End Function
' Overrides the ConvertTo method of TypeConverter.
Public Overloads Overrides Function ConvertTo(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal culture As System.Globalization.CultureInfo, ByVal value As Object, ByVal destinationType As Type) As Object
If destinationType Is GetType(Double) Then
Return Convert.ToInt32(value)
End If
Return MyBase.ConvertTo(context, culture, value, destinationType)
End Function
Public Overrides Function CreateInstance(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal propertyValues As System.Collections.IDictionary) As Object
Return MyBase.CreateInstance(context, propertyValues)
End Function
End Class
Thanks
Rishi