IMobileApplicationPublishObject.LoadFromXml

Fore Syntax

LoadFromXml(Element: IXmlDomElement);

Fore.NET Syntax

SaveToXml(Element: Prognoz.Platform.Interop.MsXml2.IXmlDomElement);

Parameters

Element. The element, from which published object parameters are loaded.

Description

The LoadFromXml method loads parameters of the published object of mobile application from XML file.

Comments

To load object parameters to XML file, use the IMobileApplicationPublishObject.SaveToXml method.

Fore Example

The example is a procedure. The mobile application object must be passed to the input. Executing the example requires the C:\MAPublishObject.xml file in the file system that contains parameters of the published object specified in the input parameter of the procedure.

Add links to the Metabase, Mobile, Xml system assemblies.

Sub MAPubObsLoad(MaPubObj: IMobileApplicationPublishObject);
Var
    XmlDoc: IXmlDomDocument3;
    el: IXmlDomElement;
    MbObj: IMetabaseObject;
    s: String;
Begin
    // Load parameters of mobile application objects
    XmlDoc := New DOMDocument60.Create;
    XmlDoc.load("C:\MAPublishObject.xml");
    el := XmlDoc.selectSingleNode("Root"As IXmlDomElement;
    MaPubObj.LoadFromXml(el);
    // Display message in the console window
    MbObj := MaPubObj.PublishObject.Object;
    s := MbObj.Name + " (" + MbObj.Id + ")";
    If MaPubObj.CreateResult = CreateMobileObjectResult.Ok Then
        Debug.WriteLine("Object parameters '" + s + "' are loaded");
    Else
        Debug.WriteLine("Error loading the object '" + s + "'");
    End If;
End Sub MAPubObsLoad;

Procedure execution result: parameters of the specified mobile application object are loaded from the C:\MAPublishObject.xml file, and the message about this procedure is displayed in the console window.

Fore.NET Example

The example is a procedure. The mobile application object must be passed to the input. Executing the example requires the C:\MAPublishObject.xml file in the file system that contains parameters of the published object specified in the input parameter of the procedure.

Imports Prognoz.Platform.Interop.Mobile;
Imports Prognoz.Platform.Interop.MsXml2;

Public Shared Sub MAPubObsLoad(MaPubObj: IMobileApplicationPublishObject);
Var
    XmlDoc: IXmlDomDocument3;
    el: IXmlDomElement;
    MbObj: IMetabaseObject;
    s: String;
Begin
    // Load parameters of mobile application objects
    XmlDoc := New DOMDocument60.Create();
    XmlDoc.load("C:\MAPublishObject.xml");
    el := XmlDoc.selectSingleNode("Root"As IXmlDomElement;
    MaPubObj.LoadFromXml(el);
    // Display message in the console window
    MbObj := MaPubObj.PublishObject.Object;
    s := MbObj.Name + " (" + MbObj.Id + ")";
    If MaPubObj.CreateResult = CreateMobileObjectResult.cmorOk Then
        System.Diagnostics.Debug.WriteLine("Object parameters '" + s + "' are loaded").
    Else
        System.Diagnostics.Debug.WriteLine("Error loading the object '" + s + "'").
    End If;;
End Sub MAPubObsLoad;

Procedure execution result: parameters of the specified mobile application object are loaded from the C:\MAPublishObject.xml file, and the message about this procedure is displayed in the console window.

See also:

IMobileApplicationPublishObject