Class AssemblyDecoratorExtensions
- Namespace
- Cuemon.Reflection
- Assembly
- Cuemon.Core.dll
Extension methods for the System.Reflection.Assembly class hidden behind the IDecorator<T> interface.
public static class AssemblyDecoratorExtensions
- Inheritance
-
ObjectAssemblyDecoratorExtensions
Methods
GetAssemblyVersion(IDecorator<Assembly>)
Returns a VersionResult that represents the System.Reflection.AssemblyVersionAttribute of the underlying System.Reflection.Assembly of the decorator
.
public static VersionResult GetAssemblyVersion(this IDecorator<Assembly> decorator)
Parameters
decorator
IDecorator<Assembly>The IDecorator<T> to extend.
Returns
- VersionResult
A VersionResult that represents the underlying System.Reflection.Assembly of the
decorator
.
Exceptions
- System.ArgumentNullException
decorator
cannot be null.
GetFileVersion(IDecorator<Assembly>)
Returns a VersionResult that represents the System.Reflection.AssemblyFileVersionAttribute of the underlying System.Reflection.Assembly of the decorator
.
public static VersionResult GetFileVersion(this IDecorator<Assembly> decorator)
Parameters
decorator
IDecorator<Assembly>The IDecorator<T> to extend.
Returns
- VersionResult
A VersionResult that represents the file version of the underlying System.Reflection.Assembly of the
decorator
; null if no System.Reflection.AssemblyFileVersionAttribute could be retrieved.
Exceptions
- System.ArgumentNullException
decorator
cannot be null.
GetManifestResources(IDecorator<Assembly>, String, ManifestResourceMatch)
Loads the embedded resources from the underlying System.Reflection.Assembly of the decorator
.
public static IDictionary<string, Stream> GetManifestResources(this IDecorator<Assembly> decorator, string name, ManifestResourceMatch match = ManifestResourceMatch.Name)
Parameters
decorator
IDecorator<Assembly>The IDecorator<T> to extend.
name
StringThe case-sensitive name of the resource being requested.
match
ManifestResourceMatchThe ruleset that defines the match to apply.
Returns
- IDictionary<String, Stream>
An System.Collections.Generic.IDictionary<TKey, TValue> that contains the result of
match
.
Remarks
The result returned can have null values if no resources were specified during compilation or if the resource is not visible to the caller.
Exceptions
- System.ArgumentNullException
decorator
cannot be null -or-name
cannot be null.- ArgumentException
name
cannot be empty or consist only of white-space characters.- System.ComponentModel.InvalidEnumArgumentException
match
was not in the range of valid values.
- See Also
-
System.Reflection.Assembly.GetManifestResourceStream(System.String)System.Reflection.Assembly.GetManifestResourceNames
GetProductVersion(IDecorator<Assembly>)
Returns a VersionResult that represents the System.Reflection.AssemblyInformationalVersionAttribute of the underlying System.Reflection.Assembly of the decorator
.
public static VersionResult GetProductVersion(this IDecorator<Assembly> decorator)
Parameters
decorator
IDecorator<Assembly>The IDecorator<T> to extend.
Returns
- VersionResult
A VersionResult that represents the product version of the underlying System.Reflection.Assembly of the
decorator
; null if no System.Reflection.AssemblyInformationalVersionAttribute could be retrieved.
Exceptions
- System.ArgumentNullException
decorator
cannot be null.
GetTypes(IDecorator<Assembly>, String, Type)
Gets the types contained within the underlying System.Reflection.Assembly of this instance.
public static IEnumerable<Type> GetTypes(this IDecorator<Assembly> decorator, string namespaceFilter = null, Type typeFilter = null)
Parameters
decorator
IDecorator<Assembly>The IDecorator<T> to extend.
namespaceFilter
StringThe filter to limit the types by namespace.
typeFilter
TypeThe filter to limit the types by a specific type.
Returns
- IEnumerable<Type>
A sequence of System.Type elements, matching the applied filters, from the underlying System.Reflection.Assembly of this instance.
Exceptions
- System.ArgumentNullException
decorator
cannot be null.
IsDebugBuild(IDecorator<Assembly>)
Determines whether the underlying System.Reflection.Assembly of the decorator
is a debug build.
public static bool IsDebugBuild(this IDecorator<Assembly> decorator)
Parameters
decorator
IDecorator<Assembly>The IDecorator<T> to extend.
Returns
- Boolean
true
if the the underlying System.Reflection.Assembly of thedecorator
is a debug build; otherwise,false
.
Exceptions
- System.ArgumentNullException
decorator
cannot be null.