예제 #1
0
파일: ETWRegistrant.cs 프로젝트: Zedfa/Core
        internal static void AddTraceToTraceList(TraceDto trace)
        {
            if (TraceList.ContainsKey(trace.Writer))
            {
                TraceList[trace.Writer].Enqueue(trace);
            }
            else
            {
                var traceWriterList = new ConcurrentQueue <TraceDto>();
                traceWriterList.Enqueue(trace);
                TraceList.Add(trace.Writer, traceWriterList);
            }

            CalculateWriterSize(trace);

            SparseWriter(trace.Writer);
        }
예제 #2
0
 public string Execute(Dictionary <string, string> parameterList)
 {
     if (ExecuteFunction == null)
     {
         return("Error function, no valid function registered!");
     }
     try
     {
         var s = ExecuteFunction(parameterList);
         TraceList.Add(DateTime.UtcNow, s);
         if (TraceList.Count > TraceCount)
         {
             var d = TraceList.FirstOrDefault();
             TraceList.Remove(d.Key);
         }
         return(s);
     }
     catch (Exception ex)
     {
         return(ex.Message);
     }
 }
예제 #3
0
 public int ExecuteNonQuery()
 {
     ExecutorMethod = "ExecuteNonQuery";
     TraceList.Add(this);
     return(0);
 }
예제 #4
0
 public object ExecuteScalar()
 {
     ExecutorMethod = "ExecuteScalar";
     TraceList.Add(this);
     return(ExpectedCommandResult);
 }
예제 #5
0
 public DbDataReader ExecuteReader(CommandBehavior behavior)
 {
     ExecutorMethod = $"ExecuteReader(CommandBehavior.{behavior})";
     TraceList.Add(this);
     return((TestDataReader)ExpectedCommandResult);
 }
예제 #6
0
 public DbDataReader ExecuteReader()
 {
     ExecutorMethod = "ExecuteReader";
     TraceList.Add(this);
     return((TestDataReader)ExpectedCommandResult);
 }