Module.IsResource Méthode

Définition

Obtient une valeur indiquant si l'objet est une ressource.

public:
 virtual bool IsResource();
public:
 bool IsResource();
public virtual bool IsResource ();
public bool IsResource ();
abstract member IsResource : unit -> bool
override this.IsResource : unit -> bool
member this.IsResource : unit -> bool
Public Overridable Function IsResource () As Boolean
Public Function IsResource () As Boolean

Retours

true si l'objet est une ressource ; sinon, false.

Exemples

L’exemple suivant illustre l’utilisation de la IsResource méthode .

using namespace System;
using namespace System::Reflection;
int main()
{
   array<Module^>^moduleArray;
   moduleArray = Assembly::GetExecutingAssembly()->GetModules( false );
   
   //In a simple project with only one module, the module at index
   // 0 will be the module containing this class.
   Module^ myModule = moduleArray[ 0 ];
   Console::WriteLine( "myModule->IsResource() = {0}", myModule->IsResource() );
}
using System;
using System.Reflection;

namespace ReflectionModule_Examples
{
    class MyMainClass
    {
        static void Main()
        {
            Module[] moduleArray;
            
            moduleArray = typeof(MyMainClass).Assembly.GetModules(false);
            
            //In a simple project with only one module, the module at index
            // 0 will be the module containing this class.
            Module myModule = moduleArray[0];

            Console.WriteLine("myModule.IsResource() = {0}", myModule.IsResource());
        }
    }
}
Imports System.Reflection

Namespace ReflectionModule_Examples
    Class MyMainClass
        Shared Sub Main()
            Dim moduleArray() As [Module]

            moduleArray = GetType(MyMainClass).Assembly.GetModules(False)

            'In a simple project with only one module, the module at index
            ' 0 will be the module containing this class.
            Dim myModule As [Module] = moduleArray(0)

            Console.WriteLine("myModule.IsResource() = {0}", myModule.IsResource())
        End Sub
    End Class
End Namespace 'ReflectionModule_Examples

S’applique à