Ejemplo n.º 1
0
        private void UploadProject(string fileName)
        {
            string pid = this.projectId;

            switch (transferMode)
            {
            case TransferMode.FTP:
                ftpInstance.AsyncUploadProject(fileName, pid, new BasicProgress <double>(p => OnFtpProgressChange((float)p)),
                                               OnFtpUploadCompleted);
                break;

            case TransferMode.COS:
                if (cosUploadModeFlag == (int)CosUploadMode.Delta)
                {
                    Debug.Log("start delta upload:" + fileName);
                    CosFacade.GetInstance(pid).AsyncUploadProject(fileName, pid, OnCosUploadProgressChange, OnCosUploadMessage, OnCosUploadSuccess, OnCosUploadFail);
                }
                else if (cosUploadModeFlag == (int)CosUploadMode.Full)
                {
                    CosFacade.GetInstance(pid).UploadProject(fileName, pid, OnCosUploadProgressChange, OnCosUploadMessage, OnCosUploadSuccess, OnCosUploadFail);
                }
                break;

            default:
                Console.WriteLine("Not supported mode!");
                return;
            }
        }