System.TypedReference Structure

Assembly: Mscorlib.dll
Namespace: System
Summary
Describes objects that contain both a managed pointer to a location and a runtime representation of the type that may be stored at that location.
This class is not CLS Compliant

C# Syntax:
[CLSCompliant(false)]
public struct TypedReference
Remarks
A typed reference is a type/value combination used for varargs and other support.TypedReference is a built-in value type that can be used for parameters and local variables.

Arrays of TypedReference objects cannot be created. For example, the following call is invalid:

          Assembly.Load("mscorlib.dll").GetType("System.TypedReference[]");
        
See also:
System Namespace

System.TypedReference Member List:

Public Methods
Equals Overridden:
Checks if this object is equal to the specified object.
GetHashCode Overridden:
Returns the hash code of this object.
GetTargetType Returns the type of the target of the specified TypedReference.
GetType
(inherited from System.Object)
See base class member description: System.Object.GetType

Derived from System.Object, the primary base class for all objects.
MakeTypedReference Makes a TypedReference for the specified target object using the specifying fields.
SetTypedReference Converts the specified value to a TypedReference.
TargetTypeToken Returns the internal metadata type handle for the specified TypedReference.
ToObject Converts the specified TypedReference to an Object.
ToString
(inherited from System.ValueType)
See base class member description: System.ValueType.ToString


Returns the fully qualified type name of this instance.
Protected Methods
Finalize
(inherited from System.Object)
See base class member description: System.Object.Finalize

Derived from System.Object, the primary base class for all objects.
MemberwiseClone
(inherited from System.Object)
See base class member description: System.Object.MemberwiseClone

Derived from System.Object, the primary base class for all objects.

Hierarchy:


System.TypedReference Member Details

Overridden Method: Equals(
   object o
)
Summary
Checks if this object is equal to the specified object.
This class is not CLS Compliant

C# Syntax:
public override bool Equals(
   object o
);
Parameters:

o

The object with which to compare the current object.

Return Value:
true if this object is equal to the specified object; otherwise, false.
Exceptions
Exception Type Condition
NotSupportedException This method is not implemented.

Return to top


Method: Finalize()
Inherited
See base class member description: System.Object.Finalize
This class is not CLS Compliant

C# Syntax:
~TypedReference();

For more information on members inherited from System.Object click on the link above.

Return to top


Overridden Method: GetHashCode()
Summary
Returns the hash code of this object.
This class is not CLS Compliant

C# Syntax:
public override int GetHashCode();
Return Value:
The hash code of this object.

Return to top


Method: GetTargetType(
   TypedReference value
)
Summary
Returns the type of the target of the specified TypedReference.
This class is not CLS Compliant

C# Syntax:
public static Type GetTargetType(
   TypedReference value
);
Parameters:

value

The value whose target's type is to be returned.

Return Value:
The type of the target of the specified TypedReference.

Return to top


Method: GetType()
Inherited
See base class member description: System.Object.GetType
This class is not CLS Compliant

C# Syntax:
public Type GetType();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: MakeTypedReference(
   object target,
   FieldInfo[] flds
)
Summary
Makes a TypedReference for the specified target object using the specifying fields.
This class is not CLS Compliant

This member is not CLS Compliant

C# Syntax:
[CLSCompliant(false)]
public static TypedReference MakeTypedReference(
   object target,
   FieldInfo[] flds
);
Parameters:

target

The target object that defines the type of the TypedReference.

flds

The fields to be encapsulated.

Return Value:
A TypedReference for the specified target.
Exceptions
Exception Type Condition
ArgumentNullException target or flds is null.
ArgumentException The flds array has no elements.

Return to top


Method: MemberwiseClone()
Inherited
See base class member description: System.Object.MemberwiseClone
This class is not CLS Compliant

C# Syntax:
protected object MemberwiseClone();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: SetTypedReference(
   TypedReference target,
   object value
)
Summary
Converts the specified value to a TypedReference.
This class is not CLS Compliant

This member is not CLS Compliant

C# Syntax:
[CLSCompliant(false)]
public static void SetTypedReference(
   TypedReference target,
   object value
);
Parameters:

target

The target of the conversion.

value

The value to be converted.

Return Value:
This method assigns value to target. A change type of value converts it to the type of the TypedReference. The Convert.ChangeType method does the conversion.
Exceptions
Exception Type Condition
ArgumentNullException value is null.
InvalidCastException The requested conversion is not possible.

Return to top


Method: TargetTypeToken(
   TypedReference value
)
Summary
Returns the internal metadata type handle for the specified TypedReference.
This class is not CLS Compliant

C# Syntax:
public static RuntimeTypeHandle TargetTypeToken(
   TypedReference value
);
Parameters:

value

The TypedReference for which the type handle is requested.

Return Value:
The internal metadata type handle for the specified TypedReference.

Return to top


Method: ToObject(
   TypedReference value
)
Summary
Converts the specified TypedReference to an Object.
This class is not CLS Compliant

C# Syntax:
public static object ToObject(
   TypedReference value
);
Parameters:

value

The TypedReference to be converted.

Return Value:
An Object converted from a TypedReference.
Remarks
This might be a boxing operation.

Return to top


Method: ToString()
Inherited
See base class member description: System.ValueType.ToString

Summary
Returns the fully qualified type name of this instance.
C# Syntax:
public override string ToString();
Return Value:
A String containing a fully qualified type name.

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.