Hi all. I have a class like so:
And I declare a class like this:
I also have a class called GNode which correctly implements Graph.Node.
But I get these errors:
Why am I not allowed to do this? Can't GNode act as a Node?
If what I'm doing is not possible, is there a good workaround?
Thanks.
VB.NET:
Public Class Graph
Public Interface Node
Property ID() As Integer
Property Location() As Point
End Interface
Public Interface Edge
Property ID() As Integer
Property StartNode() As Node
Property EndNode() As Node
End Interface
Public Nodes() As Node
Public Edges() As Edge
End Class
VB.NET:
Public Class GEdge
Inherits GraphicsItem
Implements Graph.Edge
Private _StartNode As GNode
Public Property StartNode() As GNode Implements Graph.Edge.StartNode
Get
Return _StartNode
End Get
Set(ByVal value As GNode)
_StartNode = value
End Set
End Property
Private _EndNode As GNode
Public Property EndNode() As GNode implements Graph.Edge.EndNode
Get
Return _EndNode
End Get
Set(ByVal value As GNode)
_EndNode = value
End Set
End Property
Private _ID As Integer
Public Property ID() As Integer Implements Graph.Edge.ID
Get
Return _ID
End Get
Set(ByVal value As Integer)
_ID = value
End Set
End Property
End Class
I also have a class called GNode which correctly implements Graph.Node.
But I get these errors:
'StartNode' cannot implement 'StartNode' because there is no matching property on interface 'Graph.Edge'.
'EndNode' cannot implement 'EndNode' because there is no matching property on interface 'Graph.Edge'.
Why am I not allowed to do this? Can't GNode act as a Node?
If what I'm doing is not possible, is there a good workaround?
Thanks.