protected virtual void OnImportComplete() { timer.Stop(); args.ImportStop = DateTime.Now; args.Duration = timer.Elapsed; args.RowsImported = TotalRowsImported(); ImportComplete?.Invoke(this, args); }
public async void ImportFromWebService() { var apiurl = Properties.Settings.Default.pmis_api_url; var project = Properties.Settings.Default.pmis_project_code; var authkey = Properties.Settings.Default.pmis_auth_key; string url = String.Format("{0}/api/register/docs.action", apiurl); try { using (var client = new HttpClient()) { var values = new Dictionary <string, string> { { "forward", "json" }, { "srch_show_hist", "1" }, { "pjt_cd", project }, { "access_token", authkey }, { "pageScale", "200" }, { "pageNo", "1" }, { "login_locale", "ko_KR" } }; var page = 1; var total = 999; while (page <= total) { values["pageNo"] = "" + page; var content = new FormUrlEncodedContent(values); var response = await client.PostAsync(url, content); response.EnsureSuccessStatusCode(); var responseString = await response.Content.ReadAsStringAsync(); PmisJsonResponse <RegisterDocument> dt = JsonConvert.DeserializeObject <PmisJsonResponse <RegisterDocument> >(responseString); ImportData(dt.List); page = dt.PageInfo.CurrentPage + 1; total = dt.PageInfo.TotalPages; LogUtil.Log(dt.ToString()); } } } catch (Exception ex) { ex.Log().Display(); ImportError?.Invoke(this, new ErrorEventArgs(ex)); } finally { ImportComplete?.Invoke(this, EventArgs.Empty); } }
private void onImportComplete(ImportResultSet result) { ImportComplete?.Invoke(result); }
private void buttonImport_Click(object sender, EventArgs e) { DJScanCompletList = DJScan.BaseUnit.ImageTools.DJCommonUnit.OpenFileDialogImport(openFileDialog1, DJImgEncrypt, DJScanTitle, DJScanCompletList); ImportComplete.Invoke(sender); }
/// <summary> /// Invokes import complete event /// </summary> public void NotifyImportComplete() { ImportComplete?.Invoke(this, EventArgs.Empty); }
protected virtual void OnImportComplete(EventArgs e) { ImportComplete?.Invoke(this, e); }
public void OnImportComplete() { ImportComplete?.Invoke(this, new EventArgs()); }