public DeclaredSymbolInfo GetDeclaredSymbolInfo(
            Huffman huffman,
            IList <AssemblyInfo> assemblies,
            IList <string> projects)
        {
            var result = new DeclaredSymbolInfo
            {
                AssemblyNumber = AssemblyNumber,
                Glyph          = Glyph,
                Name           = Name
            };

            if (assemblies != null && AssemblyNumber < assemblies.Count)
            {
                var assembly = assemblies[AssemblyNumber];
                result.AssemblyName = assembly.AssemblyName;
                if (projects != null && assembly.ProjectKey >= 0 && assembly.ProjectKey < projects.Count)
                {
                    result.ProjectFilePath = projects[assembly.ProjectKey];
                }
            }

            result.ID = ID;

            result.Kind = GetKind(Glyph);

            if (huffman != null && Description != IntPtr.Zero)
            {
                result.Description = huffman.Uncompress(Description);
            }

            return(result);
        }
 public IndexEntry(DeclaredSymbolInfo symbolInfo)
 {
     AssemblyNumber = symbolInfo.AssemblyNumber;
     Glyph          = symbolInfo.Glyph;
     Name           = symbolInfo.Name;
     ID             = symbolInfo.ID;
     Description    = IntPtr.Zero;
 }
Esempio n. 3
0
        public static void WriteSymbol(DeclaredSymbolInfo symbol, StringBuilder sb)
        {
            var url = symbol.GetUrl();

            sb.AppendFormat("<a href=\"{0}\" target=\"s\"><div class=\"resultItem\" onClick=\"resultClick(this);\">", url);
            sb.Append("<div class=\"resultLine\">");
            sb.AppendFormat("<img src=\"/content/icons/{0}\" height=\"16\" width=\"16\" />", GetGlyph(symbol) + ".png");
            sb.AppendFormat("<div class=\"resultKind\">{0}</div>", symbol.Kind);
            sb.AppendFormat("<div class=\"resultName\">{0}</div>", Markup.HtmlEscape(symbol.Name));
            sb.AppendLine("</div>");
            sb.AppendFormat("<div class=\"resultDescription\">{0}</div>", Markup.HtmlEscape(symbol.Description));
            sb.AppendLine();
            sb.AppendLine("</div></a>");
        }
Esempio n. 4
0
        private static string GetGlyph(DeclaredSymbolInfo symbol)
        {
            var result = symbol.Glyph;

            if (result == 196)
            {
                return("CSharp");
            }
            else if (result == 195)
            {
                return("VB");
            }
            else if (result == 228)
            {
                return("TypeScript");
            }
            else if (result == 227)
            {
                return("xaml");
            }

            return(result.ToString());
        }