Ejemplo n.º 1
0
        private string DumpStatesInternal(Exception exception)
        {
            StringBuilder builder = new StringBuilder();

            builder.AppendLine("======== Recorded Commands =====================");
            foreach (string command in recordedCommands)
            {
                builder.AppendLine(command);
            }

            RuntimeStates runtimeStates = GetRuntimeStates();

            if (null != runtimeStates)
            {
                builder.AppendLine("\n======== Runtime State Data =======================");
                builder.AppendLine(runtimeStates.ToString());
            }

            builder.AppendLine("\n======== Node Collection =======================");
            foreach (var entry in nodeCollection)
            {
                IVisualNode node = entry.Value;
                builder.AppendLine(node.ToString() + "\n");
            }

            builder.AppendLine("======== Slot Collection =======================");
            foreach (var entry in slotCollection)
            {
                ISlot slot = entry.Value;
                builder.AppendLine(slot.ToString() + "\n");
            }

            builder.AppendLine("======== Edge Collection =======================");
            if (null != edgeController)
            {
                builder.AppendLine(edgeController.ToString() + "\n");
            }

            if (null != exception)
            {
                builder.AppendLine("======== Runtime Exception =====================");
                builder.AppendLine(exception.Message + "\n");
                if (!String.IsNullOrEmpty(exception.StackTrace))
                {
                    builder.AppendLine(exception.StackTrace);
                }
            }

            return(builder.ToString());
        }