D
doofy
This is a conceptualization problem for me regarding how
classes/namespaces share information. I can't really return an
object/value back from a called class to a calling class by directly
naming the calling class instance in the called class, as this violates
object oriented guidelines, as I understand them.
Here's the issue.
I'm creating a custom control which will be a tree view that holds table
and field names from an identified database. I have a tree view as the
main control, with a context menu included. In order to get the
information to fill the tree view, I created a small form within the
custom control project. It shows up as a separate namespace within the
project. I don't know how to pull this into the tree view namespace.
Within the form, there is a list box which allows multiple selections.
When I hit the OK button, I need to pass the selected table names back
to the tree view control.
If these were in the same namespace, I could probably just reference a
private variable that they share, but I don't know how to move that form
into the namespace. It automatically created a new namespace for the form.
The other way, I assume, would be to pass some variable/object by
reference into the form control, then populate that object on closing
the form.
Right now I'm just anticipating using one long string with semi-colon
delimited table names, then parsing this out on the calling side.
Will I run into problems with that issue about not being able to change
strings, but having to create a new one each time? This could be a
problem when operating between namespaces.
Or do I need to use the StringBuilder feature (I've seen this referenced
in VB.NET, not sure about C#).
That's a lot of questions. Any help would be appreciated.
classes/namespaces share information. I can't really return an
object/value back from a called class to a calling class by directly
naming the calling class instance in the called class, as this violates
object oriented guidelines, as I understand them.
Here's the issue.
I'm creating a custom control which will be a tree view that holds table
and field names from an identified database. I have a tree view as the
main control, with a context menu included. In order to get the
information to fill the tree view, I created a small form within the
custom control project. It shows up as a separate namespace within the
project. I don't know how to pull this into the tree view namespace.
Within the form, there is a list box which allows multiple selections.
When I hit the OK button, I need to pass the selected table names back
to the tree view control.
If these were in the same namespace, I could probably just reference a
private variable that they share, but I don't know how to move that form
into the namespace. It automatically created a new namespace for the form.
The other way, I assume, would be to pass some variable/object by
reference into the form control, then populate that object on closing
the form.
Right now I'm just anticipating using one long string with semi-colon
delimited table names, then parsing this out on the calling side.
Will I run into problems with that issue about not being able to change
strings, but having to create a new one each time? This could be a
problem when operating between namespaces.
Or do I need to use the StringBuilder feature (I've seen this referenced
in VB.NET, not sure about C#).
That's a lot of questions. Any help would be appreciated.