private void TreeViewLoaded(AssemblyMetadata assembly) { ITreeViewItem rootItem = new AssemblyTreeViewItem(assembly) { Name = pathVariable.Substring(pathVariable.LastIndexOf('\\') + 1) }; HierarchicalAreas.Add(rootItem); }
public static AssemblyMetadata LoadDLL(string PathVariable, ObservableCollection <BaseTreeViewItem> HierarchicalArea) { if (PathVariable.Substring(PathVariable.Length - 4) == ".dll") { //DataService.LoadAssembly(PathVariable); AssemblyMetadata assemblyMetadata = DataService.LoadAssembly(PathVariable); BaseTreeViewItem rootItem = new AssemblyTreeViewItem(assemblyMetadata); HierarchicalArea.Add(rootItem); return(assemblyMetadata); } return(null); }
private void Deserialize() { string path = ConfigurationManager.AppSettings["connectionstring"]; if (ConfigurationManager.AppSettings["repository"] != "Database") { path = browse.GetFilePath(); } BaseTreeViewItem rootItem = new AssemblyTreeViewItem(RepositoryOperations.Read(path)); HierarchicalAreas.Clear(); HierarchicalAreas.Add(rootItem); }
public void TreeViewItemBuildingTest_WhenChildrenCountIsSetTo3_ShouldBe3() { string path = Directory.GetParent(Directory.GetCurrentDirectory()).ToString(); string root = "Tests"; while (!(path.Substring(path.Length - root.Length) == root)) { path = path.Remove(path.Length - 1); Console.WriteLine(path); } Console.WriteLine(path); string filename = "\\TPA.ApplicationArchitecture.dll"; string fullFilePath = path + filename; Console.WriteLine(fullFilePath); BaseTreeViewItem rootItem = new AssemblyTreeViewItem(); rootItem.Children.Clear(); rootItem.Children.Add(null); rootItem.Children.Add(null); rootItem.Children.Add(null); Assert.AreEqual(rootItem.Children.Count, 3); }