/// <summary> /// Creates an fragment XML reader instance. /// </summary> /// <param name="oml">OML instance which owns the fragment.</param> /// <param name="fragmentName">Name of the fragment to be written.</param> public OmlFragmentWriter(Oml oml, string fragmentName) { _instance = AssemblyUtility.ExecuteInstanceMethod <object>(oml._instance, "GetFragmentXmlWriter", new object[] { fragmentName }); }
/// <summary> /// Closes the writer. /// </summary> public void Close() { AssemblyUtility.ExecuteInstanceMethod <object>(_instance, "Close"); }
/// <summary> /// Writes XML to the fragment. /// </summary> /// <param name="fragment">XML to be written to the fragment.</param> public void Write(XElement fragment) { AssemblyUtility.ExecuteInstanceMethod <object>(_instance, "Replace", new object[] { fragment }); }
/// <summary> /// Exports the OML contents to an OML stream. /// </summary> /// <param name="outputStream">Destination stream to write the OML file contents to.</param> public void Save(Stream outputStream) { AssemblyUtility.ExecuteInstanceMethod <object>(_instance, "WriteTo", new object[] { outputStream }); }
/// <summary> /// Returns a list of available fragment names. /// </summary> /// <returns>List of availabel fragment names.</returns> public List <string> GetFragmentNames() { return(AssemblyUtility.ExecuteInstanceMethod <IEnumerable <string> >(_instance, "DumpFragmentsNames").ToList()); }
/// <summary> /// Returns XML element of the fragment. /// </summary> /// <returns>XML element of the fragment.</returns> public XElement GetXElement() { return(AssemblyUtility.ExecuteInstanceMethod <XElement>(_instance, "ToXElement")); }