private void AddNewMessage(SymbolViewModel symbolViewModel, Point p, string guid)
        {
            //create a new message
            var tam = new TimeAwareMilitaryMessage
            {
                VisibleTimeExtent = new TimeExtent(_mission.PhaseList[CurrentPhaseIndex].VisibleTimeExtent.Start,
                    _mission.PhaseList[CurrentPhaseIndex].VisibleTimeExtent.End),
                Id = guid
            };

            tam.Add(MilitaryMessage.TypePropertyName, Constants.MSG_TYPE_POSITION_REPORT);
            tam.Add(MilitaryMessage.ActionPropertyName, Constants.MSG_ACTION_UPDATE);
            tam.Add(MilitaryMessage.WkidPropertyName, "3857");
            tam.Add(MilitaryMessage.SicCodePropertyName, symbolViewModel.SymbolID);
            tam.Add(MilitaryMessage.UniqueDesignationPropertyName, "1");

            // Construct the Control Points based on the geometry type of the drawn geometry.
            var point = _mapView.ScreenToLocation(p);
            tam.SymbolGeometry = point;
            tam.Add(MilitaryMessage.ControlPointsPropertyName, point.X.ToString() + "," + point.Y.ToString());

            //Process the message
            if (ProcessMessage(_militaryMessageLayer, tam))
            {
                RecordMessageBeingAdded(tam);

                DoCloneMission(null);
            }
            else
            {
                MessageBox.Show("Failed to process message.");
            }
        }
        private void ProcessSymbol(SymbolViewModel symbol, Geometry geometry)
        {
            if (symbol == null || geometry == null)
            {
                return;
            }

            //create a new message
            var msg = new TimeAwareMilitaryMessage
            {
                VisibleTimeExtent = new TimeExtent(_mission.PhaseList[CurrentPhaseIndex].VisibleTimeExtent.Start,
                    _mission.PhaseList[CurrentPhaseIndex].VisibleTimeExtent.End),
                Id = Guid.NewGuid().ToString("D"),
                SymbolGeometry = geometry
            };

            // set default time extent

            //set the ID and other parts of the message
            msg.Add(MilitaryMessage.TypePropertyName, Constants.MSG_TYPE_POSITION_REPORT);
            msg.Add(MilitaryMessage.ActionPropertyName, Constants.MSG_ACTION_UPDATE);
            msg.Add(MilitaryMessage.WkidPropertyName, "3857");
            msg.Add(MilitaryMessage.SicCodePropertyName, symbol.SymbolID);
            msg.Add(MilitaryMessage.UniqueDesignationPropertyName, "1");

            // Construct the Control Points based on the geometry type of the drawn geometry.
            switch (geometry.GeometryType)
            {
                case GeometryType.Point:
                    MapPoint point = geometry as MapPoint;
                    if (point != null)
                        msg.Add(MilitaryMessage.ControlPointsPropertyName, string.Format("{0},{1}", point.X.ToString(), point.Y.ToString()));
                    break;
                case GeometryType.Polygon:
                    Polygon polygon = geometry as Polygon;
                    string cpts = polygon.Parts.SelectMany(pt => pt.GetPoints()).Aggregate(string.Empty, (current, segpt) => current + (";" + segpt.X.ToString() + "," + segpt.Y.ToString()));
                    //foreach (var pt in polygon.Rings[0])
                    msg.Add(MilitaryMessage.ControlPointsPropertyName, cpts);
                    break;
                case GeometryType.Polyline:
                    Polyline polyline = geometry as Polyline;
                    cpts = string.Empty;

                    // TODO find a way to determine if polyline map points need adjustment based on symbol being drawn
                    var mpList = AdjustMapPoints(polyline, symbol);

                    cpts = mpList.Aggregate(cpts, (current, mp) => current + (";" + mp.X.ToString() + "," + mp.Y.ToString()));

                    msg.Add(MilitaryMessage.ControlPointsPropertyName, cpts);
                    break;
            }

            //Process the message
            if (ProcessMessage(_militaryMessageLayer, msg))
            {
                RecordMessageBeingAdded(msg);

                DoCloneMission(null);
            }
            else
            {
                MessageBox.Show("Failed to process message.");
            }
        }