Interface IResourceLocator
Provides methods for locating resources for a template.
Namespace: Sartorius.SAF.ReportGenerator
Assembly: Sartorius.SAF.ReportGenerator.dll
Syntax
[InheritedExport]
public interface IResourceLocator
Remarks
The SAF will export a default implementation if you do not implement this. The default implementation searches for resources in the source assembly of the report and in additional assemblies configured by IReportResourceConfiguration.
Methods
View SourceGetCultures()
Gets the cultures for the current template.
Declaration
IEnumerable<CultureInfo> GetCultures()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Globalization.CultureInfo> | The cultures of the current template. |
GetFileResource(Predicate<String>)
Loads the first file resource which satisfies the specified predicate.
Declaration
Stream GetFileResource(Predicate<string> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Predicate<System.String> | predicate | The predicate to check the name of the resource. |
Returns
Type | Description |
---|---|
System.IO.Stream | A System.IO.Stream containing the content of the requested file; |
GetFileResource(String)
Gets the file resource corresponding to the specified name.
Declaration
Stream GetFileResource(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The file name. |
Returns
Type | Description |
---|---|
System.IO.Stream | A System.IO.Stream containing the content of the requested file; |
GetStringResource(CultureInfo, String)
Gets a string resource for the specified resource key and System.Globalization.CultureInfo.
Declaration
string GetStringResource(CultureInfo culture, string name)
Parameters
Type | Name | Description |
---|---|---|
System.Globalization.CultureInfo | culture | The culture for which to get the resource. |
System.String | name | The resource name. |
Returns
Type | Description |
---|---|
System.String | The requested string resource. |
GetStringResource(String)
Gets a string resource for the System.Threading.Thread.CurrentUICulture.
Declaration
string GetStringResource(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The resource name. |
Returns
Type | Description |
---|---|
System.String | The string resource for the current UI culture. |