Пример #1
0
    public bool GetSelectedFolderFileList(string _selectedFolderName, bhClowdDriveAPI.fileList_Callback callback)
    {
        if (_type == eCloudType.NotSelected)
        {
            return(false);
        }

        bool res = false;

        switch (_type)
        {
        case eCloudType.bCloudDrive:
        {
            res = _bDriveAPI.GetSelectedFolderFileList(_selectedFolderName, callback);
        }
        break;

        case eCloudType.GoogleDrive:
        {
            res = true;
            _bGoogleAPI.GetSelectedFolderFileList(_selectedFolderName, callback);
        }
        break;
        }
        return(res);
    }
Пример #2
0
    public bool GetFileListFromPath(string path, bhClowdDriveAPI.fileList_Callback callback)
    {
        if (_type == eCloudType.NotSelected)
        {
            return(false);
        }

        bool res = false;

        switch (_type)
        {
        case eCloudType.bCloudDrive:
        {
            res = _bDriveAPI.GetFileListFromPath(path, callback);
        }
        break;

        case eCloudType.GoogleDrive:
        {
            res = true;
            string resPath = path;
            if (path == "/")
            {
                resPath = "";
            }

            _bGoogleAPI.GetSelectedFolderFileList(resPath, callback);
        }
        break;
        }
        return(res);
    }
Пример #3
0
    public bool GetCurrParentFileList(bhClowdDriveAPI.fileList_Callback callback)
    {
        if (_type == eCloudType.NotSelected)
        {
            return(false);
        }

        bool res = false;

        switch (_type)
        {
        case eCloudType.bCloudDrive:
        {
            res = _bDriveAPI.GetCurrParentFileList(callback);
        }
        break;

        case eCloudType.GoogleDrive:
        {
            res = true;
            _bGoogleAPI.GetCurrParentFileList(callback);
        }
        break;
        }
        return(res);
    }
Пример #4
0
    public void  GetCurrParentFileList(bhClowdDriveAPI.fileList_Callback callback)
    {
        if (_drive == null || _isUpdateListProcessing == true)
        {
            return;
        }

        _isUpdateListDone       = false;
        _updateList_callback    = callback;
        _isUpdateListProcessing = true;

        int parentIdx = currPath.Count - 1;

        if (parentIdx < 0)
        {
            parentIdx = 0;
        }

        if (parentIdx != 0)
        {
            currPath.RemoveAt(currPath.Count - 1);
        }

        parentIdx -= 1;
        if (parentIdx < 0)
        {
            parentIdx = 0;
        }

        string bbbRes = currPath[parentIdx];

        StartCoroutine(GetFileLists_internal(bbbRes, delegate() {
            _isUpdateListDone       = true;
            _isUpdateListProcessing = false;
        }));
    }
Пример #5
0
    public void GetSelectedFolderFileList(string _selectedFolderName, bhClowdDriveAPI.fileList_Callback callback)
    {
        if (_drive == null || _isUpdateListProcessing == true)
        {
            return;
        }

        _isUpdateListDone       = false;
        _updateList_callback    = callback;
        _isUpdateListProcessing = true;

        /*
         * if (recentFolderID != "none") {
         * parentFolderID = recentFolderID;
         * }*/

        string id = "";

        if (_selectedFolderName != "")
        {
            /*
             * string removedLastWhiteSpace = "";
             *
             * for (int i = 0; i < _selectedFolderName.Length - 1; i++) {
             *      removedLastWhiteSpace += _selectedFolderName [i];
             * }*/

            //bool res = _filesDictionary.ContainsKey (_selectedFolderName);
            if (_filesDictionary != null && _filesDictionary.ContainsKey(_selectedFolderName))
            {
                id = _filesDictionary [_selectedFolderName].ID;
            }

            recentFolderName = _selectedFolderName;

            bool isDuplicated = false;
            foreach (string Path in currPath)
            {
                if (Path == id)
                {
                    isDuplicated = true;
                }
            }

            if (!isDuplicated)
            {
                currPath.Add(id);
            }
        }
        else
        {
            recentFolderID   = id;
            recentFolderName = _selectedFolderName;
            //parentFolderID = "";
            currPath.Add("");
        }


        StartCoroutine(GetFileLists_internal(id, delegate() {
            _isUpdateListDone       = true;
            _isUpdateListProcessing = false;
        }));
    }
Пример #6
0
	public void  GetCurrParentFileList (bhClowdDriveAPI.fileList_Callback callback){
		if (_drive == null || _isUpdateListProcessing == true)
			return;

		_isUpdateListDone = false;
		_updateList_callback = callback; 
		_isUpdateListProcessing = true;

		int parentIdx = currPath.Count - 1;
		if (parentIdx < 0)
			parentIdx = 0;
		
		if (parentIdx != 0) {
			currPath.RemoveAt(currPath.Count - 1);
		}

		parentIdx -= 1;
		if (parentIdx < 0)
			parentIdx = 0;

		string bbbRes = currPath[parentIdx];
			
		StartCoroutine (GetFileLists_internal (bbbRes, delegate() {
			_isUpdateListDone = true;
			_isUpdateListProcessing = false;
		}));
	}
Пример #7
0
	public void GetSelectedFolderFileList(string _selectedFolderName, bhClowdDriveAPI.fileList_Callback callback){
		if (_drive == null || _isUpdateListProcessing == true)
			return;

		_isUpdateListDone = false;
		_updateList_callback = callback;
		_isUpdateListProcessing = true;
		/*
        if (recentFolderID != "none") {
            parentFolderID = recentFolderID;
        }*/
		
		string id = "";
		if (_selectedFolderName != "") {
			/*
			string removedLastWhiteSpace = "";

			for (int i = 0; i < _selectedFolderName.Length - 1; i++) {
				removedLastWhiteSpace += _selectedFolderName [i];
			}*/

			//bool res = _filesDictionary.ContainsKey (_selectedFolderName);
			if (_filesDictionary != null &&_filesDictionary.ContainsKey(_selectedFolderName)) {
				id = _filesDictionary [_selectedFolderName].ID;
			}

			recentFolderName = _selectedFolderName;

			bool isDuplicated = false;
			foreach(string Path in currPath){
				if (Path == id) {
					isDuplicated = true;
				}
			}

			if (!isDuplicated) {
				currPath.Add (id);
			}


		}else{
			
			recentFolderID = id;
			recentFolderName = _selectedFolderName;
			//parentFolderID = "";
			currPath.Add ("");
		}


        StartCoroutine (GetFileLists_internal (id, delegate() {
			_isUpdateListDone = true;
			_isUpdateListProcessing = false;
		}));
	}