Welcome to MSDN Blogs Sign in | Join | Help

Linq Queries for .Net Framework members

How many members in the .Net framework contain the string ‘file” ?

 

Make a query like this:

 

 

        Dim q As Object

        q = From Assembly In AppDomain.CurrentDomain.GetAssemblies _

                From typ In Assembly.GetTypes _

                From Member In typ.GetMembers _

                Where Member.Name.ToLower.Contains("file") _

                Select Assembly, typ, Member.MemberType, Member.Name, Member.Module

 

 

This comes up with 1292!

 

Of course, you can use the Object Browser, but that’s not as much fun<g>

 

Sample results:

 

GetXmlNodeFilename

System.Configuration.ConfigurationException

HttpDataChunkFromFileHandle

System.Net.UnsafeNclNativeMethods+HttpApi+HTTP_DATA_CHUNK_TYPE

perfVSHelpXLinkIndexInitializeMergedFileCachedPageSlots

Microsoft.Internal.Performance.CodeMarkerEvent

 

 

Are there more properties or events?

 

        q = From Assembly In AppDomain.CurrentDomain.GetAssemblies _

                From typ In Assembly.GetTypes _

                From Member In typ.GetMembers _

                Group By Member.MemberType Into Count() Order By Count Descending

 

 

175434

Method

36564

Property

26779

Field

9826

Event

6474

Constructor

844

NestedType

 

 

 

How many static (shared in VB) members are there (those that can be called without an instance of the containing class, like System.IO.Directory.GetFiles)?

 

        q = From Assembly In AppDomain.CurrentDomain.GetAssemblies _

                From typ In Assembly.GetTypes _

                From Meth In typ.GetMethods _

                Where Meth.IsStatic _

                Select Assembly, typ, Meth.MemberType, Meth.Name, Meth.Module, Meth.IsStatic _

                Order By Name

 

Published Thursday, August 16, 2007 5:06 PM by Calvin_Hsia
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# A Little LINQ

Monday, September 10, 2007 1:40 PM by Noah Coad

So LINQ is out in strength and I've got to admit, even though I talked to Anders Hejlsberg over three

# A Little LINQ

Monday, September 10, 2007 1:55 PM by Noticias externas

LINQ is out in strength and I&#39;ve got to admit, even though I talked to Anders Hejlsberg over three

# possession methamphetamine

Tuesday, December 25, 2007 10:39 PM by ctl00$_$ctl00$_$ctl01$_$form$_$tbname

diet methamphetamine <a href= http://methamphetamine.osc.pl >possession methamphetamine</a> [url=http://methamphetamine.osc.pl]possession methamphetamine[/url]

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker