Show / Hide Table of Contents

Class DdiItemFormatter

Provides methods to get information about DDI item, and to serialize and deserialize items of that particular type.

Inheritance
object
DdiItemFormatter
Implements
IItemFormatter
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Algenta.Colectica.Model.Ddi
Assembly: Algenta.Colectica.Model.Ddi.dll
Syntax
[Export(typeof(IItemFormatter))]
public class DdiItemFormatter : IItemFormatter

Methods

AddMultilingualString(IdentifierTriple, Guid, MultilingualString, DdiStringType, Collection<ItemTextExtract>)

Adds the multilingual string to the provided collection of text extracts.

Declaration
public void AddMultilingualString(IdentifierTriple triple, Guid itemType, MultilingualString mstring, DdiStringType stringType, Collection<ItemTextExtract> texts)
Parameters
Type Name Description
IdentifierTriple triple

The identifier of the item to which the multilingual string belongs.

Guid itemType

The type of item to which the multilingual string belongs.

MultilingualString mstring

The multilingual string.

DdiStringType stringType

The type of content represented by the multilingual string.

Collection<ItemTextExtract> texts

The collection of text extracts to which the new extracts will be added.

AddString(IdentifierTriple, Guid, string, DdiStringType, Collection<ItemTextExtract>)

Adds the string to the provided collection of text extracts.

Declaration
public void AddString(IdentifierTriple triple, Guid itemType, string str, DdiStringType stringType, Collection<ItemTextExtract> texts)
Parameters
Type Name Description
IdentifierTriple triple
Guid itemType
string str
DdiStringType stringType
Collection<ItemTextExtract> texts

GetEnglishPluralLabelForItemType(Guid)

Gets the English plural label for the item type.

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

Type of the item.

Returns
Type Description
string

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.

GetItem(Guid, XElement, Ddi32Deserializer)

Instantiates an IVersionable item by deserializing the provided representantation.

Declaration
public IVersionable GetItem(Guid itemType, XElement element, Ddi32Deserializer deserializer)
Parameters
Type Name Description
Guid itemType

The type of the item to be created.

XElement element

The XML element to be deserialized.

Ddi32Deserializer deserializer

The deserializer.

Returns
Type Description
IVersionable

The instantiated IVersionable item.

Exceptions
Type Condition
InvalidOperationException

No item in DDI fragment or Supplied type is not a valid DDI object type

GetItem(Guid, XElement, Ddi33Deserializer)

Instantiates an IVersionable item by deserializing the provided representantation.

Declaration
public IVersionable GetItem(Guid itemType, XElement element, Ddi33Deserializer deserializer)
Parameters
Type Name Description
Guid itemType

The type of the item to be created.

XElement element

The XML element to be deserialized.

Ddi33Deserializer deserializer

The deserializer.

Returns
Type Description
IVersionable

The instantiated IVersionable item.

Exceptions
Type Condition
InvalidOperationException

No item in DDI fragment or Supplied type is not a valid DDI object type

GetItem(Guid, XmlNode, Collection<Note>)

Instantiates an IVersionable item by deserializing the provided representantation.

Declaration
public IVersionable GetItem(Guid itemType, XmlNode element, Collection<Note> itemNotes)
Parameters
Type Name Description
Guid itemType

The type of the item to be created.

XmlNode element

The XML element to be deserialized.

Collection<Note> itemNotes

The item notes.

Returns
Type Description
IVersionable

The instantiated IVersionable item.

GetItem(Guid, XmlNode, Collection<Note>, DDIWorkflowDeserializer)

Instantiates an IVersionable item by deserializing the provided representantation.

Declaration
public IVersionable GetItem(Guid itemType, XmlNode element, Collection<Note> notes, DDIWorkflowDeserializer deserializer)
Parameters
Type Name Description
Guid itemType

The type of the item to be created.

XmlNode element

The XML element to be deserialized.

Collection<Note> notes

The notes.

DDIWorkflowDeserializer deserializer

The deserializer.

Returns
Type Description
IVersionable

The instantiated IVersionable item.

Exceptions
Type Condition
InvalidOperationException

Supplied type is not a valid DDI object type

GetItem(XElement, Ddi32Deserializer)

Instantiates an IVersionable item by deserializing the provided representantation.

Declaration
public IVersionable GetItem(XElement fragment, Ddi32Deserializer deserializer)
Parameters
Type Name Description
XElement fragment

The XML element to be deserialized.

Ddi32Deserializer deserializer

The deserializer.

Returns
Type Description
IVersionable

The instantiated IVersionable item.

Exceptions
Type Condition
InvalidOperationException

Invalid DDI 3.2 fragment found or Unknown item type in DDI fragment

GetItem(XElement, Ddi33Deserializer)

Instantiates an IVersionable item by deserializing the provided representantation.

Declaration
public IVersionable GetItem(XElement fragment, Ddi33Deserializer deserializer)
Parameters
Type Name Description
XElement fragment

The XML element to be deserialized.

Ddi33Deserializer deserializer

The deserializer.

Returns
Type Description
IVersionable

The instantiated IVersionable item.

Exceptions
Type Condition
InvalidOperationException

Invalid DDI 3.3 fragment found or Unknown item type in DDI fragment

GetItem(XmlNode, DDIWorkflowDeserializer)

Instantiates an IVersionable item by deserializing the provided representantation.

Declaration
public IVersionable GetItem(XmlNode fragment, DDIWorkflowDeserializer deserializer)
Parameters
Type Name Description
XmlNode fragment

The XML element to be deserialized.

DDIWorkflowDeserializer deserializer

The deserializer.

Returns
Type Description
IVersionable

The instantiated IVersionable item.

Exceptions
Type Condition
InvalidOperationException

Unknown item type in DDI fragment

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 the type of the plural label for item.

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

Type of the item.

Returns
Type Description
string

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 format)
Parameters
Type Name Description
IVersionable item

The item for which a representation should be created.

Guid format

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.

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
In this article
Back to top Generated by DocFX