Ejemplo n.º 1
0
        private void SetFirstAncestorAppearance()
        {
            if(_previouslySelectedAncestorsNode != null)
            {
                _previouslySelectedAncestorsNode.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.Window);
                _previouslySelectedAncestorsNode.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.Black);
            }

            AncestorsNode n = this._ancestorsTreeView.Nodes[0] as AncestorsNode;
            if(n != null)
            {
                _previouslySelectedAncestorsNode = n;
                n.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.Highlight);
                n.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.Window);
            }
        }
Ejemplo n.º 2
0
        private void AncestorsTreeView_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if(_previouslySelectedAncestorsNode != null)
            {
                _previouslySelectedAncestorsNode.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.Window);
                _previouslySelectedAncestorsNode.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.Black);
            }

            AncestorsNode n = e.Node as AncestorsNode;
            _previouslySelectedAncestorsNode = n;
            n.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.Highlight);
            n.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.Window);

            if(_ancestorsTreeView.Focused)
            {
                _selectedTreeView = _ancestorsTreeView;
                if(n != null)
                {
                    string filename;
                    if(n.Text.Contains(": "))
                        filename = n.Text.Remove(0, 3);
                    else filename = n.Text;

                    SetForKrystal(filename);
                }
            }
        }