Mast/Common/DynamicCalls.cs
/// <summary>Emits the cast to a reference, unboxing if needed.</summary>
/// <param name="il">The MSIL generator.</param>
/// <param name="type">The type to cast.</param>
Emits the cast to a reference, unboxing if needed.
Emits the cast to a reference unboxing if needed .
private static void EmitCastToReference(ILGenerator ilGenerator, System.Type type)
        {
            if (type.IsValueType)
            {
                ilGenerator.Emit(OpCodes.Unbox_Any, type);
            }
            else
            {
                ilGenerator.Emit(OpCodes.Castclass, type);
            }
        }
private static void EmitCastToReference ( ILGenerator ilGenerator , System . Type type ) { if ( type . IsValueType ) { ilGenerator . Emit ( OpCodes . Unbox_Any , type ) ; } else { ilGenerator . Emit ( OpCodes . Castclass , type ) ; } }
Emits the cast to a reference, unboxing if needed.
Emits the cast to a reference unboxing if needed .
ilGenerator
ILGenerator
type
System.Type
The type to cast.
The type to cast .
il
The MSIL generator.
The MSIL generator .