Load(Element: IXMLDOMElement);
Load(Element: Prognoz.Platform.Interop.MsXml2.IXMLDOMElement);
Element. XML element, to which styles table is saved.
The Load method loads styles table from XML code.
To save styles table into XML code, use the IStyleSheet.Save method.
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.
The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.
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_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;
See also: