A
Anon
I have an IRange interface defined as...
Public Interface IRange
Property Min() As Object
Property Max() As Object
End Interface
....and I want to implement that in different kinds of range objects
like IntegerRange, StringRange, WeightRange, CurrencyRange, etc.
But I can't implement the interface using more specific types like
this
Public Class IntegerRange
Implements IRange
Private _max As Integer
Public Property Max() As Integer Implements IRange.Max
Get
Return _max
End Get
Set(ByVal value As Integer)
_max = value
End Set
End Property
....
The error is of course that 'Max' cannot implement 'Max' because there
is no matching property on interface 'IRange'.
I guess part of me feels like this should be allowed since Integers
and anything else I want to make a range object out of are Objects.
In the end I was wanting collections of type-specific range objects
that I could sort, perhaps by implementing IComparable, and display in
a windows control. Should I be trying some other path?
Thanks.
Public Interface IRange
Property Min() As Object
Property Max() As Object
End Interface
....and I want to implement that in different kinds of range objects
like IntegerRange, StringRange, WeightRange, CurrencyRange, etc.
But I can't implement the interface using more specific types like
this
Public Class IntegerRange
Implements IRange
Private _max As Integer
Public Property Max() As Integer Implements IRange.Max
Get
Return _max
End Get
Set(ByVal value As Integer)
_max = value
End Set
End Property
....
The error is of course that 'Max' cannot implement 'Max' because there
is no matching property on interface 'IRange'.
I guess part of me feels like this should be allowed since Integers
and anything else I want to make a range object out of are Objects.
In the end I was wanting collections of type-specific range objects
that I could sort, perhaps by implementing IComparable, and display in
a windows control. Should I be trying some other path?
Thanks.