Ejemplo n.º 1
0
        public void UpDateFileExplorerViewModel()
        {

            DirInfo temp_CurrentDirectory = CurrentTreeItem;
            DirInfo rootNode = new DirInfo(Resources.My_WorkSpace);
            rootNode.Path = Environment.GetEnvironmentVariable("USERPROFILE") + "\\" + Miseng.Properties.Resources.My_WorkSpace_Name;
            SystemDirectorySource = new List<DirInfo> { rootNode };
            _evm.UpdateDirectory = temp_CurrentDirectory;
            ExpandToCurrentNode(temp_CurrentDirectory);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// ctor
        /// </summary>
        /// <param name="evm"></param>
        public FileExplorerViewModel(ControlViewModel evm)
        {
            _evm = evm;

            //create a node for "my computer"
            // this will be the root for the file system tree
            DirInfo rootNode = new DirInfo(Resources.My_WorkSpace);
            rootNode.Path = Environment.GetEnvironmentVariable("USERPROFILE") + "\\" + Miseng.Properties.Resources.My_WorkSpace_Name;
            _evm.CurrentDirectory = rootNode; //make root node as the current directory            
            _evm.UpdateDirectory = new DirInfo();
            SystemDirectorySource = new List<DirInfo> { rootNode };
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="curDir"></param>
 public void ExpandToCurrentNode(DirInfo curDir)
 {
     //expand the current selected node in tree 
     //if this is an ancestor of the directory we want to navigate or "My Computer" current node 
     if (CurrentTreeItem != null && (curDir.Path.Contains(CurrentTreeItem.Path) || CurrentTreeItem.Path == Environment.GetEnvironmentVariable("USERPROFILE")))
     {
         // expand the current node
         // If the current node is already expanded then first collapse it n then expand it                
         CurrentTreeItem.IsExpanded = false;
         CurrentTreeItem.IsExpanded = true;
     }
 }