PlainText 类
表示纯文本。 此类不能被继承。
继承成员
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 sealed class PlainText : MessageElement, ISendable, IEquatable<MessageElement>
构造函数
| 改善此文档 查看源代码PlainText(String)
以指定内容初始化一个 PlainText 类的新实例。
声明
public PlainText(string content)
参数
类型 | 名称 | 描述 |
---|---|---|
System.String | content | 要被 PlainText 包装的字符串。 |
属性
| 改善此文档 查看源代码Content
获取未经转义的原始内容。
声明
public string Content { get; }
属性值
类型 | 描述 |
---|---|
System.String |
方法
| 改善此文档 查看源代码Escape(String)
将指定的字符串转换为可以让酷Q按原义解释字符的语法。
声明
public static string Escape(string str)
参数
类型 | 名称 | 描述 |
---|---|---|
System.String | str | 要转换的字符串。 |
返回
类型 | 描述 |
---|---|
System.String | 指定字符串的已转换值。 |
ToSendableString()
返回经过 Escape(String) 后的 Content。
声明
public override string ToSendableString()
返回
类型 | 描述 |
---|---|
System.String |
重写
| 改善此文档 查看源代码ToString()
获取当前 PlainText 实例的字符串表示形式。
声明
public override string ToString()
返回
类型 | 描述 |
---|---|
System.String | Content 的值。 |
重写
| 改善此文档 查看源代码Unescape(String)
将字符串中的转义字符转换为具有特殊意义的酷Q字符。
声明
public static string Unescape(string str)
参数
类型 | 名称 | 描述 |
---|---|---|
System.String | str | 要转换的字符串。 |
返回
类型 | 描述 |
---|---|
System.String | 指定字符串的已转换值。 |
运算符
| 改善此文档 查看源代码Implicit(PlainText to String)
声明
public static implicit operator string (PlainText text)
参数
类型 | 名称 | 描述 |
---|---|---|
PlainText | text |
返回
类型 | 描述 |
---|---|
System.String |
实现
System.IEquatable<T>