Exemple #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (CloudId.Length != 0)
            {
                hash ^= CloudId.GetHashCode();
            }
            if (createdAt_ != null)
            {
                hash ^= CreatedAt.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (Description.Length != 0)
            {
                hash ^= Description.GetHashCode();
            }
            hash ^= Labels.GetHashCode();
            if (Status != global::Yandex.Cloud.Resourcemanager.V1.Folder.Types.Status.Unspecified)
            {
                hash ^= Status.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemple #2
0
        public override async Task <bool> Start(FileInformation source, string target, OperaType operaType)
        {
            bool isSuccess = false;

            switch (operaType)
            {
            case OperaType.UpLoad:
                try
                {
                    var o = new OneDriveFileUpload();
                    o.ProgressEvent += O_ProgressEvent;
                    isSuccess        = await o.UpLoadFile(Cloud.CloudToken, source, Guid.NewGuid().ToString());
                }
                catch (Exception e)
                {
                    OnException(new ExceptionEventHandler(CloudId.ToString(), "", e.ToString()));
                }
                break;

            case OperaType.DownLoad:
                try
                {
                    var o = new OneDriveFileLoad();
                    o.ProgressEvent += O_ProgressEvent;
                    isSuccess        = await o.DownloadFile(Cloud.CloudToken, source, target, Guid.NewGuid().ToString());
                }
                catch (Exception e)
                {
                    OnException(new ExceptionEventHandler(CloudId.ToString(), "", e.ToString()));
                }
                break;
            }
            return(isSuccess);
        }
Exemple #3
0
        /// <summary>
        /// 搜寻文件夹
        /// </summary>
        /// <param name="fileid"></param>
        /// <returns></returns>
        public override IList <FileInformation> Search(string fileid)
        {
            List <FileInformation> fileInfoList       = new List <FileInformation>();
            OneDriveFileSearch     oneDriveFileSearch = new OneDriveFileSearch();

            try
            {
                fileInfoList = (List <FileInformation>)oneDriveFileSearch.SearchFile(Cloud.CloudToken, fileid);
            }
            catch (Exception ex)
            {
                OnException(new ExceptionEventHandler(CloudId.ToString(), "", ex.ToString()));
                throw;
            }
            return(fileInfoList);
        }
 public override int GetHashCode()
 {
     return(Id.GetHashCode() ^ CloudId.GetHashCode());
 }
Exemple #5
0
 private void O_ProgressEvent(long arg1, long arg2, string arg3)
 {
     OnProgress(new ProgressEventhandler(CloudId.ToString(), arg3, arg1, arg2));
 }