예제 #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());
                }
            }
        }
예제 #2
0
        private void ReadImplementedInterfaceMembers()
        {
            var implementedInterfaceMembersFile = Path.Combine(ProjectDestinationFolder, Constants.ImplementedInterfaceMembersFileName + ".txt");

            if (!File.Exists(implementedInterfaceMembersFile))
            {
                return;
            }

            var lines = File.ReadAllLines(implementedInterfaceMembersFile);

            foreach (var line in lines)
            {
                var parts                 = line.Split(';');
                var implementationId      = Serialization.HexStringToULong(parts[0]);
                var interfaceAssemblyName = string.Intern(parts[1]);
                var interfaceMemberId     = Serialization.HexStringToULong(parts[2]);
                ImplementedInterfaceMembers.Add(implementationId, Tuple.Create(interfaceAssemblyName, interfaceMemberId));
            }
        }