Пример #1
0
	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;
	}
Пример #2
0
    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);
    }
Пример #3
0
    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);
        }
    }
Пример #4
0
    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);
    }
Пример #5
0
	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;
	}
Пример #6
0
	public override bool GetSelectedFolderFileList (string _selectedFolderName, fileList_Callback callback){
		if (_recentPath == "/") {
			_recentPath += _selectedFolderName;
		} else {
			_recentPath += "/" + _selectedFolderName;
		}

		_recentPath += "/";

		GetFileListFromPath (_recentPath, callback);
		return true;
	}
Пример #7
0
 //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);
     }
 }
Пример #8
0
    public override bool GetSelectedFolderFileList(string _selectedFolderName, fileList_Callback callback)
    {
        if (_recentPath == "/")
        {
            _recentPath += _selectedFolderName;
        }
        else
        {
            _recentPath += "/" + _selectedFolderName;
        }

        _recentPath += "/";

        GetFileListFromPath(_recentPath, callback);
        return(true);
    }
Пример #9
0
    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);
        }
    }
Пример #10
0
    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);
        }
    }
Пример #11
0
 public abstract bool GetCurrParentFileList(fileList_Callback callback);
Пример #12
0
	public abstract bool GetSelectedFolderFileList (string _selectedFolderName, fileList_Callback callback);
Пример #13
0
	public abstract bool GetCurrParentFileList( fileList_Callback callback);
Пример #14
0
	public abstract bool GetFileListFromPath (string path, fileList_Callback callback);
Пример #15
0
	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;
	}
Пример #16
0
	//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;
		}
	}
Пример #17
0
	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;
	}
Пример #18
0
 public abstract bool GetFileListFromPath(string path, fileList_Callback callback);
Пример #19
0
 public abstract bool GetSelectedFolderFileList(string _selectedFolderName, fileList_Callback callback);
Пример #20
0
	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;
	}