示例#1
0
        ///////////////////////////////////////////////////////////////////////

        #region Internal State Introspection Methods
        //
        // NOTE: Used by the _Hosts.Default.BuildEngineInfoList method.
        //
        public static void AddInfo(
            StringPairList list,
            DetailFlags detailFlags
            )
        {
            if (list == null)
            {
                return;
            }

            lock (syncRoot) /* TRANSACTIONAL */
            {
                bool           empty     = HostOps.HasEmptyContent(detailFlags);
                StringPairList localList = new StringPairList();

                if (empty || isTracePossible)
                {
                    localList.Add("IsTracePossible",
                                  isTracePossible.ToString());
                }

                if (empty || (tracePriorities != TracePriority.None))
                {
                    localList.Add("TracePriorities",
                                  tracePriorities.ToString());
                }

                if (empty || (defaultTracePriority != TracePriority.None))
                {
                    localList.Add("DefaultTracePriority",
                                  defaultTracePriority.ToString());
                }

                if (empty || isTraceEnabledByDefault)
                {
                    localList.Add("IsTraceEnabledByDefault",
                                  isTraceEnabledByDefault.ToString());
                }

                if (empty || (isTraceEnabled != null))
                {
                    localList.Add("IsTraceEnabled", (isTraceEnabled != null) ?
                                  isTraceEnabled.ToString() : FormatOps.DisplayNull);
                }

                if (empty || (traceFormat != null))
                {
                    localList.Add("TraceFormat",
                                  FormatOps.DisplayString(traceFormat));
                }

                if (empty || traceDateTime)
                {
                    localList.Add("TraceDateTime",
                                  traceDateTime.ToString());
                }

                if (empty || tracePriority)
                {
                    localList.Add("TracePriority",
                                  tracePriority.ToString());
                }

                if (empty || traceAppDomain)
                {
                    localList.Add("TraceAppDomain",
                                  traceAppDomain.ToString());
                }

                if (empty || traceInterpreter)
                {
                    localList.Add("TraceInterpreter",
                                  traceInterpreter.ToString());
                }

                if (empty || traceThreadId)
                {
                    localList.Add("TraceThreadId",
                                  traceThreadId.ToString());
                }

                if (empty || traceMethod)
                {
                    localList.Add("TraceMethod",
                                  traceMethod.ToString());
                }

                if (empty || (traceCategories != null))
                {
                    localList.Add("TraceCategories", (traceCategories != null) ?
                                  traceCategories.KeysAndValuesToString(null, false) :
                                  FormatOps.DisplayNull);
                }

                if (localList.Count > 0)
                {
                    list.Add((IPair <string>)null);
                    list.Add("Trace Information");
                    list.Add((IPair <string>)null);
                    list.Add(localList);
                }
            }
        }