Class FieldViewModel
Represents a BugAnywhere field.
Inherited Members
Namespace: Phoenix.Aruba
Assembly: Phoenix.Plugin.Aruba.dll
Syntax
public class FieldViewModel : ItemViewModelBase, INotifyPropertyChanged, IDataErrorInfo
Constructors
View SourceFieldViewModel(bool, TemplateFieldDefinition, TemplateFieldDefinition, TemplateViewModel, Guid, Tokenizer, IEnumerable<object>, bool, bool)
Initializes a new instance of the FieldViewModel class.
Declaration
public FieldViewModel(bool canEdit, TemplateFieldDefinition fieldDefinition, TemplateFieldDefinition defaultFieldDefinition, TemplateViewModel templateViewModel, Guid bugResolveGuid, Tokenizer tokenizer, IEnumerable<object> validValues, bool isArrayField, bool inDesignMode)
Parameters
Type | Name | Description |
---|---|---|
bool | canEdit | The field can be edited. |
TemplateFieldDefinition | fieldDefinition | The template field definition. |
TemplateFieldDefinition | defaultFieldDefinition | The default template field definition. |
TemplateViewModel | templateViewModel | The template view model. |
Guid | bugResolveGuid | The id of the bug that this field is associated with. |
Tokenizer | tokenizer | The tokenizer. |
IEnumerable<object> | validValues | The only valid values allowed for this field. |
bool | isArrayField | Indicates if the field is an array field. |
bool | inDesignMode | Indicates if the field is in design mode. |
Properties
View SourceClearOnSave
Gets or sets a value indicating whether the field should be cleared when a bug is saved.
Declaration
public bool ClearOnSave { get; set; }
Property Value
Type | Description |
---|---|
bool |
DataType
Gets a value indicating the field value's DataType.
Declaration
public Type DataType { get; }
Property Value
Type | Description |
---|---|
Type |
DefaultPrivateTemplateValue
Gets or sets the default private template value of the field.
Declaration
public string DefaultPrivateTemplateValue { get; set; }
Property Value
Type | Description |
---|---|
string |
DefaultValue
Gets or sets the default value of the field.
Declaration
public string DefaultValue { get; set; }
Property Value
Type | Description |
---|---|
string |
DisplayName
Gets the display name of the field.
Declaration
public string DisplayName { get; }
Property Value
Type | Description |
---|---|
string |
FieldComparer
Gets the field comparer.
Declaration
public static Comparer<TemplateFieldDefinition> FieldComparer { get; }
Property Value
Type | Description |
---|---|
Comparer<TemplateFieldDefinition> |
IsArrayField
Gets a value indicating whether this is an array field.
Declaration
public bool IsArrayField { get; }
Property Value
Type | Description |
---|---|
bool |
IsDisplayed
Gets or sets a value indicating whether the field has been displayed.
Declaration
public bool IsDisplayed { get; set; }
Property Value
Type | Description |
---|---|
bool |
IsFromParent
Gets a value indicating whether this field is from a parent.
Declaration
public bool IsFromParent { get; }
Property Value
Type | Description |
---|---|
bool |
IsHtml
Gets or sets a value indicating whether the field displays as html.
Declaration
public bool IsHtml { get; set; }
Property Value
Type | Description |
---|---|
bool |
IsRequiredByDefault
Gets a value indicating whether this field is required by default (mandated by the IBugServiceClient).
Declaration
public bool IsRequiredByDefault { get; }
Property Value
Type | Description |
---|---|
bool |
IsRichText
Gets or sets a value indicating whether the field displays as RichText.
Declaration
public bool IsRichText { get; set; }
Property Value
Type | Description |
---|---|
bool |
IsValueLimited
Gets a value indicating whether the value for this field is restricted to be within a given range. If this is true, ValidValues specifies the range of possible values.
Declaration
public bool IsValueLimited { get; }
Property Value
Type | Description |
---|---|
bool |
Name
Gets the name of the field.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
string |
OverrideParent
Gets or sets a value indicating whether to override the parent value of this field.
Declaration
public bool OverrideParent { get; set; }
Property Value
Type | Description |
---|---|
bool |
ParentName
Gets the name of the parent field that is populating this field.
Declaration
public string ParentName { get; }
Property Value
Type | Description |
---|---|
string |
ResolvedValue
Gets or sets the value of the field.
Declaration
public object ResolvedValue { get; set; }
Property Value
Type | Description |
---|---|
object |
SelectableValues
Gets the selectable values for the field.
Declaration
public List<SelectableItem<object>> SelectableValues { get; }
Property Value
Type | Description |
---|---|
List<SelectableItem<object>> |
TextBoxFlowDocument
Gets or sets a value for the text box flow document.
Declaration
public FlowDocument TextBoxFlowDocument { get; set; }
Property Value
Type | Description |
---|---|
FlowDocument |
ToolTip
Gets or sets the tool tip (helper text).
Declaration
public string ToolTip { get; set; }
Property Value
Type | Description |
---|---|
string |
UrgencyLevel
Gets or sets the urgency level of the field.
Declaration
public UrgencyLevel UrgencyLevel { get; set; }
Property Value
Type | Description |
---|---|
UrgencyLevel |
ValidValues
Gets or sets the range of possible values for this field. If this is null, the value is not restricted by this.
Declaration
public IEnumerable<object> ValidValues { get; set; }
Property Value
Type | Description |
---|---|
IEnumerable<object> |
Methods
View SourceAreAllTokenizedItemsValid()
Checks if all tokenized items are valid.
Declaration
public bool AreAllTokenizedItemsValid()
Returns
Type | Description |
---|---|
bool | Returns if tokenized items are valid. |
CheckAndJoinResolvedTokens()
If this has tokenized items, join those together.
Declaration
public string CheckAndJoinResolvedTokens()
Returns
Type | Description |
---|---|
string | The resolved token value. |
GetSortedTokenizedItemsFromFields(IEnumerable<FieldViewModel>)
Utility to get tokenized items from the given fields, and sort them by resolver type, but within each resolver type, preserve original order in which the tokens were encountered in the fields.
Declaration
public static List<TokenizedItemViewModel> GetSortedTokenizedItemsFromFields(IEnumerable<FieldViewModel> fields)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<FieldViewModel> | fields | The fields to retrieve tokens from. |
Returns
Type | Description |
---|---|
List<TokenizedItemViewModel> | The list of tokenized items. |
GetTypedResolvedValue(string)
If the Field's backing type is not a string, this method tries to convert the string value to the right type before setting the field's Resolved value. Otherwise this will just set the value.
Declaration
public object GetTypedResolvedValue(string value)
Parameters
Type | Name | Description |
---|---|---|
string | value | The resolved value of this field (tokens replaced). |
Returns
Type | Description |
---|---|
object | The typed version of ResolvedValue. |
ToString()
Returns name of Field.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | Name of Field. |