private static async Task WriteCategoriesAsync(XmlWriter writer, CategoriesDocument categories, Uri baseUri, string version) { await writer.WriteStartElementAsync(App10Constants.Prefix, App10Constants.Categories, App10Constants.Namespace); await WriteCategoriesInnerXml(writer, categories, baseUri, version); await writer.WriteEndElementAsync(); }
protected CategoriesDocumentFormatter(CategoriesDocument documentToWrite) { if (documentToWrite == null) { throw new ArgumentNullException(nameof(documentToWrite)); } _document = documentToWrite; }
protected static Task WriteElementExtensionsAsync(XmlWriter writer, CategoriesDocument categories, string version) { if (categories == null) { throw new ArgumentNullException(nameof(categories)); } return(categories.WriteElementExtensionsAsync(writer, version)); }
protected static bool TryParseElement(XmlReader reader, CategoriesDocument categories, string version) { if (categories == null) { throw new ArgumentNullException(nameof(categories)); } return(categories.TryParseElement(XmlReaderWrapper.CreateFromReader(reader), version)); }
protected static void LoadElementExtensions(XmlReader reader, CategoriesDocument categories, int maxExtensionSize) { if (categories == null) { throw new ArgumentNullException(nameof(categories)); } categories.LoadElementExtensions(XmlReaderWrapper.CreateFromReader(reader), maxExtensionSize); }
public AtomPub10CategoriesDocumentFormatter(CategoriesDocument documentToWrite) : base(documentToWrite) { // No need to check that the parameter passed is valid - it is checked by the c'tor of the base class _maxExtensionSize = int.MaxValue; _preserveAttributeExtensions = true; _preserveElementExtensions = true; if (documentToWrite.IsInline) { _inlineDocumentType = documentToWrite.GetType(); _referencedDocumentType = typeof(ReferencedCategoriesDocument); } else { _referencedDocumentType = documentToWrite.GetType(); _inlineDocumentType = typeof(InlineCategoriesDocument); } }
internal static async Task WriteCategoriesInnerXml(XmlWriter writer, CategoriesDocument categories, Uri baseUri, string version) { Uri baseUriToWrite = FeedUtils.GetBaseUriToWrite(baseUri, categories.BaseUri); if (baseUriToWrite != null) { WriteXmlBase(writer, baseUriToWrite); } if (!string.IsNullOrEmpty(categories.Language)) { WriteXmlLang(writer, categories.Language); } if (categories.IsInline) { await WriteInlineCategoriesContentAsync(XmlWriterWrapper.CreateFromWriter(writer), (InlineCategoriesDocument)categories, version); } else { WriteReferencedCategoriesContent(writer, (ReferencedCategoriesDocument)categories, version); } }
protected virtual void SetDocument(CategoriesDocument document) { _document = document; }
internal static void LoadElementExtensions(XmlBuffer buffer, XmlDictionaryWriter writer, CategoriesDocument categories) { if (categories == null) { throw new ArgumentNullException(nameof(categories)); } Atom10FeedFormatter.CloseBuffer(buffer, writer); categories.LoadElementExtensions(buffer); }
protected static bool TryParseAttribute(string name, string ns, string value, CategoriesDocument categories, string version) { if (categories == null) { throw new ArgumentNullException(nameof(categories)); } return(categories.TryParseAttribute(name, ns, value, version)); }