Class PlatformResources
Global registry of named platform resources.
Namespace: Microsoft.Psi
Assembly: Microsoft.Psi.dll
Syntax
public static class PlatformResources : object
Methods
View SourceContains<T>(String)
Gets a value indicating whether a named resource with the specified type exists.
Declaration
public static bool Contains<T>(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the resource. |
Returns
Type | Description |
---|---|
System.Boolean | True if the named resource of the specified type exists, otherwise false. |
Type Parameters
Name | Description |
---|---|
T | The type of the resource. |
ContainsDefault<T>()
Gets a value indicating whether a default resource with the specified type exists.
Declaration
public static bool ContainsDefault<T>()
Returns
Type | Description |
---|---|
System.Boolean | True if the resource contains the specified name, otherwise false. |
Type Parameters
Name | Description |
---|---|
T | The type of the resource. |
Enumerate<T>()
Gets an enumeration with the names of resources of a specified type.
Declaration
public static IEnumerable<string> Enumerate<T>()
Returns
Type | Description |
---|---|
IEnumerable<String> | An enumeration with the names of resources of a specified type. |
Type Parameters
Name | Description |
---|---|
T | The type of the resource. |
Get<T>(String)
Gets a resource of a specified type by name.
Declaration
public static T Get<T>(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the resource. |
Returns
Type | Description |
---|---|
T | The resource with the specified name. |
Type Parameters
Name | Description |
---|---|
T | The type of the resource. |
GetDefault<T>()
Gets the default resource of a specified type.
Declaration
public static T GetDefault<T>()
Returns
Type | Description |
---|---|
T | The default resource of the specified type. |
Type Parameters
Name | Description |
---|---|
T | The type of the resource. |
Register<T>(String, T)
Registers a named resource of a specified type.
Declaration
public static void Register<T>(string name, T value)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the resource. |
T | value | The value of the resource. |
Type Parameters
Name | Description |
---|---|
T | The type of the resource. |
RegisterDefault<T>(T)
Registers the default resource of a specified type.
Declaration
public static void RegisterDefault<T>(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | The value of the resource. |
Type Parameters
Name | Description |
---|---|
T | The type of the resource. |
TryGet<T>(String, out T)
Tries to get a named resource of a specified type.
Declaration
public static bool TryGet<T>(string name, out T value)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the resource. |
T | value | The value of the resource. |
Returns
Type | Description |
---|---|
System.Boolean | True if a resource with the specified name exists, or false otherwise. |
Type Parameters
Name | Description |
---|---|
T | The type of the resource. |
TryGetDefault<T>(out T)
Tries to get the default resource of a specified type.
Declaration
public static bool TryGetDefault<T>(out T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | The value of the resource. |
Returns
Type | Description |
---|---|
System.Boolean | True if a default resource of the specified type exists, or false otherwise. |
Type Parameters
Name | Description |
---|---|
T | The type of the resource. |