Exemple #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]));
            }
        }