public void loadRecentlyUsedExprs() { this.Controls.Clear(); List<Expr> exprs = SettingUtility.getRecentlyUsedExprs(); foreach (Expr expr in exprs) { ExprDisplayer exprDisplayer = new ExprDisplayer(expr); exprDisplayer.Width = (this.Width - this.Margin.All * 2 - this.Padding.Right - 40) / 5; exprDisplayer.Height = exprDisplayer.Width; exprDisplayer.SizeMode = PictureBoxSizeMode.Zoom; exprDisplayer.ImageLocation = FileUtility.FullPath(expr); exprDisplayer.MouseEnter += ExprDisplayer_MouseEnter; this.Controls.Add(exprDisplayer); } }
private void RemoteExprsLoader_ProgressChanged(object sender, ProgressChangedEventArgs e) { RemoteExprsLoader worker = sender as RemoteExprsLoader; if (worker.id == requestId) { int index = e.ProgressPercentage; ExprDisplayer exprDisplayer = new ExprDisplayer(worker.exprs[index]); exprDisplayer.Width = (this.Width - this.Margin.All * 2 - this.Padding.Right - 40) / 5; exprDisplayer.Height = exprDisplayer.Width; exprDisplayer.SizeMode = PictureBoxSizeMode.Zoom; exprDisplayer.ImageLocation = FileUtility.FullPath(worker.exprs[index]); exprDisplayer.MouseEnter += ExprDisplayer_MouseEnter; this.Controls.Add(exprDisplayer); } }