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

C#

 
GeneralRe: Efficient Image loading Pin
RanCohen10-Feb-09 4:41
RanCohen10-Feb-09 4:41 
Questionhow to make .exe file in C# Pin
jananiSreedhar7-Feb-09 7:50
jananiSreedhar7-Feb-09 7:50 
AnswerRe: how to make .exe file in C# PinPopular
Anthony Mushrow7-Feb-09 7:57
professionalAnthony Mushrow7-Feb-09 7:57 
JokeRe: how to make .exe file in C# Pin
Luc Pattyn7-Feb-09 9:17
sitebuilderLuc Pattyn7-Feb-09 9:17 
QuestionPlugins and Abstract classes. Pin
iAmEntity7-Feb-09 6:45
iAmEntity7-Feb-09 6:45 
AnswerRe: Plugins and Abstract classes. Pin
Anthony Mushrow7-Feb-09 7:54
professionalAnthony Mushrow7-Feb-09 7:54 
RantRe: Plugins and Abstract classes. Pin
iAmEntity7-Feb-09 8:05
iAmEntity7-Feb-09 8:05 
GeneralRe: Plugins and Abstract classes. Pin
Anthony Mushrow7-Feb-09 9:03
professionalAnthony Mushrow7-Feb-09 9:03 
I see. Well, this ain't gonna be too pretty and there is probably a better way but this is all I can think of:


foreach(Type t in asm.GetTypes())
{
  Type baseType = t.BaseType;
  
  //Loop through all the base types until we get to the top
  while(baseType.BaseType != typeof(System.Object))
  {
    baseType = baseType.BaseType;
  }

  if (baseType == typeof(BasePlugin))
  {
    if( !t.IsInterface && !t.IsAbstract)
    {
      FoundPlugins.Add(t);
      break; 
    }
  }
}


Oh yeah, < pre > tags keep the indentation.

Using is only works when you have an instance of the class your checking, shame really.

My current favourite word is: Delicious!
-SK Genius

Game Programming articles start -here[^]-

GeneralRe: Plugins and Abstract classes. Pin
iAmEntity7-Feb-09 9:33
iAmEntity7-Feb-09 9:33 
QuestionChecking for data Pin
ziwez07-Feb-09 5:07
ziwez07-Feb-09 5:07 
AnswerRe: Checking for data Pin
Dave Kreskowiak7-Feb-09 8:54
mveDave Kreskowiak7-Feb-09 8:54 
GeneralRe: Checking for data Pin
DaveyM697-Feb-09 10:14
professionalDaveyM697-Feb-09 10:14 
GeneralRe: Checking for data Pin
Dave Kreskowiak7-Feb-09 11:47
mveDave Kreskowiak7-Feb-09 11:47 
QuestionVoice to text Conversion in windows mobile application Pin
ReachMe@CodeProject7-Feb-09 3:55
ReachMe@CodeProject7-Feb-09 3:55 
QuestionRefreshing datagrid Pin
Muammar©7-Feb-09 3:20
Muammar©7-Feb-09 3:20 
AnswerRe: Refreshing datagrid Pin
Muammar©7-Feb-09 3:58
Muammar©7-Feb-09 3:58 
GeneralRe: Refreshing datagrid Pin
Rafone7-Feb-09 5:00
Rafone7-Feb-09 5:00 
GeneralRe: Refreshing datagrid Pin
Muammar©7-Feb-09 18:56
Muammar©7-Feb-09 18:56 
Questionbest choice ? Pin
Xmen Real 7-Feb-09 2:50
professional Xmen Real 7-Feb-09 2:50 
AnswerRe: best choice ? [modified] Pin
DaveyM697-Feb-09 3:25
professionalDaveyM697-Feb-09 3:25 
AnswerRe: best choice ? Pin
Luc Pattyn7-Feb-09 3:48
sitebuilderLuc Pattyn7-Feb-09 3:48 
Questionfile upload error Pin
George_George7-Feb-09 2:43
George_George7-Feb-09 2:43 
AnswerRe: file upload error Pin
Nicholas Butler7-Feb-09 3:34
sitebuilderNicholas Butler7-Feb-09 3:34 
GeneralRe: file upload error Pin
George_George7-Feb-09 22:19
George_George7-Feb-09 22:19 
GeneralRe: file upload error Pin
Nicholas Butler7-Feb-09 23:36
sitebuilderNicholas Butler7-Feb-09 23:36 

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.