~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/Main/Base/Project/Src/Gui/Components/ExtTreeView/ExtFolderNode.cs

  • Committer: sk
  • Date: 2011-09-10 05:17:57 UTC
  • Revision ID: halega@halega.com-20110910051757-qfouz1llya9m6boy
4.1.0.7915 Release Candidate 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
 
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
 
3
 
 
4
using System;
 
5
 
 
6
namespace ICSharpCode.SharpDevelop.Gui
 
7
{
 
8
        /// <summary>
 
9
        /// Description of ExtFolderNode.
 
10
        /// </summary>
 
11
        public class ExtFolderNode : ExtTreeNode
 
12
        {
 
13
                string closedIcon = null;
 
14
                string openedIcon = null;
 
15
                
 
16
                public string ClosedIcon {
 
17
                        get {
 
18
                                return closedIcon;
 
19
                        }
 
20
                        set {
 
21
                                closedIcon = value;
 
22
                                if (closedIcon != null && !IsExpanded) {
 
23
                                        SetIcon(closedIcon);
 
24
                                }
 
25
                        }
 
26
                }
 
27
                
 
28
                public string OpenedIcon {
 
29
                        get {
 
30
                                return openedIcon;
 
31
                        }
 
32
                        set {
 
33
                                openedIcon = value;
 
34
                                if (openedIcon != null && IsExpanded) {
 
35
                                        SetIcon(openedIcon);
 
36
                                }
 
37
                        }
 
38
                }
 
39
                
 
40
                public ExtFolderNode()
 
41
                {
 
42
                }
 
43
                
 
44
                public override void Refresh() 
 
45
                {
 
46
                        base.Refresh();
 
47
                        if (Nodes.Count == 0) {
 
48
                                SetIcon(ClosedIcon);
 
49
                        } else if (IsExpanded) {
 
50
                                SetIcon(OpenedIcon);
 
51
                        }
 
52
                }
 
53
                public override void Expanding()
 
54
                {
 
55
                        base.Expanding();
 
56
                        if (openedIcon != null) {
 
57
                                SetIcon(openedIcon);
 
58
                        }
 
59
                }
 
60
                
 
61
                public override void Collapsing()
 
62
                {
 
63
                        base.Collapsing();
 
64
                        if (closedIcon != null) {
 
65
                                SetIcon(closedIcon);
 
66
                        }
 
67
                }
 
68
        }
 
69
}