コード例 #1
0
        public override IList <ModelTreeNode> LoadTree(string path)
        {
            var directory      = Path.GetDirectoryName(path);
            var folderTreeNode = new FolderTreeNode();
            var shopPaths      = Directory.EnumerateFiles(directory, "*.shop");

            folderTreeNode.Text = directory;

            foreach (var filePath in shopPaths)
            {
                var json = File.ReadAllText(filePath);
                var item = JsonConvert.DeserializeObject <NpcShop>(json);
                item.Filename = Path.GetFileName(filePath);
                var node = new NpcShopTreeNode(item);

                folderTreeNode.Nodes.Add(node);
            }

            folderTreeNode.Expand();

            return(new List <ModelTreeNode>()
            {
                folderTreeNode
            });
        }
コード例 #2
0
            public FolderTreeView()
            {
                this.FullRowSelect    = false;
                this.HideSelection    = false;
                this.LabelEdit        = false;
                this.PathSeparator    = Path.PathSeparator.ToString();
                this.Scrollable       = true;
                this.ShowLines        = true;
                this.ShowNodeToolTips = false;
                this.ShowPlusMinus    = true;
                this.ShowRootLines    = true;

                FolderTreeNode rootNode = new FolderTreeNode(_rootShellItem);

                this.Nodes.Add(rootNode);
                rootNode.Expand();
            }
コード例 #3
0
ファイル: FolderTree.cs プロジェクト: m-berkani/ClearCanvas
			public FolderTreeView()
			{
				this.FullRowSelect = false;
				this.HideSelection = false;
				this.LabelEdit = false;
				this.PathSeparator = Path.PathSeparator.ToString();
				this.Scrollable = true;
				this.ShowLines = true;
				this.ShowNodeToolTips = false;
				this.ShowPlusMinus = true;
				this.ShowRootLines = true;

				FolderTreeNode rootNode = new FolderTreeNode(_rootShellItem);
				this.Nodes.Add(rootNode);
				rootNode.Expand();
			}