protected override void ExportData(System.Xml.XmlWriter writer, ExportContext context) { var data = GetData(); var node = data as Node; if (node != null) { writer.WriteStartElement("Path"); writer.WriteString(node.Path); if (context != null) context.AddReference(node.Path); writer.WriteEndElement(); return; } var nodes = data as IEnumerable; if (nodes != null) { foreach (Node item in nodes) { writer.WriteStartElement("Path"); writer.WriteString(item.Path); if (context != null) context.AddReference(item.Path); writer.WriteEndElement(); } return; } throw ExportNotImplementedException(GetData()); }
private void ExportDataPath(System.Xml.XmlWriter writer, ExportContext context) { var data = GetData(); var node = data as Node; if (node != null) { writer.WriteStartElement("Path"); writer.WriteString(node.Path); if (context != null) { context.AddReference(node.Path); } writer.WriteEndElement(); return; } var nodes = data as IEnumerable; if (nodes != null) { foreach (Node item in nodes) { writer.WriteStartElement("Path"); writer.WriteString(item.Path); if (context != null) { context.AddReference(item.Path); } writer.WriteEndElement(); } return; } throw ExportNotSupportedException(GetData()); }