xInfo.getImportedNode Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates an instance of a tree node from an XPO file but does not import it into the AOT. For example, this allows you to compare it with another version of the same tree node.
public:
virtual Dynamics::AX::Application::TreeNode ^ getImportedNode(int _id, int _utilfiletype, Dynamics::AX::Application::UtilElementType _utiltype, System::String ^ _name, int _fileposition, int _Flag);
public virtual Dynamics.AX.Application.TreeNode getImportedNode (int _id, int _utilfiletype, Dynamics.AX.Application.UtilElementType _utiltype, string _name, int _fileposition, int _Flag);
abstract member getImportedNode : int * int * Dynamics.AX.Application.UtilElementType * string * int * int -> Dynamics.AX.Application.TreeNode
override this.getImportedNode : int * int * Dynamics.AX.Application.UtilElementType * string * int * int -> Dynamics.AX.Application.TreeNode
Public Overridable Function getImportedNode (_id As Integer, _utilfiletype As Integer, _utiltype As UtilElementType, _name As String, _fileposition As Integer, _Flag As Integer) As TreeNode
Parameters
- _id
- Int32
- _utilfiletype
- Int32
- _utiltype
- UtilElementType
- _name
- String
- _fileposition
- Int32
- _Flag
- Int32
Returns
A tree node.
Remarks
The possible values for the utilfiletype parameter are those that are available in the UtilFileType Enumeration. The possible values for the utiltype parameter are those that are available in the UtilElementType Enumeration. For a list of the possible values for the Flag parameter, see the AOTExport macro. The values are listed under the System import flags comment.
The following example uses the getImportedNode method to create a virtual tree node.
public TreeNode getVirtualTreenode(
Filename _filename = this.fileName())
{
#AOT
#AotExport
TmpAotImport tmpImportAot;
SysImportElements sysImportElements = new SysImportElements();
TreeNode treeNodeImport = null;
int exportId;
int flag = (#impGetCompareNode + #impKeepIds);
str name;
;
// Set the filename.
sysImportElements.newFile(_filename);
// Get info from the file
tmpImportAot = sysImportElements.getTmpImportAot();
// Create an import context
exportId = infolog.startImport(_filename, flag);
// Get the right name
// for doc nodes it is the path excl. the first part
switch (tmpImportAot.UtilFileType)
{
case UtilFileType::Application:
name = tmpImportAot.TreeNodeName;
break;
case UtilFileType::ApplicationCodeDocumentation:
name = strdel(tmpImportAot.TreeNodePath, 1, strlen(#ApplicationDeveloperDocPath));
break;
case UtilFileType::ApplicationHelp:
name = strdel(tmpImportAot.TreeNodePath, 1, strlen(#ApplicationDocPath));
break;
case UtilFileType::KernelHelp:
name = strdel(tmpImportAot.TreeNodePath, 1, strlen(#SystemDocPath));
break;
default:
name = tmpImportAot.TreeNodeName;
break;
}
// Import the node in memory
treeNodeImport = infolog.getImportedNode(
exportId,
tmpImportAot.UtilFileType,
tmpImportAot.UtilElementType,
name,
tmpImportAot.FilePos,
flag);
// Close the import context
infolog.endImport(exportId, 1);
return treeNodeImport;
}