Click here to Skip to main content
15,892,005 members
Home / Discussions / C#
   

C#

 
QuestionHow to Access a property of a class from another class Pin
psmukil2-Mar-06 18:36
psmukil2-Mar-06 18:36 
AnswerRe: How to Access a property of a class from another class Pin
AB77712-Mar-06 20:49
AB77712-Mar-06 20:49 
GeneralRe: How to Access a property of a class from another class Pin
psmukil4-Mar-06 2:39
psmukil4-Mar-06 2:39 
Questioncapture video clip from webcam Pin
prgramya2-Mar-06 18:13
prgramya2-Mar-06 18:13 
AnswerRe: capture video clip from webcam Pin
AB77712-Mar-06 21:44
AB77712-Mar-06 21:44 
QuestionFind events bound on a control Pin
M Harris2-Mar-06 15:23
M Harris2-Mar-06 15:23 
AnswerRe: Find events bound on a control Pin
Marc Clifton3-Mar-06 6:50
mvaMarc Clifton3-Mar-06 6:50 
QuestionRe: Find events bound on a control Pin
M Harris7-Mar-06 20:02
M Harris7-Mar-06 20:02 
Well, after giving myself a rather large headache over the last 2 days trying to work this out, i have come up with nothing. I just can't work this out, and I have to demo the software to the staff here tuesday next week!

So here is what I'm having problems with as far as this goes:
GetInvocationList looks like EXACTLY what I need, however i can't call it, as i dont have an event to call it on.

Due to the fact that this is a serialiser, i'm going over every control on the form with code somewhat similar to this:
GetControls(_form, 0);
private void GetControls(object oControl, int parentId)
{
	if (((Control)oControl).Controls.Count > 0)
	{
		foreach (Control childCtrl in ((Control)oControl).Controls)
		{
			// put basic details into the database, get a control id for it from the database
			
			// get its properties
			GetProperties("control", childCtrl, control_id);
			GetEvents("control", childCtrl, control_id);
			GetControls(childCtrl, control_id);
		}
	}
}


GetEvents is defined:
private void GetEvents(string type, object oControl, int controlId)


Since this control could be any type of control i get the events on it:
Type t = oControl.GetType();
EventInfo[] events = t.GetEvents();


and then loop through them

foreach (EventInfo evnt in events)
{
}


Now I have an EventInfo for hte object. From this I can create a delegate if I'm so inclined (dlgt = Delegate.CreateDelegate(evnt.EventHandlerType, mi ); ) however, I get the problem of where does MemberInfo come from? I can't get it from the class that the control is in, because I don't know what this event needs to be bound to (moreover, this is what i'm actually trying to find out).

I'd really love any ideas you have or if you could just point out where I'm going wrong (if the entire concept is not incorrect).
QuestionReturn an image to mspaint! Pin
Gareth_Hastings2-Mar-06 12:56
Gareth_Hastings2-Mar-06 12:56 
AnswerRe: Return an image to mspaint! Pin
Curtis Schlak.2-Mar-06 13:17
Curtis Schlak.2-Mar-06 13:17 
GeneralRe: Return an image to mspaint! Pin
Gareth_Hastings2-Mar-06 21:18
Gareth_Hastings2-Mar-06 21:18 
GeneralRe: Return an image to mspaint! Pin
Curtis Schlak.3-Mar-06 15:21
Curtis Schlak.3-Mar-06 15:21 
AnswerRe: Return an image to mspaint! Pin
Vasudevan Deepak Kumar2-Mar-06 20:05
Vasudevan Deepak Kumar2-Mar-06 20:05 
GeneralRe: Return an image to mspaint! Pin
Gareth_Hastings2-Mar-06 21:26
Gareth_Hastings2-Mar-06 21:26 
QuestionC# Video Tutorials Pin
shatterstar64572-Mar-06 12:16
shatterstar64572-Mar-06 12:16 
AnswerRe: C# Video Tutorials Pin
renjithkr2-Mar-06 22:25
renjithkr2-Mar-06 22:25 
QuestionHTML vriable to C# Pin
ytubis2-Mar-06 11:36
ytubis2-Mar-06 11:36 
AnswerRe: HTML vriable to C# Pin
Curtis Schlak.2-Mar-06 12:24
Curtis Schlak.2-Mar-06 12:24 
GeneralRe: HTML vriable to C# Pin
ytubis2-Mar-06 12:38
ytubis2-Mar-06 12:38 
GeneralRe: HTML vriable to C# Pin
Curtis Schlak.2-Mar-06 13:21
Curtis Schlak.2-Mar-06 13:21 
QuestionVSTO Excel buttons Pin
Drew McGhie2-Mar-06 11:30
Drew McGhie2-Mar-06 11:30 
Question"unable to setablish connection to network" exception Pin
amresawy2-Mar-06 10:11
amresawy2-Mar-06 10:11 
AnswerRe: "unable to setablish connection to network" exception Pin
Vasudevan Deepak Kumar2-Mar-06 21:08
Vasudevan Deepak Kumar2-Mar-06 21:08 
QuestionCall C# DLL from unmanaged C++: question on string Pin
Koushik Biswas2-Mar-06 10:05
Koushik Biswas2-Mar-06 10:05 
QuestionRegex and Replace Pin
eggsovereasy2-Mar-06 9:39
eggsovereasy2-Mar-06 9:39 

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.