public override bool GetCurrParentFileList (fileList_Callback callback){ /* "/" is root folder */ if (_recentPath == "/") { return false; } string[] stringSeparators = new string[] {"/", "\\"}; string[] result = _recentPath.Split(stringSeparators, StringSplitOptions.None); //example //recentFolder = "aaa/bbb/ccc" //cut it = "aaa/bbb/" for (int i = 0; i < (result.Length -2 ); ++i) { if (i == 0) { _recentPath = result[0]; } else { _recentPath += "/" + result[i]; } } if (_recentPath == "") { _recentPath = "/"; } GetFileListFromPath (_recentPath, callback); return true; }
public override bool GetFileListFromPath(string path, fileList_Callback callback) { _recentPath = path; if (!Directory.Exists(_recentPath)) { return(false); } string jsonStr = "{\n \"entries\":[\n "; string[] files = Directory.GetFiles(path); string[] folders = Directory.GetDirectories(path); foreach (string file in files) { string[] stringSeparators = new string[] { "/", "\\" }; string[] result = file.Split(stringSeparators, StringSplitOptions.None); jsonStr += "{\n \".tag\":\"file\",\n \"name\":\"" + result[result.Length - 1] + "\",\n },\n "; } foreach (string folder in folders) { string[] stringSeparators = new string[] { "\\", "/" }; string[] result = folder.Split(stringSeparators, StringSplitOptions.None); jsonStr += "{\n \".tag\":\"folder\",\n \"name\":\"" + result[result.Length - 1] + "\",\n },\n "; } jsonStr += " ],\n }"; callback(jsonStr); return(true); }
public override bool GetSelectedFolderFileList(string _selectedFolderName, fileList_Callback callback) { if (_status == JobStatus.Started) { return(false); } else { _status = JobStatus.Started; } if (_recentPath == "/") { _recentPath += _selectedFolderName; } else { _recentPath += "/" + _selectedFolderName; } bool res = GetFileListFromPath_internal(_recentPath, callback); if (res) { return(true); } else { return(false); } }
public override bool GetCurrParentFileList(fileList_Callback callback) { /* "/" is root folder */ if (_recentPath == "/") { return(false); } string[] stringSeparators = new string[] { "/", "\\" }; string[] result = _recentPath.Split(stringSeparators, StringSplitOptions.None); //example //recentFolder = "aaa/bbb/ccc" //cut it = "aaa/bbb/" for (int i = 0; i < (result.Length - 2); ++i) { if (i == 0) { _recentPath = result[0]; } else { _recentPath += "/" + result[i]; } } if (_recentPath == "") { _recentPath = "/"; } GetFileListFromPath(_recentPath, callback); return(true); }
public override bool GetFileListFromPath (string path, fileList_Callback callback){ _recentPath = path; if (!Directory.Exists (_recentPath)) return false; string jsonStr = "{\n \"entries\":[\n "; string[] files = Directory.GetFiles (path); string[] folders = Directory.GetDirectories (path); foreach (string file in files) { string[] stringSeparators = new string[] {"/", "\\"}; string[] result = file.Split(stringSeparators, StringSplitOptions.None); jsonStr += "{\n \".tag\":\"file\",\n \"name\":\""+ result[result.Length - 1] + "\",\n },\n "; } foreach (string folder in folders) { string[] stringSeparators = new string[] {"\\", "/"}; string[] result = folder.Split(stringSeparators, StringSplitOptions.None); jsonStr += "{\n \".tag\":\"folder\",\n \"name\":\""+ result[result.Length - 1] + "\",\n },\n "; } jsonStr += " ],\n }"; callback(jsonStr); return true; }
public override bool GetSelectedFolderFileList (string _selectedFolderName, fileList_Callback callback){ if (_recentPath == "/") { _recentPath += _selectedFolderName; } else { _recentPath += "/" + _selectedFolderName; } _recentPath += "/"; GetFileListFromPath (_recentPath, callback); return true; }
//Internal Usage---------------------------------------------------------------------------------------------- private bool GetFileListFromPath_internal(string path, fileList_Callback callback) { if (_updateList_bw.IsBusy != true) { _recentPath = path; _isUpdateListDone = false; _updateList_callback = callback; _updateList_bw.RunWorkerAsync(new updateList_argData(_token, CheckPathFilter(path))); return(true); } else { return(false); } }
public override bool GetSelectedFolderFileList(string _selectedFolderName, fileList_Callback callback) { if (_recentPath == "/") { _recentPath += _selectedFolderName; } else { _recentPath += "/" + _selectedFolderName; } _recentPath += "/"; GetFileListFromPath(_recentPath, callback); return(true); }
public override bool GetCurrParentFileList(fileList_Callback callback) { if (_status == JobStatus.Started) { return(false); } else { _status = JobStatus.Started; } /* "/" is root folder */ if (_recentPath == "/") { return(false); } string[] stringSeparators = new string[] { "/" }; string[] result = _recentPath.Split(stringSeparators, StringSplitOptions.None); //example //recentFolder = "aaa/bbb/ccc" //cut it = "aaa/bbb/" for (int i = 0; i < (result.Length - 1); ++i) { if (i == 0) { _recentPath = result [0]; } else { _recentPath += "/" + result [i]; } } bool res = GetFileListFromPath_internal(_recentPath, callback); if (res) { return(true); } else { return(false); } }
public override bool GetFileListFromPath(string path, fileList_Callback callback) { if (_status == JobStatus.Started) { return(false); } else { _status = JobStatus.Started; } bool res = GetFileListFromPath_internal(path, callback); if (res) { return(true); } else { return(false); } }
public abstract bool GetCurrParentFileList(fileList_Callback callback);
public abstract bool GetSelectedFolderFileList (string _selectedFolderName, fileList_Callback callback);
public abstract bool GetCurrParentFileList( fileList_Callback callback);
public abstract bool GetFileListFromPath (string path, fileList_Callback callback);
public override bool GetFileListFromPath (string path, fileList_Callback callback){ if (_status == JobStatus.Started) return false; else _status = JobStatus.Started; bool res = GetFileListFromPath_internal (path, callback); if (res) return true; else return false; }
//Internal Usage---------------------------------------------------------------------------------------------- private bool GetFileListFromPath_internal (string path, fileList_Callback callback){ if (_updateList_bw.IsBusy != true) { _recentPath = path; _isUpdateListDone = false; _updateList_callback = callback; _updateList_bw.RunWorkerAsync (new updateList_argData(_token,CheckPathFilter (path) )); return true; } else { return false; } }
public override bool GetSelectedFolderFileList(string _selectedFolderName, fileList_Callback callback){ if (_status == JobStatus.Started) return false; else _status = JobStatus.Started; if (_recentPath == "/") { _recentPath += _selectedFolderName; } else { _recentPath += "/" + _selectedFolderName; } bool res = GetFileListFromPath_internal (_recentPath, callback); if (res) return true; else return false; }
public abstract bool GetFileListFromPath(string path, fileList_Callback callback);
public abstract bool GetSelectedFolderFileList(string _selectedFolderName, fileList_Callback callback);
public override bool GetCurrParentFileList ( fileList_Callback callback){ if (_status == JobStatus.Started) return false; else _status = JobStatus.Started; /* "/" is root folder */ if (_recentPath == "/") { return false; } string[] stringSeparators = new string[] {"/"}; string[] result = _recentPath.Split(stringSeparators, StringSplitOptions.None); //example //recentFolder = "aaa/bbb/ccc" //cut it = "aaa/bbb/" for (int i = 0; i < (result.Length -1 ); ++i) { if (i == 0) { _recentPath = result [0]; } else { _recentPath += "/" + result [i]; } } bool res = GetFileListFromPath_internal (_recentPath, callback); if (res) return true; else return false; }