ExternalLoad(Source: String);
ExternalLoad(Source: string);
Source. A string, in which selection in the XML format is saved.
The ExternalLoad method loads selection in the XML format from the string.
It is used together with the IDimSelection.ExternalSave method.
Executing the example requires a form, the UiDimension component with the UiDimension1 identifier, and the DimensionTree component with the DimensionTree1 identifier. UiDimension1 is set as a data source for DimensionTree1. A dictionary with the DIC_CAL_SL identifier located in the repository is connected to the UiDimension1 component. The file system is supposed to have the file C:\File.xml containing selection in the XML format.
Add a link to the XML system assembly.
The example is a handler of the OnCreate event for the form.
Sub IDIMSELECTION_SELECTLEVEL_OnCreate(Sender: Object; Args: IEventArgs);
Var
XMLS: string;
XML: FreeThreadedDOMDocument60;
Begin
// Get selection from XML file
XML := New FreeThreadedDOMDocument60.Create;
XML.load("c:\File.xml");
XMLS := XML.xml;
DimensionTree1.Selection.DeselectAll;
// Load selection in the XML format from the string
DimensionTree1.Selection.ExternalLoad(XMLS);
End Sub IDIMSELECTION_SELECTLEVEL_OnCreate;
After executing the example the selection is loaded from the file C:\File.xml.
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.MsXml2;
…
Private Sub IDIMSELECTION_SELECTLEVEL_FORM_NETForm_Activated(sender: System.Object; e: System.EventArgs);
Var
XMLS: string;
XML: FreeThreadedDOMDocument60;
Begin
// Get selection from XML file
XML := New FreeThreadedDOMDocument60.Create();
XML.load("c:\File.xml");
XMLS := XML.xml;
DimensionTreeNet1.Selection.DeselectAll();
// Load selection in the XML format from the string
DimensionTreeNet1.Selection.ExternalLoad(XMLS);
End Sub;
See also: