B
BobRoyAce
Let's say that I have a class, called EntityNote. Then, suppose that I
have multiple classes, all of which have a property, called Notes,
which is a List(Of EntityNote). One of the methods of each of these
classes is called AddNoteTo, and it is, as you'd expect, used to add a
new EntityNote to Notes.
Now, what I want to do is have one form that can be used to view
existing EntityNotes, and add new ones, for all of the classes that
have a Notes property. What I'd like to do is have a property of the
form that I could assign the reference to. However, how can I have a
property like that, where I would need to be able to assign instances
of many different classes to it (one at a time, of course). For
example, one time I may want to open the form showing Notes for a
Class1, and be able to call Class1.AddNoteTo method. Then, I may want
to open the same form again, this time showing all Notes for a Class2,
and be able to call Class2.AddNoteTo method. And, so on...
How could I accomplish something like this?
have multiple classes, all of which have a property, called Notes,
which is a List(Of EntityNote). One of the methods of each of these
classes is called AddNoteTo, and it is, as you'd expect, used to add a
new EntityNote to Notes.
Now, what I want to do is have one form that can be used to view
existing EntityNotes, and add new ones, for all of the classes that
have a Notes property. What I'd like to do is have a property of the
form that I could assign the reference to. However, how can I have a
property like that, where I would need to be able to assign instances
of many different classes to it (one at a time, of course). For
example, one time I may want to open the form showing Notes for a
Class1, and be able to call Class1.AddNoteTo method. Then, I may want
to open the same form again, this time showing all Notes for a Class2,
and be able to call Class2.AddNoteTo method. And, so on...
How could I accomplish something like this?