Show / Hide Table of Contents

    CQCode 类

    表示CQ码。

    继承
    System.Object
    MessageElement
    CQCode
    Anonymous
    ContactShare
    CustomEmoticon
    CustomMusic
    Dice
    Emoji
    Emoticon
    Image
    Location
    Mention
    MentionAll
    Music
    Record
    RedEnvelope
    RichText
    RockPaperScissors
    Shake
    Share
    SigningIn
    SmallEmoticon
    实现
    ISendable
    System.IEquatable<MessageElement>
    继承成员
    MessageElement.FromString(String)
    MessageElement.Add(MessageElement)
    MessageElement.ToComplexMessage()
    MessageElement.ToString()
    MessageElement.GetHashCode()
    MessageElement.Equals(Object)
    MessageElement.Equals(MessageElement)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    命名空间: HuajiTech.CoolQ.Messaging
    程序集: HuajiTech.CoolQ.Messaging.dll
    语法
    public class CQCode : MessageElement, ISendable, IEquatable<MessageElement>

    构造函数

    | 改善此文档 查看源代码

    CQCode(String)

    以指定的类型初始化一个 CQCode 类的新实例。

    声明
    public CQCode(string type)
    参数
    类型 名称 描述
    System.String type

    CQ码的类型。

    异常
    类型 条件
    System.ArgumentException

    type 为 null、System.String.Empty 或仅由空白字符组成。

    | 改善此文档 查看源代码

    CQCode(String, IDictionary<String, String>)

    以指定的类型和参数初始化一个 CQCode 类的新实例。

    声明
    public CQCode(string type, IDictionary<string, string> parameters)
    参数
    类型 名称 描述
    System.String type

    CQ码的类型。

    System.Collections.Generic.IDictionary<System.String, System.String> parameters

    一个字典,包含 CQCode 的所有参数。

    异常
    类型 条件
    System.ArgumentException

    type 为 null、System.String.Empty 或仅由空白字符组成。

    System.ArgumentNullException

    parameters 为 null。

    属性

    | 改善此文档 查看源代码

    Item[String]

    获取或设置指定键处的参数的值。

    声明
    public string this[string key] { get; set; }
    参数
    类型 名称 描述
    System.String key

    要获取或设置的参数的键。

    属性值
    类型 描述
    System.String

    指定 key 处的参数的值。 如果指定键不存在,则为 null。

    | 改善此文档 查看源代码

    Parameters

    获取当前 CQCode 实例的参数。

    声明
    public IDictionary<string, string> Parameters { get; }
    属性值
    类型 描述
    System.Collections.Generic.IDictionary<System.String, System.String>
    | 改善此文档 查看源代码

    Type

    获取当前 CQCode 实例的类型。

    声明
    public string Type { get; }
    属性值
    类型 描述
    System.String

    方法

    | 改善此文档 查看源代码

    Create(String)

    以指定的类型创建一个 CQCode 类的新实例。

    声明
    public static CQCode Create(string type)
    参数
    类型 名称 描述
    System.String type

    要创建的 CQCode 实例的类型。

    返回
    类型 描述
    CQCode

    一个 CQCode 类的新实例。

    异常
    类型 条件
    System.ArgumentException

    type 为 null、System.String.Empty 或仅由空白字符组成。

    | 改善此文档 查看源代码

    Create(String, IDictionary<String, String>)

    以指定的类型和参数创建一个 CQCode 类的新实例。

    声明
    public static CQCode Create(string type, IDictionary<string, string> parameters)
    参数
    类型 名称 描述
    System.String type

    要创建的 CQCode 实例的类型。

    System.Collections.Generic.IDictionary<System.String, System.String> parameters

    要创建的 CQCode 实例的参数。

    返回
    类型 描述
    CQCode

    一个 CQCode 类的新实例。

    异常
    类型 条件
    System.ArgumentException

    type 为 null、System.String.Empty 或仅由空白字符组成。

    System.ArgumentNullException

    parameters 为 null。

    | 改善此文档 查看源代码

    Escape(String)

    将指定的字符串转换为可以让酷Q按原义解释字符的语法。

    声明
    public static string Escape(string str)
    参数
    类型 名称 描述
    System.String str

    要转换的字符串。

    返回
    类型 描述
    System.String

    指定字符串的已转换值。

    | 改善此文档 查看源代码

    GetParameterAsBoolean(String)

    声明
    public bool GetParameterAsBoolean(string key)
    参数
    类型 名称 描述
    System.String key
    返回
    类型 描述
    System.Boolean
    | 改善此文档 查看源代码

    GetParameterAsDouble(String)

    声明
    public double GetParameterAsDouble(string key)
    参数
    类型 名称 描述
    System.String key
    返回
    类型 描述
    System.Double
    | 改善此文档 查看源代码

    GetParameterAsInt32(String)

    声明
    public int GetParameterAsInt32(string key)
    参数
    类型 名称 描述
    System.String key
    返回
    类型 描述
    System.Int32
    | 改善此文档 查看源代码

    GetParameterAsInt64(String)

    声明
    public long GetParameterAsInt64(string key)
    参数
    类型 名称 描述
    System.String key
    返回
    类型 描述
    System.Int64
    | 改善此文档 查看源代码

    GetParameterAsSingle(String)

    声明
    public float GetParameterAsSingle(string key)
    参数
    类型 名称 描述
    System.String key
    返回
    类型 描述
    System.Single
    | 改善此文档 查看源代码

    GetParameterAsUri(String)

    声明
    public Uri GetParameterAsUri(string key)
    参数
    类型 名称 描述
    System.String key
    返回
    类型 描述
    System.Uri
    | 改善此文档 查看源代码

    SetParameter(String, Boolean)

    声明
    public CQCode SetParameter(string key, bool value)
    参数
    类型 名称 描述
    System.String key
    System.Boolean value
    返回
    类型 描述
    CQCode
    | 改善此文档 查看源代码

    SetParameter(String, Double)

    声明
    public CQCode SetParameter(string key, double value)
    参数
    类型 名称 描述
    System.String key
    System.Double value
    返回
    类型 描述
    CQCode
    | 改善此文档 查看源代码

    SetParameter(String, Int32)

    声明
    public CQCode SetParameter(string key, int value)
    参数
    类型 名称 描述
    System.String key
    System.Int32 value
    返回
    类型 描述
    CQCode
    | 改善此文档 查看源代码

    SetParameter(String, Int64)

    声明
    public CQCode SetParameter(string key, long value)
    参数
    类型 名称 描述
    System.String key
    System.Int64 value
    返回
    类型 描述
    CQCode
    | 改善此文档 查看源代码

    SetParameter(String, Single)

    声明
    public CQCode SetParameter(string key, float value)
    参数
    类型 名称 描述
    System.String key
    System.Single value
    返回
    类型 描述
    CQCode
    | 改善此文档 查看源代码

    SetParameter(String, Uri)

    声明
    public CQCode SetParameter(string key, Uri value)
    参数
    类型 名称 描述
    System.String key
    System.Uri value
    返回
    类型 描述
    CQCode
    | 改善此文档 查看源代码

    ToSendableString()

    声明
    public override sealed string ToSendableString()
    返回
    类型 描述
    System.String
    重写
    MessageElement.ToSendableString()
    | 改善此文档 查看源代码

    Unescape(String)

    将字符串中的转义字符转换为具有特殊意义的酷Q字符。

    声明
    public static string Unescape(string str)
    参数
    类型 名称 描述
    System.String str

    要转换的字符串。

    返回
    类型 描述
    System.String

    指定字符串的已转换值。

    实现

    ISendable
    System.IEquatable<T>
    • 改善此文档
    • 查看源代码
    Back to top 本文档使用 CC BY-NC-SA 4.0 进行许可。