Lädt externes Xml file für automatisierte Aktionen

 
Assembly: EDKB12WS (in EDKB12WS.exe)

Syntax

Visual Basic

Public Function Load( _
   ByVal xmlImportFile As FileInfo _
) As Boolean

C#

public bool Load(
   FileInfoxmlImportFile
)

C++

public: 
bool Load(
   FileInfoxmlImportFile

JScript

public function Load(
    xmlImportFile : FileInfo
) : boolean;

Parameters

xmlImportFile

Das Xml File mit den entsprechenden Parametern

 

 

 

Source code

Visual Basic

 Public Function Load(ByVal xmlImportFile As FileInfo) As Boolean
    If Param.DebugMode Then
        DivFnkt.InsertJournale("EDKB12: Start Load XML-File", clsDivFnkt.Enum_InfoTyp.Information)
    End If
 
 
    Try
        'Validate source
        If Not IsValid(xmlImportFile) Then
            'xml file is invalid
            DivFnkt.InsertJournale("EDKB12::Fehler:: Load XML-File::File invalid", clsDivFnkt.Enum_InfoTyp.Fehler)
            If Param.DebugMode Then
                DivFnkt.InsertJournale("EDKB12::Fehler::  XML-File::File invalid", clsDivFnkt.Enum_InfoTyp.Information)
            End If
            Return False
        End If
 
        Dim doc As New XmlDocument()
        doc.Load(xmlImportFile.FullName)
 
        'read header elements
        _actionType = CType(doc.SelectSingleNode("action/actionId").InnerText, ActionType)
        _creatorTgNr = doc.SelectSingleNode("action/creatorTg").InnerText
        _sourceApplication = doc.SelectSingleNode("action/sourceApplication").InnerText
 
        Dim RootNode As XmlElement = doc.DocumentElement
        Dim nodeList As XmlNodeList = RootNode.ChildNodes
        If nodeList.Count > 0 Then
            'set correct array size
            ReDim _parameters(nodeList.Count - 1)
 
            Dim value As String
            Dim name As String
            Dim parameterCounter As Integer = 0
 
            Dim i As Integer
 
            For i = 0 To nodeList.Count - 1
                value = nodeList.Item(i).InnerText
                name = nodeList.Item(i).LocalName
                'append new parameter
                _parameters(parameterCounter) = New Parameter(name, value)
 
                parameterCounter = parameterCounter + 1
            Next
        End If
        If Param.DebugMode Then
            DivFnkt.InsertJournale("EDKB12: Ende Load XML-File (True)", clsDivFnkt.Enum_InfoTyp.Information)
        End If
 
        Return True
    Catch ex As Exception
        DivFnkt.InsertJournale("EDKB12::Fehler:: Load XML-File::File invalid::" & ex.Message, clsDivFnkt.Enum_InfoTyp.Fehler)
        If Param.DebugMode Then
            DivFnkt.InsertJournale("EDKB12: Load XML-File::File invalid(False)", clsDivFnkt.Enum_InfoTyp.Information)
        End If
        Return False
    End Try
 End Function 

Platforms

Windows 8, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

 

Version Information

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0
 

.NET Compact Framework

Supported in: 3.5, 2.0, 1.0
 

XNA Framework

Supported in: 3.0, 2.0, 1.0
 

 

See Also