Task Elements in NMF Files
ArcGIS Explorer uses NMF files to store various information types, including maps, layers, results, and also tasks. If you understand how task information is stored in an NMF file, this will help you to ensure that your custom tasks are specified correctly in map and task NMFs, and help you to troubleshoot problems with tasks on your machine and your users machines.
This topic contains information on the contents of an NMF file which relate to custom tasks specifically; for all other information about NMF files, please see the main ArcGIS Explorer application help system which you can open from the Help menu in ArcGIS Explorer itself.
| Note | |
|---|---|
| You can easily create an NMF file which defines a single task by using the Task File new item template which is part of the SDK. | |
Tasks in NMF Files
NMF files with tasks are used in a number of different ways within ArcGIS Explorer, for example:
- A user can open an NMF file containing the specification for an entire map. As well as layer and other information, the NMF file will also include details of all the tasks which are to be available in the map.
- A user can also use the Get Tasks button within the Manage Tasks dialog to open an NMF which contains details of a task or tasks. In this case, the tasks specified in the NMF file can be downloaded to the machine and added to the current map. A similar thing can also be done by using the Open Content dialog.
- ArcGIS Explorer itself also has another use for NMF files. Once a task has been downloaded to a machine, ArcGIS Explorer creates a single NMF file for each custom task on the machine, which it uses to store download location information. For this specific use, each NMF file created by Explorer contains information for only one custom task.
Task Schema
An NMF file may contain zero, one, or more E2TaskUIDescription elements. Each element contains the information required for ArcGIS Explorer to identify one task assembly and load it, and also download the task assembly if it does not already exist on the machine. Below is an example of an E2TaskUIDescription element in an NMF file.
<esri:ArcExplorerDocument xmlns:esri='http://www.esri.com/schemas/ArcGIS/9.2' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xs='http://www.w3.org/2001/XMLSchema' >
<E2TaskUIDescriptions xsi:type='esri:ArrayOfE2TaskUIDescription'>
<E2TaskUIDescription xsi:type='esri:E2CustomTaskUI'>
<Assembly>MyCustomTask, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</Assembly>
<Class>MyCustomTask.CustomTaskUI</Class>
<DisplayName>Some Company - My Custom Task</DisplayName>
<DownloadLocation>http://www.somecompany.com/SomeLocation/MyCustomTask.dll</DownloadLocation>
<PropertySet>Optional Property Set Information</PropertySet>
</E2TaskUIDescription>
</E2TaskUIDescriptions>
</esri:ArcExplorerDocument>
Each element is described in turn below. For more information about the NMF file schema, see the main ArcGIS Explorer application help file, which describes the NMF file schema.
| Element | Description |
| E2TaskUIDescriptions | This parent element contains zero to many E2TaskUIDescription elements. |
| E2TaskUIDescription | The E2TaskUIDescription element describes a single custom task, in terms of the TaskUI class. |
| Assembly | contains the full name of the assembly, also known in the .NET Framework as the FullName. The full name consists of the filename (without extension) of the assembly, followed by the version, culture information, and public key token. For more information, see the FullName property of the System.Reflection.Assembly class. |
| Class | The fully qualified (e.g. includes the namespace) name of the TaskUI class. This allows Explorer to instantiate the correct class in the assembly, and also allows you to have more than one TaskUI class in a single task assembly. |
| DisplayName | A readable string which will be displayed in the Manage Tasks dialog to identify the task. Note that .NET Framework documentation will sometimes also refer to an assemblies full name as its display name, but this element does not refer to the assembly name, but refers to a string used to identify the task in the ArcGIS Explorer user interface. |
| DownloadLocation | A path where the task assembly can be downloaded from, if it does not already exist on the machine. See the Task Downloading topic for more information. |
| PropertySet | This element is optional, and if present will contain a serialized set of data which will be passed to the TaskUI class on startup, allowing an NMF to pass information into a TaskUI. |
These elements together describe a custom task with enough information for ArcGIS Explorer to identify the correct task assembly to load if the assembly already exists on the machine, and where to download the assembly from if it does not already exist on the machine.