Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

Token.cs

namespace Nop.Services.Messages;

/// 
/// Represents token
/// 
public sealed partial class Token
{
    #region Ctor

    /// 
    /// Ctor
    /// 
    /// Key
    /// Value
    public Token(string key, object value) : this(key, value, false)
    {
    }

    /// 
    /// Ctor
    /// 
    /// Key
    /// Value
    /// Indicates whether this token should not be HTML encoded
    public Token(string key, object value, bool neverHtmlEncoded)
    {
        Key = key;
        Value = value;
        NeverHtmlEncoded = neverHtmlEncoded;
    }

    #endregion

    #region Properties

    /// 
    /// Token key
    /// 
    public string Key { get; }

    /// 
    /// Token value
    /// 
    public object Value { get; }

    /// 
    /// Indicates whether this token should not be HTML encoded
    /// 
    public bool NeverHtmlEncoded { get; }

    #endregion

    #region Methods

    /// 
    /// The string representation of the value of this token
    /// 
    /// String value
    public override string ToString()
    {
        return $"{Key}: {Value}";
    }

    #endregion
}