ISysSettings.Root

Fore Syntax

Root: ISysSettingsKey;

Fore.NET Syntax

Root: Prognoz.Platform.Interop.ForeSystem.ISysSettingsKey;

Description

The Root property returns parameters of the Root element from the settings file.

Fore Example

Executing the example requires the Settings.xml file. This file contains all sections with BI server settings filled. Add a link to the Xml system assembly.

Sub UserSample;
Var
    Settings: ISysSettings;
    Node: ISysSettingsKey;
    XmlNode: IXmlDomElement;
    Lock: Object;
Begin
    Settings := New SysSettings.Create;
    Debug.WriteLine("File location: " + Settings.Location);
    //The Root element
    Node := Settings.Root;
    XmlNode := Node.Element As IXmlDomElement;
    //Get parameters of the <Root> element/<Key Name="PP">/<BIS>/<Key Name="System">/<Pool>
    XmlNode := XmlNode.selectSingleNode("//Pool"As IXmlDomElement;
    //Change value of the MaxConnections attribute
    XmlNode.setAttribute("MaxConnections""10");
    //Lock before saving
    Lock := Settings.CriticalLock;
    Try
        Settings.Commit;
    Finally
        Dispose Lock;
    End Try;
End Sub UserSample;

After executing the example value of the MaxConnections parameter is changed in the file with BI server settings.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports System.Xml;
Imports Prognoz.Platform.Interop.ForeSystem;

Public Shared Sub UserProc();
Var
    Settings: SysSettings = New SysSettingsClass();
    Node: ISysSettingsKey;
    XmlNode: XmlElement;
    Lock: Object;
Begin
    System.Diagnostics.Debug.WriteLine("File location: " + Settings.Location);
    //The Root element
    Node := Settings.Root;
    XmlNode := Node.Element As XmlElement;
    //Get parameters of the <Root> element/<Key Name="PP">/<BIS>/<Key Name="System">/<Pool>
    XmlNode := XmlNode.selectSingleNode("//Pool"As XmlElement;
    //Change value of the MaxConnections attribute
    XmlNode.setAttribute("MaxConnections""10");
    //Lock before saving
    Lock := Settings.CriticalLock;
    Try
        Settings.Commit();
    Finally
        System.Runtime.InteropServices.Marshal.ReleaseComObject(Lock);
    End Try;
End Sub;

See also:

ISysSettings