Exemplo n.º 1
0
        public void Initialize(ISourceController sourceController, ITrackController trackController, ITagController tagController)
        {
            this.sourceController = sourceController;
            this.trackController  = trackController;
            this.tagController    = tagController;

            treeView.ItemsSource = boundSources;

            boundSources.Add(new DeviceCatalogSource {
                Name = "Devices"
            });

            var sources = sourceController.Search(new Dictionary <string, object> {
                { "Parent", null }
            });

            if (sources != null && sources.Count() > 0)
            {
                foreach (var source in sources)
                {
                    boundSources.Add(source);
                    LoadSourceChildren(source);
                }
            }
        }
Exemplo n.º 2
0
        private void LoadSourceChildren(ISource source)
        {
            var children = sourceController.Search(new Dictionary <string, object> {
                { "Parent", source.Id.ToString() }
            });

            if (children != null && children.Count() > 0)
            {
                foreach (var child in children)
                {
                    child.Parent = source;
                    source.AddChild(child);
                    LoadSourceChildren(child);
                }
            }
        }
Exemplo n.º 3
0
        public void Initialize(ISourceController sourceController, ITrackController trackController, ITagController tagController)
        {
            this.sourceController = sourceController;
            this.trackController = trackController;
            this.tagController = tagController;

            treeView.ItemsSource = boundSources;

            boundSources.Add(new DeviceCatalogSource { Name = "Devices" });

            var sources = sourceController.Search(new Dictionary<string, object> { { "Parent", null } });
            if (sources != null && sources.Count() > 0)
            {
                foreach (var source in sources)
                {
                    boundSources.Add(source);
                    LoadSourceChildren(source);
                }
            }
        }