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

C#

 
QuestionSome Questions for LINQ ? Pin
Honeyboy_2020-Apr-11 13:13
Honeyboy_2020-Apr-11 13:13 
AnswerRe: Some Questions for LINQ ? Pin
Peter_in_278020-Apr-11 14:39
professionalPeter_in_278020-Apr-11 14:39 
AnswerRe: Some Questions for LINQ ? Pin
Prasanta_Prince20-Apr-11 21:42
Prasanta_Prince20-Apr-11 21:42 
Questionusing matlab fuzzy logic in c sharp Pin
Abou taleb20-Apr-11 11:35
Abou taleb20-Apr-11 11:35 
AnswerRe: using matlab fuzzy logic in c sharp Pin
BobJanova20-Apr-11 23:30
BobJanova20-Apr-11 23:30 
Questionhow to open all *.xml files on my computer by my C# program ? Pin
Gali197820-Apr-11 9:58
Gali197820-Apr-11 9:58 
AnswerRe: how to open all *.xml files on my computer by my C# program ? Pin
#realJSOP20-Apr-11 10:04
mve#realJSOP20-Apr-11 10:04 
GeneralRe: how to open all *.xml files on my computer by my C# program ? Pin
DaveyM6920-Apr-11 10:47
professionalDaveyM6920-Apr-11 10:47 
AnswerRe: how to open all *.xml files on my computer by my C# program ? Pin
Tarakeshwar Reddy20-Apr-11 12:33
professionalTarakeshwar Reddy20-Apr-11 12:33 
AnswerRe: how to open all *.xml files on my computer by my C# program ? Pin
Prasanta_Prince20-Apr-11 21:35
Prasanta_Prince20-Apr-11 21:35 
QuestionHow do I go about recording a playlist to stream to a large mp3? Pin
roman_s20-Apr-11 8:50
roman_s20-Apr-11 8:50 
QuestionAnyone know if this is possible and, if so, how to go about it? Pin
DaleDaleM20-Apr-11 6:27
DaleDaleM20-Apr-11 6:27 
AnswerRe: Anyone know if this is possible and, if so, how to go about it? Pin
Not Active20-Apr-11 6:36
mentorNot Active20-Apr-11 6:36 
AnswerRe: Anyone know if this is possible and, if so, how to go about it? Pin
SledgeHammer0120-Apr-11 7:48
SledgeHammer0120-Apr-11 7:48 
GeneralRe: Anyone know if this is possible and, if so, how to go about it? Pin
DaleDaleM19-May-11 3:30
DaleDaleM19-May-11 3:30 
GeneralRe: Anyone know if this is possible and, if so, how to go about it? Pin
SledgeHammer0119-May-11 4:37
SledgeHammer0119-May-11 4:37 
GeneralRe: Anyone know if this is possible and, if so, how to go about it? Pin
DaleDaleM19-May-11 4:41
DaleDaleM19-May-11 4:41 
AnswerRe: Anyone know if this is possible and, if so, how to go about it? Pin
Ennis Ray Lynch, Jr.20-Apr-11 8:15
Ennis Ray Lynch, Jr.20-Apr-11 8:15 
GeneralRe: Anyone know if this is possible and, if so, how to go about it? Pin
DaleDaleM19-May-11 3:42
DaleDaleM19-May-11 3:42 
AnswerRe: Anyone know if this is possible and, if so, how to go about it? Pin
AspDotNetDev20-Apr-11 9:25
protectorAspDotNetDev20-Apr-11 9:25 
I'm not sure there is an easy way to do that, but that doesn't mean it's impossible. Here is one way to go about it.

You'll need to create a post-build event to call your code that inspects the assembly.

The code to inspect the assembly will first have to load up the just-built assembly. You can then get a list of all the types in that assembly (see here).

Next, you'll need to inspect the methods on each of those types:
C#
public void InspectMethod(MethodInfo mi)
{
    var body = mi.GetMethodBody();
    var ilBytes = body.GetILAsByteArray();
    // TODO: inspect the ilBytes.
}

The only way I can see to check calls to your method would be to manually inspect the IL. That's the part that I don't think will be easy, but it should be doable. You can read about that here: "Parsing the IL of a Method Body".

This sounds like a big pain in the rear, and I can think of very few scenarios where this would be necessary or even useful. Perhaps if you let us know what you're trying to accomplish by doing this, we could suggest another way.
Chris Maunder wrote:
Fixign now.
But who's fixing the fixign?

GeneralRe: Anyone know if this is possible and, if so, how to go about it? Pin
BobJanova20-Apr-11 23:32
BobJanova20-Apr-11 23:32 
GeneralRe: Anyone know if this is possible and, if so, how to go about it? Pin
DaleDaleM19-May-11 3:36
DaleDaleM19-May-11 3:36 
AnswerRe: Anyone know if this is possible and, if so, how to go about it? Pin
Luc Pattyn20-Apr-11 12:19
sitebuilderLuc Pattyn20-Apr-11 12:19 
GeneralRe: Anyone know if this is possible and, if so, how to go about it? Pin
DaleDaleM19-May-11 3:39
DaleDaleM19-May-11 3:39 
AnswerRe: Anyone know if this is possible and, if so, how to go about it? Pin
Luc Pattyn19-May-11 3:57
sitebuilderLuc Pattyn19-May-11 3:57 

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.