コード例 #1
0
 protected void AddTrace(int id, string ruleId, string expression, string description, object value, bool push = false)
 {
     //if (!IncludeTrace) return;
     var info = new RuleBookTraceInformation(ruleId, expression, description, value)
                    {
                        Id = id,
                        LoopContext = CurrentLoopContext,
                        ContextId = CurrentContextId
                    };
     if (push)
     {
         CurrentTraceInfo.TraceInformation.Add(info);
         TraceInfoStack.Push(info);
     }
     else
     {
         CurrentTraceInfo.TraceInformation.Add(info);
     }
 }
コード例 #2
0
 protected void Traverse(RuleBookTraceInformation parent, Action<RuleBookTraceInformation> action)
 {
     foreach (var child in parent.TraceInformation)
     {
         action(child);
         child.Traverse(child, action);
     }
 }
コード例 #3
0
 public void Initialize()
 {
     Result = new RuleBookResult();
     TraceInfoStack = new Stack<RuleBookTraceInformation>();
     LoopContextStack = new Stack<string>();
     ContextIdStack = new Stack<string>();
     CurrentLoopItemStack = new Stack<IDictionary<string, object>>();
     ResultItemsStack = new Stack<IDictionary<string, object>>();
     var rootTrace = new RuleBookTraceInformation(string.Empty, "", "Root", true);
     Result.TraceInformation.Add(rootTrace);
     TraceInfoStack.Push(rootTrace);
 }