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