ResourceHelper Class
Represents a collection of helper methods when working with resources.
public static class ResourceHelper
- Inheritance:
- object object
Methods
GetLocationUri(Assembly, string)
Returns a pack System.Uri based on the specified parameters, that can be used to construct a System.Uri.
public static Uri GetLocationUri(Assembly assembly, string relativeLocation)
Parameter | Type | Description |
---|---|---|
assembly | Assembly | The Assembly that contains the resource. |
relativeLocation | string | The relative location of the resource file within the assembly.
The location must start NOT with a .
|
Returns
- Uri:
A pack System.Uri.
GetLocationUri(Assembly, string, bool, bool)
Returns a pack System.Uri based on the specified parameters, that can be used to construct a System.Uri.
public static Uri GetLocationUri(Assembly assembly, string relativeLocation, bool includePackPrefix, bool includeAssemblyVersion)
Parameter | Type | Description |
---|---|---|
assembly | Assembly | The Assembly that contains the resource. |
relativeLocation | string | The relative location of the resource file within the assembly.
The location must start NOT with a .
|
includePackPrefix | bool | if set to |
includeAssemblyVersion | bool | if set to |
Returns
- Uri:
A pack System.Uri.
GetLocationUriString(Assembly, string)
Returns a string-representation of a pack URI based on the specified parameters, that can be used to construct a System.Uri.
public static string GetLocationUriString(Assembly assembly, string relativeLocation)
Parameter | Type | Description |
---|---|---|
assembly | Assembly | The Assembly that contains the resource. |
relativeLocation | string | The relative location of the resource file within the assembly.
The location must start NOT with a .
|
Returns
- string:
A string-representation of a pack URI.
GetLocationUriString(Assembly, string, bool, bool)
Returns a string-representation of a pack URI based on the specified parameters, that can be used to construct a System.Uri.
public static string GetLocationUriString(Assembly assembly, string relativeLocation, bool includePackPrefix, bool includeAssemblyVersion)
Parameter | Type | Description |
---|---|---|
assembly | Assembly | The Assembly that contains the resource. |
relativeLocation | string | The relative location of the resource file within the assembly.
The location must start NOT with a .
|
includePackPrefix | bool | if set to |
includeAssemblyVersion | bool | if set to |
Returns
- string:
A string-representation of a pack URI.
GetLocationUriStringBase(Assembly)
Returns a string-representation of a base pack URI based on the specified parameters, that can be used to construct a System.Uri.
public static string GetLocationUriStringBase(Assembly assembly)
Parameter | Type | Description |
---|---|---|
assembly | Assembly | The Assembly that contains the resource. |
Returns
- string:
A string-representation of a base pack URI.