示例#1
0
        public static void CLRMain(
            // error?
            //XElementAction xml = null,
            StringAction ListMethods  = null,
            Action SwitchVM           = null,
            IJavaArchiveReflector jar = null
            )
        {
            System.Console.WriteLine(XML);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(
                new Form1().With(f =>
            {
                var n = f.treeView1.Nodes.Add(jar.FileNameString + " (" + jar.Count + ")");

                var Namespaces = new Dictionary <string, TreeNode>();

                for (int i = 0; i < jar.Count; i++)
                {
                    System.Console.WriteLine("# " + i);

                    var fqn = jar.GetTypeFullName(i);

                    if (!string.IsNullOrEmpty(fqn))
                    {
                        var Namespace = fqn.TakeUntilLastOrEmpty(".");
                        var Name      = fqn.SkipUntilLastIfAny(".");

                        if (!Namespaces.ContainsKey(Namespace))
                        {
                            Namespaces[Namespace] = n.Nodes.Add(Namespace);
                        }

                        Namespaces[Namespace].Nodes.Add(Name);

                        //n.Nodes.Add(fqn);
                    }
                }

                f.button2.Click +=
                    delegate
                {
                    if (SwitchVM != null)
                    {
                        SwitchVM();
                    }

                    f.Close();
                };
                f.button1.Click +=
                    delegate
                {
                    if (ListMethods != null)
                    {
                        ListMethods(f.textBox1.Text);
                    }
                };
            }
                                 ));
        }
示例#2
0
        public static void CLRMain(
            // error?
            //XElementAction xml = null,
             StringAction ListMethods = null,
             Action SwitchVM = null,
             IJavaArchiveReflector jar = null
            )
        {
            System.Console.WriteLine(XML);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(
                new Form1().With(f =>
                {
                    var n = f.treeView1.Nodes.Add(jar.FileNameString + " (" + jar.Count + ")");

                    var Namespaces = new Dictionary<string, TreeNode>();

                    for (int i = 0; i < jar.Count; i++)
                    {
                        System.Console.WriteLine("# " + i);

                        var fqn = jar.GetTypeFullName(i);

                        if (!string.IsNullOrEmpty(fqn))
                        {
                            var Namespace = fqn.TakeUntilLastOrEmpty(".");
                            var Name = fqn.SkipUntilLastIfAny(".");

                            if (!Namespaces.ContainsKey(Namespace))
                            {
                                Namespaces[Namespace] = n.Nodes.Add(Namespace);
                            }

                            Namespaces[Namespace].Nodes.Add(Name);

                            //n.Nodes.Add(fqn);
                        }
                    }

                    f.button2.Click +=
                        delegate
                        {
                            if (SwitchVM != null)
                                SwitchVM();

                            f.Close();
                        };
                    f.button1.Click +=
                        delegate
                        {
                            if (ListMethods != null)
                                ListMethods(f.textBox1.Text);
                        };
                }
            ));
        }