Class FieldDefinitionCollection
Represents a collection of custom fields in a translation memory (see FieldDefinitions).
Inheritance
Implements
Inherited Members
Namespace: SdlSdl.LanguagePlatformTranslationMemoryApi
Assembly: Sdl.LanguagePlatform.TranslationMemoryApi.dll
Syntax
public class FieldDefinitionCollection : ObservableCollection<FieldDefinition>, IList<FieldDefinition>, ICollection<FieldDefinition>, IList, ICollection, IReadOnlyList<FieldDefinition>, IReadOnlyCollection<FieldDefinition>, IEnumerable<FieldDefinition>, IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged, 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
this[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 |
---|---|---|
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 |
---|---|---|
IEnumerableFieldDefinition | fieldDefinitions | The fields to be added. |
ClearItems()
Removes all items from the collection.
Declaration
protected override void ClearItems()
Overrides
InsertItem(int, FieldDefinition)
Inserts an item into the collection at the specified index.
Declaration
protected override void InsertItem(int index, FieldDefinition item)
Parameters
Type | Name | Description |
---|---|---|
int | index | The zero-based index at which |
FieldDefinition | item | The object to insert. |
Overrides
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 |
---|---|---|
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 |
---|---|---|
string | name |
Returns
Type | Description |
---|---|
IField |
RemoveItem(int)
Removes the item at the specified index of the collection.
Declaration
protected override void RemoveItem(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | The zero-based index of the element to remove. |