예제 #1
0
        public List <AExplorerTreeChildItemModel> FilesToFileItemModel(List <string> files, IExplorerTreeItemModel parentItem)
        {
            List <AExplorerTreeChildItemModel> returnList = new List <AExplorerTreeChildItemModel>();

            foreach (var file in files)
            {
                FileItemModel fileItemModel = new FileItemModel();
                fileItemModel.FileInfo   = new FileInfo(file);
                fileItemModel.IsHidden   = this.CheckIfFileOrDirectoryIsHidden(fileItemModel.FileInfo.Attributes);
                fileItemModel.FullName   = file;
                fileItemModel.Name       = Path.GetFileName(file);
                fileItemModel.IconModel  = IconModelParser.ParseIconModel(fileItemModel.IconModel, file);
                fileItemModel.ParentItem = parentItem;
                returnList.Add(fileItemModel);
            }
            return(returnList);
        }
예제 #2
0
        public List <AExplorerTreeChildItemModel> DirectoriesToDirectoryItemModel(List <string> directories, IExplorerTreeItemModel parentItem)
        {
            List <AExplorerTreeChildItemModel> returnList = new List <AExplorerTreeChildItemModel>();

            foreach (var directory in directories)
            {
                DirectoryItemModel directoryItemModel = new DirectoryItemModel();
                directoryItemModel.DirectoryInfo = new DirectoryInfo(directory);
                directoryItemModel.IsHidden      = this.CheckIfFileOrDirectoryIsHidden(directoryItemModel.DirectoryInfo.Attributes);
                directoryItemModel.FullName      = directory;
                directoryItemModel.Name          = Path.GetFileName(directory);
                directoryItemModel.IconModel     = IconModelParser.ParseIconModel(directoryItemModel.IconModel, directory);
                directoryItemModel.ParentItem    = parentItem;
                returnList.Add(directoryItemModel);
            }
            return(returnList);
        }
예제 #3
0
 internal FileParser(IconModelParser iconModelParser = null)
 {
     this.IconModelParser = iconModelParser ?? new IconModelParser();
 }
예제 #4
0
 public DriveParser(IconModelParser iconModelParser = null)
 {
     this.IconModelParser = iconModelParser ?? new IconModelParser();
 }
예제 #5
0
 internal DirectoryParser(IconModelParser iconModelParser = null)
 {
     this.IconModelParser = iconModelParser ?? new IconModelParser();
 }