private void Init() { try { // суммарная статистика var blank = new SummaryStatItem(string.Empty, Color.Empty); gridSummaryStat.Columns.Add(new FastColumn(blank.Property(p => p.ValueString), Localizer.GetString("TitleValue"))); gridSummaryStat.colorFormatter = (object value, out Color? color, out Color? fontColor) => { color = null; var rowData = (SummaryStatItem) value; fontColor = rowData.RowColor; }; gridSummaryStat.UserDrawCellText += GridSummaryStatUserDrawCellText; // обычная статистика singleParametersFastGrid.Columns.Add(new FastColumn("a", Localizer.GetString("TitleStatisticsIndex"))); singleParametersFastGrid.Columns.Add(new FastColumn("b", " ") { colorColumnFormatter = (object value, out Color? color, out Color? fontColor) => { color = null; fontColor = null; var strVal = value as string; if (string.IsNullOrEmpty(strVal)) return; fontColor = strVal[0] == '-' ? Color.Red : char.IsDigit(strVal[0]) ? Color.Blue : (Color?) null; } }); SetupChart(chartProfit); SetupChart(chartProfit1000); SetupDealsGrid(openedDealsFastGrid, false); SetupDealsGrid(closedDealsFastGrid, true); var metadataSettings = TradeSharpDictionary.Instance.proxy.GetMetadataByCategory("UserInfoEx"); if (metadataSettings != null) photoPanel.Size = new Size((int) metadataSettings["BigAvatarMaxSize"], (int) metadataSettings["BigAvatarMaxSize"]); siteAccessor = new ForexInvestSiteAccessor(forecastsWebBrowser); } catch (Exception ex) { Logger.Info("PerformerStatistic.Init", ex); } }
private void BrowserFormLoad(object sender, EventArgs e) { // запомнить окошко MainForm.Instance.AddNonChartWindowSets(new NonChartWindowSettings { Window = WindowCode, WindowPos = Location, WindowSize = Size, WindowState = WindowState.ToString() }); // восстановить посещенные страницы var urls = UserSettings.Instance.VisitedUrls; cbURL.DataSource = UserSettings.Instance.VisitedUrls; siteAccessor = new ForexInvestSiteAccessor(webBrowser); NavigateOnStart(urls.Count == 0 ? string.Empty : urls[0]); Instance = this; }