Module.IsResource Method ()

 

Gets a value indicating whether the object is a resource.

Namespace:   System.Reflection
Assembly:  mscorlib (in mscorlib.dll)

public virtual bool IsResource()

Return Value

Type: System.Boolean

true if the object is a resource; otherwise, false.

The following example demonstrates a use of the IsResource method.

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());
        }
    }
}

.NET Framework
Available since 1.1
Return to top
Show: