IStyleSheet.Load

Syntax

Load(Element: IXMLDOMElement);

Parameters

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

Description

The Load method loads styles table from XML code.

Comments

To save styles table into XML code, use the IStyleSheet.Save method.

Example

Executing the example requires that the repository contains an empty styles table with the STYLE_TB_NEW identifier. The file system should contain the C:\StyleSheet.xml file containing a styles table as XML code.

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_NEW").Edit As IStyleSheet;
    // Load styles table into XML file
    Doc := New FreeThreadedDOMDocument60.Create;
    Doc.load("C:\StyleSheet.xml");
    Element := Doc.documentElement;
    styleSheet.Load(Element);
    (styleSheet As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the STYLE_TB_NEW styles table is loaded from the C:\StyleSheet.xml file.

See also:

IStyleSheet