/// <summary> /// Graph this object to the specified stream /// </summary> public void Graph(System.Xml.XmlWriter s, object o, DatatypeFormatterGraphResult result) { ENFormatter formatter = new ENFormatter() { Host = this.Host }; // Validate and remove any incriminating data ON instance = o as ON; for (int i = instance.Part.Count - 1; i >= 0; i--) { if (instance.Part[i].Type == EntityNamePartType.Family || instance.Part[i].Type == EntityNamePartType.Given) { result.AddResultDetail(new VocabularyIssueResultDetail(ResultDetailType.Warning, String.Format("Part name '{0}' in ON instance will be removed. ON Parts cannot have FAM or GIV parts", instance.Part[i]), s.ToString(), null)); instance.Part.RemoveAt(i); } } formatter.Graph(s, o, result); }
/// <summary> /// Graph object <paramref name="o"/> onto <paramref name="s"/> /// </summary> /// <param name="s">The stream to parse from</param> /// <param name="o">The object to parse</param> public void Graph(System.Xml.XmlWriter s, object o, DatatypeFormatterGraphResult result) { ENFormatter baseFormatter = new ENFormatter(); baseFormatter.Host = this.Host; baseFormatter.GenericArguments = this.GenericArguments; // Format baseFormatter.Graph(s, o, result); }