private void LoadTree()
{
if (!string.IsNullOrEmpty( _testProgramSetName ))
{
if (_fileSystemWatcher != null)
{
_fileSystemWatcher.EnableRaisingEvents = false;
}
testSetNavigationTree.Nodes.Clear();
var testPathDir = new DirectoryInfo( ATMLContext.TESTSET_PATH );
foreach (DirectoryInfo testSetDir in testPathDir.GetDirectories( _testProgramSetName ))
{
var node = new TreeNode( testSetDir.Name );
node.Name = testSetDir.Name;
node.Tag = testSetDir;
testSetNavigationTree.Nodes.Add( node );
AddFolderToTree( testSetDir, node );
}
AddFilesToTree( testPathDir, null );
testSetNavigationTree.ExpandAll();
_testProgramPath = Path.Combine( testPathDir.FullName, _testProgramSetName );
_fileSystemWatcher = new FileSystemWatcher(_testProgramPath );
_fileSystemWatcher.NotifyFilter = NotifyFilters.FileName;
_fileSystemWatcher.Filter = "*.*";
_fileSystemWatcher.IncludeSubdirectories = true;
_fileSystemWatcher.Created += _fileSystemWatcher_Created;
_fileSystemWatcher.Deleted +=FileSystemWatcherOnDeleted;
_fileSystemWatcher.EnableRaisingEvents = true;
}
}