Class TokenizedItemViewModel
Used for Token resolution. Based on Microsoft.Internal.GamesTest.BugAnywhere.Tokens.TokenizedItem Represents either a TokenReference or plain text that can represent a parsed component of a field value.
Inherited Members
Namespace: Phoenix.Aruba
Assembly: Phoenix.Plugin.Aruba.dll
Syntax
public class TokenizedItemViewModel : ItemViewModelBase, INotifyPropertyChanged, IDataErrorInfo
Properties
View SourceBugResolveGuid
Gets or sets the bug resolve id for the creation of this bug.
Declaration
public Guid BugResolveGuid { get; set; }
Property Value
Type | Description |
---|---|
Guid |
CancelResolveThisCommand
Gets the cancel resolve command
Declaration
public ICommand CancelResolveThisCommand { get; }
Property Value
Type | Description |
---|---|
ICommand |
IsInDesignMode
Gets a value indicating whether the TokenizedItem is to be used in Design mode.
Declaration
public bool IsInDesignMode { get; }
Property Value
Type | Description |
---|---|
bool |
IsInvalidToken
Gets a value indicating whether this token was created as an 'InvalidToken'.
Declaration
public bool IsInvalidToken { get; }
Property Value
Type | Description |
---|---|
bool |
IsResolving
Gets or sets a value indicating whether token is refreshing.
Declaration
public bool IsResolving { get; set; }
Property Value
Type | Description |
---|---|
bool |
IsToken
Gets a value indicating whether this is a Token item.
Declaration
public bool IsToken { get; }
Property Value
Type | Description |
---|---|
bool |
ResolveThisCommand
Gets the resolve command.
Declaration
public ICommand ResolveThisCommand { get; }
Property Value
Type | Description |
---|---|
ICommand |
ResolvedValues
Gets or sets the Resolved values for this item. If this item is just a string, the string value will be returned. If the item is a token the resolved values will be returned.
Declaration
public ObservableCollection<ResolvedTokenizedItem> ResolvedValues { get; set; }
Property Value
Type | Description |
---|---|
ObservableCollection<ResolvedTokenizedItem> |
TextValue
Gets the plain text, if this represents plain text.
Declaration
public string? TextValue { get; }
Property Value
Type | Description |
---|---|
string |
TokenReference
Gets the reference to a token if this represents one.
Declaration
public TokenReferenceViewModel? TokenReference { get; }
Property Value
Type | Description |
---|---|
TokenReferenceViewModel |
TokenResolveError
Gets the error message raised when a token could not be resolved.
Declaration
public string? TokenResolveError { get; }
Property Value
Type | Description |
---|---|
string |
TokenResolveErrors
Gets the token resolve errors (in the case of multiple devices).
Declaration
public List<string?> TokenResolveErrors { get; }
Property Value
Type | Description |
---|---|
List<string> |
TokenResolverRegistry
Gets or sets the TokenResolverRegistry to use for resolving this token. If this is null the token cannot be resolved by itself.
Declaration
public TokenResolverRegistry? TokenResolverRegistry { get; set; }
Property Value
Type | Description |
---|---|
TokenResolverRegistry |
Methods
View SourceCancelResolveThis()
Cancels the resolve
Declaration
public void CancelResolveThis()
DeepCopyResolvedValues(TokenizedItemViewModel)
Deep copy ResolvedValues from a source TokenizedItemViewModel.
Declaration
public void DeepCopyResolvedValues(TokenizedItemViewModel sourceTokenizedItemViewModel)
Parameters
Type | Name | Description |
---|---|---|
TokenizedItemViewModel | sourceTokenizedItemViewModel | The source TokenizedItemViewModel to copy from. |
FromTextValue(string, bool, bool)
Create a new instance of the TokenizedItemViewModel class from a text value.
Declaration
public static TokenizedItemViewModel FromTextValue(string textValue, bool canEdit, bool isInDesignMode)
Parameters
Type | Name | Description |
---|---|---|
string | textValue | The plain string represented by this item. |
bool | canEdit | Whether this object is editable. |
bool | isInDesignMode | The indication if the Tokenized item is to be used in Design mode. |
Returns
Type | Description |
---|---|
TokenizedItemViewModel | The created TokenizedItemViewModel |
FromTokenReference(TokenReference, TokenResolverRegistry, bool, bool)
Create a new instance of the TokenizedItemViewModel class from a token.
Declaration
public static TokenizedItemViewModel FromTokenReference(TokenReference tokenReference, TokenResolverRegistry registry, bool canEdit, bool isInDesignMode)
Parameters
Type | Name | Description |
---|---|---|
TokenReference | tokenReference | Token reference that has been parsed already. |
TokenResolverRegistry | registry | Token resolver registry. |
bool | canEdit | Whether this object is editable. |
bool | isInDesignMode | The indication if the Tokenized item is to be used in Design mode. |
Returns
Type | Description |
---|---|
TokenizedItemViewModel | The created TokenizedItemViewModel |
GetInvalidToken(TokenReference, TokenResolverRegistry, bool, bool)
Creates a TokenizedItemViewModel that represents an invalid token.
Declaration
public static TokenizedItemViewModel GetInvalidToken(TokenReference tokenReference, TokenResolverRegistry tokenResolverRegistry, bool canEdit, bool isInDesignMode)
Parameters
Type | Name | Description |
---|---|---|
TokenReference | tokenReference | The token reference that was trying to be created. |
TokenResolverRegistry | tokenResolverRegistry | The token resolver that was being used for this token. |
bool | canEdit | Whether this object is editable. |
bool | isInDesignMode | The indication if the Tokenized item is to be used in Design mode. |
Returns
Type | Description |
---|---|
TokenizedItemViewModel | The created TokenizedItemViewModel |
RaiseResolvedValues()
Raises property changed on Resolved Values.
Declaration
public void RaiseResolvedValues()
ResolveThisAsync()
Resolve this item by itself.
Declaration
public Task ResolveThisAsync()
Returns
Type | Description |
---|---|
Task | A task. |
ToString()
Returns the string representation of TokenizedItem.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | The string representation of TokenizedItem. |