示例#1
0
        private void ReadTree()
        {
            try
            {
                if (tvSearchs == null)
                {
                    return;
                }

                if (tvSearchs.Nodes == null)
                {
                    return;
                }

                if (tvSearchs.Nodes[0].Nodes == null)
                {
                    return;
                }

                m_Search = new List <SearchProperties>();

                for (int i = 0; i < tvSearchs.Nodes[0].Nodes.Count; i++)
                {
                    if (tvSearchs.Nodes[0].Nodes[i].Tag != null)
                    {
                        SearchProperties currentSearchProperties = (SearchProperties)(tvSearchs.Nodes[0].Nodes[i].Tag);
                        currentSearchProperties.ZapMatches();

                        if (tvSearchs.Nodes[0].Nodes[i].Nodes != null)
                        {
                            for (int j = 0; j < tvSearchs.Nodes[0].Nodes[i].Nodes.Count; j++)
                            {
                                if (tvSearchs.Nodes[0].Nodes[i].Nodes[j].Tag != null)
                                {
                                    MatchProperties currentMatchProperties = (MatchProperties)(tvSearchs.Nodes[0].Nodes[i].Nodes[j].Tag);

                                    currentSearchProperties.Match.Add(currentMatchProperties);
                                }
                            }
                        }

                        m_Search.Add(currentSearchProperties);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Read Tree Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }