Class Filter
Represents a filter meant to retrieve a subset of translation units from a translation memory.
Inherited Members
Namespace: Sdl.LanguagePlatform.TranslationMemory
Assembly: Sdl.LanguagePlatform.TranslationMemory.dll
Syntax
[DataContract]
public class Filter
Constructors
Filter(FilterExpression, string, int)
Initializes a new instance of the Filter class with the specified expression, name and penalty.
Declaration
public Filter(FilterExpression filterExpression, string name, int penalty)
Parameters
| Type | Name | Description |
|---|---|---|
| FilterExpression | filterExpression | The filter expression. |
| string | name | The filter name (non-null, non-empty, and cannot contain blanks). |
| int | penalty | The filter penalty (0 or larger). |
Properties
FilterExpression
Gets or sets the filter expression.
Declaration
[DataMember]
public FilterExpression FilterExpression { get; set; }
Property Value
| Type | Description |
|---|---|
| FilterExpression |
Name
Gets or sets the filter name. Filter names must be non-empty and cannot contain blanks.
Declaration
[DataMember]
public string Name { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Penalty
Gets or sets the filter penalty.
Declaration
[DataMember]
public int Penalty { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
Load(Stream)
Loads an filter from the specified stream.
Declaration
public static Filter Load(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream to read the data from |
Returns
| Type | Description |
|---|---|
| Filter | The filter loaded from the specified stream. |
Load(string)
Loads a filter from the specified file name.
Declaration
public static Filter Load(string fileName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fileName | The file name to load the data from. |
Returns
| Type | Description |
|---|---|
| Filter | The filter stored in the specified file. |
Save(Stream)
Serializes the filter to the specified output stream.
Declaration
public void Save(Stream outputStream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | outputStream | The output stream. |
Save(string)
Saves the filter in the specified file.
Declaration
public void Save(string fileName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fileName | The file name to save the filter in. Existing files will be overwritten. |