Export (0) Print
Expand All
Expand Minimize

Type.IsMarshalByRef Property

Gets a value indicating whether the Type is marshaled by reference.

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

'Declaration
Public ReadOnly Property IsMarshalByRef As Boolean

Property Value

Type: System.Boolean
true if the Type is marshaled by reference; otherwise, false.

Implements

_Type.IsMarshalByRef

The following example demonstrates the IsContextful, IsMarshalByRef, and IsPrimitive properties of the Type class. It checks whether the given type can be hosted in the context, whether it can be marshaled by reference, and whether the type is a primitive data type.

Imports System.Runtime.Remoting.Contexts

Public Class ContextBoundClass : Inherits ContextBoundObject
    Public Value As String = "The Value property." 
End Class 

Public Class Example
    Public Shared Sub Main()
         ' Determine whether the types can be hosted in a Context.
         Console.WriteLine("The IsContextful property for the {0} type is {1}.",
                           GetType(Example).Name, GetType(Example).IsContextful)
         Console.WriteLine("The IsContextful property for the {0} type is {1}.",
                           GetType(ContextBoundClass).Name, GetType(ContextBoundClass).IsContextful)
         ' Determine whether the types are marshalled by reference.
         Console.WriteLine("The IsMarshalByRef property of {0} is {1}.",
                           GetType(Example).Name, GetType(Example).IsMarshalByRef)
         Console.WriteLine("The IsMarshalByRef property of {0} is {1}.",
                           GetType(ContextBoundClass).Name, GetType(ContextBoundClass).IsMarshalByRef)
         ' Determine whether the types are primitive datatypes.
         Console.WriteLine("{0} is a primitive data type: {1}.",
                           GetType(Integer).Name, GetType(Integer).IsPrimitive)
         Console.WriteLine("{0} is a primitive data type: {1}.",
                           GetType(String).Name, GetType(String).IsPrimitive)
    End Sub 
End Class 
' The example displays the following output: 
'    The IsContextful property for the Example type is False. 
'    The IsContextful property for the ContextBoundClass type is True. 
'    The IsMarshalByRef property of Example is False. 
'    The IsMarshalByRef property of ContextBoundClass is True. 
'    Int32 is a primitive data type: True. 
'    String is a primitive data type: False.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8
Show:
© 2015 Microsoft