Class PicklistField
Represents a field declaration.
Inherited Members
Namespace: SdlSdl.LanguagePlatformTranslationMemory
Assembly: Sdl.LanguagePlatform.TranslationMemory.dll
Syntax
[DataContract]
public class PicklistField : Field, ICloneable, IField
Constructors
PicklistField()
Initializes a new instance with an empty resource token.
Declaration
public PicklistField()
PicklistField(PicklistField)
Initializes a new instance with the values of another instance, creating a deep copy.
Declaration
public PicklistField(PicklistField other)
Parameters
Type | Name | Description |
---|---|---|
PicklistField | other | The other instance |
PicklistField(string, FieldValueType)
Initializes a new instance, with the specified name and type.
Declaration
public PicklistField(string name, FieldValueType t)
Parameters
Type | Name | Description |
---|---|---|
string | name | The field name. |
FieldValueType | t | The field type. |
PicklistField(string, FieldValueType, ICollection<PicklistItem>)
Initializes a new instance of the PicklistField class with a specified name and type.
Declaration
public PicklistField(string name, FieldValueType t, ICollection<PicklistItem> picklistValues)
Parameters
Type | Name | Description |
---|---|---|
string | name | The field name. |
FieldValueType | t | The field type. |
ICollectionPicklistItem | picklistValues | The seed list of picklist values |
PicklistField(string, FieldValueType, ICollection<string>)
Initializes a new instance of the PicklistField class with a specified name and type.
Declaration
public PicklistField(string name, FieldValueType t, ICollection<string> picklistValues)
Parameters
Type | Name | Description |
---|---|---|
string | name | The field name. |
FieldValueType | t | The field type. |
ICollectionstring | picklistValues | The seed list of picklist values |
Properties
Picklist
Gets the picklist items collection.
Declaration
public PicklistItems Picklist { get; }
Property Value
Type | Description |
---|---|
PicklistItems |
PicklistItemNames
The names of all picklist items for this Field. This collection will be empty if this field is not a SinglePicklist or MultiplePicklist.
Declaration
public override IList<string> PicklistItemNames { get; }
Property Value
Type | Description |
---|---|
IListstring |
Overrides
Methods
AddPickListItem(PicklistItem)
Declaration
public void AddPickListItem(PicklistItem value)
Parameters
Type | Name | Description |
---|---|---|
PicklistItem | value |
AddPickListItem(string)
Adds a new pick list item to the list and returns true, false if nothing is added
Declaration
public bool AddPickListItem(string value)
Parameters
Type | Name | Description |
---|---|---|
string | value |
Returns
Type | Description |
---|---|
bool |
Clone()
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
object | A new object that is a deep copy of this instance. |
Overrides
Duplicate()
Creates a new instance that is a deep copy of this instance.
Declaration
public override Field Duplicate()
Returns
Type | Description |
---|---|
Field | A new instance that is a deep copy of this instance. |
Overrides
Equals(object)
Determines whether this instance of Field and a specified object, which must also be a Field object, represent the same field declaration including the picklist according to type.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The other object. |
Returns
Type | Description |
---|---|
bool | true if obj represents the same field declaration as this instance; false otherwise. |
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int |
Overrides
PicklistFromString(string)
Deserializes the picklist values from the provided string and sets the picklist values accordingly. Existing values will be overwritten.
Declaration
public void PicklistFromString(string values)
Parameters
Type | Name | Description |
---|---|---|
string | values |
PicklistToString()
Serializes the picklist values into a comma separated string.
Declaration
public string PicklistToString()
Returns
Type | Description |
---|---|
string | The picklist as a comma separated string or null if the field declaration is not of one of the picklist types. |