bool checkRootPathExist() { if (RootPathFileNames.ContainsKey(Info.RootPath)) { return(RootPathFileNames[Info.RootPath].Count > 0); } else { InitAndroidFileExtractor(); var res = androidFileExtracter.SearchFiles(androidDevice, Info.RootPath, "*", Android.AndroidFileType.file); if (res.Success) { RootPathFileNames.Add(Info.RootPath, res.FilePropertys.Select(c => c.Name).ToList()); return(res.FilePropertys.Count > 0); } else { throw new Exception("FileExtracter Error"); } } }
bool checkRootPathExist(string rootPath) { lock (RootPathFileNames) { if (RootPathFileNames.ContainsKey(rootPath)) { return(RootPathFileNames[rootPath].Count > 0); } var pcRoot = PCPath + rootPath.Replace('/', '\\'); try { DirectoryInfo theFolder = new DirectoryInfo(pcRoot); FileInfo[] thefileInfo = theFolder.GetFiles("*.*", SearchOption.AllDirectories); RootPathFileNames.Add(rootPath, thefileInfo.Select(c => c.FullName.Substring(PCPath.Length)).ToList()); } catch { RootPathFileNames.Add(rootPath, new List <string>()); } return(RootPathFileNames[rootPath].Count > 0); } }