Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get list of the classes in casual assembly
Message
De
16/03/2010 09:52:04
Vladimir Zhuravlev
Institute of the Physics of Earth,Russia
Moscow Region, Russie
 
 
À
16/03/2010 09:24:41
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01453908
Message ID:
01454766
Vues:
30
Gregory
Is this Ok?
The error is in this string on '.where'
 classList.AddRange(from x in module.GetTypes().Where(x => x.IsClass) select x);
Intelisence does not see .where after module.GetTypes().
The error says
*****
System.Array does not know 'Where' or some 'using clause is missing'
  public string GetModInfo(string Assemblyname)

        {
              string vbTab = "   ";


              var assembly = Assembly.Load(Assemblyname);
              List<Type> classList = new List<Type>();

              foreach (var module in assembly.GetModules())
              {
                  classList.AddRange(from x in module.GetTypes().Where(x => x.IsClass) select x);
              }

              foreach (var className in classList)
              {
                   vbTab =  vbTab + className.Name;
              }
              
            return vbTab;
        }
Usiing part is
using System;
using System.Collections.Generic;
using System.Text;

using System.Runtime.InteropServices;
using System.Reflection;

using DotNetBridgeLib.Tools;



using System.Data;
using System.Data.Linq;
using System.Xml;
using System.Xml.Linq;
MVP-2006-2011, PHD in Math and Physics ,
host of www.foxclub.ru,
VFP lector at Interface and Microinform companies
Head science researcher of VNIIA Rosatom.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform