Class TuContexts
A collection of translation unit context objects.
The same translation unit may occur in different places within a document, thus having different contexts.
Inherited Members
Namespace: SdlSdl.LanguagePlatformTranslationMemory
Assembly: Sdl.LanguagePlatform.TranslationMemory.dll
Syntax
[DataContract]
public class TuContexts
Constructors
TuContexts()
Initializes a new instance with default values.
Declaration
public TuContexts()
TuContexts(TuContexts)
Initializes a new instance of the TuContexts class from another instance.
Declaration
public TuContexts(TuContexts other)
Parameters
Type | Name | Description |
---|---|---|
TuContexts | other | The other instance. |
Properties
Length
Gets the number of contexts contained in this instance.
Declaration
public int Length { get; }
Property Value
Type | Description |
---|---|
int |
Values
Gets or sets the collection of TuContext objects of this instance.
Declaration
[DataMember]
public HashSet<TuContext> Values { get; set; }
Property Value
Type | Description |
---|---|
HashSetTuContext |
Methods
Add(TuContext)
Adds a new context to the list, if it isn't already there.
Declaration
public bool Add(TuContext newVal)
Parameters
Type | Name | Description |
---|---|---|
TuContext | newVal | The new context. |
Returns
Type | Description |
---|---|
bool | true if newVal was added, false if it was already in the list. |
AddRange(TuContexts)
Adds the elements of another instance to the list of this instance without checking for duplicates.
Declaration
public void AddRange(TuContexts contexts)
Parameters
Type | Name | Description |
---|---|---|
TuContexts | contexts | The other instance. |
AddRange(IEnumerable<TuContext>)
Adds a collection of contexts to this instance without checking for duplicates.
Declaration
public void AddRange(IEnumerable<TuContext> values)
Parameters
Type | Name | Description |
---|---|---|
IEnumerableTuContext | values | The context collection. |
Assign(TuContexts)
Assigns the elements of another instance to the list of this instance.
Declaration
public bool Assign(TuContexts contexts)
Parameters
Type | Name | Description |
---|---|---|
TuContexts | contexts | The other instance. |
Returns
Type | Description |
---|---|
bool | true if this instance was changed, otherwise false. |
Clear()
Removes all the contexts from this instance.
Declaration
public void Clear()
Equals(TuContexts)
Determines if this instance is equivalent to another instance, i.e. they contain the same collection of contexts, independent of order.
Declaration
public bool Equals(TuContexts other)
Parameters
Type | Name | Description |
---|---|---|
TuContexts | other | The other instance. |
Returns
Type | Description |
---|---|
bool | true if the two objects represent the same collection of contexts, otherwise false. |
HasValue(TuContext)
Determines whether a context is already in the list.
Declaration
public bool HasValue(TuContext val)
Parameters
Type | Name | Description |
---|---|---|
TuContext | val | The context. |
Returns
Type | Description |
---|---|
bool | true if it is already in the list, otherwise false. |
HasValues(TuContexts)
Determines whether this instance contains all the contexts from another instance.
Declaration
public bool HasValues(TuContexts other)
Parameters
Type | Name | Description |
---|---|---|
TuContexts | other | The other instance. |
Returns
Type | Description |
---|---|
bool | true if this instance contains all the contexts from other, otherwise false. |
Merge(TuContext)
Adds an element to the list if it doesn't already exist.
Declaration
public bool Merge(TuContext value)
Parameters
Type | Name | Description |
---|---|---|
TuContext | value | The new context. |
Returns
Type | Description |
---|---|
bool | true if value was added, otherwise false. |
Merge(TuContexts)
Adds the elements of another instance to the list of this instance if they don't already exist in the collection.
Declaration
public bool Merge(TuContexts contexts)
Parameters
Type | Name | Description |
---|---|---|
TuContexts | contexts | The other instance. |
Returns
Type | Description |
---|---|
bool | true if this instance was changed, otherwise false. |
Merge(IEnumerable<TuContext>)
Adds a collection of contexts to this instance if they don't already exist in the collection.
Declaration
public bool Merge(IEnumerable<TuContext> values)
Parameters
Type | Name | Description |
---|---|---|
IEnumerableTuContext | values | The collection of contexts to be added. |
Returns
Type | Description |
---|---|
bool | true if this instance was changed, otherwise false. |