Class AssemblyExtensions
A static class that contains extension methods for the System.Reflection.Assembly class.
Inheritance
Inherited Members
Namespace: Juhta.Net.Extensions
Assembly: Juhta.Net.dll
Syntax
public static class AssemblyExtensions
Methods
| Improve this Doc View SourceGetCompany(Assembly)
Gets the value of the current assembly's Company attribute.
Declaration
public static string GetCompany(this Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | Specifies the current assembly. |
Returns
Type | Description |
---|---|
System.String | Returns the value of the Company attribute, or null, if the attibute was not found. |
GetCopyright(Assembly)
Gets the value of the current assembly's Copyright attribute.
Declaration
public static string GetCopyright(this Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | Specifies the current assembly. |
Returns
Type | Description |
---|---|
System.String | Returns the value of the Copyright attribute, or null, if the attibute was not found. |
GetDescription(Assembly)
Gets the value of the current assembly's Description attribute.
Declaration
public static string GetDescription(this Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | Specifies the current assembly. |
Returns
Type | Description |
---|---|
System.String | Returns the value of the Description attribute, or null, if the attibute was not found. |
GetDirectory(Assembly)
Gets the directory of the current assembly.
Declaration
public static string GetDirectory(this Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | Specifies the current assembly. |
Returns
Type | Description |
---|---|
System.String | Returns the directory of the current assembly without an ending directory separator. |
GetFileName(Assembly)
Gets the file name of the current assembly.
Declaration
public static string GetFileName(this Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | Specifies the current assembly. |
Returns
Type | Description |
---|---|
System.String | Returns the file name of the current assembly. |
GetFileNameWithoutExtension(Assembly)
Gets the file name of the current assembly without the extension.
Declaration
public static string GetFileNameWithoutExtension(this Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | Specifies the current assembly. |
Returns
Type | Description |
---|---|
System.String | Returns the file name of the current assembly without the extension. |
GetProduct(Assembly)
Gets the value of the current assembly's Product attribute.
Declaration
public static string GetProduct(this Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | Specifies the current assembly. |
Returns
Type | Description |
---|---|
System.String | Returns the value of the Product attribute, or null, if the attibute was not found. |
GetProductVersion(Assembly)
Gets the product version associated with the current assembly.
Declaration
public static string GetProductVersion(this Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | Specifies the current assembly. |
Returns
Type | Description |
---|---|
System.String | Returns the product version associated with the current assembly. |
GetTitle(Assembly)
Gets the value of the current assembly's Title attribute.
Declaration
public static string GetTitle(this Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | Specifies the current assembly. |
Returns
Type | Description |
---|---|
System.String | Returns the value of the Title attribute, or null, if the attibute was not found. |
GetVersion(Assembly)
Gets the value of the current assembly's Version attribute.
Declaration
public static string GetVersion(this Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | Specifies the current assembly. |
Returns
Type | Description |
---|---|
System.String | Returns the value of the Version attribute, or null, if the attibute was not found. |
LoadEmbeddedResourceFile(Assembly, String)
Loads an embedded resource file from the current assembly.
Declaration
public static string LoadEmbeddedResourceFile(this Assembly assembly, string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | Specifies the current assembly. |
System.String | fileName | Specifies the name of a resource file to be loaded. |
Returns
Type | Description |
---|---|
System.String | Returns the contents of the requested resource file. |
Remarks
This method loads the first resource file whose name matches the specified file name regardless of the file namespace.
LoadEmbeddedResourceFile(Assembly, String, String)
Loads an embedded resource file from the current assembly.
Declaration
public static string LoadEmbeddedResourceFile(this Assembly assembly, string fileName, string fileNamespace)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.Assembly | assembly | Specifies the current assembly. |
System.String | fileName | Specifies the name of a resource file to be loaded. |
System.String | fileNamespace | Specifies the namespace of a resource file to be loaded. Can be null in which case the method loads the first resource file whose name matches the specified file name. |
Returns
Type | Description |
---|---|
System.String | Returns the contents of the requested resource file. |