IStyleSheet.Save

Fore Syntax

Save(Element: IXMLDOMElement);

Fore.NET Syntax

Save(Element: Prognoz.Platform.Interop.MsXml2.IXMLDOMElement);

Parameters

Element. XML element, to which styles table is saved.

Description

The Save method saves styles table as an XML code.

Comments

To load styles table from XML code, use the IStyleSheet.Load method.

Fore Example

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.

Fore.NET Example

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:

IStyleSheet