C# Type IsContextful
Description
Type IsContextful
gets a value indicating whether the
Type can be hosted in a context.
Syntax
Type.IsContextful
has the following syntax.
public bool IsContextful { get; }
Example
The following example demonstrates the IsContextful, IsMarshalByRef, and IsPrimitive properties of the Type class.
// ww w .ja va2 s . co m
using System;
using System.Runtime.Remoting.Contexts;
public class MyContextBoundClass: ContextBoundObject
{
public string myString = "This class demonstrates the IsContextful.";
}
public class MyTypeDemoClass
{
public static void Main()
{
try
{
Console.WriteLine (typeof(MyTypeDemoClass).IsContextful);
}
catch (Exception e)
{
Console.WriteLine("An exception occurred: " + e.Message);
}
}
}
The code above generates the following result.