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