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
Namespace: Algenta.Colectica.Model.Utility
Assembly: Algenta.Colectica.Model.dll
Syntax
public sealed class ItemFormatPool : object, 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
public IEnumerable<IItemFormatter> ItemFormatters { get; set; }
Property Value
Type | Description |
---|---|
IEnumerable<IItemFormatter> | The item formatters. |
Methods
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 |
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. |
System.String | imageName | The name of the 16x16 image. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Implements
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. |
System.String | imageName | The name of the 32x32 image. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Implements
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 = null)
Parameters
Type | Name | Description |
---|---|---|
Guid | itemType | The type of the item to be created. |
System.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. |
Implements
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 |
---|---|
System.String | A label for the specified item type. |
Implements
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 |
---|---|
System.String | A label for the specified item type. |
Implements
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. |
Implements
GetRepresentation(IVersionable, Guid)
Gets the XML representation for the specified item.
Declaration
public string GetRepresentation(IVersionable item, Guid itemFormat = null)
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 |
---|---|
System.String |
Implements
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 |
---|---|
System.Int32 | The sort order of the specified item type. |
Implements
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. |
Implements
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. |
Implements
Initialize()
Initializes this instance.
Declaration
public bool Initialize()
Returns
Type | Description |
---|---|
System.Boolean |
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. |
Implements
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 |
---|---|
System.Boolean |
|