Exemplo n.º 1
0
        public async override void StreamThread()
        {
            // 다운로드시 보일 라벨과 프로그래스 바를 설정해준다.
            label.Text       = "0%";
            label.Name       = "label";
            label.AutoSize   = true;
            progress.Value   = 0;
            progress.Maximum = 100;
            progress.Controls.Add(label);
            progress.Size = new System.Drawing.Size(181, 23);
            this.OnControl(this, progress);
            FolderInfo folders = new FolderInfo();

            folders.isfile = false;
            //folder.directory = new List<System.IO.DirectoryInfo>();
            this.maxsize += await CreateDirectory(folders, localfolder, localfolder.FullName);

            // 폴더안에 파일들을 가져오는 함수 시작
            // 업로드를 시작한다.
            CloudFiles file = await folder.CreateFolder(System.IO.Path.GetFileName(localfolder.FullName), this.fileid);

            await UpFolder(folders, file.Item.FileID);

            this.OnProgressChange(this, this.maxsize, this.maxsize, this.progress);
            // 업로드 완료시 이벤트 발생
            this.OnComplete(this, progress, file, this.fileid, group);
        }
Exemplo n.º 2
0
        private async void btn_OK_Click(object sender, EventArgs e)
        {
            if (tb_NAME.Text != "")
            {
                if (NewFileOption.CREATEFOLDER == option)
                {
                    if (MessageBox.Show(tb_NAME.Text + "로 폴더를 생성하시겠습니까?", "폴더 생성", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
                    {
                        try
                        {
                            file = await folder.CreateFolder(tb_NAME.Text, parentid);

                            this.DialogResult = System.Windows.Forms.DialogResult.OK;
                            Close();
                        }
                        catch (Exception er)
                        {
                            MessageBox.Show("에러 : " + er.Message);
                        }
                    }
                    else
                    {
                        return;
                    }
                }
                else if (NewFileOption.RENAME == option)
                {
                    if (MessageBox.Show(tb_NAME.Text + "로 파일명을 변경하시겠습니까?", "파일명 변경", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
                    {
                        try
                        {
                            await file.ChageFileName(tb_NAME.Text);

                            this.DialogResult = System.Windows.Forms.DialogResult.OK;
                            Close();
                        }
                        catch (Exception error)
                        {
                            MessageBox.Show("에러 : " + error.Message);
                        }
                    }
                    else
                    {
                        return;
                    }
                }
            }
            else
            {
                MessageBox.Show("폴더명을 입력해야 합니다");
                return;
            }
        }