Пример #1
0
        public override IList <ModelTreeNode> LoadTree(string path)
        {
            var directory      = Path.GetDirectoryName(path);
            var folderTreeNode = new FolderTreeNode();
            var shopPaths      = Directory.EnumerateFiles(directory, "*.currency");

            folderTreeNode.Text = directory;

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

                folderTreeNode.Nodes.Add(node);
            }

            folderTreeNode.Expand();

            return(new List <ModelTreeNode>()
            {
                folderTreeNode
            });
        }
Пример #2
0
        public override IList <ModelTreeNode> CreateTree()
        {
            var nodes = new List <ModelTreeNode>(1);
            var item  = new CurrencyDefinition();
            var node  = new CurrencyTreeNode(item);

            nodes.Add(node);

            return(nodes);
        }
 public CurrencyTreeNode(CurrencyTreeNode other)
 {
     throw new NotImplementedException();
 }