예제 #1
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            TreeNode t = treeView1.SelectedNode;

            if (t == null)
            {
                t = treeView1.Nodes[0];
            }
            string search = toolStripTextBox1.Text;

            toolStripButton2.Visible = true;
            stop = false;
            while ((t = FindNext(t)) != null)
            {
                Application.DoEvents();
                statusConsumer("Searching : " + GetPath(t) + "...");
                if (stop)
                {
                    statusConsumer("Search stopped.");
                    toolStripButton2.Visible = false;
                    return;
                }
                try
                {
                    byte[] data = Tools.GetDataBySHA1(t.Name, GlobalStuff.getCatFile());
                    if (data.Length != 0)
                    {
                        DAIEbx ebxFile = deserializeEbx(data);
                        string xml     = ebxFile.ToXml();

                        if (xml.Contains(search))
                        {
                            ignoreonce             = true;
                            treeView1.SelectedNode = t;

                            showViewer();
                            setEbxFile(ebxFile);
                            rawXmlViewer.search(search);

                            statusConsumer("Match!");
                            toolStripButton2.Visible = false;
                            return;
                        }
                    }
                }
                catch (Exception ex)
                {
                    messageBoxOnException(ex);
                }
            }
            toolStripButton2.Visible = false;
            statusConsumer("Not found.");
        }
예제 #2
0
        public void renderXml()
        {
            if (Visible)
            {
                if (currentFile != null)
                {
                    var xml = currentFile.ToXml();

                    if (xml.Length > 0)
                    {
                        rtb1.Text          = xml;
                        findButton.Enabled = true;
                    }
                    else
                    {
                        disableSearch();
                    }
                }
            }
        }