Visual Basic (Declaration) | |
---|---|
Public Function ProcessMessage( _ ByVal message As Message _ ) As Boolean |
The ProcessMessage method takes a Message instance and performs the appropriate action (as specified by the "_action" key):
- "update": A new Message is generated, or an existing Message updated in the MessageLayer. Use MessageHelper.CreateMilitaryUpdateMessage to create an update Message or one of the overloads.
- "select": An existing Message in the MessageLayer is selected. This is visually represented as a glow, or halo, around the symbol. Use MessageHelper.CreateMilitarySelectMessage to create a select Message.
- "un-select": An existing Message in the MessageLayer is de-selected. Use MessageHelper.CreateMilitarySelectMessage to create a Message with the action un-select by specifying false for the select parameter.
- "remove": An existing Message in the MessageLayer is removed. Use MessageHelper.CreateMilitaryRemoveMessage to create a remove Message.
A fundamental part of Message processing is the correct generation of the symbol geometry. The MessageLayer automatically generates the symbol based on the provided symbol id code (sic) and the control points. It is important to note that for some symbols the required control points which define the symbol do not necessarily correlate to the standard geometry types of point, polyline, and polygon.
Parameters
- message
- The Message to be processed.
The following example shows how to create a new message with the action update and add the message to a message layer in the Map by calling process message.
C# | Copy Code |
---|---|
/* * Add using statements: * using ESRI.ArcGIS.Client.AdvancedSymbology; * using ESRI.ArcGIS.Client.Geometry; * using System.Collections; */ // Use the static MessageHelper class to create a new Message instance with a key, value of _action, "update". Message message = MessageHelper.CreateMilitaryUpdateMessage("MyStringIdentifier", "position_report", new List<MapPoint> { new MapPoint(3.22, 53.9) }, new Dictionary<string, string>() { { "sic", "GHGPGPWA------X" } }, new SpatialReference(4326)); // Get the MessageLayer instance from the Map MessageLayer messageLayer = _map.Layers["MyMessageLayer"] as MessageLayer; // Instruct the MessageLayer to process the Message. messageLayer.ProcessMessage(message); |
VB.NET | Copy Code |
---|---|
' ' * Add using statements: ' * Imports ESRI.ArcGIS.Client.AdvancedSymbology ' * Imports ESRI.ArcGIS.Client.Geometry ' * Imports System.Collections ' Dim message As Message message = MessageHelper.CreateMilitaryUpdateMessage("MyStringIdentifier", "position_report", _ New List(Of MapPoint)() From _ { _ New MapPoint(3.22, 53.9) _ }, _ New Dictionary(Of String, String)() From _ { _ { _ "sic", "GHGPGPWA------X" _ } _ }, _ New SpatialReference(4326)) ' Get the MessageLayer instance from the Map Dim messageLayer As MessageLayer = TryCast(_map.Layers("MyMessageLayer"), MessageLayer) ' Instruct the MessageLayer to process the Message. messageLayer.ProcessMessage(message) |
Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows 7, Windows 8