Click here to Skip to main content
15,891,033 members
Home / Discussions / C#
   

C#

 
QuestionAdding an object to Treeview Pin
Anthony Mushrow17-Aug-06 8:03
professionalAnthony Mushrow17-Aug-06 8:03 
AnswerRe: Adding an object to Treeview Pin
led mike17-Aug-06 8:14
led mike17-Aug-06 8:14 
QuestionRe: Adding an object to Treeview Pin
Anthony Mushrow17-Aug-06 13:50
professionalAnthony Mushrow17-Aug-06 13:50 
AnswerRe: Adding an object to Treeview Pin
Anthony Mushrow17-Aug-06 13:53
professionalAnthony Mushrow17-Aug-06 13:53 
AnswerRe: Adding an object to Treeview Pin
leppie17-Aug-06 9:24
leppie17-Aug-06 9:24 
QuestionHow to identify whether any message box are being displayed or not on the form Pin
engsrini17-Aug-06 7:20
engsrini17-Aug-06 7:20 
AnswerRe: How to identify whether any message box are being displayed or not on the form Pin
coolestCoder17-Aug-06 19:59
coolestCoder17-Aug-06 19:59 
QuestionReflection (?) Help [modified] Pin
David Knechtges17-Aug-06 7:00
David Knechtges17-Aug-06 7:00 
As a fairly new C# programmer, I am in need of some help with reflection, or another way of something similar in C#:

I have created a control with several overloaded DisplayObject methods. I have also created an interface within the control's class similar to the following:

interface TheInterface
{
string a
{
get;
set;
}
string b
{
get;
set;
}

The DisplayObject methods have an implementation of this interface like:
DisplayObject(TheInterface myInt)
and
DisplayObject(TheInterface[] myInts)

I have these two methods working just fine. But, I want to add to them......

Outside of the control I define two classes like:
class Outside1 : TheInterface
class Outside2 : TheInterface

And I define another class such as
class WayOutside
{
class Outside1 myOutside1;
class Outside2 myOutside2;
}

Then, the user of my control would call:
DisplayObject(WayOutside);

To handle that case, what I would like to do inside of my control is have another DisplayObject method that would take a generic variable (maybe an object type?) and then have my control go through the class and call the other DisplayObject method that takes either of the "TheInterface" methods above so that the code might look like:

void DisplayObject(object generic)
{
.... HELP HERE? Reflection? Another way? .....
foreach(TheInterface item in generic)
this.DisplayObject(item);
}

Basically, the WayOutside class can have any number of classes in it, but they will all implement TheInterface.

Anyone have any ideas as to how I can do something like this?

Thanks!

David


-- modified at 13:06 Thursday 17th August, 2006
AnswerRe: Reflection (?) Help Pin
Dustin Metzgar17-Aug-06 8:06
Dustin Metzgar17-Aug-06 8:06 
AnswerRe: Reflection (?) Help Pin
Guffa17-Aug-06 11:57
Guffa17-Aug-06 11:57 
GeneralRe: Reflection (?) Help Pin
David Knechtges18-Aug-06 2:49
David Knechtges18-Aug-06 2:49 
AnswerDirectoryInfo.GetFiles with multiple file filters [modified] Pin
Chris Maunder17-Aug-06 6:23
cofounderChris Maunder17-Aug-06 6:23 
AnswerRe: DirectoryInfo.GetFiles with multiple file filters Pin
Dustin Metzgar17-Aug-06 6:37
Dustin Metzgar17-Aug-06 6:37 
AnswerRe: DirectoryInfo.GetFiles with multiple file filters Pin
Judah Gabriel Himango17-Aug-06 6:53
sponsorJudah Gabriel Himango17-Aug-06 6:53 
GeneralRe: DirectoryInfo.GetFiles with multiple file filters Pin
Chris Maunder17-Aug-06 6:57
cofounderChris Maunder17-Aug-06 6:57 
GeneralRe: DirectoryInfo.GetFiles with multiple file filters Pin
Judah Gabriel Himango17-Aug-06 7:45
sponsorJudah Gabriel Himango17-Aug-06 7:45 
GeneralRe: DirectoryInfo.GetFiles with multiple file filters Pin
Dustin Metzgar17-Aug-06 7:56
Dustin Metzgar17-Aug-06 7:56 
GeneralRe: DirectoryInfo.GetFiles with multiple file filters Pin
Chris Maunder17-Aug-06 10:35
cofounderChris Maunder17-Aug-06 10:35 
GeneralRe: DirectoryInfo.GetFiles with multiple file filters Pin
Judah Gabriel Himango18-Aug-06 5:00
sponsorJudah Gabriel Himango18-Aug-06 5:00 
JokeRe: DirectoryInfo.GetFiles with multiple file filters Pin
Dustin Metzgar17-Aug-06 6:57
Dustin Metzgar17-Aug-06 6:57 
GeneralRe: DirectoryInfo.GetFiles with multiple file filters Pin
Judah Gabriel Himango17-Aug-06 7:35
sponsorJudah Gabriel Himango17-Aug-06 7:35 
Questionproblems using System.Diagnosics.Process.Start to start Process Pin
3Dizard17-Aug-06 5:37
3Dizard17-Aug-06 5:37 
AnswerRe: problems using System.Diagnosics.Process.Start to start Process Pin
Judah Gabriel Himango17-Aug-06 6:04
sponsorJudah Gabriel Himango17-Aug-06 6:04 
GeneralRe: problems using System.Diagnosics.Process.Start to start Process Pin
3Dizard17-Aug-06 7:14
3Dizard17-Aug-06 7:14 
AnswerRe: problems using System.Diagnosics.Process.Start to start Process Pin
Ennis Ray Lynch, Jr.17-Aug-06 6:22
Ennis Ray Lynch, Jr.17-Aug-06 6:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.