public FrmUploadData() { this.accounts = JsonConvert.DeserializeObject<IDictionary<string, string>>(File.ReadAllText("Scripts/Accounts.json")); this.tableKeys = JsonConvert.DeserializeObject<string[]>(Settings.Default.DBKeys); this.Text = Resources.FormTitle; this.jsObj.OnLogin += OnLogin; this.jsObj.OnContinue += OnContinue; this.jsObj.OnException += OnException; this.webView = new ChromiumWebBrowser("about:blank"); this.webView.RegisterJsObject("submitSys", this.jsObj); var actionsJson = File.ReadAllText("Scripts/ActionDefinition.json"); this.actions = JsonConvert.DeserializeObject<Actions>(actionsJson); this.InitializeComponent(); this.cmbAccount.DataSource = this.accounts.ToList(); // set the date time controls dateStart.MaxDate = dateEnd.Value; dateEnd.MinDate = dateStart.Value; this.webView.FrameLoadEnd += this.WebViewOnLoginFrameLoadEnd; this.webView.Dock = DockStyle.Fill; this.pnlWebView.Controls.Add(this.webView); this.webView.Load(this.actions.LoginUrl); this.dataFiles = new List<DataFile>(); }
public FrmDownloadDoc() { this.Text = Resources.FormTitle; this.jsObj.OnLogin += OnLogin; this.jsObj.OnContinue += OnContinue; this.jsObj.OnException += OnException; this.webView = new ChromiumWebBrowser("about:blank"); this.webView.RegisterJsObject("submitSys", this.jsObj); var actionsJson = File.ReadAllText("Scripts/DownloadActionDefinition.json"); this.actions = JsonConvert.DeserializeObject<Actions>(actionsJson); this.InitializeComponent(); this.webView.FrameLoadEnd += this.WebViewOnLoginFrameLoadEnd; this.webView.FrameLoadEnd += this.WebViewOnSetDefaultConditionsFrameLoadEnd; this.webView.Dock = DockStyle.Fill; this.pnlWebView.Controls.Add(this.webView); this.webView.Load(this.actions.LoginUrl); this.dbDocTable = new DBDocTable(File.ReadAllText("FieldMaps/DatabaseTable.map")); }