Show / Hide Table of Contents

Class ItemFormatPool

Contains all of the item formatters found through MEF, and implements proxy methods that call the corresponding method from the appropriate formatter.

Inheritance
object
ItemFormatPool
Implements
IItemFormatter
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
Namespace: Algenta.Colectica.Model.Utility
Assembly: Algenta.Colectica.Model.dll
Syntax
public sealed class ItemFormatPool : IItemFormatter

Properties

Instance

Gets the one and only singleton instance of this class.

Declaration
public static ItemFormatPool Instance { get; }
Property Value
Type Description
ItemFormatPool

The one and only instance.

ItemFormatters

Gets the item formatters from MEF.

Declaration
[ImportMany(AllowRecomposition = true)]
public IEnumerable<IItemFormatter> ItemFormatters { get; set; }
Property Value
Type Description
IEnumerable<IItemFormatter>

The item formatters.

Methods

GetEnglishPluralLabelForItemType(Guid)

Gets plural label for the specified type of item, in English.

Declaration
public string GetEnglishPluralLabelForItemType(Guid type)
Parameters
Type Name Description
Guid type
Returns
Type Description
string

A label for the specified item type.

GetFormatterForType(Guid)

Gets the IItemFormatter for the specified item type.

Declaration
public IItemFormatter GetFormatterForType(Guid itemType)
Parameters
Type Name Description
Guid itemType

The item type for which to retrieve a formatter.

Returns
Type Description
IItemFormatter

The IItemFormatter if one exists; otherwise null.

GetImageNameForItemType16(Guid, out string)

Gets the image name for a 16x16 image representing items of the specified type.

Declaration
public bool GetImageNameForItemType16(Guid itemType, out string imageName)
Parameters
Type Name Description
Guid itemType

The type of the item.

string imageName

The name of the 16x16 image.

Returns
Type Description
bool

true if an image can be provided; otherwise false.

GetImageNameForItemType32(Guid, out string)

Gets the image name for a 32x32 image representing items of the specified type.

Declaration
public bool GetImageNameForItemType32(Guid itemType, out string imageName)
Parameters
Type Name Description
Guid itemType

The type of the item.

string imageName

The name of the 32x32 image.

Returns
Type Description
bool

true if an image can be provided; otherwise false.

GetItem(Guid, string, Collection<Note>, ItemCache, Guid)

Instantiates an IVersionable item by deserializing the provided representantation.

Declaration
public IVersionable GetItem(Guid itemType, string representation, Collection<Note> itemNotes, ItemCache itemCache = null, Guid format = default)
Parameters
Type Name Description
Guid itemType

The type of the item to be created.

string representation

The representation: usually an xml element.

Collection<Note> itemNotes

The item notes.

ItemCache itemCache

The item cache.

Guid format

The format of the representation to be created, generally taken from RepositoryFormats.

Returns
Type Description
IVersionable

The instantiated IVersionable item.

GetLabelForItemType(Guid)

Gets a singular label for the specified type of item.

Declaration
public string GetLabelForItemType(Guid itemType)
Parameters
Type Name Description
Guid itemType

The type of item.

Returns
Type Description
string

A label for the specified item type.

GetPluralLabelForItemType(Guid)

Gets a plural label for the specified type of item.

Declaration
public string GetPluralLabelForItemType(Guid type)
Parameters
Type Name Description
Guid type
Returns
Type Description
string

A label for the specified item type.

GetReferencedTypes(Guid)

Gets an array of item types that can be referenced from the specified item type.

Declaration
public Guid[] GetReferencedTypes(Guid itemType)
Parameters
Type Name Description
Guid itemType

The type of the item.

Returns
Type Description
Guid[]

An array of item types that can be referenced from the specified item type.

GetRepresentation(IVersionable, Guid)

Gets the XML representation for the specified item.

Declaration
public string GetRepresentation(IVersionable item, Guid itemFormat = default)
Parameters
Type Name Description
IVersionable item

The item for which a representation should be created.

Guid itemFormat

The format of the representation to be created, generally taken from RepositoryFormats.

Returns
Type Description
string

GetSortOrder(Guid)

Gets the sort order of the specified item type. Lower numbers are sorted before higher numbers.

Declaration
public int GetSortOrder(Guid itemType)
Parameters
Type Name Description
Guid itemType

Type of the item.

Returns
Type Description
int

The sort order of the specified item type.

GetTextExtract(IVersionable)

Gets a list of the ItemTextExtract extracts from the specified item. These extracts are used for full text indexing.

Declaration
public Collection<ItemTextExtract> GetTextExtract(IVersionable item)
Parameters
Type Name Description
IVersionable item

The item from which extracts are created.

Returns
Type Description
Collection<ItemTextExtract>

A list of extracts.

GetTypeForItemType(Guid)

Gets the .NET type for the specified item type.

Declaration
public Type GetTypeForItemType(Guid itemType)
Parameters
Type Name Description
Guid itemType

The type of the item.

Returns
Type Description
Type

The .NET type for the specified item type.

Initialize()

Initializes this instance.

Declaration
public bool Initialize()
Returns
Type Description
bool

SupportedItems()

Gets a list of item types about which this class can provide information.

Declaration
public List<Guid> SupportedItems()
Returns
Type Description
List<Guid>

The list of item types about which this class can provide information.

SupportsItem(Guid)

Determines whether this class can provide information about an item with the specified type.

Declaration
public bool SupportsItem(Guid itemType)
Parameters
Type Name Description
Guid itemType

The type of the item for which information is being queried.

Returns
Type Description
bool

true if this class can provide information about the specified item type; otherwise false.

Implements

IItemFormatter

Extension Methods

Extensions.Yield<T>(T)
In this article
Back to top Generated by DocFX