Posts Tagged ‘reflection’

Cross Language References in ASP.NET

ppl-crwd-018

Most ASP.NET programmers are aware that the environment allows programmers to write code in multiple languages.  This is what allows a programmer who prefers CSharp to write modules for DotNetNuke in CSharp even though the core code is written in VB.NET.  (Until version 6.0, anyhow, where the core will finally be written in CSharp.)

What many don’t realize is that you can’t have CSharp code reference VB.NET and also have VB.NET code reference the CSharp code within the same application.  At least, you can’t do it directly.

Read the rest of this entry »

Reflecting Parameters

I got a question last week from a gentleman asking how to tell what parameters were available for a particular method.  This is useful when you know that a method will be available on a class you are calling, but the method could have any parameters, or when you have used reflection to get the list of methods in your class, and need to pull out the parameter list for each.

The solution is actually quite simple:

Read the rest of this entry »

Reflection From a DLL and Serialization

Last week, we finished up our main series on reflection.  For most people, what we covered is all they will ever need.  However, there are a few other things I’ve needed to know due mainly to the fact that I was using reflection from a DLL instead of an EXE

When I wrote VSS.NET, which was my first .NET application, allow Visual SourceSafe to be used over the Internet, I wanted to implement the SCC api.  This is the API that allows you to use VSS from the IDE.  For some reason that I can’t remember now and isn’t important to this discussion, I needed to use reflection from the DLL that the SCC interface was calling.  This posed two problems.

Read the rest of this entry »

Reflection and Interfaces

Today is the last official installment in the series on reflection.  If you’ve been following along, you’ve probably notice that calling code in other classes using reflection is a huge pain in the butt.

Read the rest of this entry »

Reflection – Accessing Methods

Today is the next to last installment on reflection.  We will look at how to call methods and pass parameters.  This is going to look a lot like what we’ve already done in previous sessions.

Read the rest of this entry »

Bear