public override void Execute(object parameter)
 {
     try
     {
         DllTypeManager tempDllTypeManager = new DllTypeManager();
         tempDllTypeManager.AssignPathToFile(_treeViewViewModel.FileDllPathOpener.GetPathToFile());
         _typeManager = tempDllTypeManager;
         base.Execute(parameter);
     }
     catch (ArgumentException ae)
     {
         return;
     }
 }
Example #2
0
        public void TreeViewViewModelTest()
        {
            TreeViewViewModel treeViewViewModel = new TreeViewViewModel();

            Assert.AreEqual(new ObservableCollection <TreeViewTypeElement>().GetType(),
                            treeViewViewModel.ReferencedTypes.GetType());
            Assert.IsFalse(treeViewViewModel.HasTypeManager);
            DllTypeManager dllTypeManager = new DllTypeManager();
            string         pathToTest     = Environment.CurrentDirectory;

            for (int i = 0; i < 4; i++)
            {
                pathToTest = Directory.GetParent(pathToTest).FullName;
            }
            dllTypeManager.AssignPathToFile(Path.Combine(pathToTest, "testData\\TPA.ApplicationArchitecture.dll"));
            dllTypeManager.InitTypeManager();
            treeViewViewModel.TypeManagerInst = dllTypeManager;
            Assert.IsTrue(treeViewViewModel.ReferencedTypes.Count == 0);

            treeViewViewModel.ShowTreeViewCommand.Execute(this);
            Assert.IsTrue(treeViewViewModel.ReferencedTypes.Count > 0);
        }