Show / Hide Table of Contents

Class AssemblyUnpacker<T>

Base class for defining an IUnpacker<T> that extracts embedded resources from an Assembly.

Inheritance
object
AssemblyUnpacker<T>
BitmapUnpacker
ImageUnpacker
StringUnpacker
TextUnpacker
Unpacker
XamlUnpacker
Implements
IUnpacker<T>
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: TheXDS.MCART.Resources
Assembly: MCART.dll
Syntax
public abstract class AssemblyUnpacker<T> : IUnpacker<T>
Type Parameters
Name Description
T

Type of resources to extract.

Constructors

| Edit this page View Source

AssemblyUnpacker(Assembly, string)

Base class for defining an IUnpacker<T> that extracts embedded resources from an Assembly.

Declaration
protected AssemblyUnpacker(Assembly assembly, string path)
Parameters
Type Name Description
Assembly assembly

Assembly from which embedded resources will be extracted.

string path

Path (in namespace format) where the embedded resources will be located.

Methods

| Edit this page View Source

TryUnpack(string, ICompressorGetter, out T)

Attempts to get an identifiable resource.

Declaration
public virtual bool TryUnpack(string id, ICompressorGetter compressor, out T result)
Parameters
Type Name Description
string id

Identifier of the resource.

ICompressorGetter compressor

ICompressorGetter to use to extract the resource.

T result

Output parameter. A resource of type T.

Returns
Type Description
bool

true if the resource was successfully extracted, false otherwise.

| Edit this page View Source

TryUnpack(string, out T)

Attempts to get an identifiable resource.

Declaration
public virtual bool TryUnpack(string id, out T result)
Parameters
Type Name Description
string id

Identifier of the resource.

T result

Output parameter. A resource of type T.

Returns
Type Description
bool

true if the resource was successfully extracted, false otherwise.

| Edit this page View Source

Unpack(string)

Gets an identifiable resource.

Declaration
public abstract T Unpack(string id)
Parameters
Type Name Description
string id

Identifier of the resource.

Returns
Type Description
T

A resource of type T.

| Edit this page View Source

Unpack(string, ICompressorGetter)

Extracts a compressed resource using the specified compressor.

Declaration
public abstract T Unpack(string id, ICompressorGetter compressor)
Parameters
Type Name Description
string id

Identifier of the resource.

ICompressorGetter compressor

ICompressorGetter to use to extract the resource.

Returns
Type Description
T

An uncompressed resource of type T.

| Edit this page View Source

UnpackStream(string)

Gets a Stream from which to read an embedded resource.

Declaration
protected Stream? UnpackStream(string id)
Parameters
Type Name Description
string id

Identifier of the embedded resource.

Returns
Type Description
Stream

A Stream from which to read an embedded resource.

Exceptions
Type Condition
ArgumentNullException

Thrown if id is an empty string or null.

| Edit this page View Source

UnpackStream(string, ICompressorGetter?)

Gets a Stream from which to extract a compressed embedded resource.

Declaration
protected Stream UnpackStream(string id, ICompressorGetter? compressor)
Parameters
Type Name Description
string id

Identifier of the embedded resource.

ICompressorGetter compressor

ICompressorGetter to use to extract the resource, or null to not use a decompression extractor.

Returns
Type Description
Stream

A Stream from which to read an uncompressed embedded resource.

Exceptions
Type Condition
ArgumentNullException

Thrown if id is an empty string or null.

MissingResourceException

Thrown if an embedded resource with the specified ID is not found in the path defined for this resource extractor.

Implements

IUnpacker<T>

Extension Methods

Objects.ShallowCopyTo(object, object, Type)
ObjectExtensions.FieldsOf<T>(object)
ObjectExtensions.GetAttribute<T>(object)
ObjectExtensions.GetAttributes<T>(object)
ObjectExtensions.HasAttrValue<TAttribute, TValue>(object, out TValue)
ObjectExtensions.HasAttribute<T>(object)
ObjectExtensions.HasAttribute<T>(object, out T?)
ObjectExtensions.HasAttributes<T>(object, out IEnumerable<T>?)
ObjectExtensions.Is(object?, object?)
ObjectExtensions.IsEither(object, IEnumerable)
ObjectExtensions.IsEither(object, params object[])
ObjectExtensions.IsNeither(object, IEnumerable)
ObjectExtensions.IsNeither(object, params object[])
ObjectExtensions.IsNot(object?, object?)
ObjectExtensions.PropertiesOf<T>(object)
ObjectExtensions.WhichAre(object, IEnumerable<object>)
ObjectExtensions.WhichAre(object, params object[])
Common.IfNotNull<T>(T?, Action<T>)
Objects.Itself<T>(T)
Objects.ShallowCopyTo<T>(T, T)
CollectionExtensions.PushInto<TItem, TCollection>(TItem, ICollection<TCollection>)
DictionaryExtensions.PushInto<TKey, TValue>(TValue, TKey, IDictionary<TKey, TValue>)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX