Save(Element: IXMLDOMElement);
Save(Element: Prognoz.Platform.Interop.MsXml2.IXMLDOMElement);
Element. XML element, to which styles table is saved.
The Save method saves styles table as an XML code.
To load styles table from XML code, use the IStyleSheet.Load method.
Executing the example requires that the repository contains a styles table with the STYLE_TB identifier.
Add links to the Drawing, Metabase system assemblies.
Sub UserProc;
Var
mb: IMetabase;
styleSheet: IStyleSheet;
Doc: FreeThreadedDOMDocument60;
Element: IXmlDomElement;
Begin
// Get current repository
mb := MetabaseClass.Active;
// Get styles table
styleSheet := mb.ItemById("STYLE_TB").Bind As IStyleSheet;
// Load styles table into XML file
Doc := New FreeThreadedDOMDocument60.Create;
Element := Doc.createElement("StyleSheet");
styleSheet.Save(Element);
Doc.appendChild(Element);
Doc.save("C:\StyleSheet.xml");
End Sub UserProc;
After executing the example the STYLE_TB styles table is saved to the C:\StyleSheet.xml file.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.MsXml2;
…
Public Shared Sub Main(Params: StartParams);
Var
mb: IMetabase;
styleSheet: IStyleSheet;
Doc: FreeThreadedDOMDocument60;
Element: IXmlDomElement;
Begin
// Get current repository
mb := Params.Metabase;
// Get styles table
styleSheet := mb.ItemById["STYLE_TB"].Bind() As IStyleSheet;
// Load styles table into XML file
Doc := New FreeThreadedDOMDocument60.Create();
Element := Doc.createElement("StyleSheet");
styleSheet.Save(Element);
Doc.appendChild(Element);
Doc.save("C:\StyleSheet.xml");
End Sub;
See also: