static public void Browse(string assemb, string nspace, TextWriter tw1)
        {
            tw = tw1;

            html ht = new html(tw, assemb);

            foreach (var ns in BrowseAssembly.dic.Keys)
            {
                if (ns == nspace)
                {
                    ht.Heading1("Informacao para o seguinte namespace:");

                    ht.BeginElementList();
                    ht.Paragraph(ns);
                    ht.EndElementList();
                    ht.BeginList();
                    BrowseAssembly.dic1 = BrowseAssembly.dic[ns];    // obter do dic1 o que estiver para a respectiva chave do dic
                    foreach (var nt in BrowseAssembly.dic1.Keys)     // obtem as chaves de dic1
                    {
                        ht.BeginElementList();

                        ht.LinkTipo(nt);
                        ht.EndElementList();
                    }
                    ht.EndList();
                }
            }

            ht.EndList();
            ht.Close();
        }
コード例 #2
0
        static public void Browse(string assemb, TextWriter tw1)
        {
            tw = tw1;
            //tw.WriteLine("<html><head><title>Erro</title></head>");
            //tw.WriteLine("<body>");
            //tw.WriteLine("Tipo de nome nao encontrado");
            //tw.WriteLine("</body>");
            //tw.WriteLine("</html>");


            try
            {
                Assembly ass = Assembly.LoadFrom(@"C:\Windows\Microsoft.NET\Framework\v4.0.30319\" + assemb);

                html ht = new html(tw, assemb);

                Type[] ass_types = ass.GetExportedTypes();

                ht.Heading1(assemb);
                //ht.Heading1("<a href = assemb >assemb</a>" );

                string local = ass.Location;
                ht.Paragraph(local);

                ht.Heading2("Tipos:");

                ht.BeginList();
                //SortedDictionary<string, SortedDictionary<string, Type>> dic;
                dic = new SortedDictionary <string, SortedDictionary <string, Type> >();
                //SortedDictionary<string, Type> dic1;
                foreach (Type tp in ass_types)
                {
                    string s = tp.Namespace;
                    if (s == null)
                    {
                        s = "";
                    }

                    if (!dic.TryGetValue(s, out dic1))
                    {
                        dic.Add(s, dic1 = new SortedDictionary <string, Type>());
                    }

                    dic1.Add(tp.FullName, tp);
                    //ht.BeginElementList();
                    //ht.link(tp.FullName);
                    //ht.EndElementList();
                }

                foreach (var ns in dic.Keys)
                {
                    if (ns != "")
                    {
                        ht.BeginElementList();
                        //ht.Paragraph(ns);
                        ht.LinkNs(assemb, ns);
                        ht.EndElementList();
                        ht.BeginList();
                        dic1 = dic[ns];               // obter do dic1 o que estiver para a respectiva chave do dic
                        foreach (var nt in dic1.Keys) // obtem as chaves de dic1
                        {
                            ht.BeginElementList();
                            //ht.link(dic1[nt].FullName);
                            ht.LinkTipo(nt);
                            ht.EndElementList();
                        }
                        ht.EndList();
                    }
                }


                ht.EndList();
                ht.Close();
            }
            catch (Exception e)
            {
                html ht = new html(tw, "Erro", e.Message);
            }
        }