WriteSymbol() public static method

public static WriteSymbol ( DeclaredSymbolInfo symbol, StringBuilder sb ) : void
symbol DeclaredSymbolInfo
sb StringBuilder
return void
Ejemplo n.º 1
0
        private void WriteImplementedInterfaceMembers(ulong symbolId, StreamWriter writer)
        {
            if (!ImplementedInterfaceMembers.TryGetValue(symbolId, out HashSet <Tuple <string, ulong> > implementedInterfaceMembers))
            {
                return;
            }

            Write(writer, string.Format(@"<div class=""rH"">Implemented interface member{0}:</div>", implementedInterfaceMembers.Count > 1 ? "s" : ""));

            foreach (var implementedInterfaceMember in implementedInterfaceMembers)
            {
                var assemblyName      = implementedInterfaceMember.Item1;
                var interfaceSymbolId = implementedInterfaceMember.Item2;

                if (!this.SolutionFinalizer.assemblyNameToProjectMap.TryGetValue(assemblyName, out ProjectFinalizer baseProject))
                {
                    return;
                }

                if (baseProject.DeclaredSymbols.TryGetValue(interfaceSymbolId, out DeclaredSymbolInfo symbol))
                {
                    var sb = new StringBuilder();
                    Markup.WriteSymbol(symbol, sb);
                    writer.Write(sb.ToString());
                }
            }
        }
        private void WriteBaseMember(ulong symbolId, StreamWriter writer)
        {
            Tuple <string, ulong> baseMemberLink;

            if (!BaseMembers.TryGetValue(symbolId, out baseMemberLink))
            {
                return;
            }

            Write(writer, @"<div class=""rH"">Base:</div>");

            var assemblyName = baseMemberLink.Item1;
            var baseSymbolId = baseMemberLink.Item2;

            ProjectFinalizer baseProject = null;

            if (!this.SolutionFinalizer.assemblyNameToProjectMap.TryGetValue(assemblyName, out baseProject))
            {
                return;
            }

            DeclaredSymbolInfo symbol = null;

            if (baseProject.DeclaredSymbols.TryGetValue(baseSymbolId, out symbol))
            {
                var sb = new StringBuilder();
                Markup.WriteSymbol(symbol, sb);
                writer.Write(sb.ToString());
            }
        }