Ejemplo n.º 1
0
        /// <summary>
        /// Process the custom tracking record. This record will contain the persistence detail.
        /// </summary>
        /// <param name="record">Record representing custom tracking record.</param>
        private void ProcessCustomTrackingRecord(CustomTrackingRecord record)
        {
            Tracer.WriteMessage(String.Format(CultureInfo.InvariantCulture, "\n\tUser Data:"));

            if (_debugger != null &&
                record.Data != null)
            {
                // Get breakpoint info if available.
                object value;
                string bp = null;
                if (record.Data.TryGetValue("DebugSequencePoint", out value))
                {
                    bp = value as string;
                    record.Data.Remove("DebugSequencePoint");
                }

                // Update debugger variables.
                _debugger.UpdateVariables(record.Data);

                // Pass breakpoint info to debugger, which will optionally stop WF activity execution here.
                if (!string.IsNullOrEmpty(bp))
                {
                    try
                    {
                        string[]         symbols    = bp.Trim('\'', '\"').Split(':');
                        ActivityPosition debuggerBP = new ActivityPosition(
                            symbols[2],                                                 // WF Name
                            Convert.ToInt32(symbols[0], CultureInfo.InvariantCulture),  // Line number
                            Convert.ToInt32(symbols[1], CultureInfo.InvariantCulture)); // Col number

                        // Debugger blocking call if breakpoint hit or debugger stepping is active.
                        _debugger.DebuggerCheck(debuggerBP);
                    }
                    catch (FormatException)
                    { }
                    catch (OverflowException)
                    { }
                }
            }

            foreach (string data in record.Data.Keys)
            {
                Tracer.WriteMessage(String.Format(CultureInfo.InvariantCulture, " \t\t {0} : {1}", data, record.Data[data]));
            }
        }
Ejemplo n.º 2
0
        //TODO Clean up that mess :)
        protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            base.OnElementPropertyChanged(sender, e);

            var customMap = (CustomMap)sender;

            if (e.PropertyName == CustomMap.ActualPositionProperty.PropertyName)
            {
                if (_lastPosition == null)
                {
                    _lastPosition = customMap.ActuallPosition;
                    return;
                }

                var actuallPosition = customMap.ActuallPosition;

                var po = new PolylineOptions();
                po.InvokeColor(0x66FF0000);
                po.InvokeWidth(5);
                po.Add(new LatLng(_lastPosition.Latitude, _lastPosition.Longitude));
                po.Add(new LatLng(actuallPosition.Latitude, actuallPosition.Longitude));

                var polyline = _map.AddPolyline(po);
                _mapPolylines.Add(polyline);

                _lastPosition = actuallPosition;
            }

            if (e.PropertyName == CustomMap.PositionsProperty.PropertyName)
            {
                positions.Clear();

                foreach (var position in customMap.Positions)
                {
                    positions.Add(new LatLng(position.Latitude, position.Longitude));
                }

                if (_map == null)
                {
                    return;
                }
                UpdatePolylines();
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Process the custom tracking record. This record will contain the persistence detail.
        /// </summary>
        /// <param name="record">Record representing custom tracking record.</param>
        private void ProcessCustomTrackingRecord(CustomTrackingRecord record)
        {
            Tracer.WriteMessage(String.Format(CultureInfo.InvariantCulture, "\n\tUser Data:"));

            if (_debugger != null &&
                record.Data != null)
            {
                // Get breakpoint info if available.
                object value;
                string bp = null;
                if (record.Data.TryGetValue("DebugSequencePoint", out value))
                {
                    bp = value as string;
                    record.Data.Remove("DebugSequencePoint");
                }

                // Update debugger variables.
                _debugger.UpdateVariables(record.Data);

                // Pass breakpoint info to debugger, which will optionally stop WF activity execution here.
                if (!string.IsNullOrEmpty(bp))
                {
                    try
                    {
                        string[] symbols = bp.Trim('\'', '\"').Split(':');
                        ActivityPosition debuggerBP = new ActivityPosition(
                            symbols[2],                                                 // WF Name
                            Convert.ToInt32(symbols[0], CultureInfo.InvariantCulture),  // Line number
                            Convert.ToInt32(symbols[1], CultureInfo.InvariantCulture)); // Col number

                        // Debugger blocking call if breakpoint hit or debugger stepping is active.
                        _debugger.DebuggerCheck(debuggerBP);
                    }
                    catch (FormatException)
                    { }
                    catch (OverflowException)
                    { }
                }
            }

            foreach (string data in record.Data.Keys)
            {
                Tracer.WriteMessage(String.Format(CultureInfo.InvariantCulture, " \t\t {0} : {1}", data, record.Data[data]));
            }
        }