CQCode 类
继承成员
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
程序集: HuajiTech.CoolQ.Messaging.dll
语法
public class CQCode : MessageElement, ISendable, IEquatable<MessageElement>
构造函数
|
改善此文档
查看源代码
CQCode(String)
声明
public CQCode(string type)
参数
类型 |
名称 |
描述 |
System.String |
type |
CQ码的类型。
|
异常
类型 |
条件 |
System.ArgumentException |
type 为 null、System.String.Empty 或仅由空白字符组成。
|
|
改善此文档
查看源代码
CQCode(String, IDictionary<String, String>)
声明
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
声明
public IDictionary<string, string> Parameters { get; }
属性值
类型 |
描述 |
System.Collections.Generic.IDictionary<System.String, System.String> |
|
|
改善此文档
查看源代码
Type
声明
public string Type { get; }
属性值
方法
|
改善此文档
查看源代码
Create(String)
声明
public static CQCode Create(string type)
参数
类型 |
名称 |
描述 |
System.String |
type |
要创建的 CQCode 实例的类型。
|
返回
异常
类型 |
条件 |
System.ArgumentException |
type 为 null、System.String.Empty 或仅由空白字符组成。
|
|
改善此文档
查看源代码
Create(String, IDictionary<String, String>)
声明
public static CQCode Create(string type, IDictionary<string, string> parameters)
参数
类型 |
名称 |
描述 |
System.String |
type |
要创建的 CQCode 实例的类型。
|
System.Collections.Generic.IDictionary<System.String, System.String> |
parameters |
要创建的 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 |
|
返回
|
改善此文档
查看源代码
GetParameterAsDouble(String)
声明
public double GetParameterAsDouble(string key)
参数
类型 |
名称 |
描述 |
System.String |
key |
|
返回
|
改善此文档
查看源代码
GetParameterAsInt32(String)
声明
public int GetParameterAsInt32(string key)
参数
类型 |
名称 |
描述 |
System.String |
key |
|
返回
|
改善此文档
查看源代码
GetParameterAsInt64(String)
声明
public long GetParameterAsInt64(string key)
参数
类型 |
名称 |
描述 |
System.String |
key |
|
返回
|
改善此文档
查看源代码
GetParameterAsSingle(String)
声明
public float GetParameterAsSingle(string key)
参数
类型 |
名称 |
描述 |
System.String |
key |
|
返回
|
改善此文档
查看源代码
GetParameterAsUri(String)
声明
public Uri GetParameterAsUri(string key)
参数
类型 |
名称 |
描述 |
System.String |
key |
|
返回
|
改善此文档
查看源代码
SetParameter(String, Boolean)
声明
public CQCode SetParameter(string key, bool value)
参数
类型 |
名称 |
描述 |
System.String |
key |
|
System.Boolean |
value |
|
返回
|
改善此文档
查看源代码
SetParameter(String, Double)
声明
public CQCode SetParameter(string key, double value)
参数
类型 |
名称 |
描述 |
System.String |
key |
|
System.Double |
value |
|
返回
|
改善此文档
查看源代码
SetParameter(String, Int32)
声明
public CQCode SetParameter(string key, int value)
参数
类型 |
名称 |
描述 |
System.String |
key |
|
System.Int32 |
value |
|
返回
|
改善此文档
查看源代码
SetParameter(String, Int64)
声明
public CQCode SetParameter(string key, long value)
参数
类型 |
名称 |
描述 |
System.String |
key |
|
System.Int64 |
value |
|
返回
|
改善此文档
查看源代码
SetParameter(String, Single)
声明
public CQCode SetParameter(string key, float value)
参数
类型 |
名称 |
描述 |
System.String |
key |
|
System.Single |
value |
|
返回
|
改善此文档
查看源代码
SetParameter(String, Uri)
声明
public CQCode SetParameter(string key, Uri value)
参数
类型 |
名称 |
描述 |
System.String |
key |
|
System.Uri |
value |
|
返回
|
改善此文档
查看源代码
ToSendableString()
声明
public override sealed string ToSendableString()
返回
重写
|
改善此文档
查看源代码
Unescape(String)
将字符串中的转义字符转换为具有特殊意义的酷Q字符。
声明
public static string Unescape(string str)
参数
类型 |
名称 |
描述 |
System.String |
str |
要转换的字符串。
|
返回
类型 |
描述 |
System.String |
指定字符串的已转换值。
|
实现
System.IEquatable<T>