Token Class

Namespace:
Weavy.Core.TwitterText
Assembly:
Weavy.Core.dll

Contains data about tokens in a plain text message.

public class Token
Inheritance:
System.Object → Token

Constructors

Token()
Token(Int32, Int32, String, TokenType) Initializes a new instance of the Token class.
Token(Match, TokenType, Int32) Initializes a new instance of the Token class.
Token(Match, TokenType, Int32, Int32) Initializes a new instance of the Token class.

Properties

End Gets or sets the end index of the token in the text.
SpaceId Gets or sets the id of the mentioned space.
Start Gets or sets the start index of the token in the text.
Type Gets or sets the token type, i.e. Url, Hashtag, Mention or Cashtag.
UrlText Gets or sets a string to display instead of the URL.
UrlTitle Gets or sets a string to use as title text for the URL.
UserId Gets or sets the id of the mentioned user.
Value Gets or sets the value of the token.

Methods

Equals(object) Determines whether this instance and another Token have the same value.
GetHashCode() Returns the hashcode for this Token.
ToString() Returns a string representation of the current token.

Extension Methods

IsNullOrDefault(T) Gets a value indicating if the specified value has the default value of the generic type.
Serialize(object) Serializes an object, or graph of connected objects, to a byte array.
SerializeToJson(object, Formatting?, JsonSerializerSettings) Serializes an object, or graph of connected objects, to a json string.
IsValid(object) Determines whether the specified object is valid by evaluating each ValidationAttribute instance that is attached to the object type.