XmlWriter.WriteCharEntity(Char) 方法

定义

当在派生类中被重写时,为指定的 Unicode 字符值强制生成字符实体。When overridden in a derived class, forces the generation of a character entity for the specified Unicode character value.

public:
 abstract void WriteCharEntity(char ch);
public abstract void WriteCharEntity (char ch);
abstract member WriteCharEntity : char -> unit
Public MustOverride Sub WriteCharEntity (ch As Char)

参数

ch
Char

为其生成字符实体的 Unicode 字符。The Unicode character for which to generate a character entity.

例外

该字符在代理项对字符范围 0xd800 - 0xdfff 内。The character is in the surrogate pair character range, 0xd800 - 0xdfff.

在上一次异步操作完成之前调用了 XmlWriter 方法。An XmlWriter method was called before a previous asynchronous operation finished. 在此情况下,会引发 InvalidOperationException 并显示消息“异步操作已在进行中。”In this case, InvalidOperationException is thrown with the message "An asynchronous operation is already in progress."

示例

XmlTextWriter.WriteCharEntity有关使用此方法的示例,请参阅。See XmlTextWriter.WriteCharEntity for an example using this method.

注解

此方法写入十六进制字符实体引用格式的 Unicode 字符。This method writes the Unicode character in hexadecimal character entity reference format.

有关此方法的异步版本,请参阅 WriteCharEntityAsyncFor the asynchronous version of this method, see WriteCharEntityAsync.

适用于