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); } } }
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); } } }
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); } } }