Class FieldDefinitionCollection
Represents a collection of custom fields in a translation memory (see FieldDefinitions).
Inheritance
Implements
Namespace: Sdl.LanguagePlatform.TranslationMemoryApi
Assembly: Sdl.LanguagePlatform.TranslationMemoryApi.dll
Syntax
public class FieldDefinitionCollection : ObservableCollection<FieldDefinition>, IFieldDefinitions
Constructors
FieldDefinitionCollection()
Creates a new, empty field definition collection.
Declaration
public FieldDefinitionCollection()
Remarks
This constructor should typically only be used by implementers of IFieldsTemplate or ITranslationMemory.
Properties
Item[String]
Gets the Field with the specified name. The name is considered case-insensitive.
Declaration
public FieldDefinition this[string name] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name |
Property Value
| Type | Description |
|---|---|
| FieldDefinition |
Remarks
Do not use this accessor to modify field settings directly as these changes will not be propagated to the underlying Field collection.
Methods
AddRange(IEnumerable<FieldDefinition>)
Adds a number of fields to the collection.
Declaration
public void AddRange(IEnumerable<FieldDefinition> fieldDefinitions)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<FieldDefinition> | fieldDefinitions | The fields to be added. |
ClearItems()
Removes all items from the collection.
Declaration
protected override void ClearItems()
InsertItem(Int32, FieldDefinition)
Inserts an item into the collection at the specified index.
Declaration
protected override void InsertItem(int index, FieldDefinition item)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | The zero-based index at which |
| FieldDefinition | item | The object to insert. |
LookupIField(Guid)
Returns the field with the specified GUID, or null if there is no field with that
GUID.
Declaration
public IField LookupIField(Guid guid)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Guid | guid |
Returns
| Type | Description |
|---|---|
| IField |
LookupIField(String)
Returns the field with the specified name, or null if there is no field with that
name.
Declaration
public IField LookupIField(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name |
Returns
| Type | Description |
|---|---|
| IField |
RemoveItem(Int32)
Removes the item at the specified index of the collection.
Declaration
protected override void RemoveItem(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | The zero-based index of the element to remove. |