public ThreeSharpFormSample() { InitializeComponent(); this.transfers = new BindingList <TransferInfo>(); this.dataGridViewStatistics.DataSource = transfers; bindStatisticsDelegate = new BindStatisticsDelegate(this.BindStatistics); listBucketDelegate = new ListBucketDelegate(this.ListBucket); listFolderDelegate = new ListFolderDelegate(this.ListFolder); uploadFileDelegate = new UploadFileDelegate(this.UploadFile); downloadFileDelegate = new DownloadFileDelegate(this.DownloadFile); this.basePath = "C:\\"; config = new ThreeSharpConfig(); config.AwsAccessKeyID = Properties.Settings.Default.AwsAccessKeyID; config.AwsSecretAccessKey = Properties.Settings.Default.AwsSecretAccessKey; config.ConnectionLimit = 40; config.IsSecure = true; // It is necessary to use the SUBDOMAIN CallingFormat for accessing EU buckets config.Format = CallingFormat.SUBDOMAIN; this.service = new ThreeSharpQuery(config); }
public ThreeSharpFormSample() { InitializeComponent(); this.transfers = new BindingList<Transfer>(); this.dataGridViewStatistics.DataSource = transfers; bindStatisticsDelegate = new BindStatisticsDelegate(this.BindStatistics); listBucketDelegate = new ListBucketDelegate(this.ListBucket); listFolderDelegate = new ListFolderDelegate(this.ListFolder); uploadFileDelegate = new UploadFileDelegate(this.UploadFile); downloadFileDelegate = new DownloadFileDelegate(this.DownloadFile); this.basePath = "C:\\"; config = new ThreeSharpConfig(); config.AwsAccessKeyID = Properties.Settings.Default.AwsAccessKeyID; config.AwsSecretAccessKey = Properties.Settings.Default.AwsSecretAccessKey; config.ConnectionLimit = 40; config.IsSecure = true; // It is necessary to use the SUBDOMAIN CallingFormat for accessing EU buckets config.Format = CallingFormat.SUBDOMAIN; this.service = new ThreeSharpQuery(config); }
public void ChangeItem(object objDr) { DataRow dr = (DataRow)objDr; string fileId = dr["fileId"].ToString(); ItemUploadFile item = (ItemUploadFile)dr["item"]; UploadFileDelegate ufd = UploadFile; ufd.BeginInvoke(dr, this.Complete, dr); while (true) { if (dr != null && dr.RowState != DataRowState.Detached && dr.RowState != DataRowState.Deleted) { long fileSize = 0; long currentSize = 0; try { fileSize = Convert.ToInt64(dr["FileSize"]); currentSize = Convert.ToInt64(dr["UploadSize"]); } catch (Exception ex) { Thread.Sleep(50); fileSize = Convert.ToInt64(dr["FileSize"]); currentSize = Convert.ToInt64(dr["UploadSize"]); } int value = (int)((currentSize * 100) / fileSize); item.Invoke(new Action(() => { item.value = value; item.Invalidate(); //item.Invalidate(); })); if (value >= 100) { this.sendMessage.Invoke(item.File); RemoveItem.Invoke(item.File); this.addFileMessage(item.File); lock (dtMission) { dtMission.Rows.Remove(dr); } break; } } else { break; } Thread.Sleep(500); } }