├── .gitattributes ├── .gitignore ├── 1.png ├── 2.png ├── 3.png ├── 4.png ├── Binary ├── FastTree.dll ├── FastTree.xml └── Tester.exe ├── FastTree.sln ├── FastTree ├── FastList │ ├── FastList.cs │ ├── FastListBase.cs │ └── FastListBase.resx ├── FastTree.csproj ├── FastTree.csproj.DotSettings ├── FastTree │ ├── FastTree.cs │ └── FastTreeNode.cs ├── FastTreeModel │ └── FastTreeNode.cs ├── Properties │ └── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Resources │ ├── checkbox_no.png │ ├── checkbox_yes.png │ ├── collapse.png │ ├── default_icon.png │ ├── empty.png │ └── expand.png └── obj │ └── Debug │ ├── FastTree.csproj.FileListAbsolute.txt │ ├── FastTreeNS.FastListBase.resources │ ├── FastTreeNS.Resources.resources │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── README.md └── Tester ├── DataModel └── Node.cs ├── FastListCustomize.Designer.cs ├── FastListCustomize.cs ├── FastListCustomize.resx ├── FastListDragItemSample.Designer.cs ├── FastListDragItemSample.cs ├── FastListDragItemSample.resx ├── FastListDropItemSample.Designer.cs ├── FastListDropItemSample.cs ├── FastListDropItemSample.resx ├── FastListExpandedSample.Designer.cs ├── FastListExpandedSample.cs ├── FastListExpandedSample.resx ├── FastListReadonlyAndDisabledItemsSample.Designer.cs ├── FastListReadonlyAndDisabledItemsSample.cs ├── FastListReadonlyAndDisabledItemsSample.resx ├── FastListSimplestSample.Designer.cs ├── FastListSimplestSample.cs ├── FastListSimplestSample.resx ├── FastListStressTest.Designer.cs ├── FastListStressTest.cs ├── FastListStressTest.resx ├── FastListVirtualCheckboxesSample.Designer.cs ├── FastListVirtualCheckboxesSample.cs ├── FastListVirtualCheckboxesSample.resx ├── FastTreeDragAndDropSample.Designer.cs ├── FastTreeDragAndDropSample.cs ├── FastTreeDragAndDropSample.resx ├── FastTreeEditSample.Designer.cs ├── FastTreeEditSample.cs ├── FastTreeEditSample.resx ├── FastTreeFileExplorerSample.Designer.cs ├── FastTreeFileExplorerSample.cs ├── FastTreeFileExplorerSample.resx ├── FastTreeFileExplorerSample2.Designer.cs ├── FastTreeFileExplorerSample2.cs ├── FastTreeFileExplorerSample2.resx ├── FastTreeSimplestSample.Designer.cs ├── FastTreeSimplestSample.cs ├── FastTreeSimplestSample.resx ├── FastTreeStressTest.Designer.cs ├── FastTreeStressTest.cs ├── FastTreeStressTest.resx ├── MainForm.Designer.cs ├── MainForm.cs ├── MainForm.resx ├── Program.cs ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Settings.Designer.cs └── Settings.settings ├── Resources ├── default_icon.png └── folder.png ├── Tester.csproj ├── app.config ├── bin └── Debug │ ├── Tester.exe.config │ └── Tester.vshost.exe.config └── obj └── x86 └── Debug ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── Tester.FastListDragItemSample.resources ├── Tester.FastListDropItemSample.resources ├── Tester.FastListExpandedSample.resources ├── Tester.FastListReadonlyAndDisabledItemsSample.resources ├── Tester.FastListSimplestSample.resources ├── Tester.FastTreeFileExplorerSample.resources ├── Tester.FastTreeFileExplorerSample2.resources ├── Tester.FastTreeSimplestSample.resources ├── Tester.MainForm.resources ├── Tester.Properties.Resources.resources └── Tester.csproj.FileListAbsolute.txt /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Build Folders (you can keep bin if you'd like, to store dlls and pdbs) 2 | [Bb]in/ 3 | [Oo]bj/ 4 | 5 | # mstest test results 6 | TestResults 7 | 8 | ## Ignore Visual Studio temporary files, build results, and 9 | ## files generated by popular Visual Studio add-ons. 10 | 11 | # User-specific files 12 | *.suo 13 | *.user 14 | *.sln.docstates 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Rr]elease/ 19 | x64/ 20 | *_i.c 21 | *_p.c 22 | *.ilk 23 | *.meta 24 | *.obj 25 | *.pch 26 | *.pdb 27 | *.pgc 28 | *.pgd 29 | *.rsp 30 | *.sbr 31 | *.tlb 32 | *.tli 33 | *.tlh 34 | *.tmp 35 | *.log 36 | *.vspscc 37 | *.vssscc 38 | .builds 39 | 40 | # Visual C++ cache files 41 | ipch/ 42 | *.aps 43 | *.ncb 44 | *.opensdf 45 | *.sdf 46 | 47 | # Visual Studio profiler 48 | *.psess 49 | *.vsp 50 | *.vspx 51 | 52 | # Guidance Automation Toolkit 53 | *.gpState 54 | 55 | # ReSharper is a .NET coding add-in 56 | _ReSharper* 57 | 58 | # NCrunch 59 | *.ncrunch* 60 | .*crunch*.local.xml 61 | 62 | # Installshield output folder 63 | [Ee]xpress 64 | 65 | # DocProject is a documentation generator add-in 66 | DocProject/buildhelp/ 67 | DocProject/Help/*.HxT 68 | DocProject/Help/*.HxC 69 | DocProject/Help/*.hhc 70 | DocProject/Help/*.hhk 71 | DocProject/Help/*.hhp 72 | DocProject/Help/Html2 73 | DocProject/Help/html 74 | 75 | # Click-Once directory 76 | publish 77 | 78 | # Publish Web Output 79 | *.Publish.xml 80 | 81 | # NuGet Packages Directory 82 | packages 83 | 84 | # Windows Azure Build Output 85 | csx 86 | *.build.csdef 87 | 88 | # Windows Store app package directory 89 | AppPackages/ 90 | 91 | # Others 92 | [Bb]in 93 | [Oo]bj 94 | sql 95 | TestResults 96 | [Tt]est[Rr]esult* 97 | *.Cache 98 | ClientBin 99 | [Ss]tyle[Cc]op.* 100 | ~$* 101 | *.dbmdl 102 | Generated_Code #added for RIA/Silverlight projects 103 | 104 | # Backup & report files from converting an old project file to a newer 105 | # Visual Studio version. Backup files are not needed, because we have git ;-) 106 | _UpgradeReport_Files/ 107 | Backup*/ 108 | UpgradeLog*.XML 109 | -------------------------------------------------------------------------------- /1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/1.png -------------------------------------------------------------------------------- /2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/2.png -------------------------------------------------------------------------------- /3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/3.png -------------------------------------------------------------------------------- /4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/4.png -------------------------------------------------------------------------------- /Binary/FastTree.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/Binary/FastTree.dll -------------------------------------------------------------------------------- /Binary/FastTree.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | FastTree 5 | 6 | 7 | 8 | 9 | Occurs when user start to drag items 10 | 11 | 12 | 13 | 14 | Occurs when user drag object over node 15 | 16 | 17 | 18 | 19 | Occurs when user drop object on given item 20 | 21 | 22 | 23 | 24 | Draws Expand box, Check box and Icon of the Item 25 | 26 | 27 | 28 | 29 | Absolute Y coordinate of the control to item index 30 | 31 | 32 | 33 | 34 | 35 | 36 | Control visible rect coordinates to item index 37 | 38 | 39 | 40 | 41 | Control visible rect coordinates to item info 42 | 43 | 44 | 45 | 46 | x0 x1 x2 x3 x4 x5 47 | | | | | | | 48 | □ □ □ ItemText 49 | 50 | 51 | 52 | 53 | Updates scrollbar position after Value changed 54 | 55 | 56 | 57 | 58 | List of all visible nodes 59 | 60 | 61 | 62 | 63 | Occurs when user start to drag node 64 | 65 | 66 | 67 | 68 | Occurs when user drag object over node 69 | 70 | 71 | 72 | 73 | Occurs when user drop object on given node 74 | 75 | 76 | 77 | 78 | Returns all expanded children of the node 79 | 80 | 81 | 82 | 83 | Returns all expanded children of the item 84 | 85 | 86 | 87 | 88 | This method is used only for programmatically expanding. 89 | For GUI expanding - use CanExpandItem 90 | 91 | 92 | 93 | 94 | General tree data model 95 | 96 | 97 | 98 | 99 | A strongly-typed resource class, for looking up localized strings, etc. 100 | 101 | 102 | 103 | 104 | Returns the cached ResourceManager instance used by this class. 105 | 106 | 107 | 108 | 109 | Overrides the current thread's CurrentUICulture property for all 110 | resource lookups using this strongly typed resource class. 111 | 112 | 113 | 114 | 115 | Looks up a localized resource of type System.Drawing.Bitmap. 116 | 117 | 118 | 119 | 120 | Looks up a localized resource of type System.Drawing.Bitmap. 121 | 122 | 123 | 124 | 125 | Looks up a localized resource of type System.Drawing.Bitmap. 126 | 127 | 128 | 129 | 130 | Looks up a localized resource of type System.Drawing.Bitmap. 131 | 132 | 133 | 134 | 135 | Looks up a localized resource of type System.Drawing.Bitmap. 136 | 137 | 138 | 139 | 140 | Looks up a localized resource of type System.Drawing.Bitmap. 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /Binary/Tester.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/Binary/Tester.exe -------------------------------------------------------------------------------- /FastTree.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FastTree", "FastTree\FastTree.csproj", "{C8B484C9-A5C6-4B4E-BF98-8198921F30B6}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tester", "Tester\Tester.csproj", "{11E7396C-50B2-40FE-8037-B7689AE7AFCF}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Debug|Mixed Platforms = Debug|Mixed Platforms 12 | Debug|x86 = Debug|x86 13 | Release|Any CPU = Release|Any CPU 14 | Release|Mixed Platforms = Release|Mixed Platforms 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {C8B484C9-A5C6-4B4E-BF98-8198921F30B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {C8B484C9-A5C6-4B4E-BF98-8198921F30B6}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {C8B484C9-A5C6-4B4E-BF98-8198921F30B6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 21 | {C8B484C9-A5C6-4B4E-BF98-8198921F30B6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 22 | {C8B484C9-A5C6-4B4E-BF98-8198921F30B6}.Debug|x86.ActiveCfg = Debug|Any CPU 23 | {C8B484C9-A5C6-4B4E-BF98-8198921F30B6}.Release|Any CPU.ActiveCfg = Release|Any CPU 24 | {C8B484C9-A5C6-4B4E-BF98-8198921F30B6}.Release|Any CPU.Build.0 = Release|Any CPU 25 | {C8B484C9-A5C6-4B4E-BF98-8198921F30B6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 26 | {C8B484C9-A5C6-4B4E-BF98-8198921F30B6}.Release|Mixed Platforms.Build.0 = Release|Any CPU 27 | {C8B484C9-A5C6-4B4E-BF98-8198921F30B6}.Release|x86.ActiveCfg = Release|Any CPU 28 | {11E7396C-50B2-40FE-8037-B7689AE7AFCF}.Debug|Any CPU.ActiveCfg = Debug|x86 29 | {11E7396C-50B2-40FE-8037-B7689AE7AFCF}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 30 | {11E7396C-50B2-40FE-8037-B7689AE7AFCF}.Debug|Mixed Platforms.Build.0 = Debug|x86 31 | {11E7396C-50B2-40FE-8037-B7689AE7AFCF}.Debug|x86.ActiveCfg = Debug|x86 32 | {11E7396C-50B2-40FE-8037-B7689AE7AFCF}.Debug|x86.Build.0 = Debug|x86 33 | {11E7396C-50B2-40FE-8037-B7689AE7AFCF}.Release|Any CPU.ActiveCfg = Release|x86 34 | {11E7396C-50B2-40FE-8037-B7689AE7AFCF}.Release|Mixed Platforms.ActiveCfg = Release|x86 35 | {11E7396C-50B2-40FE-8037-B7689AE7AFCF}.Release|Mixed Platforms.Build.0 = Release|x86 36 | {11E7396C-50B2-40FE-8037-B7689AE7AFCF}.Release|x86.ActiveCfg = Release|x86 37 | {11E7396C-50B2-40FE-8037-B7689AE7AFCF}.Release|x86.Build.0 = Release|x86 38 | EndGlobalSection 39 | GlobalSection(SolutionProperties) = preSolution 40 | HideSolutionNode = FALSE 41 | EndGlobalSection 42 | EndGlobal 43 | -------------------------------------------------------------------------------- /FastTree/FastList/FastListBase.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | 124 | 77, 17 125 | 126 | -------------------------------------------------------------------------------- /FastTree/FastTree.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {C8B484C9-A5C6-4B4E-BF98-8198921F30B6} 9 | Library 10 | Properties 11 | FastTreeNS 12 | FastTree 13 | v3.5 14 | 512 15 | 16 | 17 | 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | bin\Debug\FastTree.XML 26 | 27 | 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | UserControl 45 | 46 | 47 | UserControl 48 | 49 | 50 | UserControl 51 | 52 | 53 | 54 | 55 | True 56 | True 57 | Resources.resx 58 | 59 | 60 | 61 | 62 | FastListBase.cs 63 | 64 | 65 | ResXFileCodeGenerator 66 | Designer 67 | Resources.Designer.cs 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 96 | -------------------------------------------------------------------------------- /FastTree/FastTree.csproj.DotSettings: -------------------------------------------------------------------------------- 1 |  2 | True 3 | True -------------------------------------------------------------------------------- /FastTree/FastTree/FastTreeNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace FastTreeNS 7 | { 8 | /// 9 | /// General tree data model 10 | /// 11 | public class FastTreeNode 12 | { 13 | protected readonly List childs = new List(); 14 | 15 | public object Tag { get; set; } 16 | 17 | private FastTreeNode parent; 18 | public FastTreeNode Parent 19 | { 20 | get { return parent; } 21 | set 22 | { 23 | if (parent == value) 24 | return; 25 | 26 | SetParent(value); 27 | 28 | if(parent != null) 29 | parent.childs.Add(this); 30 | } 31 | } 32 | 33 | protected virtual void SetParent(FastTreeNode value) 34 | { 35 | if (parent != null && parent != value) 36 | parent.childs.Remove(this); 37 | 38 | parent = value; 39 | } 40 | 41 | public virtual void RemoveNode(FastTreeNode node) 42 | { 43 | childs.Remove(node); 44 | SetParent(null); 45 | } 46 | 47 | public virtual void AddNode(FastTreeNode node) 48 | { 49 | if(node.Parent != this) 50 | childs.Add(node); 51 | SetParent(this); 52 | } 53 | 54 | public virtual void InsertNode(int index, FastTreeNode node) 55 | { 56 | childs.Insert(index, node); 57 | SetParent(this); 58 | } 59 | 60 | public virtual void InsertNodeBefore(FastTreeNode existsNode, FastTreeNode node) 61 | { 62 | var i = childs.IndexOf(existsNode); 63 | if (i < 0) i = 0; 64 | 65 | InsertNode(i, node); 66 | } 67 | 68 | public virtual void InsertNodeAfter(FastTreeNode existsNode, FastTreeNode node) 69 | { 70 | var i = childs.IndexOf(existsNode) + 1; 71 | InsertNode(i, node); 72 | } 73 | 74 | public virtual void RemoveNode(IEnumerable nodes) 75 | { 76 | var hash = new HashSet(nodes); 77 | var j = 0; 78 | for (int i = 0; i < childs.Count; i++) 79 | { 80 | if (hash.Contains(childs[i])) 81 | j++; 82 | else 83 | childs[i].SetParent(null); 84 | childs[i] = childs[i + j]; 85 | } 86 | 87 | if(j > 0) 88 | childs.RemoveRange(childs.Count - j, j); 89 | } 90 | 91 | public virtual void AddNode(IEnumerable nodes) 92 | { 93 | childs.AddRange(nodes); 94 | foreach(var node in nodes) 95 | node.SetParent(this); 96 | } 97 | 98 | public virtual void InsertNode(int index, IEnumerable nodes) 99 | { 100 | childs.InsertRange(index, nodes); 101 | foreach (var node in nodes) 102 | node.SetParent(this); 103 | } 104 | 105 | public virtual void InsertNodeBefore(FastTreeNode existsNode, IEnumerable nodes) 106 | { 107 | var i = childs.IndexOf(existsNode); 108 | if (i < 0) 109 | i = 0; 110 | 111 | InsertNode(i, nodes); 112 | } 113 | 114 | public virtual void InsertNodeAfter(FastTreeNode existsNode, IEnumerable nodes) 115 | { 116 | var i = childs.IndexOf(existsNode) + 1; 117 | InsertNode(i, nodes); 118 | } 119 | 120 | public int IndexOf(FastTreeNode node) 121 | { 122 | return childs.IndexOf(node); 123 | } 124 | 125 | public IEnumerable Childs 126 | { 127 | get 128 | { 129 | return childs; 130 | } 131 | } 132 | 133 | public IEnumerable GetChilds() 134 | { 135 | return GetChilds(t=>t is TagType); 136 | } 137 | 138 | public IEnumerable GetChilds(Predicate tagCondition) 139 | { 140 | return childs.Where(c=>tagCondition(c.Tag)); 141 | } 142 | 143 | public IEnumerable AllChilds 144 | { 145 | get 146 | { 147 | yield return this; 148 | 149 | foreach(var c in childs) 150 | foreach (var cc in c.AllChilds) 151 | yield return cc; 152 | } 153 | } 154 | 155 | public IEnumerable GetAllChilds() 156 | { 157 | return GetAllChilds(t => t is TagType); 158 | } 159 | 160 | public IEnumerable GetAllChilds(Predicate tagCondition) 161 | { 162 | return AllChilds.Where(c => tagCondition(c.Tag)); 163 | } 164 | 165 | public FastTreeNode GetParent() 166 | { 167 | return GetParent(t => t is TagType); 168 | } 169 | 170 | public FastTreeNode GetParent(Predicate tagCondition) 171 | { 172 | var parent = Parent; 173 | while (parent != null && !tagCondition(parent)) 174 | parent = parent.parent; 175 | return parent; 176 | } 177 | } 178 | } 179 | -------------------------------------------------------------------------------- /FastTree/FastTreeModel/FastTreeNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace FastTreeNS 7 | { 8 | /// 9 | /// General tree data model 10 | /// 11 | [Serializable] 12 | public class FastTreeNode 13 | { 14 | protected readonly List childs = new List(); 15 | 16 | public object Tag { get; set; } 17 | 18 | private FastTreeNode parent; 19 | public FastTreeNode Parent 20 | { 21 | get { return parent; } 22 | set 23 | { 24 | if (parent == value) 25 | return; 26 | 27 | SetParent(value); 28 | 29 | if(parent != null) 30 | parent.childs.Add(this); 31 | } 32 | } 33 | 34 | protected virtual void SetParent(FastTreeNode value) 35 | { 36 | if (parent != null && parent != value) 37 | parent.childs.Remove(this); 38 | 39 | parent = value; 40 | } 41 | 42 | public virtual void RemoveNode(FastTreeNode node) 43 | { 44 | childs.Remove(node); 45 | SetParent(null); 46 | } 47 | 48 | public virtual void AddNode(FastTreeNode node) 49 | { 50 | if(node.Parent != this) 51 | childs.Add(node); 52 | SetParent(this); 53 | } 54 | 55 | public virtual void InsertNode(int index, FastTreeNode node) 56 | { 57 | childs.Insert(index, node); 58 | SetParent(this); 59 | } 60 | 61 | public virtual void InsertNodeBefore(FastTreeNode existsNode, FastTreeNode node) 62 | { 63 | var i = childs.IndexOf(existsNode); 64 | if (i < 0) i = 0; 65 | 66 | InsertNode(i, node); 67 | } 68 | 69 | public virtual void InsertNodeAfter(FastTreeNode existsNode, FastTreeNode node) 70 | { 71 | var i = childs.IndexOf(existsNode) + 1; 72 | InsertNode(i, node); 73 | } 74 | 75 | public virtual void RemoveNode(IEnumerable nodes) 76 | { 77 | var hash = new HashSet(nodes); 78 | var j = 0; 79 | for (int i = 0; i < childs.Count; i++) 80 | { 81 | if (hash.Contains(childs[i])) 82 | j++; 83 | else 84 | childs[i].SetParent(null); 85 | childs[i] = childs[i + j]; 86 | } 87 | 88 | if(j > 0) 89 | childs.RemoveRange(childs.Count - j, j); 90 | } 91 | 92 | public virtual void AddNode(IEnumerable nodes) 93 | { 94 | childs.AddRange(nodes); 95 | foreach(var node in nodes) 96 | node.SetParent(this); 97 | } 98 | 99 | public virtual void InsertNode(int index, IEnumerable nodes) 100 | { 101 | childs.InsertRange(index, nodes); 102 | foreach (var node in nodes) 103 | node.SetParent(this); 104 | } 105 | 106 | public virtual void InsertNodeBefore(FastTreeNode existsNode, IEnumerable nodes) 107 | { 108 | var i = childs.IndexOf(existsNode); 109 | if (i < 0) 110 | i = 0; 111 | 112 | InsertNode(i, nodes); 113 | } 114 | 115 | public virtual void InsertNodeAfter(FastTreeNode existsNode, IEnumerable nodes) 116 | { 117 | var i = childs.IndexOf(existsNode) + 1; 118 | InsertNode(i, nodes); 119 | } 120 | 121 | public int IndexOf(FastTreeNode node) 122 | { 123 | return childs.IndexOf(node); 124 | } 125 | 126 | public IEnumerable Childs 127 | { 128 | get 129 | { 130 | return childs; 131 | } 132 | } 133 | 134 | public IEnumerable GetChilds() 135 | { 136 | return GetChilds(t=>t is TagType); 137 | } 138 | 139 | public IEnumerable GetChilds(Predicate tagCondition) 140 | { 141 | return childs.Where(c=>tagCondition(c.Tag)); 142 | } 143 | 144 | public IEnumerable AllChilds 145 | { 146 | get 147 | { 148 | yield return this; 149 | 150 | foreach(var c in childs) 151 | foreach (var cc in c.AllChilds) 152 | yield return cc; 153 | } 154 | } 155 | 156 | public IEnumerable GetAllChilds() 157 | { 158 | return GetAllChilds(t => t is TagType); 159 | } 160 | 161 | public IEnumerable GetAllChilds(Predicate tagCondition) 162 | { 163 | return AllChilds.Where(c => tagCondition(c.Tag)); 164 | } 165 | 166 | public FastTreeNode GetParent() 167 | { 168 | return GetParent(t => t is TagType); 169 | } 170 | 171 | public FastTreeNode GetParent(Predicate tagCondition) 172 | { 173 | var parent = Parent; 174 | while (parent != null && !tagCondition(parent.Tag)) 175 | parent = parent.parent; 176 | return parent; 177 | } 178 | } 179 | } 180 | -------------------------------------------------------------------------------- /FastTree/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("FastTree")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("FastTree")] 13 | [assembly: AssemblyCopyright("© Pavel Torgashov, 2014-2015, pavel_torgashov@ukr.net")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("f3bb7c23-57e7-433b-8067-8755321c977a")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.6.0.0")] 36 | [assembly: AssemblyFileVersion("1.6.0.0")] 37 | -------------------------------------------------------------------------------- /FastTree/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18408 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace FastTreeNS { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FastTreeNS.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap checkbox_no { 67 | get { 68 | object obj = ResourceManager.GetObject("checkbox_no", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Bitmap. 75 | /// 76 | internal static System.Drawing.Bitmap checkbox_yes { 77 | get { 78 | object obj = ResourceManager.GetObject("checkbox_yes", resourceCulture); 79 | return ((System.Drawing.Bitmap)(obj)); 80 | } 81 | } 82 | 83 | /// 84 | /// Looks up a localized resource of type System.Drawing.Bitmap. 85 | /// 86 | internal static System.Drawing.Bitmap collapse { 87 | get { 88 | object obj = ResourceManager.GetObject("collapse", resourceCulture); 89 | return ((System.Drawing.Bitmap)(obj)); 90 | } 91 | } 92 | 93 | /// 94 | /// Looks up a localized resource of type System.Drawing.Bitmap. 95 | /// 96 | internal static System.Drawing.Bitmap default_icon { 97 | get { 98 | object obj = ResourceManager.GetObject("default_icon", resourceCulture); 99 | return ((System.Drawing.Bitmap)(obj)); 100 | } 101 | } 102 | 103 | /// 104 | /// Looks up a localized resource of type System.Drawing.Bitmap. 105 | /// 106 | internal static System.Drawing.Bitmap empty { 107 | get { 108 | object obj = ResourceManager.GetObject("empty", resourceCulture); 109 | return ((System.Drawing.Bitmap)(obj)); 110 | } 111 | } 112 | 113 | /// 114 | /// Looks up a localized resource of type System.Drawing.Bitmap. 115 | /// 116 | internal static System.Drawing.Bitmap expand { 117 | get { 118 | object obj = ResourceManager.GetObject("expand", resourceCulture); 119 | return ((System.Drawing.Bitmap)(obj)); 120 | } 121 | } 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /FastTree/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | Resources\checkbox_no.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | 125 | Resources\checkbox_yes.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 126 | 127 | 128 | Resources\collapse.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 129 | 130 | 131 | Resources\default_icon.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 132 | 133 | 134 | 135 | Resources\empty.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 136 | 137 | 138 | Resources\expand.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 139 | 140 | -------------------------------------------------------------------------------- /FastTree/Resources/checkbox_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/FastTree/Resources/checkbox_no.png -------------------------------------------------------------------------------- /FastTree/Resources/checkbox_yes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/FastTree/Resources/checkbox_yes.png -------------------------------------------------------------------------------- /FastTree/Resources/collapse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/FastTree/Resources/collapse.png -------------------------------------------------------------------------------- /FastTree/Resources/default_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/FastTree/Resources/default_icon.png -------------------------------------------------------------------------------- /FastTree/Resources/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/FastTree/Resources/empty.png -------------------------------------------------------------------------------- /FastTree/Resources/expand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/FastTree/Resources/expand.png -------------------------------------------------------------------------------- /FastTree/obj/Debug/FastTree.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Projects_CSharp\FastTree\FastTree\bin\Debug\FastTree.dll 2 | C:\Projects_CSharp\FastTree\FastTree\bin\Debug\FastTree.pdb 3 | C:\Projects_CSharp\FastTree\FastTree\obj\Debug\FastTreeNS.FastListBase.resources 4 | C:\Projects_CSharp\FastTree\FastTree\obj\Debug\FastTreeNS.Resources.resources 5 | C:\Projects_CSharp\FastTree\FastTree\obj\Debug\FastTree.csproj.GenerateResource.Cache 6 | C:\Projects_CSharp\FastTree\FastTree\obj\Debug\FastTree.dll 7 | C:\Projects_CSharp\FastTree\FastTree\obj\Debug\FastTree.pdb 8 | C:\Projects_CSharp\FastTree\FastTree\obj\Debug\FastTree.csprojResolveAssemblyReference.cache 9 | -------------------------------------------------------------------------------- /FastTree/obj/Debug/FastTreeNS.FastListBase.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/FastTree/obj/Debug/FastTreeNS.FastListBase.resources -------------------------------------------------------------------------------- /FastTree/obj/Debug/FastTreeNS.Resources.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/FastTree/obj/Debug/FastTreeNS.Resources.resources -------------------------------------------------------------------------------- /FastTree/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/FastTree/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /FastTree/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/FastTree/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /FastTree/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/FastTree/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | FastTree and FastList 2 | ======== 3 | 4 | These components are designed to replace standard TreeView, ListBox and CheckedListBox in virtual mode. 5 | Components have ample opportunity to fine-tuning, they are fast and reliable. 6 | 7 | Features: 8 | 9 | * Virtual mode 10 | * Multiselection 11 | * Icons, Checkboxes 12 | * DragAndDrop 13 | * Node customizing (color, height, visibility, text, indenting, icon, checkbox, etc) 14 | * Wide set of events: permitting events (e.g. *CanUnselectNodeNeeded*), data events (e.g. *NodeTextNeeded*), state events (e.g. *NodeSelectedStateChanged*), drag&drop events and other. 15 | 16 | Screenshots: 17 | 18 | ![ScreenShot](https://raw.github.com/PavelTorgashov/FastTree/master/1.png) 19 | ![ScreenShot](https://raw.github.com/PavelTorgashov/FastTree/master/2.png) 20 | ![ScreenShot](https://raw.github.com/PavelTorgashov/FastTree/master/3.png) 21 | ![ScreenShot](https://raw.github.com/PavelTorgashov/FastTree/master/4.png) 22 | 23 | More details: http://www.codeproject.com/Articles/820415/FastTree-and-FastList 24 | 25 | Nuget package: https://www.nuget.org/packages/FastTree/ 26 | 27 | -------------------------------------------------------------------------------- /Tester/DataModel/Node.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Tester.DataModel 4 | { 5 | /// 6 | /// Warning!!! 7 | /// This class is needed only for demonstration of features of FastTree. 8 | /// In real life you need to use own class of your data model. 9 | /// 10 | public class Node : IEnumerable 11 | { 12 | public string Title { get; set; } 13 | public List Childs { get; private set; } 14 | public Node Parent { get; set; } 15 | 16 | public Node(string title = null) 17 | { 18 | Title = title; 19 | Childs = new List(); 20 | } 21 | 22 | public IEnumerator GetEnumerator() 23 | { 24 | return Childs.GetEnumerator(); 25 | } 26 | 27 | System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() 28 | { 29 | return Childs.GetEnumerator(); 30 | } 31 | 32 | public override string ToString() 33 | { 34 | return Title; 35 | } 36 | 37 | public bool IsChildOf(Node parent) 38 | { 39 | return parent == Parent || (Parent != null && Parent.IsChildOf(parent)); 40 | } 41 | 42 | public void AddChild(Node child) 43 | { 44 | Childs.Add(child); 45 | child.Parent = this; 46 | } 47 | 48 | public void InsertChild(Node child, int index) 49 | { 50 | Childs.Insert(index, child); 51 | child.Parent = this; 52 | } 53 | 54 | public void RemoveChild(Node child) 55 | { 56 | Childs.Remove(child); 57 | child.Parent = null; 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Tester/FastListCustomize.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Tester 2 | { 3 | partial class FastListCustomize 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FastListCustomize)); 33 | this.imageList1 = new System.Windows.Forms.ImageList(this.components); 34 | this.propertyGrid1 = new System.Windows.Forms.PropertyGrid(); 35 | this.fl = new FastTreeNS.FastList(); 36 | this.SuspendLayout(); 37 | // 38 | // imageList1 39 | // 40 | this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream"))); 41 | this.imageList1.TransparentColor = System.Drawing.Color.Transparent; 42 | this.imageList1.Images.SetKeyName(0, "folder.png"); 43 | this.imageList1.Images.SetKeyName(1, "play_button_blue_16_2.png"); 44 | // 45 | // propertyGrid1 46 | // 47 | this.propertyGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 48 | | System.Windows.Forms.AnchorStyles.Right))); 49 | this.propertyGrid1.Location = new System.Drawing.Point(446, 14); 50 | this.propertyGrid1.Name = "propertyGrid1"; 51 | this.propertyGrid1.PropertySort = System.Windows.Forms.PropertySort.Alphabetical; 52 | this.propertyGrid1.SelectedObject = this.fl; 53 | this.propertyGrid1.Size = new System.Drawing.Size(245, 416); 54 | this.propertyGrid1.TabIndex = 1; 55 | this.propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged); 56 | // 57 | // fl 58 | // 59 | this.fl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 60 | | System.Windows.Forms.AnchorStyles.Left) 61 | | System.Windows.Forms.AnchorStyles.Right))); 62 | this.fl.AutoScroll = true; 63 | this.fl.AutoScrollMinSize = new System.Drawing.Size(0, 200002); 64 | this.fl.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); 65 | this.fl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 66 | this.fl.FullItemSelect = true; 67 | this.fl.HotTracking = true; 68 | this.fl.HotTrackingColor = System.Drawing.Color.DarkSeaGreen; 69 | this.fl.ImageCheckBoxOff = ((System.Drawing.Image)(resources.GetObject("fl.ImageCheckBoxOff"))); 70 | this.fl.ImageCheckBoxOn = ((System.Drawing.Image)(resources.GetObject("fl.ImageCheckBoxOn"))); 71 | this.fl.ImageCollapse = ((System.Drawing.Image)(resources.GetObject("fl.ImageCollapse"))); 72 | this.fl.ImageDefaultIcon = ((System.Drawing.Image)(resources.GetObject("fl.ImageDefaultIcon"))); 73 | this.fl.ImageExpand = ((System.Drawing.Image)(resources.GetObject("fl.ImageExpand"))); 74 | this.fl.IsEditMode = false; 75 | this.fl.ItemCount = 10000; 76 | this.fl.ItemHeightDefault = 18; 77 | this.fl.ItemIndentDefault = 17; 78 | this.fl.Location = new System.Drawing.Point(12, 12); 79 | this.fl.MultiSelect = true; 80 | this.fl.Name = "fl"; 81 | this.fl.ShowIcons = true; 82 | this.fl.Size = new System.Drawing.Size(428, 418); 83 | this.fl.TabIndex = 0; 84 | this.fl.ItemHeightNeeded += new System.EventHandler(this.fl_ItemHeightNeeded); 85 | this.fl.ItemIndentNeeded += new System.EventHandler(this.fl_ItemIndentNeeded); 86 | this.fl.ItemTextNeeded += new System.EventHandler(this.fl_ItemTextNeeded); 87 | this.fl.ItemIconNeeded += new System.EventHandler(this.fl_ItemIconNeeded); 88 | this.fl.ItemBackColorNeeded += new System.EventHandler(this.fl_ItemBackColorNeeded); 89 | this.fl.ItemForeColorNeeded += new System.EventHandler(this.fl_ItemForeColorNeeded); 90 | this.fl.PaintItem += new System.EventHandler(this.fl_PaintItem); 91 | // 92 | // FastListCustomize 93 | // 94 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 95 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 96 | this.ClientSize = new System.Drawing.Size(703, 442); 97 | this.Controls.Add(this.propertyGrid1); 98 | this.Controls.Add(this.fl); 99 | this.Name = "FastListCustomize"; 100 | this.Text = "FastListCustomize"; 101 | this.ResumeLayout(false); 102 | 103 | } 104 | 105 | #endregion 106 | 107 | private FastTreeNS.FastList fl; 108 | private System.Windows.Forms.PropertyGrid propertyGrid1; 109 | private System.Windows.Forms.ImageList imageList1; 110 | } 111 | } -------------------------------------------------------------------------------- /Tester/FastListCustomize.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | 10 | namespace Tester 11 | { 12 | public partial class FastListCustomize : Form 13 | { 14 | public FastListCustomize() 15 | { 16 | InitializeComponent(); 17 | 18 | Application.Idle += (o, e) => fl.Invalidate(); 19 | } 20 | 21 | private void fl_ItemTextNeeded(object sender, FastTreeNS.StringItemEventArgs e) 22 | { 23 | if(e.ItemIndex == 0) 24 | e.Result = "Time " + DateTime.Now.TimeOfDay; 25 | else 26 | e.Result = "Item " + e.ItemIndex; 27 | } 28 | 29 | #region Routines 30 | 31 | private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) 32 | { 33 | (propertyGrid1.SelectedObject as Control).Invalidate(); 34 | } 35 | 36 | #endregion 37 | 38 | private void fl_ItemIndentNeeded(object sender, FastTreeNS.IntItemEventArgs e) 39 | { 40 | if (e.ItemIndex == 5) 41 | e.Result = 30; 42 | } 43 | 44 | private void fl_ItemHeightNeeded(object sender, FastTreeNS.IntItemEventArgs e) 45 | { 46 | if (e.ItemIndex == 10) 47 | e.Result = 40; 48 | } 49 | 50 | private void fl_ItemForeColorNeeded(object sender, FastTreeNS.ColorItemEventArgs e) 51 | { 52 | if (e.ItemIndex == 1) 53 | e.Result = Color.Red; 54 | if (e.ItemIndex == 10) 55 | e.Result = Color.White; 56 | } 57 | 58 | private void fl_ItemBackColorNeeded(object sender, FastTreeNS.ColorItemEventArgs e) 59 | { 60 | if (e.ItemIndex == 10) 61 | e.Result = Color.SteelBlue; 62 | if(e.ItemIndex == 8) 63 | e.Result = DateTime.Now.Millisecond > 500 ? Color.Transparent : Color.Tomato; 64 | } 65 | 66 | private void fl_ItemIconNeeded(object sender, FastTreeNS.ImageItemEventArgs e) 67 | { 68 | if(e.ItemIndex == 1) 69 | e.Result = DateTime.Now.Millisecond > 500 ? null : imageList1.Images[0]; 70 | } 71 | 72 | private void fl_PaintItem(object sender, FastTreeNS.PaintItemContentEventArgs e) 73 | { 74 | if (e.Info.ItemIndex > 12 && e.Info.ItemIndex < 16) 75 | { 76 | //draw default background 77 | fl.DrawItemBackgound(e.Graphics, e.Info); 78 | //draw default selection 79 | if (fl.SelectedItemIndexes.Contains(e.Info.ItemIndex)) 80 | fl.DrawSelection(e.Graphics, e.Info); 81 | //draw icon 82 | fl.DrawItemIcons(e.Graphics, e.Info); 83 | //draw custom bold text 84 | using (var font = new Font(Font, FontStyle.Bold)) 85 | e.Graphics.DrawString(e.Info.Text, font, Brushes.Black, e.Info.TextRect); 86 | }else 87 | if (e.Info.ItemIndex == 18) 88 | { 89 | //draw whole item 90 | fl.DrawItemWhole(e.Graphics, e.Info); 91 | //draw border 92 | e.Graphics.DrawRectangle(Pens.Gray, e.Info.TextAndIconRect); 93 | }else 94 | if (e.Info.ItemIndex == 3) 95 | { 96 | //draw whole item 97 | fl.DrawItemWhole(e.Graphics, e.Info); 98 | //draw second icon 99 | e.Graphics.DrawImage(imageList1.Images[1], new Point(e.Info.X - 16, e.Info.Rect.Top)); 100 | } 101 | else 102 | //default drawing 103 | fl.DrawItemWhole(e.Graphics, e.Info); 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /Tester/FastListDragItemSample.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Tester 2 | { 3 | partial class FastListDragItemSample 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FastListDragItemSample)); 32 | this.propertyGrid1 = new System.Windows.Forms.PropertyGrid(); 33 | this.fl = new FastTreeNS.FastList(); 34 | this.lb = new System.Windows.Forms.Label(); 35 | this.SuspendLayout(); 36 | // 37 | // propertyGrid1 38 | // 39 | this.propertyGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 40 | | System.Windows.Forms.AnchorStyles.Right))); 41 | this.propertyGrid1.Location = new System.Drawing.Point(446, 119); 42 | this.propertyGrid1.Name = "propertyGrid1"; 43 | this.propertyGrid1.PropertySort = System.Windows.Forms.PropertySort.Alphabetical; 44 | this.propertyGrid1.SelectedObject = this.fl; 45 | this.propertyGrid1.Size = new System.Drawing.Size(245, 311); 46 | this.propertyGrid1.TabIndex = 1; 47 | this.propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged); 48 | // 49 | // fl 50 | // 51 | this.fl.AllowDragItems = true; 52 | this.fl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 53 | | System.Windows.Forms.AnchorStyles.Left) 54 | | System.Windows.Forms.AnchorStyles.Right))); 55 | this.fl.AutoScroll = true; 56 | this.fl.AutoScrollMinSize = new System.Drawing.Size(0, 2002); 57 | this.fl.BackColor = System.Drawing.SystemColors.Window; 58 | this.fl.ImageCheckBoxOff = ((System.Drawing.Image)(resources.GetObject("fl.ImageCheckBoxOff"))); 59 | this.fl.ImageCheckBoxOn = ((System.Drawing.Image)(resources.GetObject("fl.ImageCheckBoxOn"))); 60 | this.fl.ImageCollapse = ((System.Drawing.Image)(resources.GetObject("fl.ImageCollapse"))); 61 | this.fl.ImageDefaultIcon = ((System.Drawing.Image)(resources.GetObject("fl.ImageDefaultIcon"))); 62 | this.fl.ImageExpand = ((System.Drawing.Image)(resources.GetObject("fl.ImageExpand"))); 63 | this.fl.IsEditMode = false; 64 | this.fl.ItemCount = 100; 65 | this.fl.Location = new System.Drawing.Point(12, 12); 66 | this.fl.MultiSelect = true; 67 | this.fl.Name = "fl"; 68 | this.fl.ShowIcons = true; 69 | this.fl.Size = new System.Drawing.Size(428, 418); 70 | this.fl.TabIndex = 0; 71 | this.fl.ItemTextNeeded += new System.EventHandler(this.fl_ItemTextNeeded); 72 | this.fl.ItemDrag += new System.EventHandler(this.fl_ItemDrag); 73 | // 74 | // lb 75 | // 76 | this.lb.AllowDrop = true; 77 | this.lb.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 78 | this.lb.BackColor = System.Drawing.Color.WhiteSmoke; 79 | this.lb.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 80 | this.lb.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); 81 | this.lb.ForeColor = System.Drawing.Color.Gray; 82 | this.lb.Location = new System.Drawing.Point(446, 12); 83 | this.lb.Name = "lb"; 84 | this.lb.Size = new System.Drawing.Size(245, 94); 85 | this.lb.TabIndex = 2; 86 | this.lb.Text = "Drag items here"; 87 | this.lb.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 88 | this.lb.DragDrop += new System.Windows.Forms.DragEventHandler(this.lb_DragDrop); 89 | this.lb.DragEnter += new System.Windows.Forms.DragEventHandler(this.lb_DragEnter); 90 | // 91 | // FastListDragItemSample 92 | // 93 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 94 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 95 | this.ClientSize = new System.Drawing.Size(703, 442); 96 | this.Controls.Add(this.lb); 97 | this.Controls.Add(this.propertyGrid1); 98 | this.Controls.Add(this.fl); 99 | this.Name = "FastListDragItemSample"; 100 | this.Text = "FastListDragItemSample"; 101 | this.ResumeLayout(false); 102 | 103 | } 104 | 105 | #endregion 106 | 107 | private FastTreeNS.FastList fl; 108 | private System.Windows.Forms.PropertyGrid propertyGrid1; 109 | private System.Windows.Forms.Label lb; 110 | } 111 | } -------------------------------------------------------------------------------- /Tester/FastListDragItemSample.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | 10 | namespace Tester 11 | { 12 | public partial class FastListDragItemSample : Form 13 | { 14 | public FastListDragItemSample() 15 | { 16 | InitializeComponent(); 17 | 18 | fl.ItemCount = 1000000; 19 | } 20 | 21 | private void fl_ItemTextNeeded(object sender, FastTreeNS.StringItemEventArgs e) 22 | { 23 | e.Result = "Item " + e.ItemIndex; 24 | } 25 | 26 | private void fl_ItemDrag(object sender, FastTreeNS.ItemDragEventArgs e) 27 | { 28 | fl.DoDragDrop(e.ItemIndex, DragDropEffects.Copy); 29 | } 30 | 31 | private void lb_DragDrop(object sender, DragEventArgs e) 32 | { 33 | var itemIndex = e.Data.GetData(typeof (HashSet)) as HashSet; 34 | 35 | lb.Text = itemIndex.Aggregate("", (s, i) => s + i + ";"); 36 | } 37 | 38 | private void lb_DragEnter(object sender, DragEventArgs e) 39 | { 40 | e.Effect = DragDropEffects.All; 41 | } 42 | 43 | #region Routines 44 | 45 | private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) 46 | { 47 | (propertyGrid1.SelectedObject as Control).Invalidate(); 48 | } 49 | 50 | #endregion 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Tester/FastListDropItemSample.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Tester 2 | { 3 | partial class FastListDropItemSample 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FastListDropItemSample)); 32 | this.propertyGrid1 = new System.Windows.Forms.PropertyGrid(); 33 | this.fl = new FastTreeNS.FastList(); 34 | this.lbRegular = new System.Windows.Forms.Label(); 35 | this.label1 = new System.Windows.Forms.Label(); 36 | this.lbAfter13 = new System.Windows.Forms.Label(); 37 | this.lbReplace = new System.Windows.Forms.Label(); 38 | this.lbEndOfList = new System.Windows.Forms.Label(); 39 | this.SuspendLayout(); 40 | // 41 | // propertyGrid1 42 | // 43 | this.propertyGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 44 | | System.Windows.Forms.AnchorStyles.Right))); 45 | this.propertyGrid1.Location = new System.Drawing.Point(446, 12); 46 | this.propertyGrid1.Name = "propertyGrid1"; 47 | this.propertyGrid1.PropertySort = System.Windows.Forms.PropertySort.Alphabetical; 48 | this.propertyGrid1.SelectedObject = this.fl; 49 | this.propertyGrid1.Size = new System.Drawing.Size(245, 418); 50 | this.propertyGrid1.TabIndex = 1; 51 | this.propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged); 52 | // 53 | // fl 54 | // 55 | this.fl.AllowDrop = true; 56 | this.fl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 57 | | System.Windows.Forms.AnchorStyles.Left) 58 | | System.Windows.Forms.AnchorStyles.Right))); 59 | this.fl.AutoScroll = true; 60 | this.fl.AutoScrollMinSize = new System.Drawing.Size(0, 2002); 61 | this.fl.BackColor = System.Drawing.SystemColors.Window; 62 | this.fl.ImageCheckBoxOff = ((System.Drawing.Image)(resources.GetObject("fl.ImageCheckBoxOff"))); 63 | this.fl.ImageCheckBoxOn = ((System.Drawing.Image)(resources.GetObject("fl.ImageCheckBoxOn"))); 64 | this.fl.ImageCollapse = ((System.Drawing.Image)(resources.GetObject("fl.ImageCollapse"))); 65 | this.fl.ImageDefaultIcon = ((System.Drawing.Image)(resources.GetObject("fl.ImageDefaultIcon"))); 66 | this.fl.ImageExpand = ((System.Drawing.Image)(resources.GetObject("fl.ImageExpand"))); 67 | this.fl.IsEditMode = false; 68 | this.fl.ItemCount = 100; 69 | this.fl.Location = new System.Drawing.Point(176, 12); 70 | this.fl.MultiSelect = true; 71 | this.fl.Name = "fl"; 72 | this.fl.ShowIcons = true; 73 | this.fl.Size = new System.Drawing.Size(264, 418); 74 | this.fl.TabIndex = 0; 75 | this.fl.ItemTextNeeded += new System.EventHandler(this.fl_ItemTextNeeded); 76 | this.fl.DragOverItem += new System.EventHandler(this.fl_DragOverItem); 77 | this.fl.DropOverItem += new System.EventHandler(this.fl_DropOverItem); 78 | // 79 | // lbRegular 80 | // 81 | this.lbRegular.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255))))); 82 | this.lbRegular.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 83 | this.lbRegular.Location = new System.Drawing.Point(12, 65); 84 | this.lbRegular.Name = "lbRegular"; 85 | this.lbRegular.Size = new System.Drawing.Size(151, 34); 86 | this.lbRegular.TabIndex = 2; 87 | this.lbRegular.Text = "This label can be inserted anywhere"; 88 | this.lbRegular.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 89 | this.lbRegular.MouseMove += new System.Windows.Forms.MouseEventHandler(this.lb_MouseMove); 90 | // 91 | // label1 92 | // 93 | this.label1.AutoSize = true; 94 | this.label1.Location = new System.Drawing.Point(12, 37); 95 | this.label1.Name = "label1"; 96 | this.label1.Size = new System.Drawing.Size(151, 13); 97 | this.label1.TabIndex = 3; 98 | this.label1.Text = "Drag these labels into FastList:"; 99 | // 100 | // lbAfter13 101 | // 102 | this.lbAfter13.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255))))); 103 | this.lbAfter13.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 104 | this.lbAfter13.Location = new System.Drawing.Point(12, 113); 105 | this.lbAfter13.Name = "lbAfter13"; 106 | this.lbAfter13.Size = new System.Drawing.Size(151, 34); 107 | this.lbAfter13.TabIndex = 4; 108 | this.lbAfter13.Text = "This label can be inserted only after Item 13"; 109 | this.lbAfter13.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 110 | this.lbAfter13.MouseMove += new System.Windows.Forms.MouseEventHandler(this.lb_MouseMove); 111 | // 112 | // lbReplace 113 | // 114 | this.lbReplace.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255))))); 115 | this.lbReplace.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 116 | this.lbReplace.Location = new System.Drawing.Point(12, 162); 117 | this.lbReplace.Name = "lbReplace"; 118 | this.lbReplace.Size = new System.Drawing.Size(151, 34); 119 | this.lbReplace.TabIndex = 5; 120 | this.lbReplace.Text = "This label always replaces items"; 121 | this.lbReplace.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 122 | this.lbReplace.MouseMove += new System.Windows.Forms.MouseEventHandler(this.lb_MouseMove); 123 | // 124 | // lbEndOfList 125 | // 126 | this.lbEndOfList.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255))))); 127 | this.lbEndOfList.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 128 | this.lbEndOfList.Location = new System.Drawing.Point(12, 210); 129 | this.lbEndOfList.Name = "lbEndOfList"; 130 | this.lbEndOfList.Size = new System.Drawing.Size(151, 34); 131 | this.lbEndOfList.TabIndex = 6; 132 | this.lbEndOfList.Text = "This label will be added at end of list"; 133 | this.lbEndOfList.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 134 | this.lbEndOfList.MouseMove += new System.Windows.Forms.MouseEventHandler(this.lb_MouseMove); 135 | // 136 | // FastListDropItemSample 137 | // 138 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 139 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 140 | this.ClientSize = new System.Drawing.Size(703, 442); 141 | this.Controls.Add(this.lbEndOfList); 142 | this.Controls.Add(this.lbReplace); 143 | this.Controls.Add(this.lbAfter13); 144 | this.Controls.Add(this.label1); 145 | this.Controls.Add(this.lbRegular); 146 | this.Controls.Add(this.propertyGrid1); 147 | this.Controls.Add(this.fl); 148 | this.Name = "FastListDropItemSample"; 149 | this.Text = "FastListDropItemSample"; 150 | this.ResumeLayout(false); 151 | this.PerformLayout(); 152 | 153 | } 154 | 155 | #endregion 156 | 157 | private FastTreeNS.FastList fl; 158 | private System.Windows.Forms.PropertyGrid propertyGrid1; 159 | private System.Windows.Forms.Label lbRegular; 160 | private System.Windows.Forms.Label label1; 161 | private System.Windows.Forms.Label lbAfter13; 162 | private System.Windows.Forms.Label lbReplace; 163 | private System.Windows.Forms.Label lbEndOfList; 164 | } 165 | } -------------------------------------------------------------------------------- /Tester/FastListDropItemSample.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | using FastTreeNS; 10 | 11 | namespace Tester 12 | { 13 | public partial class FastListDropItemSample : Form 14 | { 15 | private List list; 16 | 17 | public FastListDropItemSample() 18 | { 19 | InitializeComponent(); 20 | 21 | CreateList(); 22 | 23 | fl.ItemCount = list.Count; 24 | } 25 | 26 | private void CreateList() 27 | { 28 | list = new List(); 29 | 30 | for (int i = 0; i < 1000; i++) 31 | list.Add("Item " + i); 32 | } 33 | 34 | private void fl_ItemTextNeeded(object sender, FastTreeNS.StringItemEventArgs e) 35 | { 36 | e.Result = list[e.ItemIndex]; 37 | } 38 | 39 | private void lb_MouseMove(object sender, MouseEventArgs e) 40 | { 41 | if (e.Button == MouseButtons.Left) 42 | (sender as Label).DoDragDrop(sender, DragDropEffects.All); 43 | } 44 | 45 | private void fl_DragOverItem(object sender, DragOverItemEventArgs e) 46 | { 47 | var lb = e.Data.GetData(typeof (Label)) as Label; 48 | 49 | if (lb == lbRegular) 50 | { 51 | e.Effect = e.AllowedEffect; 52 | return; 53 | } 54 | 55 | if (lb == lbAfter13 && list[e.ItemIndex] == "Item 13") 56 | { 57 | e.Effect = e.AllowedEffect; 58 | e.InsertEffect = InsertEffect.InsertAfter; 59 | return; 60 | } 61 | 62 | if (lb == lbEndOfList) 63 | { 64 | e.Effect = e.AllowedEffect; 65 | e.InsertEffect = InsertEffect.InsertAfter; 66 | e.ItemIndex = list.Count - 1; 67 | return; 68 | } 69 | 70 | if (lb == lbReplace) 71 | { 72 | e.Effect = DragDropEffects.Move; 73 | e.InsertEffect = InsertEffect.Replace; 74 | return; 75 | } 76 | 77 | e.Effect = DragDropEffects.None; 78 | } 79 | 80 | private void fl_DropOverItem(object sender, DragOverItemEventArgs e) 81 | { 82 | var text = (e.Data.GetData(typeof(Label)) as Label).Text; 83 | 84 | switch(e.InsertEffect) 85 | { 86 | case InsertEffect.InsertBefore: 87 | list.Insert(e.ItemIndex, text); 88 | fl.ItemCount = list.Count; 89 | break; 90 | case InsertEffect.InsertAfter: 91 | list.Insert(e.ItemIndex + 1, text); 92 | fl.ItemCount = list.Count; 93 | break; 94 | case InsertEffect.Replace: 95 | if (MessageBox.Show("Are you sure to replace item?", "Replace", MessageBoxButtons.OKCancel) == DialogResult.OK) 96 | { 97 | list[e.ItemIndex] = text; 98 | fl.Invalidate(); 99 | } 100 | break; 101 | } 102 | } 103 | 104 | #region Routines 105 | 106 | private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) 107 | { 108 | (propertyGrid1.SelectedObject as Control).Invalidate(); 109 | } 110 | 111 | #endregion 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /Tester/FastListExpandedSample.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Tester 2 | { 3 | partial class FastListExpandedSample 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FastListExpandedSample)); 32 | this.propertyGrid1 = new System.Windows.Forms.PropertyGrid(); 33 | this.fl = new FastTreeNS.FastList(); 34 | this.SuspendLayout(); 35 | // 36 | // propertyGrid1 37 | // 38 | this.propertyGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 39 | | System.Windows.Forms.AnchorStyles.Right))); 40 | this.propertyGrid1.Location = new System.Drawing.Point(446, 14); 41 | this.propertyGrid1.Name = "propertyGrid1"; 42 | this.propertyGrid1.PropertySort = System.Windows.Forms.PropertySort.Alphabetical; 43 | this.propertyGrid1.SelectedObject = this.fl; 44 | this.propertyGrid1.Size = new System.Drawing.Size(245, 416); 45 | this.propertyGrid1.TabIndex = 1; 46 | this.propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged); 47 | // 48 | // fl 49 | // 50 | this.fl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 51 | | System.Windows.Forms.AnchorStyles.Left) 52 | | System.Windows.Forms.AnchorStyles.Right))); 53 | this.fl.AutoScroll = true; 54 | this.fl.AutoScrollMinSize = new System.Drawing.Size(0, 2002); 55 | this.fl.BackColor = System.Drawing.SystemColors.Window; 56 | this.fl.ImageCheckBoxOff = ((System.Drawing.Image)(resources.GetObject("fl.ImageCheckBoxOff"))); 57 | this.fl.ImageCheckBoxOn = ((System.Drawing.Image)(resources.GetObject("fl.ImageCheckBoxOn"))); 58 | this.fl.ImageCollapse = ((System.Drawing.Image)(resources.GetObject("fl.ImageCollapse"))); 59 | this.fl.ImageDefaultIcon = ((System.Drawing.Image)(resources.GetObject("fl.ImageDefaultIcon"))); 60 | this.fl.ImageExpand = ((System.Drawing.Image)(resources.GetObject("fl.ImageExpand"))); 61 | this.fl.IsEditMode = false; 62 | this.fl.ItemCount = 100; 63 | this.fl.Location = new System.Drawing.Point(12, 12); 64 | this.fl.Name = "fl"; 65 | this.fl.ShowExpandBoxes = true; 66 | this.fl.Size = new System.Drawing.Size(428, 418); 67 | this.fl.TabIndex = 0; 68 | this.fl.ItemHeightNeeded += new System.EventHandler(this.fl_ItemHeightNeeded); 69 | this.fl.ItemExpandedNeeded += new System.EventHandler(this.fl_ItemExpandedNeeded); 70 | this.fl.ItemExpandedStateChanged += new System.EventHandler(this.fl_ItemExpandedStateChanged); 71 | this.fl.PaintItem += new System.EventHandler(this.fl_PaintItemContent); 72 | // 73 | // FastListExpandedSample 74 | // 75 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 76 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 77 | this.ClientSize = new System.Drawing.Size(703, 442); 78 | this.Controls.Add(this.propertyGrid1); 79 | this.Controls.Add(this.fl); 80 | this.Name = "FastListExpandedSample"; 81 | this.Text = "FastListExpandedSample"; 82 | this.ResumeLayout(false); 83 | 84 | } 85 | 86 | #endregion 87 | 88 | private FastTreeNS.FastList fl; 89 | private System.Windows.Forms.PropertyGrid propertyGrid1; 90 | } 91 | } -------------------------------------------------------------------------------- /Tester/FastListExpandedSample.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | using FastTreeNS; 10 | 11 | namespace Tester 12 | { 13 | public partial class FastListExpandedSample : Form 14 | { 15 | private int expandedItemIndex = -1; 16 | 17 | public FastListExpandedSample() 18 | { 19 | InitializeComponent(); 20 | 21 | fl.ItemCount = 100000; 22 | } 23 | 24 | #region Routines 25 | 26 | private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) 27 | { 28 | (propertyGrid1.SelectedObject as Control).Invalidate(); 29 | } 30 | 31 | #endregion 32 | 33 | private void fl_ItemExpandedStateChanged(object sender, FastTreeNS.ItemExpandedStateChangedEventArgs e) 34 | { 35 | expandedItemIndex = e.Expanded ? e.ItemIndex : -1; 36 | fl.BuildNeeded(); 37 | } 38 | 39 | private void fl_ItemHeightNeeded(object sender, IntItemEventArgs e) 40 | { 41 | if (e.ItemIndex == expandedItemIndex) 42 | e.Result = 40; 43 | else 44 | e.Result = fl.ItemHeightDefault; 45 | } 46 | 47 | private void fl_PaintItemContent(object sender, PaintItemContentEventArgs e) 48 | { 49 | fl.DrawItemBackgound(e.Graphics, e.Info); 50 | fl.DrawItemIcons(e.Graphics, e.Info); 51 | 52 | if (e.Info.ItemIndex == expandedItemIndex) 53 | { 54 | //custom drawing 55 | var rect = new Rectangle(e.Info.X_Text, e.Info.Y, e.Info.X_End - e.Info.X_Text + 1, e.Info.Height); 56 | 57 | using (var brush = new SolidBrush(Color.WhiteSmoke)) 58 | e.Graphics.FillRectangle(brush, rect); 59 | 60 | using (var pen = new Pen(Color.Navy)) 61 | e.Graphics.DrawRectangle(pen, rect); 62 | 63 | using (var brush = new SolidBrush(e.Info.ForeColor)) 64 | { 65 | var text = string.Format("It is expanded block\r\nItemIndex: {0}\r\nY: {1} Height: {2}", e.Info.ItemIndex, e.Info.Y, e.Info.Height); 66 | e.Graphics.DrawString(text, fl.Font, brush, rect); 67 | } 68 | } 69 | else 70 | { 71 | //default drawing 72 | e.Info.Text = "Item " + e.Info.ItemIndex; 73 | fl.DrawItemContent(e.Graphics, e.Info); 74 | } 75 | } 76 | 77 | private void fl_ItemExpandedNeeded(object sender, BoolItemEventArgs e) 78 | { 79 | e.Result = e.ItemIndex == expandedItemIndex; 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /Tester/FastListReadonlyAndDisabledItemsSample.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Tester 2 | { 3 | partial class FastListReadonlyAndDisabledItemsSample 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FastListReadonlyAndDisabledItemsSample)); 32 | this.propertyGrid1 = new System.Windows.Forms.PropertyGrid(); 33 | this.fl = new FastTreeNS.FastList(); 34 | this.SuspendLayout(); 35 | // 36 | // propertyGrid1 37 | // 38 | this.propertyGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 39 | | System.Windows.Forms.AnchorStyles.Right))); 40 | this.propertyGrid1.Location = new System.Drawing.Point(446, 12); 41 | this.propertyGrid1.Name = "propertyGrid1"; 42 | this.propertyGrid1.PropertySort = System.Windows.Forms.PropertySort.Alphabetical; 43 | this.propertyGrid1.SelectedObject = this.fl; 44 | this.propertyGrid1.Size = new System.Drawing.Size(245, 418); 45 | this.propertyGrid1.TabIndex = 1; 46 | this.propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged); 47 | // 48 | // fl 49 | // 50 | this.fl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 51 | | System.Windows.Forms.AnchorStyles.Left) 52 | | System.Windows.Forms.AnchorStyles.Right))); 53 | this.fl.AutoScroll = true; 54 | this.fl.AutoScrollMinSize = new System.Drawing.Size(0, 1902); 55 | this.fl.BackColor = System.Drawing.SystemColors.Window; 56 | this.fl.FullItemSelect = true; 57 | this.fl.ImageCheckBoxOff = ((System.Drawing.Image)(resources.GetObject("fl.ImageCheckBoxOff"))); 58 | this.fl.ImageCheckBoxOn = ((System.Drawing.Image)(resources.GetObject("fl.ImageCheckBoxOn"))); 59 | this.fl.ImageCollapse = ((System.Drawing.Image)(resources.GetObject("fl.ImageCollapse"))); 60 | this.fl.ImageDefaultIcon = ((System.Drawing.Image)(resources.GetObject("fl.ImageDefaultIcon"))); 61 | this.fl.ImageEmptyExpand = ((System.Drawing.Image)(resources.GetObject("fl.ImageEmptyExpand"))); 62 | this.fl.ImageExpand = ((System.Drawing.Image)(resources.GetObject("fl.ImageExpand"))); 63 | this.fl.IsEditMode = false; 64 | this.fl.ItemCount = 100; 65 | this.fl.Location = new System.Drawing.Point(12, 12); 66 | this.fl.MultiSelect = true; 67 | this.fl.Name = "fl"; 68 | this.fl.ShowCheckBoxes = true; 69 | this.fl.Size = new System.Drawing.Size(428, 418); 70 | this.fl.TabIndex = 0; 71 | this.fl.ItemTextNeeded += new System.EventHandler(this.fl_ItemTextNeeded); 72 | this.fl.ItemForeColorNeeded += new System.EventHandler(this.fl_ItemForeColorNeeded); 73 | this.fl.CanUnselectItemNeeded += new System.EventHandler(this.fl_CanSelectItemNeeded); 74 | this.fl.CanSelectItemNeeded += new System.EventHandler(this.fl_CanSelectItemNeeded); 75 | this.fl.CanUncheckItemNeeded += new System.EventHandler(this.fl_CanCheckItemNeeded); 76 | this.fl.CanCheckItemNeeded += new System.EventHandler(this.fl_CanCheckItemNeeded); 77 | this.fl.CanExpandItemNeeded += new System.EventHandler(this.fl_CanSelectItemNeeded); 78 | this.fl.CanCollapseItemNeeded += new System.EventHandler(this.fl_CanSelectItemNeeded); 79 | this.fl.CanEditItemNeeded += new System.EventHandler(this.fl_CanEditItemNeeded); 80 | // 81 | // FastListReadonlyAndDisabledItemsSample 82 | // 83 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 84 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 85 | this.ClientSize = new System.Drawing.Size(703, 442); 86 | this.Controls.Add(this.propertyGrid1); 87 | this.Controls.Add(this.fl); 88 | this.Name = "FastListReadonlyAndDisabledItemsSample"; 89 | this.Text = "FastListReadonlyAndDisabledItemsSample"; 90 | this.ResumeLayout(false); 91 | 92 | } 93 | 94 | #endregion 95 | 96 | private FastTreeNS.FastList fl; 97 | private System.Windows.Forms.PropertyGrid propertyGrid1; 98 | } 99 | } -------------------------------------------------------------------------------- /Tester/FastListReadonlyAndDisabledItemsSample.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | 10 | namespace Tester 11 | { 12 | public partial class FastListReadonlyAndDisabledItemsSample : Form 13 | { 14 | public FastListReadonlyAndDisabledItemsSample() 15 | { 16 | InitializeComponent(); 17 | 18 | fl.ItemCount = 1000000; 19 | } 20 | 21 | private void fl_ItemTextNeeded(object sender, FastTreeNS.StringItemEventArgs e) 22 | { 23 | switch(e.ItemIndex % 20) 24 | { 25 | case 5: e.Result = "Readonly item " + e.ItemIndex + ". You can not check/uncheck/edit this item."; break; 26 | case 15: e.Result = "Disabled item " + e.ItemIndex + ". You can not select this item."; break; 27 | default: e.Result = "Regular item " + e.ItemIndex; break; 28 | } 29 | } 30 | 31 | private void fl_CanCheckItemNeeded(object sender, FastTreeNS.BoolItemEventArgs e) 32 | { 33 | switch (e.ItemIndex % 20) 34 | { 35 | case 5: e.Result = false; break; 36 | case 15: e.Result = false; break; 37 | } 38 | } 39 | 40 | private void fl_CanEditItemNeeded(object sender, FastTreeNS.BoolItemEventArgs e) 41 | { 42 | switch (e.ItemIndex % 20) 43 | { 44 | case 5: e.Result = false; break; 45 | } 46 | } 47 | 48 | private void fl_CanSelectItemNeeded(object sender, FastTreeNS.BoolItemEventArgs e) 49 | { 50 | switch (e.ItemIndex % 20) 51 | { 52 | case 15: e.Result = false; break; 53 | } 54 | } 55 | 56 | #region Routines 57 | 58 | private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) 59 | { 60 | (propertyGrid1.SelectedObject as Control).Invalidate(); 61 | } 62 | 63 | #endregion 64 | 65 | private void fl_ItemForeColorNeeded(object sender, FastTreeNS.ColorItemEventArgs e) 66 | { 67 | switch (e.ItemIndex % 20) 68 | { 69 | case 5: e.Result = Color.Red; break; 70 | case 15: e.Result = Color.Silver; break; 71 | } 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Tester/FastListSimplestSample.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Tester 2 | { 3 | partial class FastListSimplestSample 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FastListSimplestSample)); 32 | this.propertyGrid1 = new System.Windows.Forms.PropertyGrid(); 33 | this.fl = new FastTreeNS.FastList(); 34 | this.SuspendLayout(); 35 | // 36 | // propertyGrid1 37 | // 38 | this.propertyGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 39 | | System.Windows.Forms.AnchorStyles.Right))); 40 | this.propertyGrid1.Location = new System.Drawing.Point(446, 14); 41 | this.propertyGrid1.Name = "propertyGrid1"; 42 | this.propertyGrid1.PropertySort = System.Windows.Forms.PropertySort.Alphabetical; 43 | this.propertyGrid1.SelectedObject = this.fl; 44 | this.propertyGrid1.Size = new System.Drawing.Size(245, 416); 45 | this.propertyGrid1.TabIndex = 1; 46 | this.propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged); 47 | // 48 | // fl 49 | // 50 | this.fl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 51 | | System.Windows.Forms.AnchorStyles.Left) 52 | | System.Windows.Forms.AnchorStyles.Right))); 53 | this.fl.AutoScroll = true; 54 | this.fl.AutoScrollMinSize = new System.Drawing.Size(0, 1902); 55 | this.fl.BackColor = System.Drawing.SystemColors.Window; 56 | this.fl.ImageCheckBoxOff = ((System.Drawing.Image)(resources.GetObject("fl.ImageCheckBoxOff"))); 57 | this.fl.ImageCheckBoxOn = ((System.Drawing.Image)(resources.GetObject("fl.ImageCheckBoxOn"))); 58 | this.fl.ImageCollapse = ((System.Drawing.Image)(resources.GetObject("fl.ImageCollapse"))); 59 | this.fl.ImageDefaultIcon = ((System.Drawing.Image)(resources.GetObject("fl.ImageDefaultIcon"))); 60 | this.fl.ImageExpand = ((System.Drawing.Image)(resources.GetObject("fl.ImageExpand"))); 61 | this.fl.IsEditMode = false; 62 | this.fl.ItemCount = 100; 63 | this.fl.Location = new System.Drawing.Point(12, 12); 64 | this.fl.MultiSelect = true; 65 | this.fl.Name = "fl"; 66 | this.fl.ShowCheckBoxes = true; 67 | this.fl.ShowIcons = true; 68 | this.fl.Size = new System.Drawing.Size(428, 418); 69 | this.fl.TabIndex = 0; 70 | this.fl.ItemTextNeeded += new System.EventHandler(this.fl_ItemTextNeeded); 71 | // 72 | // FastListSimplestSample 73 | // 74 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 75 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 76 | this.ClientSize = new System.Drawing.Size(703, 442); 77 | this.Controls.Add(this.propertyGrid1); 78 | this.Controls.Add(this.fl); 79 | this.Name = "FastListSimplestSample"; 80 | this.Text = "FastListSimplestSample"; 81 | this.ResumeLayout(false); 82 | 83 | } 84 | 85 | #endregion 86 | 87 | private FastTreeNS.FastList fl; 88 | private System.Windows.Forms.PropertyGrid propertyGrid1; 89 | } 90 | } -------------------------------------------------------------------------------- /Tester/FastListSimplestSample.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | 10 | namespace Tester 11 | { 12 | public partial class FastListSimplestSample : Form 13 | { 14 | private List list; 15 | 16 | public FastListSimplestSample() 17 | { 18 | InitializeComponent(); 19 | 20 | CreateList(); 21 | 22 | fl.ItemCount = list.Count; 23 | } 24 | 25 | private void CreateList() 26 | { 27 | list = new List(); 28 | 29 | for (int i = 0; i < 100000; i++) 30 | list.Add("Item " + i); 31 | } 32 | 33 | private void fl_ItemTextNeeded(object sender, FastTreeNS.StringItemEventArgs e) 34 | { 35 | e.Result = list[e.ItemIndex]; 36 | } 37 | 38 | #region Routines 39 | 40 | private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) 41 | { 42 | (propertyGrid1.SelectedObject as Control).Invalidate(); 43 | } 44 | 45 | #endregion 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Tester/FastListStressTest.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Tester 2 | { 3 | partial class FastListStressTest 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FastListStressTest)); 32 | this.propertyGrid1 = new System.Windows.Forms.PropertyGrid(); 33 | this.fl = new FastTreeNS.FastList(); 34 | this.SuspendLayout(); 35 | // 36 | // propertyGrid1 37 | // 38 | this.propertyGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 39 | | System.Windows.Forms.AnchorStyles.Right))); 40 | this.propertyGrid1.Location = new System.Drawing.Point(446, 14); 41 | this.propertyGrid1.Name = "propertyGrid1"; 42 | this.propertyGrid1.PropertySort = System.Windows.Forms.PropertySort.Alphabetical; 43 | this.propertyGrid1.SelectedObject = this.fl; 44 | this.propertyGrid1.Size = new System.Drawing.Size(245, 416); 45 | this.propertyGrid1.TabIndex = 1; 46 | this.propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged); 47 | // 48 | // fl 49 | // 50 | this.fl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 51 | | System.Windows.Forms.AnchorStyles.Left) 52 | | System.Windows.Forms.AnchorStyles.Right))); 53 | this.fl.AutoScroll = true; 54 | this.fl.AutoScrollMinSize = new System.Drawing.Size(0, 1900000002); 55 | this.fl.BackColor = System.Drawing.SystemColors.Window; 56 | this.fl.ImageCheckBoxOff = ((System.Drawing.Image)(resources.GetObject("fl.ImageCheckBoxOff"))); 57 | this.fl.ImageCheckBoxOn = ((System.Drawing.Image)(resources.GetObject("fl.ImageCheckBoxOn"))); 58 | this.fl.ImageCollapse = ((System.Drawing.Image)(resources.GetObject("fl.ImageCollapse"))); 59 | this.fl.ImageDefaultIcon = ((System.Drawing.Image)(resources.GetObject("fl.ImageDefaultIcon"))); 60 | this.fl.ImageExpand = ((System.Drawing.Image)(resources.GetObject("fl.ImageExpand"))); 61 | this.fl.IsEditMode = false; 62 | this.fl.ItemCount = 100000000; 63 | this.fl.Location = new System.Drawing.Point(12, 12); 64 | this.fl.MultiSelect = true; 65 | this.fl.Name = "fl"; 66 | this.fl.ShowCheckBoxes = true; 67 | this.fl.ShowIcons = true; 68 | this.fl.Size = new System.Drawing.Size(428, 418); 69 | this.fl.TabIndex = 0; 70 | this.fl.ItemTextNeeded += new System.EventHandler(this.fl_ItemTextNeeded); 71 | // 72 | // FastListStressTest 73 | // 74 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 75 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 76 | this.ClientSize = new System.Drawing.Size(703, 442); 77 | this.Controls.Add(this.propertyGrid1); 78 | this.Controls.Add(this.fl); 79 | this.Name = "FastListStressTest"; 80 | this.Text = "FastListStressTest"; 81 | this.ResumeLayout(false); 82 | 83 | } 84 | 85 | #endregion 86 | 87 | private FastTreeNS.FastList fl; 88 | private System.Windows.Forms.PropertyGrid propertyGrid1; 89 | } 90 | } -------------------------------------------------------------------------------- /Tester/FastListStressTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | 10 | namespace Tester 11 | { 12 | public partial class FastListStressTest : Form 13 | { 14 | public FastListStressTest() 15 | { 16 | InitializeComponent(); 17 | } 18 | 19 | private void fl_ItemTextNeeded(object sender, FastTreeNS.StringItemEventArgs e) 20 | { 21 | e.Result = "Item " + e.ItemIndex; 22 | } 23 | 24 | #region Routines 25 | 26 | private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) 27 | { 28 | (propertyGrid1.SelectedObject as Control).Invalidate(); 29 | } 30 | 31 | #endregion 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Tester/FastListVirtualCheckboxesSample.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Tester 2 | { 3 | partial class FastListVirtualCheckboxesSample 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FastListVirtualCheckboxesSample)); 32 | this.propertyGrid1 = new System.Windows.Forms.PropertyGrid(); 33 | this.fl = new FastTreeNS.FastList(); 34 | this.SuspendLayout(); 35 | // 36 | // propertyGrid1 37 | // 38 | this.propertyGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 39 | | System.Windows.Forms.AnchorStyles.Right))); 40 | this.propertyGrid1.Location = new System.Drawing.Point(446, 14); 41 | this.propertyGrid1.Name = "propertyGrid1"; 42 | this.propertyGrid1.PropertySort = System.Windows.Forms.PropertySort.Alphabetical; 43 | this.propertyGrid1.SelectedObject = this.fl; 44 | this.propertyGrid1.Size = new System.Drawing.Size(245, 416); 45 | this.propertyGrid1.TabIndex = 1; 46 | this.propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged); 47 | // 48 | // fl 49 | // 50 | this.fl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 51 | | System.Windows.Forms.AnchorStyles.Left) 52 | | System.Windows.Forms.AnchorStyles.Right))); 53 | this.fl.AutoScroll = true; 54 | this.fl.AutoScrollMinSize = new System.Drawing.Size(0, 1902); 55 | this.fl.BackColor = System.Drawing.SystemColors.Window; 56 | this.fl.ImageCheckBoxOff = ((System.Drawing.Image)(resources.GetObject("fl.ImageCheckBoxOff"))); 57 | this.fl.ImageCheckBoxOn = ((System.Drawing.Image)(resources.GetObject("fl.ImageCheckBoxOn"))); 58 | this.fl.ImageCollapse = ((System.Drawing.Image)(resources.GetObject("fl.ImageCollapse"))); 59 | this.fl.ImageDefaultIcon = ((System.Drawing.Image)(resources.GetObject("fl.ImageDefaultIcon"))); 60 | this.fl.ImageExpand = ((System.Drawing.Image)(resources.GetObject("fl.ImageExpand"))); 61 | this.fl.IsEditMode = false; 62 | this.fl.ItemCount = 100; 63 | this.fl.Location = new System.Drawing.Point(12, 12); 64 | this.fl.MultiSelect = true; 65 | this.fl.Name = "fl"; 66 | this.fl.ShowCheckBoxes = true; 67 | this.fl.ShowIcons = true; 68 | this.fl.Size = new System.Drawing.Size(428, 418); 69 | this.fl.TabIndex = 0; 70 | this.fl.ItemTextNeeded += new System.EventHandler(this.fl_ItemTextNeeded); 71 | this.fl.ItemCheckStateNeeded += new System.EventHandler(this.fl_ItemCheckStateNeeded); 72 | this.fl.ItemCheckedStateChanged += new System.EventHandler(this.fl_ItemCheckedStateChanged); 73 | // 74 | // FastListVirtualCheckboxesSample 75 | // 76 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 77 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 78 | this.ClientSize = new System.Drawing.Size(703, 442); 79 | this.Controls.Add(this.propertyGrid1); 80 | this.Controls.Add(this.fl); 81 | this.Name = "FastListVirtualCheckboxesSample"; 82 | this.Text = "FastListVirtualCheckboxesSample"; 83 | this.ResumeLayout(false); 84 | 85 | } 86 | 87 | #endregion 88 | 89 | private FastTreeNS.FastList fl; 90 | private System.Windows.Forms.PropertyGrid propertyGrid1; 91 | } 92 | } -------------------------------------------------------------------------------- /Tester/FastListVirtualCheckboxesSample.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | 10 | namespace Tester 11 | { 12 | public partial class FastListVirtualCheckboxesSample : Form 13 | { 14 | private List list; 15 | 16 | public FastListVirtualCheckboxesSample() 17 | { 18 | InitializeComponent(); 19 | 20 | CreateList(); 21 | 22 | fl.ItemCount = list.Count; 23 | } 24 | 25 | private void CreateList() 26 | { 27 | list = new List(); 28 | 29 | for (int i = 0; i < 100000; i++) 30 | list.Add(new MyItem{Name = "Item " + i, Checked = (i % 3) == 0}); 31 | } 32 | 33 | private void fl_ItemTextNeeded(object sender, FastTreeNS.StringItemEventArgs e) 34 | { 35 | e.Result = list[e.ItemIndex].Name; 36 | } 37 | 38 | private void fl_ItemCheckStateNeeded(object sender, FastTreeNS.BoolItemEventArgs e) 39 | { 40 | e.Result = list[e.ItemIndex].Checked; 41 | } 42 | 43 | private void fl_ItemCheckedStateChanged(object sender, FastTreeNS.ItemCheckedStateChangedEventArgs e) 44 | { 45 | list[e.ItemIndex].Checked = e.Checked; 46 | } 47 | 48 | #region Routines 49 | 50 | private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) 51 | { 52 | (propertyGrid1.SelectedObject as Control).Invalidate(); 53 | } 54 | 55 | #endregion 56 | } 57 | 58 | class MyItem 59 | { 60 | public string Name; 61 | public bool Checked; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Tester/FastTreeDragAndDropSample.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Tester 2 | { 3 | partial class FastTreeDragAndDropSample 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FastTreeDragAndDropSample)); 32 | this.propertyGrid1 = new System.Windows.Forms.PropertyGrid(); 33 | this.ft = new FastTreeNS.FastTree(); 34 | this.SuspendLayout(); 35 | // 36 | // propertyGrid1 37 | // 38 | this.propertyGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 39 | | System.Windows.Forms.AnchorStyles.Right))); 40 | this.propertyGrid1.Location = new System.Drawing.Point(446, 14); 41 | this.propertyGrid1.Name = "propertyGrid1"; 42 | this.propertyGrid1.PropertySort = System.Windows.Forms.PropertySort.Alphabetical; 43 | this.propertyGrid1.SelectedObject = this.ft; 44 | this.propertyGrid1.Size = new System.Drawing.Size(245, 416); 45 | this.propertyGrid1.TabIndex = 1; 46 | this.propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged); 47 | // 48 | // ft 49 | // 50 | this.ft.AllowDragItems = true; 51 | this.ft.AllowDrop = true; 52 | this.ft.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 53 | | System.Windows.Forms.AnchorStyles.Left) 54 | | System.Windows.Forms.AnchorStyles.Right))); 55 | this.ft.AutoScroll = true; 56 | this.ft.AutoScrollMinSize = new System.Drawing.Size(0, 59); 57 | this.ft.BackColor = System.Drawing.SystemColors.Window; 58 | this.ft.IsEditMode = false; 59 | this.ft.Location = new System.Drawing.Point(12, 14); 60 | this.ft.MultiSelect = true; 61 | this.ft.Name = "ft"; 62 | this.ft.ShowExpandBoxes = true; 63 | this.ft.ShowIcons = true; 64 | this.ft.Size = new System.Drawing.Size(428, 416); 65 | this.ft.TabIndex = 2; 66 | this.ft.DragOverNode += new System.EventHandler(this.ft_DragOverNode); 67 | this.ft.DropOverNode += new System.EventHandler(this.ft_DropOverNode); 68 | // 69 | // FastTreeDragAndDropSample 70 | // 71 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 72 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 73 | this.ClientSize = new System.Drawing.Size(703, 442); 74 | this.Controls.Add(this.ft); 75 | this.Controls.Add(this.propertyGrid1); 76 | this.Name = "FastTreeDragAndDropSample"; 77 | this.Text = "FastTreeDragAndDropSample"; 78 | this.ResumeLayout(false); 79 | 80 | } 81 | 82 | #endregion 83 | 84 | private System.Windows.Forms.PropertyGrid propertyGrid1; 85 | private FastTreeNS.FastTree ft; 86 | } 87 | } -------------------------------------------------------------------------------- /Tester/FastTreeDragAndDropSample.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | using Tester.DataModel; 10 | 11 | namespace Tester 12 | { 13 | public partial class FastTreeDragAndDropSample : Form 14 | { 15 | private Node root; 16 | 17 | public FastTreeDragAndDropSample() 18 | { 19 | InitializeComponent(); 20 | 21 | CreateTree(); 22 | ft.Build(root); 23 | } 24 | 25 | private void CreateTree() 26 | { 27 | root = new Node("Root"); 28 | for (int i = 0; i < 1000; i++) 29 | { 30 | var n = new Node("Node " + i); 31 | root.AddChild(n); 32 | for (int j = 0; j < 10; j++) 33 | { 34 | var subNode = new Node("SubNode " + i + "-" + j); 35 | n.AddChild(subNode); 36 | for (int k = 0; k < 10; k++) 37 | { 38 | var subSubNode = new Node("SubNode " + i + "-" + j + "-" + k); 39 | subNode.AddChild(subSubNode); 40 | } 41 | } 42 | } 43 | } 44 | 45 | #region Routines 46 | 47 | private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) 48 | { 49 | (propertyGrid1.SelectedObject as Control).Invalidate(); 50 | } 51 | 52 | #endregion 53 | 54 | private void ft_DragOverNode(object sender, FastTreeNS.DragOverItemEventArgs e) 55 | { 56 | var draggedNodes = (e.Data.GetData(typeof(HashSet)) as HashSet).ToList().Cast(); 57 | var targetNode = e.Tag as Node; 58 | 59 | //check if targetNode is child of draggedNodes 60 | foreach(var n in draggedNodes) 61 | if (targetNode.IsChildOf(n) || n == targetNode) 62 | { 63 | e.Effect = DragDropEffects.None; 64 | return; 65 | } 66 | // 67 | e.Effect = e.AllowedEffect; 68 | if(e.X > e.TextRect.Left + 50) 69 | e.InsertEffect = FastTreeNS.InsertEffect.AddAsChild; 70 | else 71 | if(e.Y < e.TextRect.Top + 10) 72 | e.InsertEffect = FastTreeNS.InsertEffect.InsertBefore; 73 | else 74 | e.InsertEffect = FastTreeNS.InsertEffect.InsertAfter; 75 | } 76 | 77 | private void ft_DropOverNode(object sender, FastTreeNS.DragOverItemEventArgs e) 78 | { 79 | var draggedNodes = (e.Data.GetData(typeof(HashSet)) as HashSet).ToList().Cast(); 80 | var targetNode = e.Tag as Node; 81 | // 82 | switch(e.InsertEffect) 83 | { 84 | case FastTreeNS.InsertEffect.AddAsChild: AddChild(draggedNodes, targetNode); break; 85 | case FastTreeNS.InsertEffect.InsertBefore: InsertBefore(draggedNodes, targetNode); break; 86 | case FastTreeNS.InsertEffect.InsertAfter: InsertAfter(draggedNodes, targetNode); break; 87 | } 88 | 89 | ft.Build(root); 90 | } 91 | 92 | private void InsertAfter(IEnumerable draggedNodes, Node targetNode) 93 | { 94 | //build list of nodes without childs 95 | var list = ExcludeChild(draggedNodes); 96 | 97 | //inserting 98 | foreach(var n in list) 99 | if(n != targetNode) 100 | { 101 | n.Parent.RemoveChild(n); 102 | var index = targetNode.Parent.Childs.IndexOf(targetNode) + 1; 103 | targetNode.Parent.InsertChild(n, index); 104 | } 105 | } 106 | 107 | private void InsertBefore(IEnumerable draggedNodes, Node targetNode) 108 | { 109 | //build list of nodes without childs 110 | var list = ExcludeChild(draggedNodes); 111 | 112 | //inserting 113 | foreach (var n in list) 114 | if (n != targetNode) 115 | { 116 | n.Parent.RemoveChild(n); 117 | var index = targetNode.Parent.Childs.IndexOf(targetNode); 118 | targetNode.Parent.InsertChild(n, index); 119 | } 120 | } 121 | 122 | private void AddChild(IEnumerable draggedNodes, Node targetNode) 123 | { 124 | //build list of nodes without childs 125 | var list = ExcludeChild(draggedNodes); 126 | 127 | //change parent 128 | foreach (var n in list) 129 | { 130 | n.Parent.Childs.Remove(n); 131 | targetNode.AddChild(n); 132 | } 133 | } 134 | 135 | private static List ExcludeChild(IEnumerable draggedNodes) 136 | { 137 | //build list of nodes without childs 138 | var list = new List(); 139 | foreach (var n in draggedNodes) 140 | { 141 | var was = false; 142 | foreach (var p in draggedNodes) 143 | if (n.IsChildOf(p)) 144 | { 145 | was = true; 146 | break; 147 | } 148 | if (!was) 149 | list.Add(n); 150 | } 151 | return list; 152 | } 153 | } 154 | } 155 | -------------------------------------------------------------------------------- /Tester/FastTreeDragAndDropSample.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | 123 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 124 | YQUAAABfSURBVDhPxczBBgAxDIThPnofN0pUiIpQu9b2OIcJyw7fJeRvn6z3flWd13fPoTIY2HvTYCAz 125 | aTAQETQYWGvRYMDdaTBgZjQYmHPSYEBVaTAwxqDBgIjQYKDqvP6+1m4CTEnNFMdnuAAAAABJRU5ErkJg 126 | gg== 127 | 128 | 129 | 130 | 131 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 132 | YQUAAACISURBVDhPxYwBBwUhEIT76f3cRBJJIvdsu3vm2PcUxxs+amZn3Cvy3l+nSJVFxonMgTnnNubA 133 | GOMneGMO9N6/QjnemAOttQW+9a+gJ1UWGbXWhR7jG3P1pcoio5SywJKiGd5IlUVGzvkGy+hjLlUWGSml 134 | B5anmAMxxm3MgRDCNubAKVL9u5z7ADdgLW6zhommAAAAAElFTkSuQmCC 135 | 136 | 137 | 138 | 139 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 140 | YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjExR/NC 141 | NwAAAN5JREFUOE+l0L2thDAQBOCrDjISZ8RQBA1AX9AACRIQmIyEPwkhQYCYu3HkfTh43AWfrNkdS+AX 142 | gJ84h084h0+IkKapyrJMf8BBc2/3SYQkSXTTNLiu64Zz7u0+iRDHMc7zxHEcxr7vmOcZfd9jGAZwb/dJ 143 | BKWUubSuq7lUVRXKsjTqugb3dp9E8H0f27aB519t25rT7pMInudhmiYsy3LTdR24t/skQhAE5l/5+S7c 144 | 230SIQxDXRQFxnG8yfMc3Nt9EiGKIvV5ac3XdtDc230S4RvO4RPO4RPO4f/h9QY97Pu/27V7IQAAAABJ 145 | RU5ErkJggg== 146 | 147 | 148 | 149 | 150 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 151 | YQUAAAF+SURBVDhPjdHBTsJAEABQjpwhMeEgRGwicPXCRaCFpP6I/+A3cDF+gRf1M9QPUD+AixyUxIO2 152 | tLRbtlvGmd2WIt0aJ5nsstl5nR0qACCzWq1eTCaTc0w7y/F4bFuWZVumaTebzaPs7m5uN3jxDtdCiDiG 153 | iIXw+vL83u12T/FID4xM8xZXSJIENpsNbWXQ7/V6Db7nwXz+9nncbp/gsQYYjSTA8YtCCFmYBYGLxQfM 154 | ZjN4enxYtFotA4/1AH2N8xjiPYRzDq7rAAtD6HQ613ikB1gUpQgvdJLtcRZXuPwGhkMFhCHLke1z8plQ 155 | lABDCayCQCFsH8k76fV6RWCQAr6/SpFQ04lC9MBgIAHP88FfpQhjEEmEy8ESQlEK0FPd5VIh2EkQhIWZ 156 | UJQCQiTgOG6OYCdBNpMUodACZwjwWMDXtwOOS4i3g6hO6DkUZf/C/X8BbQf9fv9G4BAcZ6mKfSoOVPHO 157 | MCkMw5hmdVug0Wgc1uv1y1qt9mfSHcwDVQeVH0AbGAaJOl0WAAAAAElFTkSuQmCC 158 | 159 | 160 | 161 | 162 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 163 | YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjExR/NC 164 | NwAAAORJREFUOE+lkDtuhEAQRPd0kJFMRgyH4AJwL7gAIRAMGQk/CSEgQPRutYTVbU9g7OBp+lXXSDAv 165 | IvoXzvAJzvAJStI0NVmW2Q/kwGIv+0BJkiS2rmu6rusHyLGXfaAkjmM6z5OO42Dg0zRR13XU9z277AMl 166 | xhja952WZeFL8LIsmaqq2GUfKPF9n9Z1JZzfaZqGT9kHSjzPo3EcaZ5nBn7Pbduyyz5QEgQB/ys+H8Dv 167 | +XbZB0rCMLRFUdAwDMy2bV9znueEvewDJVEUmc9LW7y2A4u97AMlf8EZPsEZPsEZ/h56vQFjP/Teeqi9 168 | 7wAAAABJRU5ErkJggg== 169 | 170 | 171 | -------------------------------------------------------------------------------- /Tester/FastTreeEditSample.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Tester 2 | { 3 | partial class FastTreeEditSample 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FastTreeSimplestSample)); 32 | this.propertyGrid1 = new System.Windows.Forms.PropertyGrid(); 33 | this.ft = new FastTreeNS.FastTree(); 34 | this.SuspendLayout(); 35 | // 36 | // propertyGrid1 37 | // 38 | this.propertyGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 39 | | System.Windows.Forms.AnchorStyles.Right))); 40 | this.propertyGrid1.Location = new System.Drawing.Point(446, 14); 41 | this.propertyGrid1.Name = "propertyGrid1"; 42 | this.propertyGrid1.PropertySort = System.Windows.Forms.PropertySort.Alphabetical; 43 | this.propertyGrid1.SelectedObject = this.ft; 44 | this.propertyGrid1.Size = new System.Drawing.Size(245, 416); 45 | this.propertyGrid1.TabIndex = 1; 46 | this.propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged); 47 | // 48 | // ft 49 | // 50 | this.ft.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 51 | | System.Windows.Forms.AnchorStyles.Left) 52 | | System.Windows.Forms.AnchorStyles.Right))); 53 | this.ft.AutoScroll = true; 54 | this.ft.AutoScrollMinSize = new System.Drawing.Size(0, 59); 55 | this.ft.BackColor = System.Drawing.SystemColors.Window; 56 | this.ft.ImageCheckBoxOff = ((System.Drawing.Image)(resources.GetObject("ft.ImageCheckBoxOff"))); 57 | this.ft.ImageCheckBoxOn = ((System.Drawing.Image)(resources.GetObject("ft.ImageCheckBoxOn"))); 58 | this.ft.ImageCollapse = ((System.Drawing.Image)(resources.GetObject("ft.ImageCollapse"))); 59 | this.ft.ImageDefaultIcon = ((System.Drawing.Image)(resources.GetObject("ft.ImageDefaultIcon"))); 60 | this.ft.ImageEmptyExpand = ((System.Drawing.Image)(resources.GetObject("ft.ImageEmptyExpand"))); 61 | this.ft.ImageExpand = ((System.Drawing.Image)(resources.GetObject("ft.ImageExpand"))); 62 | this.ft.IsEditMode = false; 63 | this.ft.Location = new System.Drawing.Point(12, 14); 64 | this.ft.MultiSelect = true; 65 | this.ft.Name = "ft"; 66 | this.ft.ShowExpandBoxes = true; 67 | this.ft.Size = new System.Drawing.Size(428, 416); 68 | this.ft.TabIndex = 2; 69 | this.ft.NodeTextPushed += new System.EventHandler(this.ft_NodeTextPushed); 70 | // 71 | // FastTreeSimplestSample 72 | // 73 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 74 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 75 | this.ClientSize = new System.Drawing.Size(703, 442); 76 | this.Controls.Add(this.ft); 77 | this.Controls.Add(this.propertyGrid1); 78 | this.Name = "FastTreeSimplestSample"; 79 | this.Text = "FastTreeEditSample"; 80 | this.ResumeLayout(false); 81 | 82 | } 83 | 84 | #endregion 85 | 86 | private System.Windows.Forms.PropertyGrid propertyGrid1; 87 | private FastTreeNS.FastTree ft; 88 | } 89 | } -------------------------------------------------------------------------------- /Tester/FastTreeEditSample.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | using Tester.DataModel; 10 | 11 | namespace Tester 12 | { 13 | public partial class FastTreeEditSample : Form 14 | { 15 | private Node root; 16 | 17 | public FastTreeEditSample() 18 | { 19 | InitializeComponent(); 20 | 21 | CreateTree(); 22 | ft.Build(root); 23 | } 24 | 25 | private void CreateTree() 26 | { 27 | root = new Node("Root"); 28 | for (int i = 0; i < 100; i++) 29 | { 30 | var n = new Node("Node " + i); 31 | root.AddChild(n); 32 | for (int j = 0; j < 100; j++) 33 | { 34 | var subNode = new Node("SubNode " + i + "-" + j); 35 | n.AddChild(subNode); 36 | for (int k = 0; k < 10; k++) 37 | { 38 | var subSubNode = new Node("SubNode " + i + "-" + j + "-" + k); 39 | subNode.AddChild(subSubNode); 40 | } 41 | } 42 | } 43 | } 44 | 45 | private void ft_NodeTextPushed(object sender, FastTreeNS.NodeTextPushedEventArgs e) 46 | { 47 | (e.Node as Node).Title = e.Text; 48 | } 49 | 50 | #region Routines 51 | 52 | private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) 53 | { 54 | (propertyGrid1.SelectedObject as Control).Invalidate(); 55 | } 56 | 57 | #endregion 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Tester/FastTreeFileExplorerSample.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Tester 2 | { 3 | partial class FastTreeFileExplorerSample 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FastTreeFileExplorerSample)); 32 | this.propertyGrid1 = new System.Windows.Forms.PropertyGrid(); 33 | this.ft = new FastTreeNS.FastTree(); 34 | this.SuspendLayout(); 35 | // 36 | // propertyGrid1 37 | // 38 | this.propertyGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 39 | | System.Windows.Forms.AnchorStyles.Right))); 40 | this.propertyGrid1.Location = new System.Drawing.Point(446, 14); 41 | this.propertyGrid1.Name = "propertyGrid1"; 42 | this.propertyGrid1.PropertySort = System.Windows.Forms.PropertySort.Alphabetical; 43 | this.propertyGrid1.SelectedObject = this.ft; 44 | this.propertyGrid1.Size = new System.Drawing.Size(245, 416); 45 | this.propertyGrid1.TabIndex = 1; 46 | this.propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged); 47 | // 48 | // ft 49 | // 50 | this.ft.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 51 | | System.Windows.Forms.AnchorStyles.Left) 52 | | System.Windows.Forms.AnchorStyles.Right))); 53 | this.ft.AutoScroll = true; 54 | this.ft.AutoScrollMinSize = new System.Drawing.Size(0, 62); 55 | this.ft.BackColor = System.Drawing.SystemColors.Window; 56 | this.ft.IsEditMode = false; 57 | this.ft.ItemCount = 3; 58 | this.ft.Location = new System.Drawing.Point(12, 14); 59 | this.ft.MultiSelect = true; 60 | this.ft.Name = "ft"; 61 | this.ft.ShowExpandBoxes = true; 62 | this.ft.ShowIcons = true; 63 | this.ft.Size = new System.Drawing.Size(428, 416); 64 | this.ft.TabIndex = 2; 65 | this.ft.NodeIconNeeded += new System.EventHandler(this.ft_NodeIconNeeded); 66 | // 67 | // FastTreeFileExplorerSample 68 | // 69 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 70 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 71 | this.ClientSize = new System.Drawing.Size(703, 442); 72 | this.Controls.Add(this.ft); 73 | this.Controls.Add(this.propertyGrid1); 74 | this.Name = "FastTreeFileExplorerSample"; 75 | this.Text = "FastTreeFileExplorerSample"; 76 | this.ResumeLayout(false); 77 | 78 | } 79 | 80 | #endregion 81 | 82 | private System.Windows.Forms.PropertyGrid propertyGrid1; 83 | private FastTreeNS.FastTree ft; 84 | } 85 | } -------------------------------------------------------------------------------- /Tester/FastTreeFileExplorerSample.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Data; 6 | using System.Drawing; 7 | using System.IO; 8 | using System.Linq; 9 | using System.Text; 10 | using System.Windows.Forms; 11 | using Tester.DataModel; 12 | using Tester.Properties; 13 | 14 | namespace Tester 15 | { 16 | public partial class FastTreeFileExplorerSample : Form 17 | { 18 | public FastTreeFileExplorerSample() 19 | { 20 | InitializeComponent(); 21 | 22 | var drivers = DriveInfo.GetDrives().Select(d=>new FileNode(d.RootDirectory.FullName, true)).ToList(); 23 | ft.Build(drivers); 24 | } 25 | 26 | private void ft_NodeIconNeeded(object sender, FastTreeNS.ImageNodeEventArgs e) 27 | { 28 | e.Result = (e.Node as FileNode).IsDir ? Resources.folder : Resources.default_icon; 29 | } 30 | 31 | #region Routines 32 | 33 | private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) 34 | { 35 | (propertyGrid1.SelectedObject as Control).Invalidate(); 36 | } 37 | 38 | #endregion 39 | } 40 | 41 | public class FileNode : IEnumerable 42 | { 43 | public string Path { get; private set; } 44 | public bool IsDir { get; private set; } 45 | 46 | public FileNode(string path, bool isDir) 47 | { 48 | this.Path = path; 49 | this.IsDir = isDir; 50 | } 51 | 52 | public string Name 53 | { 54 | get 55 | { 56 | var name = System.IO.Path.GetFileName(Path); 57 | if (string.IsNullOrEmpty(name)) 58 | return Path; 59 | return name; 60 | } 61 | } 62 | 63 | public bool HasChildren 64 | { 65 | get { return true; } 66 | } 67 | 68 | public IEnumerator GetEnumerator() 69 | { 70 | if (!IsDir) 71 | yield break; 72 | 73 | string[] dirs, files; 74 | 75 | try 76 | { 77 | dirs = Directory.GetDirectories(Path); 78 | files = Directory.GetFiles(Path); 79 | }catch 80 | { 81 | yield break;//UnauthorizedAccessException 82 | } 83 | 84 | foreach (var path in dirs) 85 | yield return new FileNode(path, true); 86 | 87 | foreach (var path in files) 88 | yield return new FileNode(path, false); 89 | } 90 | 91 | System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() 92 | { 93 | return GetEnumerator(); 94 | } 95 | 96 | public override string ToString() 97 | { 98 | return Name; 99 | } 100 | 101 | public override bool Equals(object obj) 102 | { 103 | return Path.Equals((obj as FileNode).Path); 104 | } 105 | 106 | public override int GetHashCode() 107 | { 108 | return Name.GetHashCode(); 109 | } 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /Tester/FastTreeFileExplorerSample.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | 123 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 124 | YQUAAABfSURBVDhPxczBBgAxDIThPnofN0pUiIpQu9b2OIcJyw7fJeRvn6z3flWd13fPoTIY2HvTYCAz 125 | aTAQETQYWGvRYMDdaTBgZjQYmHPSYEBVaTAwxqDBgIjQYKDqvP6+1m4CTEnNFMdnuAAAAABJRU5ErkJg 126 | gg== 127 | 128 | 129 | 130 | 131 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 132 | YQUAAACISURBVDhPxYwBBwUhEIT76f3cRBJJIvdsu3vm2PcUxxs+amZn3Cvy3l+nSJVFxonMgTnnNubA 133 | GOMneGMO9N6/QjnemAOttQW+9a+gJ1UWGbXWhR7jG3P1pcoio5SywJKiGd5IlUVGzvkGy+hjLlUWGSml 134 | B5anmAMxxm3MgRDCNubAKVL9u5z7ADdgLW6zhommAAAAAElFTkSuQmCC 135 | 136 | 137 | 138 | 139 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 140 | YQUAAAAJcEhZcwAADsAAAA7AAWrWiQkAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjExR/NC 141 | NwAAAN5JREFUOE+l0L2thDAQBOCrDjISZ8RQBA1AX9AACRIQmIyEPwkhQYCYu3HkfTh43AWfrNkdS+AX 142 | gJ84h084h0+IkKapyrJMf8BBc2/3SYQkSXTTNLiu64Zz7u0+iRDHMc7zxHEcxr7vmOcZfd9jGAZwb/dJ 143 | BKWUubSuq7lUVRXKsjTqugb3dp9E8H0f27aB519t25rT7pMInudhmiYsy3LTdR24t/skQhAE5l/5+S7c 144 | 230SIQxDXRQFxnG8yfMc3Nt9EiGKIvV5ac3XdtDc230S4RvO4RPO4RPO4f/h9QY97Pu/27V7IQAAAABJ 145 | RU5ErkJggg== 146 | 147 | 148 | 149 | 150 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 151 | YQUAAAF+SURBVDhPjdHBTsJAEABQjpwhMeEgRGwicPXCRaCFpP6I/+A3cDF+gRf1M9QPUD+AixyUxIO2 152 | tLRbtlvGmd2WIt0aJ5nsstl5nR0qACCzWq1eTCaTc0w7y/F4bFuWZVumaTebzaPs7m5uN3jxDtdCiDiG 153 | iIXw+vL83u12T/FID4xM8xZXSJIENpsNbWXQ7/V6Db7nwXz+9nncbp/gsQYYjSTA8YtCCFmYBYGLxQfM 154 | ZjN4enxYtFotA4/1AH2N8xjiPYRzDq7rAAtD6HQ613ikB1gUpQgvdJLtcRZXuPwGhkMFhCHLke1z8plQ 155 | lABDCayCQCFsH8k76fV6RWCQAr6/SpFQ04lC9MBgIAHP88FfpQhjEEmEy8ESQlEK0FPd5VIh2EkQhIWZ 156 | UJQCQiTgOG6OYCdBNpMUodACZwjwWMDXtwOOS4i3g6hO6DkUZf/C/X8BbQf9fv9G4BAcZ6mKfSoOVPHO 157 | MCkMw5hmdVug0Wgc1uv1y1qt9mfSHcwDVQeVH0AbGAaJOl0WAAAAAElFTkSuQmCC 158 | 159 | 160 | 161 | 162 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 163 | YQUAAAAJcEhZcwAADsAAAA7AAWrWiQkAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjExR/NC 164 | NwAAAORJREFUOE+lkDtuhEAQRPd0kJFMRgyH4AJwL7gAIRAMGQk/CSEgQPRutYTVbU9g7OBp+lXXSDAv 165 | IvoXzvAJzvAJStI0NVmW2Q/kwGIv+0BJkiS2rmu6rusHyLGXfaAkjmM6z5OO42Dg0zRR13XU9z277AMl 166 | xhja952WZeFL8LIsmaqq2GUfKPF9n9Z1JZzfaZqGT9kHSjzPo3EcaZ5nBn7Pbduyyz5QEgQB/ys+H8Dv 167 | +XbZB0rCMLRFUdAwDMy2bV9znueEvewDJVEUmc9LW7y2A4u97AMlf8EZPsEZPsEZ/h56vQFjP/Teeqi9 168 | 7wAAAABJRU5ErkJggg== 169 | 170 | 171 | -------------------------------------------------------------------------------- /Tester/FastTreeFileExplorerSample2.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Tester 2 | { 3 | partial class FastTreeFileExplorerSample2 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FastTreeFileExplorerSample2)); 32 | this.propertyGrid1 = new System.Windows.Forms.PropertyGrid(); 33 | this.ft = new FastTreeNS.FastTree(); 34 | this.SuspendLayout(); 35 | // 36 | // propertyGrid1 37 | // 38 | this.propertyGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 39 | | System.Windows.Forms.AnchorStyles.Right))); 40 | this.propertyGrid1.Location = new System.Drawing.Point(446, 14); 41 | this.propertyGrid1.Name = "propertyGrid1"; 42 | this.propertyGrid1.PropertySort = System.Windows.Forms.PropertySort.Alphabetical; 43 | this.propertyGrid1.SelectedObject = this.ft; 44 | this.propertyGrid1.Size = new System.Drawing.Size(245, 416); 45 | this.propertyGrid1.TabIndex = 1; 46 | this.propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged); 47 | // 48 | // ft 49 | // 50 | this.ft.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 51 | | System.Windows.Forms.AnchorStyles.Left) 52 | | System.Windows.Forms.AnchorStyles.Right))); 53 | this.ft.AutoScroll = true; 54 | this.ft.AutoScrollMinSize = new System.Drawing.Size(0, 59); 55 | this.ft.BackColor = System.Drawing.SystemColors.Window; 56 | this.ft.IsEditMode = false; 57 | this.ft.Location = new System.Drawing.Point(12, 14); 58 | this.ft.MultiSelect = true; 59 | this.ft.Name = "ft"; 60 | this.ft.ShowCheckBoxes = true; 61 | this.ft.ShowExpandBoxes = true; 62 | this.ft.ShowIcons = true; 63 | this.ft.Size = new System.Drawing.Size(428, 416); 64 | this.ft.TabIndex = 2; 65 | this.ft.NodeTextNeeded += new System.EventHandler(this.ft_NodeTextNeeded); 66 | this.ft.NodeIconNeeded += new System.EventHandler(this.ft_NodeIconNeeded); 67 | this.ft.NodeChildrenNeeded += new System.EventHandler(this.ft_NodeChildrenNeeded); 68 | // 69 | // FastTreeFileExplorerSample2 70 | // 71 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 72 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 73 | this.ClientSize = new System.Drawing.Size(703, 442); 74 | this.Controls.Add(this.ft); 75 | this.Controls.Add(this.propertyGrid1); 76 | this.Name = "FastTreeFileExplorerSample2"; 77 | this.Text = "FastTreeFileExplorerSample2"; 78 | this.ResumeLayout(false); 79 | 80 | } 81 | 82 | #endregion 83 | 84 | private System.Windows.Forms.PropertyGrid propertyGrid1; 85 | private FastTreeNS.FastTree ft; 86 | } 87 | } -------------------------------------------------------------------------------- /Tester/FastTreeFileExplorerSample2.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Data; 6 | using System.Drawing; 7 | using System.IO; 8 | using System.Linq; 9 | using System.Text; 10 | using System.Windows.Forms; 11 | using Tester.DataModel; 12 | using Tester.Properties; 13 | 14 | namespace Tester 15 | { 16 | public partial class FastTreeFileExplorerSample2 : Form 17 | { 18 | public FastTreeFileExplorerSample2() 19 | { 20 | InitializeComponent(); 21 | 22 | ft.Build(null); 23 | } 24 | 25 | private void ft_NodeIconNeeded(object sender, FastTreeNS.ImageNodeEventArgs e) 26 | { 27 | var path = e.Node as string; 28 | 29 | e.Result = File.Exists(path) ? Resources.default_icon : Resources.folder; 30 | } 31 | 32 | private void ft_NodeTextNeeded(object sender, FastTreeNS.StringNodeEventArgs e) 33 | { 34 | var path = e.Node as string; 35 | 36 | e.Result = Path.GetFileName(path); 37 | if (string.IsNullOrEmpty(e.Result)) 38 | e.Result = path; 39 | } 40 | 41 | private void ft_NodeChildrenNeeded(object sender, FastTreeNS.NodeChildrenNeededEventArgs e) 42 | { 43 | var path = e.Node as string; 44 | 45 | //root ? 46 | if (path == null) 47 | { 48 | //return driver's list 49 | e.Children = DriveInfo.GetDrives().Select(d => d.RootDirectory.FullName).ToList(); 50 | return; 51 | } 52 | 53 | //path is not dir ? 54 | if (!Directory.Exists(path)) 55 | return; 56 | 57 | //get subdirs and files 58 | string[] dirs, files; 59 | 60 | try 61 | { 62 | dirs = Directory.GetDirectories(path); 63 | files = Directory.GetFiles(path); 64 | } 65 | catch 66 | { 67 | return;//UnauthorizedAccessException 68 | } 69 | 70 | e.Children = dirs.Concat(files); 71 | } 72 | 73 | #region Routines 74 | 75 | private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) 76 | { 77 | (propertyGrid1.SelectedObject as Control).Invalidate(); 78 | } 79 | 80 | #endregion 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /Tester/FastTreeSimplestSample.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Tester 2 | { 3 | partial class FastTreeSimplestSample 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FastTreeSimplestSample)); 32 | this.propertyGrid1 = new System.Windows.Forms.PropertyGrid(); 33 | this.ft = new FastTreeNS.FastTree(); 34 | this.SuspendLayout(); 35 | // 36 | // propertyGrid1 37 | // 38 | this.propertyGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 39 | | System.Windows.Forms.AnchorStyles.Right))); 40 | this.propertyGrid1.Location = new System.Drawing.Point(446, 14); 41 | this.propertyGrid1.Name = "propertyGrid1"; 42 | this.propertyGrid1.PropertySort = System.Windows.Forms.PropertySort.Alphabetical; 43 | this.propertyGrid1.SelectedObject = this.ft; 44 | this.propertyGrid1.Size = new System.Drawing.Size(245, 416); 45 | this.propertyGrid1.TabIndex = 1; 46 | this.propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged); 47 | // 48 | // ft 49 | // 50 | this.ft.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 51 | | System.Windows.Forms.AnchorStyles.Left) 52 | | System.Windows.Forms.AnchorStyles.Right))); 53 | this.ft.AutoScroll = true; 54 | this.ft.AutoScrollMinSize = new System.Drawing.Size(0, 59); 55 | this.ft.BackColor = System.Drawing.SystemColors.Window; 56 | this.ft.ImageCheckBoxOff = ((System.Drawing.Image)(resources.GetObject("ft.ImageCheckBoxOff"))); 57 | this.ft.ImageCheckBoxOn = ((System.Drawing.Image)(resources.GetObject("ft.ImageCheckBoxOn"))); 58 | this.ft.ImageCollapse = ((System.Drawing.Image)(resources.GetObject("ft.ImageCollapse"))); 59 | this.ft.ImageDefaultIcon = ((System.Drawing.Image)(resources.GetObject("ft.ImageDefaultIcon"))); 60 | this.ft.ImageEmptyExpand = ((System.Drawing.Image)(resources.GetObject("ft.ImageEmptyExpand"))); 61 | this.ft.ImageExpand = ((System.Drawing.Image)(resources.GetObject("ft.ImageExpand"))); 62 | this.ft.IsEditMode = false; 63 | this.ft.ItemHeightDefault = 50; 64 | this.ft.ItemLineAlignmentDefault = System.Drawing.StringAlignment.Center; 65 | this.ft.Location = new System.Drawing.Point(12, 14); 66 | this.ft.MultiSelect = true; 67 | this.ft.Name = "ft"; 68 | this.ft.ShowExpandBoxes = true; 69 | this.ft.Size = new System.Drawing.Size(428, 416); 70 | this.ft.TabIndex = 2; 71 | // 72 | // FastTreeSimplestSample 73 | // 74 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 75 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 76 | this.ClientSize = new System.Drawing.Size(703, 442); 77 | this.Controls.Add(this.ft); 78 | this.Controls.Add(this.propertyGrid1); 79 | this.Name = "FastTreeSimplestSample"; 80 | this.Text = "FastTreeSimplestSample"; 81 | this.ResumeLayout(false); 82 | 83 | } 84 | 85 | #endregion 86 | 87 | private System.Windows.Forms.PropertyGrid propertyGrid1; 88 | private FastTreeNS.FastTree ft; 89 | } 90 | } -------------------------------------------------------------------------------- /Tester/FastTreeSimplestSample.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | using Tester.DataModel; 10 | 11 | namespace Tester 12 | { 13 | public partial class FastTreeSimplestSample : Form 14 | { 15 | private Node root; 16 | 17 | public FastTreeSimplestSample() 18 | { 19 | InitializeComponent(); 20 | 21 | CreateTree(); 22 | ft.Build(root); 23 | } 24 | 25 | private void CreateTree() 26 | { 27 | root = new Node("Root"); 28 | for (int i = 0; i < 100; i++) 29 | { 30 | var n = new Node("Node " + i); 31 | root.AddChild(n); 32 | for (int j = 0; j < 100; j++) 33 | { 34 | var subNode = new Node("SubNode " + i + "-" + j); 35 | n.AddChild(subNode); 36 | for (int k = 0; k < 10; k++) 37 | { 38 | var subSubNode = new Node("SubNode " + i + "-" + j + "-" + k); 39 | subNode.AddChild(subSubNode); 40 | } 41 | } 42 | } 43 | } 44 | 45 | #region Routines 46 | 47 | private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) 48 | { 49 | (propertyGrid1.SelectedObject as Control).Invalidate(); 50 | } 51 | 52 | #endregion 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Tester/FastTreeStressTest.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Tester 2 | { 3 | partial class FastTreeStressTest 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FastTreeStressTest)); 32 | this.propertyGrid1 = new System.Windows.Forms.PropertyGrid(); 33 | this.ft = new FastTreeNS.FastTree(); 34 | this.SuspendLayout(); 35 | // 36 | // propertyGrid1 37 | // 38 | this.propertyGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 39 | | System.Windows.Forms.AnchorStyles.Right))); 40 | this.propertyGrid1.Location = new System.Drawing.Point(446, 14); 41 | this.propertyGrid1.Name = "propertyGrid1"; 42 | this.propertyGrid1.PropertySort = System.Windows.Forms.PropertySort.Alphabetical; 43 | this.propertyGrid1.SelectedObject = this.ft; 44 | this.propertyGrid1.Size = new System.Drawing.Size(245, 416); 45 | this.propertyGrid1.TabIndex = 1; 46 | this.propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged); 47 | // 48 | // ft 49 | // 50 | this.ft.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 51 | | System.Windows.Forms.AnchorStyles.Left) 52 | | System.Windows.Forms.AnchorStyles.Right))); 53 | this.ft.AutoScroll = true; 54 | this.ft.AutoScrollMinSize = new System.Drawing.Size(0, 59); 55 | this.ft.BackColor = System.Drawing.SystemColors.Window; 56 | this.ft.IsEditMode = false; 57 | this.ft.Location = new System.Drawing.Point(12, 14); 58 | this.ft.MultiSelect = true; 59 | this.ft.Name = "ft"; 60 | this.ft.ShowExpandBoxes = true; 61 | this.ft.ShowIcons = true; 62 | this.ft.Size = new System.Drawing.Size(428, 416); 63 | this.ft.TabIndex = 2; 64 | this.ft.NodeChildrenNeeded += new System.EventHandler(this.ft_NodeChildrenNeeded); 65 | // 66 | // FastTreeStressTest 67 | // 68 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 69 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 70 | this.ClientSize = new System.Drawing.Size(703, 442); 71 | this.Controls.Add(this.ft); 72 | this.Controls.Add(this.propertyGrid1); 73 | this.Name = "FastTreeStressTest"; 74 | this.Text = "FastTreeSimplestSample"; 75 | this.ResumeLayout(false); 76 | 77 | } 78 | 79 | #endregion 80 | 81 | private System.Windows.Forms.PropertyGrid propertyGrid1; 82 | private FastTreeNS.FastTree ft; 83 | } 84 | } -------------------------------------------------------------------------------- /Tester/FastTreeStressTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | using Tester.DataModel; 10 | 11 | namespace Tester 12 | { 13 | public partial class FastTreeStressTest : Form 14 | { 15 | public FastTreeStressTest() 16 | { 17 | InitializeComponent(); 18 | 19 | ft.Build("Node"); 20 | } 21 | 22 | private void ft_NodeChildrenNeeded(object sender, FastTreeNS.NodeChildrenNeededEventArgs e) 23 | { 24 | e.Children = GenerateNodes(e.Node as string, 100000); 25 | } 26 | 27 | IEnumerable GenerateNodes(string parent, int count) 28 | { 29 | for (int i = 0; i < count; i++) 30 | yield return string.Concat(parent, "_", i); 31 | } 32 | 33 | #region Routines 34 | 35 | private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) 36 | { 37 | (propertyGrid1.SelectedObject as Control).Invalidate(); 38 | } 39 | 40 | #endregion 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Tester/FastTreeStressTest.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | 123 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 124 | YQUAAABfSURBVDhPxczBBgAxDIThPnofN0pUiIpQu9b2OIcJyw7fJeRvn6z3flWd13fPoTIY2HvTYCAz 125 | aTAQETQYWGvRYMDdaTBgZjQYmHPSYEBVaTAwxqDBgIjQYKDqvP6+1m4CTEnNFMdnuAAAAABJRU5ErkJg 126 | gg== 127 | 128 | 129 | 130 | 131 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 132 | YQUAAACISURBVDhPxYwBBwUhEIT76f3cRBJJIvdsu3vm2PcUxxs+amZn3Cvy3l+nSJVFxonMgTnnNubA 133 | GOMneGMO9N6/QjnemAOttQW+9a+gJ1UWGbXWhR7jG3P1pcoio5SywJKiGd5IlUVGzvkGy+hjLlUWGSml 134 | B5anmAMxxm3MgRDCNubAKVL9u5z7ADdgLW6zhommAAAAAElFTkSuQmCC 135 | 136 | 137 | 138 | 139 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 140 | YQUAAAAJcEhZcwAADr0AAA69AUf7kK0AAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjExR/NC 141 | NwAAAN5JREFUOE+l0L2thDAQBOCrDjISZ8RQBA1AX9AACRIQmIyEPwkhQYCYu3HkfTh43AWfrNkdS+AX 142 | gJ84h084h0+IkKapyrJMf8BBc2/3SYQkSXTTNLiu64Zz7u0+iRDHMc7zxHEcxr7vmOcZfd9jGAZwb/dJ 143 | BKWUubSuq7lUVRXKsjTqugb3dp9E8H0f27aB519t25rT7pMInudhmiYsy3LTdR24t/skQhAE5l/5+S7c 144 | 230SIQxDXRQFxnG8yfMc3Nt9EiGKIvV5ac3XdtDc230S4RvO4RPO4RPO4f/h9QY97Pu/27V7IQAAAABJ 145 | RU5ErkJggg== 146 | 147 | 148 | 149 | 150 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 151 | YQUAAAF+SURBVDhPjdHBTsJAEABQjpwhMeEgRGwicPXCRaCFpP6I/+A3cDF+gRf1M9QPUD+AixyUxIO2 152 | tLRbtlvGmd2WIt0aJ5nsstl5nR0qACCzWq1eTCaTc0w7y/F4bFuWZVumaTebzaPs7m5uN3jxDtdCiDiG 153 | iIXw+vL83u12T/FID4xM8xZXSJIENpsNbWXQ7/V6Db7nwXz+9nncbp/gsQYYjSTA8YtCCFmYBYGLxQfM 154 | ZjN4enxYtFotA4/1AH2N8xjiPYRzDq7rAAtD6HQ613ikB1gUpQgvdJLtcRZXuPwGhkMFhCHLke1z8plQ 155 | lABDCayCQCFsH8k76fV6RWCQAr6/SpFQ04lC9MBgIAHP88FfpQhjEEmEy8ESQlEK0FPd5VIh2EkQhIWZ 156 | UJQCQiTgOG6OYCdBNpMUodACZwjwWMDXtwOOS4i3g6hO6DkUZf/C/X8BbQf9fv9G4BAcZ6mKfSoOVPHO 157 | MCkMw5hmdVug0Wgc1uv1y1qt9mfSHcwDVQeVH0AbGAaJOl0WAAAAAElFTkSuQmCC 158 | 159 | 160 | 161 | 162 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 163 | YQUAAAAJcEhZcwAADr0AAA69AUf7kK0AAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjExR/NC 164 | NwAAAORJREFUOE+lkDtuhEAQRPd0kJFMRgyH4AJwL7gAIRAMGQk/CSEgQPRutYTVbU9g7OBp+lXXSDAv 165 | IvoXzvAJzvAJStI0NVmW2Q/kwGIv+0BJkiS2rmu6rusHyLGXfaAkjmM6z5OO42Dg0zRR13XU9z277AMl 166 | xhja952WZeFL8LIsmaqq2GUfKPF9n9Z1JZzfaZqGT9kHSjzPo3EcaZ5nBn7Pbduyyz5QEgQB/ys+H8Dv 167 | +XbZB0rCMLRFUdAwDMy2bV9znueEvewDJVEUmc9LW7y2A4u97AMlf8EZPsEZPsEZ/h56vQFjP/Teeqi9 168 | 7wAAAABJRU5ErkJggg== 169 | 170 | 171 | -------------------------------------------------------------------------------- /Tester/MainForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | 10 | namespace Tester 11 | { 12 | public partial class MainForm : Form 13 | { 14 | public MainForm() 15 | { 16 | InitializeComponent(); 17 | } 18 | 19 | private void button1_Click(object sender, EventArgs e) 20 | { 21 | new FastListSimplestSample().Show(); 22 | } 23 | 24 | private void button2_Click(object sender, EventArgs e) 25 | { 26 | new FastListExpandedSample().Show(); 27 | } 28 | 29 | private void button3_Click(object sender, EventArgs e) 30 | { 31 | new FastListDragItemSample().Show(); 32 | } 33 | 34 | private void button4_Click(object sender, EventArgs e) 35 | { 36 | new FastListDropItemSample().Show(); 37 | } 38 | 39 | private void button5_Click(object sender, EventArgs e) 40 | { 41 | new FastListReadonlyAndDisabledItemsSample().Show(); 42 | } 43 | 44 | private void button6_Click(object sender, EventArgs e) 45 | { 46 | new FastTreeSimplestSample().Show(); 47 | } 48 | 49 | private void button7_Click(object sender, EventArgs e) 50 | { 51 | new FastTreeFileExplorerSample().Show(); 52 | } 53 | 54 | private void button8_Click(object sender, EventArgs e) 55 | { 56 | new FastTreeFileExplorerSample2().Show(); 57 | } 58 | 59 | private void button9_Click(object sender, EventArgs e) 60 | { 61 | new FastTreeDragAndDropSample().Show(); 62 | } 63 | 64 | private void button10_Click(object sender, EventArgs e) 65 | { 66 | new FastListVirtualCheckboxesSample().Show(); 67 | } 68 | 69 | private void button11_Click(object sender, EventArgs e) 70 | { 71 | new FastListStressTest().Show(); 72 | } 73 | 74 | private void button12_Click(object sender, EventArgs e) 75 | { 76 | new FastTreeStressTest().Show(); 77 | } 78 | 79 | private void button13_Click(object sender, EventArgs e) 80 | { 81 | new FastListCustomize().Show(); 82 | } 83 | 84 | private void button14_Click(object sender, EventArgs e) 85 | { 86 | new FastTreeEditSample().Show(); 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /Tester/MainForm.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /Tester/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | using System.Windows.Forms; 6 | 7 | namespace Tester 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new MainForm()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Tester/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Tester")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Tester")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("63cd8cea-398a-47ff-96b3-98227dc03f8c")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Tester/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.17929 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Tester.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tester.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap default_icon { 67 | get { 68 | object obj = ResourceManager.GetObject("default_icon", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Bitmap. 75 | /// 76 | internal static System.Drawing.Bitmap folder { 77 | get { 78 | object obj = ResourceManager.GetObject("folder", resourceCulture); 79 | return ((System.Drawing.Bitmap)(obj)); 80 | } 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /Tester/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\Resources\default_icon.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | 125 | ..\Resources\folder.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 126 | 127 | -------------------------------------------------------------------------------- /Tester/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.17929 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Tester.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Tester/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Tester/Resources/default_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/Tester/Resources/default_icon.png -------------------------------------------------------------------------------- /Tester/Resources/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/Tester/Resources/folder.png -------------------------------------------------------------------------------- /Tester/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Tester/bin/Debug/Tester.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Tester/bin/Debug/Tester.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Tester/obj/x86/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/Tester/obj/x86/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /Tester/obj/x86/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/Tester/obj/x86/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /Tester/obj/x86/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/Tester/obj/x86/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /Tester/obj/x86/Debug/Tester.FastListDragItemSample.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/Tester/obj/x86/Debug/Tester.FastListDragItemSample.resources -------------------------------------------------------------------------------- /Tester/obj/x86/Debug/Tester.FastListDropItemSample.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/Tester/obj/x86/Debug/Tester.FastListDropItemSample.resources -------------------------------------------------------------------------------- /Tester/obj/x86/Debug/Tester.FastListExpandedSample.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/Tester/obj/x86/Debug/Tester.FastListExpandedSample.resources -------------------------------------------------------------------------------- /Tester/obj/x86/Debug/Tester.FastListReadonlyAndDisabledItemsSample.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/Tester/obj/x86/Debug/Tester.FastListReadonlyAndDisabledItemsSample.resources -------------------------------------------------------------------------------- /Tester/obj/x86/Debug/Tester.FastListSimplestSample.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/Tester/obj/x86/Debug/Tester.FastListSimplestSample.resources -------------------------------------------------------------------------------- /Tester/obj/x86/Debug/Tester.FastTreeFileExplorerSample.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/Tester/obj/x86/Debug/Tester.FastTreeFileExplorerSample.resources -------------------------------------------------------------------------------- /Tester/obj/x86/Debug/Tester.FastTreeFileExplorerSample2.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/Tester/obj/x86/Debug/Tester.FastTreeFileExplorerSample2.resources -------------------------------------------------------------------------------- /Tester/obj/x86/Debug/Tester.FastTreeSimplestSample.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/Tester/obj/x86/Debug/Tester.FastTreeSimplestSample.resources -------------------------------------------------------------------------------- /Tester/obj/x86/Debug/Tester.MainForm.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/Tester/obj/x86/Debug/Tester.MainForm.resources -------------------------------------------------------------------------------- /Tester/obj/x86/Debug/Tester.Properties.Resources.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavelTorgashov/FastTree/eec02bd5137f605ce8569b532ffa5aed7205e7d0/Tester/obj/x86/Debug/Tester.Properties.Resources.resources -------------------------------------------------------------------------------- /Tester/obj/x86/Debug/Tester.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Projects_CSharp\FastTree\Tester\bin\Debug\Tester.exe 2 | C:\Projects_CSharp\FastTree\Tester\bin\Debug\Tester.pdb 3 | C:\Projects_CSharp\FastTree\Tester\obj\x86\Debug\Tester.Properties.Resources.resources 4 | C:\Projects_CSharp\FastTree\Tester\obj\x86\Debug\Tester.csproj.GenerateResource.Cache 5 | C:\Projects_CSharp\FastTree\Tester\obj\x86\Debug\Tester.exe 6 | C:\Projects_CSharp\FastTree\Tester\obj\x86\Debug\Tester.pdb 7 | C:\Projects_CSharp\FastTree\Tester\obj\x86\Debug\Tester.csprojResolveAssemblyReference.cache 8 | C:\Projects_CSharp\FastTree\Tester\bin\Debug\Tester.exe.config 9 | C:\Projects_CSharp\FastTree\Tester\bin\Debug\FastTree.dll 10 | C:\Projects_CSharp\FastTree\Tester\bin\Debug\FastTree.pdb 11 | C:\Projects_CSharp\FastTree\Tester\obj\x86\Debug\Tester.MainForm.resources 12 | C:\Projects_CSharp\FastTree\Tester\obj\x86\Debug\Tester.FastListExpandedSample.resources 13 | C:\Projects_CSharp\FastTree\Tester\obj\x86\Debug\Tester.FastListSimplestSample.resources 14 | C:\Projects_CSharp\FastTree\Tester\obj\x86\Debug\Tester.FastListDragItemSample.resources 15 | C:\Projects_CSharp\FastTree\Tester\obj\x86\Debug\Tester.FastListDropItemSample.resources 16 | C:\Projects_CSharp\FastTree\Tester\obj\x86\Debug\Tester.FastListReadonlyAndDisabledItemsSample.resources 17 | C:\Projects_CSharp\FastTree\Tester\obj\x86\Debug\Tester.FastTreeSimplestSample.resources 18 | C:\Projects_CSharp\FastTree\Tester\obj\x86\Debug\Tester.FastTreeFileExplorerSample.resources 19 | C:\Projects_CSharp\FastTree\Tester\obj\x86\Debug\Tester.FastTreeFileExplorerSample2.resources 20 | C:\Projects_CSharp\FastTree\Tester\bin\Debug\FastTree.xml 21 | C:\Projects_CSharp\FastTree\Tester\obj\x86\Debug\Tester.FastTreeDragAndDropSample.resources 22 | C:\Projects_CSharp\FastTree\Tester\obj\x86\Debug\Tester.FastListVirtualCheckboxesSample.resources 23 | C:\Projects_CSharp\FastTree\Tester\obj\x86\Debug\Tester.FastListStressTest.resources 24 | C:\Projects_CSharp\FastTree\Tester\obj\x86\Debug\Tester.FastTreeStressTest.resources 25 | C:\Projects_CSharp\FastTree\Tester\obj\x86\Debug\Tester.FastListCustomize.resources 26 | --------------------------------------------------------------------------------