Share via


OpaqueDataDictionary.GetValue Generic Method

Note

This generic method is available only when developing for Windows.

Gets the value of the specified key/value pair of the asset.

Syntax

'Declaration
Public Function GetValue(Of T) ( _
         key As String, _
         defaultValue As T _
) As T 
public T GetValue<T> (
         string key,
         T defaultValue
)
public:
generic<typename T>
T GetValue(
         String key,
         T defaultValue
)

Type Parameters

  • T
    The type of the current instance.

Parameters

  • key
    Type: String
    The name of the key.
  • defaultValue
    Type: T
    The value to return if the key cannot be found. This can be null for reference types, 0 for primitive types, and a zero-filled structure for structure types.

Return Value

Type: T
The value of the retrieved opaque data.

Remarks

GetValue looks only for values of a specific type. If the entry is of a different type, the defaultvalue is returned.

Requirements

Namespace: Microsoft.Xna.Framework.Content.Pipeline

Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

See Also

Reference

OpaqueDataDictionary Class
OpaqueDataDictionary Members
Microsoft.Xna.Framework.Content.Pipeline Namespace

Platforms

Windows 7, Windows Vista, Windows XP