IMobileApplicationPublishObject.LoadFromXml

Fore Syntax

LoadFromXml(Element: IXmlDomElement);

Fore.NET Syntax

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

Parameters

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

Description

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

Comments

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

Fore Example

This example is a procedure. The mobile application object must be passed to the input. Executing this 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
    // Loading parameters of the mobile application objects
    XmlDoc := New DOMDocument60.Create;
    XmlDoc.load("C:\MAPublishObject.xml");
    el := XmlDoc.selectSingleNode("Root"As IXmlDomElement;
    MaPubObj.LoadFromXml(el);
    // Displaying the 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;

The procedure 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

This 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 the mobile application objects
    XmlDoc := New DOMDocument60.Create();
    XmlDoc.load("C:\MAPublishObject.xml");
    el := XmlDoc.selectSingleNode("Root"As IXmlDomElement;
    MaPubObj.LoadFromXml(el);
    // Display the 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;

The procedure 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