Click here to Skip to main content
15,887,027 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to check vaild email address? Pin
BillWoodruff28-Sep-14 20:37
professionalBillWoodruff28-Sep-14 20:37 
SuggestionRe: how to check vaild email address? Pin
Kornfeld Eliyahu Peter28-Sep-14 21:01
professionalKornfeld Eliyahu Peter28-Sep-14 21:01 
AnswerRe: how to check vaild email address? Pin
Bernhard Hiller28-Sep-14 22:03
Bernhard Hiller28-Sep-14 22:03 
GeneralRe: how to check vaild email address? Pin
Pete O'Hanlon28-Sep-14 22:15
mvePete O'Hanlon28-Sep-14 22:15 
GeneralRe: how to check vaild email address? Pin
Richard Deeming29-Sep-14 1:42
mveRichard Deeming29-Sep-14 1:42 
AnswerRe: how to check vaild email address? Pin
jschell29-Sep-14 7:49
jschell29-Sep-14 7:49 
Questioninvoke method in derived classes vs. invoke method in base class: C# language question Pin
BillWoodruff27-Sep-14 21:56
professionalBillWoodruff27-Sep-14 21:56 
AnswerRe: invoke method in derived classes vs. invoke method in base class: C# language question Pin
Kornfeld Eliyahu Peter27-Sep-14 22:47
professionalKornfeld Eliyahu Peter27-Sep-14 22:47 
In a case like you I always going to see IL code - it can tell a lot about your code really looks like...
C#
private static void invokeClassMethod1(BaseClass theClass)
{
	theClass.ShowMe();
}

private static void invokeClassMethod2([Dynamic] dynamic theClass)
{
	if (Program.<invokeClassMethod2>o__SiteContainer0.<>p__Site1 == null)
	{
		Program.<invokeClassMethod2>o__SiteContainer0.<>p__Site1 = CallSite<Action<CallSite, object>>.Create(Binder.InvokeMember(CSharpBinderFlags.ResultDiscarded, "ShowMe", null, typeof(Program), new CSharpArgumentInfo[]
		{
			CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
		}));
	}
	Program.<invokeClassMethod2>o__SiteContainer0.<>p__Site1.Target(Program.<invokeClassMethod2>o__SiteContainer0.<>p__Site1, theClass);
}

This is the IL code (decopiled to C#) you will get for your first two 'invoke' method. It is obvious that the dynamic approach will add more run-time handling (as the type is unknown at compile time)...
If you pass to the first 'invoke' method a series of classes that using virtual/override approach the calling address of the right function will be searched by the basic 'engine' of the object oriented programming (a search in the virtual method table of the actual type of the object), so no need for additional code in your application...

I did not measured the difference between the dynamic search and the object oriented look-up, but I have the feeling that OO will hit dynamic...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)

GeneralRe: invoke method in derived classes vs. invoke method in base class: C# language question Pin
BillWoodruff27-Sep-14 23:44
professionalBillWoodruff27-Sep-14 23:44 
AnswerRe: invoke method in derived classes vs. invoke method in base class: C# language question Pin
Kornfeld Eliyahu Peter27-Sep-14 23:55
professionalKornfeld Eliyahu Peter27-Sep-14 23:55 
GeneralRe: invoke method in derived classes vs. invoke method in base class: C# language question Pin
Richard Deeming29-Sep-14 1:40
mveRichard Deeming29-Sep-14 1:40 
AnswerRe: invoke method in derived classes vs. invoke method in base class: C# language question Pin
Kornfeld Eliyahu Peter29-Sep-14 2:06
professionalKornfeld Eliyahu Peter29-Sep-14 2:06 
Questionexecuting multiple sql select queries in ms access using c# Pin
nishadamit9027-Sep-14 21:32
nishadamit9027-Sep-14 21:32 
QuestionXSD question... Pin
SledgeHammer0126-Sep-14 15:41
SledgeHammer0126-Sep-14 15:41 
QuestionRe: XSD question... Pin
Richard MacCutchan26-Sep-14 21:37
mveRichard MacCutchan26-Sep-14 21:37 
QuestionRe: XSD question... Pin
George Jonsson27-Sep-14 3:55
professionalGeorge Jonsson27-Sep-14 3:55 
AnswerRe: XSD question... Pin
SledgeHammer0127-Sep-14 6:26
SledgeHammer0127-Sep-14 6:26 
AnswerRe: XSD question... Pin
George Jonsson27-Sep-14 13:21
professionalGeorge Jonsson27-Sep-14 13:21 
GeneralRe: XSD question... Pin
SledgeHammer0127-Sep-14 14:21
SledgeHammer0127-Sep-14 14:21 
GeneralRe: XSD question... Pin
George Jonsson27-Sep-14 15:13
professionalGeorge Jonsson27-Sep-14 15:13 
GeneralRe: XSD question... Pin
SledgeHammer0127-Sep-14 16:00
SledgeHammer0127-Sep-14 16:00 
GeneralRe: XSD question... Pin
George Jonsson27-Sep-14 20:21
professionalGeorge Jonsson27-Sep-14 20:21 
GeneralRe: XSD question... Pin
SledgeHammer0128-Sep-14 7:10
SledgeHammer0128-Sep-14 7:10 
QuestionRecommendations on VB.Net to C# code conversion tool Pin
Vipul Mehta26-Sep-14 8:31
Vipul Mehta26-Sep-14 8:31 
QuestionRe: Recommendations on VB.Net to C# code conversion tool Pin
Richard MacCutchan26-Sep-14 10:16
mveRichard MacCutchan26-Sep-14 10:16 

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.