private void AddParsedComponentFromConfigFile(TraceComponentInfo componentInfo, string currentLine, bool bypassFilterModifierSet)
        {
            Dictionary <int, TraceTagInfo>          dictionary  = new Dictionary <int, TraceTagInfo>();
            List <TraceComponentInfo>               list        = bypassFilterModifierSet ? this.bypassFilterComponentsList : this.enabledComponentsList;
            Dictionary <string, TraceComponentInfo> dictionary2 = bypassFilterModifierSet ? this.bypassFilterEnabledComponentsIndex : this.enabledComponentsIndex;

            if (this.ReadComponentTags(currentLine, componentInfo.PrettyName, dictionary))
            {
                if (!dictionary2.ContainsKey(componentInfo.PrettyName))
                {
                    list.Add(componentInfo);
                    dictionary2.Add(componentInfo.PrettyName, componentInfo);
                }
                componentInfo.TagInfoList = new TraceTagInfo[dictionary.Count];
                dictionary.Values.CopyTo(componentInfo.TagInfoList, 0);
            }
        }
        private TraceComponentInfo CreateComponentIfNeccessary(string name, bool bypassFilterList)
        {
            Dictionary <string, TraceComponentInfo> dictionary = bypassFilterList ? this.bypassFilterEnabledComponentsIndex : this.enabledComponentsIndex;

            if (dictionary.ContainsKey(name))
            {
                return(dictionary[name]);
            }
            TraceComponentInfo traceComponentInfo = null;

            if (AvailableTraces.InnerDictionary.TryGetValue(name, out traceComponentInfo))
            {
                return(new TraceComponentInfo(traceComponentInfo.PrettyName, traceComponentInfo.ComponentGuid, null));
            }
            InternalBypassTrace.TracingConfigurationTracer.TraceDebug(0, 0L, "{0} not a known component (may be custom parameter)", new object[]
            {
                name
            });
            return(null);
        }
        protected void ProcessFaultInjectionLine(string line)
        {
            InternalBypassTrace.FaultInjectionConfigurationTracer.TraceDebug(50735, 0L, "Processing line: {0}", new object[]
            {
                line
            });
            string             text  = null;
            FaultInjectionType type  = FaultInjectionType.None;
            string             empty = string.Empty;
            uint          key        = 0U;
            List <string> parameters = null;

            for (;;)
            {
                bool   flag      = false;
                string nextLexem = this.GetNextLexem(ref line, ref flag);
                if (flag)
                {
                    break;
                }
                if (string.IsNullOrEmpty(nextLexem))
                {
                    goto IL_A4;
                }
                if (nextLexem == ",")
                {
                    if (!this.ReadFaultInjectionTagComponent(ref line, ref empty))
                    {
                        goto Block_4;
                    }
                }
                else
                {
                    if (nextLexem == ":")
                    {
                        goto IL_A4;
                    }
                    text = nextLexem;
                }
            }
            this.ReportError("Low level scanning error in the statement header.", new object[0]);
            return;

Block_4:
            this.ReportError("Failed to read fault injection tag component.", new object[0]);
            return;

IL_A4:
            if (string.IsNullOrEmpty(text))
            {
                this.ReportError("Colon is not preceded with component name.", new object[0]);
                return;
            }
            TraceComponentInfo traceComponentInfo = this.CreateComponentIfNeccessary(text, true);

            if (traceComponentInfo == null)
            {
                this.ReportError("Not a component.", new object[0]);
                return;
            }
            if (!this.ReadFaultInjectionType(ref line, ref type))
            {
                this.ReportError("Failed to read fault injection type.", new object[0]);
                return;
            }
            if (!this.ReadFaultInjectionLid(ref line, ref key))
            {
                this.ReportError("Failed to read fault injection LID.", new object[0]);
                return;
            }
            if (!this.ReadFaultInjectionParameters(ref line, ref parameters))
            {
                this.ReportError("Failed to read fault injection parameters.", new object[0]);
                return;
            }
            lock (this.FaultInjectionConfig)
            {
                FaultInjectionTagComponentConfig faultInjectionTagComponentConfig = null;
                FaultInjectionComponentConfig    faultInjectionComponentConfig    = null;
                if (!this.FaultInjectionConfig.TryGetValue(traceComponentInfo.ComponentGuid, out faultInjectionTagComponentConfig))
                {
                    faultInjectionTagComponentConfig = new FaultInjectionTagComponentConfig();
                    this.FaultInjectionConfig.Add(traceComponentInfo.ComponentGuid, faultInjectionTagComponentConfig);
                }
                if (!faultInjectionTagComponentConfig.TryGetValue(empty, out faultInjectionComponentConfig))
                {
                    faultInjectionComponentConfig = new FaultInjectionComponentConfig();
                    faultInjectionTagComponentConfig.Add(empty, faultInjectionComponentConfig);
                }
                faultInjectionComponentConfig[key] = new FaultInjectionPointConfig(type, parameters);
            }
        }
        protected void ProcessLine(string line)
        {
            string             text = null;
            TraceComponentInfo traceComponentInfo = null;
            bool flag  = false;
            bool flag2 = false;
            bool flag3 = false;
            bool flag4 = false;
            bool flag5 = false;
            bool flag6 = false;

            InternalBypassTrace.TracingConfigurationTracer.TraceDebug(34351, 0L, "Processing line: {0}", new object[]
            {
                line
            });
            for (;;)
            {
                bool   flag7     = false;
                string nextLexem = this.GetNextLexem(ref line, ref flag7);
                if (flag7)
                {
                    break;
                }
                if (string.IsNullOrEmpty(nextLexem))
                {
                    goto IL_1C4;
                }
                if (nextLexem == ",")
                {
                    goto Block_3;
                }
                if (nextLexem == ":")
                {
                    goto Block_4;
                }
                if (string.Equals(nextLexem, "bypassFilter", StringComparison.OrdinalIgnoreCase))
                {
                    flag4 = true;
                }
                else
                {
                    text = nextLexem;
                }
            }
            this.ReportError("Low level scanning error in the statement header.", new object[0]);
            goto IL_1C4;
Block_3:
            this.ReportError("Bogus comma in the statement header.", new object[0]);
            goto IL_1C4;
Block_4:
            if (string.IsNullOrEmpty(text))
            {
                this.ReportError("Colon is not preceded with component name.", new object[0]);
            }
            else if (text.Equals("TraceTypes", StringComparison.OrdinalIgnoreCase) || text.Equals("TraceLevels", StringComparison.OrdinalIgnoreCase))
            {
                flag = true;
            }
            else if (text.Equals("FilteredTracing", StringComparison.OrdinalIgnoreCase))
            {
                flag2 = true;
            }
            else if (text.Equals("InMemoryTracing", StringComparison.OrdinalIgnoreCase))
            {
                flag3 = true;
            }
            else if (text.Equals("ConsoleTracing", StringComparison.OrdinalIgnoreCase))
            {
                flag5 = true;
            }
            else if (text.Equals("SystemDiagnosticsTracing", StringComparison.OrdinalIgnoreCase))
            {
                flag6 = true;
            }
            else
            {
                traceComponentInfo = this.CreateComponentIfNeccessary(text, flag4);
                if (traceComponentInfo == null)
                {
                    List <string> list = null;
                    if (!this.customParameters.TryGetValue(text, out list))
                    {
                        list = new List <string>();
                        this.customParameters[text] = list;
                    }
                    InternalBypassTrace.TracingConfigurationTracer.TraceDebug(0, 0L, "Added line as a custom parameter name,value = {0},{1}", new object[]
                    {
                        text,
                        line
                    });
                    list.Add(line.Trim());
                }
            }
IL_1C4:
            if (flag)
            {
                BitArray bitArray = new BitArray(ConfigurationDocument.TraceTypesCount + 1);
                if (this.ReadTraceTypes(line, ref bitArray))
                {
                    this.enabledTraceTypes = bitArray;
                    return;
                }
            }
            else if (flag2)
            {
                if (line.Trim().Equals("Yes", StringComparison.OrdinalIgnoreCase))
                {
                    this.filteredTracingEnabled = true;
                    return;
                }
            }
            else if (flag3)
            {
                if (line.Trim().Equals("Yes", StringComparison.OrdinalIgnoreCase))
                {
                    this.inMemoryTracingEnabled = true;
                    return;
                }
            }
            else if (flag5)
            {
                if (line.Trim().Equals("Yes", StringComparison.OrdinalIgnoreCase))
                {
                    this.consoleTracingEnabled = this.GetConsoleTracingEnabled();
                    return;
                }
            }
            else if (flag6)
            {
                if (line.Trim().Equals("Yes", StringComparison.OrdinalIgnoreCase))
                {
                    this.systemDiagnosticsTracingEnabled = true;
                    return;
                }
            }
            else
            {
                if (traceComponentInfo != null)
                {
                    this.AddParsedComponentFromConfigFile(traceComponentInfo, line, flag4);
                    return;
                }
                this.ReportError("Line could not be parsed", new object[0]);
            }
        }