Class PicklistField
Represents a field declaration that contains a picklist and whose field values can only be chosen from that picklist.
Inherited Members
Namespace: Sdl.LanguagePlatform.TranslationMemory
Assembly: Sdl.LanguagePlatform.TranslationMemory.dll
Syntax
public class PicklistField : Field, ICloneable, IField
Constructors
PicklistField()
Initializes a new instance with default values.
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 of the PicklistField class with a specified name and type.
Declaration
public PicklistField(string name, FieldValueType t)
Parameters
Type | Name | Description |
---|---|---|
System.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 |
---|---|---|
System.String | name | The field name. |
FieldValueType | t | The field type. |
System.Collections.Generic.ICollection<PicklistItem> | 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 |
---|---|---|
System.String | name | The field name. |
FieldValueType | t | The field type. |
System.Collections.Generic.ICollection<System.String> | 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 |
---|---|
System.Collections.Generic.IList<System.String> |
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 |
---|---|---|
System.String | value |
Returns
Type | Description |
---|---|
System.Boolean |
Clone()
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
System.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)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object to compare with the current object. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified object is equal to the current object; otherwise, false. |
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
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 |
---|---|---|
System.String | values |
PicklistToString()
Serializes the picklist values into a comma separated string.
Declaration
public string PicklistToString()
Returns
Type | Description |
---|---|
System.String | The picklist as a comma separated string or null if the field declaration is not of one of the picklist types. |