Module.IsResource Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a value indicating whether the object is a resource.
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
Returns
true
if the object is a resource; otherwise, false
.
Examples
The following example demonstrates a use of the IsResource
method.
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
Applies to
Colaborați cu noi pe GitHub
Sursa pentru acest conținut poate fi găsită pe GitHub, unde puteți, de asemenea, să creați și să consultați probleme și solicitări de tragere. Pentru mai multe informații, consultați ghidul nostru pentru colaboratori.