예제 #1
0
        void PrintRecursive(TreeNode treeNode, string key_full)
        {
            oKey key = treeNode.Tag as oKey;

            if (key != null)
            {
                var ok = key.findKeys(m_keys).Where(x => x.key_full == key_full).Count() == 1;
                if (ok)
                {
                    f_key_selected(treeNode);
                    return;
                }
            }

            foreach (TreeNode tn in treeNode.Nodes)
            {
                PrintRecursive(tn, key_full);
            }
        }
예제 #2
0
        void f_key_selected(TreeNode node)
        {
            txtEditor.Text = "";
            listKeys.Items.Clear();
            m_key_selected = null;
            m_key_ids      = new string[] { };
            listKeys.Items.Clear();
            lblKeyID_Selected.Text = "";
            lblKeyID_Counter.Text  = "";
            labelKey_Selected.Text = "";

            if (node != null)
            {
                if (node.Tag == null)
                {
                    string err = "ERR: " + node.Text;
                    f_message(err);
                    //MessageBox.Show(err);
                }
                else
                {
                    labelKey_Selected.Text = node.Text;

                    oKey key = node.Tag as oKey;
                    lblKeySelected_Path.Text = key.getPath();
                    lblKeySelected_Time.Text = "";

                    var keys = key.findKeys(m_keys);
                    if (keys.Length == 1)
                    {
                        m_key_selected = keys[0];
                        m_key_ids      = m_key_selected.keys_last.Reverse().ToArray();
                        listKeys.Items.AddRange(m_key_ids);
                        lblKeyID_Counter.Text = "(" + m_key_ids.Length.ToString() + ")";
                    }
                }
            }
        }