protected internal override Task WriteEndAttributeAsync()
        {
            CheckAsync();
            var task = coreWriter.WriteEndAttributeAsync();

            lastTask = task;
            return(task);
        }
 internal async Task WriteDeclAsync(XmlWriter writer, XmlRawWriter rawWriter) {
     Debug.Assert(kind == NamespaceKind.NeedToWrite);
     if (null != rawWriter) {
         await rawWriter.WriteNamespaceDeclarationAsync(prefix, namespaceUri).ConfigureAwait(false);
     }
     else {
         if (prefix.Length == 0) {
             await writer.WriteStartAttributeAsync(string.Empty, "xmlns", XmlReservedNs.NsXmlNs).ConfigureAwait(false);
         }
         else {
             await writer.WriteStartAttributeAsync("xmlns", prefix, XmlReservedNs.NsXmlNs).ConfigureAwait(false);
         }
         await writer.WriteStringAsync(namespaceUri).ConfigureAwait(false);
         await writer.WriteEndAttributeAsync().ConfigureAwait(false);
     }
 }
            internal async Task WriteDeclAsync(XmlWriter writer, XmlRawWriter?rawWriter)
            {
                Debug.Assert(kind == NamespaceKind.NeedToWrite);
                if (null != rawWriter)
                {
                    await rawWriter.WriteNamespaceDeclarationAsync(prefix, namespaceUri).ConfigureAwait(false);
                }
                else
                {
                    if (prefix.Length == 0)
                    {
                        await writer.WriteStartAttributeAsync(string.Empty, "xmlns", XmlReservedNs.NsXmlNs).ConfigureAwait(false);
                    }
                    else
                    {
                        await writer.WriteStartAttributeAsync("xmlns", prefix, XmlReservedNs.NsXmlNs).ConfigureAwait(false);
                    }
                    await writer.WriteStringAsync(namespaceUri).ConfigureAwait(false);

                    await writer.WriteEndAttributeAsync().ConfigureAwait(false);
                }
            }