protected override void OnClick(EventArgs e) { var dict = new Dictionary<string, Control>(); LongShortResultDisplay lsrd = new LongShortResultDisplay(); lsrd.Create(m_analyzer); dict.Add("Per Instrument", lsrd); OverallLongShortDisplay olsd = new OverallLongShortDisplay(); olsd.Create(m_analyzer); dict.Add("Overall portfolio", olsd); OverallPersistenceDisplay olpd = new OverallPersistenceDisplay(); olpd.Create(m_analyzer); dict.Add("Position persistence", olpd); if (m_isFX) { RegionSidePnlChart rspc = new RegionSidePnlChart(); rspc.Create(m_analyzer); dict.Add("Regional Pnl / Positioning", rspc); USDWeightRegionalBreakdownDisplay uwrbd = new USDWeightRegionalBreakdownDisplay(); uwrbd.Create(m_analyzer.SourceWts, new FXGroup[] { FXGroup.G10, FXGroup.EMEA, FXGroup.LATAM, FXGroup.ASIA }); dict.Add("Region concentration", uwrbd); } dict.DisplayInShowForm(m_analyzer.Name); }
private void handleWtsColumnChartDataClicked(object sender, SI.Controls.SimpleWtsColumnChart.DataClickedEventArgs e_) { if ((ModifierKeys & Keys.Shift) != 0 && (ModifierKeys & Keys.Control) != 0) { string name = e_.ColumnLabel.Substring(0, e_.ColumnLabel.LastIndexOf('.') ); WtsSeriesAnalyzer analyzer = m_seriesAnalyzers.Where(x => x.Name.Equals(name)).FirstOrDefault(); DateTime startDate, endDate; string formatString = ExtensionMethods.FormatStringForPeriodicity(m_brArgs.Period); switch (m_brArgs.Period) { case Periodicity.Days: startDate = endDate = DateTime.ParseExact(e_.RowLabel, formatString, System.Globalization.CultureInfo.InvariantCulture); break; case Periodicity.Months: startDate = DateTime.ParseExact(e_.RowLabel, formatString, System.Globalization.CultureInfo.InvariantCulture); endDate = MyCalendar.LastWeekDayOfMonth(startDate); break; case Periodicity.Weeks: startDate = DateTime.ParseExact(e_.RowLabel, formatString, System.Globalization.CultureInfo.InvariantCulture); endDate = startDate.AddDays(6d); break; case Periodicity.Years: startDate = DateTime.ParseExact(e_.RowLabel, formatString, System.Globalization.CultureInfo.InvariantCulture); endDate = new DateTime(startDate.Year, 12, 31); break; default: startDate = endDate = DateTime.Today; break; } LongShortResultDisplay lsrd = new LongShortResultDisplay(); lsrd.Create(analyzer, startDate, endDate); RegionSidePnlChart rspc = new RegionSidePnlChart(); rspc.Create(analyzer, startDate, endDate); OverallLongShortDisplay olsd = new OverallLongShortDisplay(); olsd.Create(analyzer,startDate,endDate); new KeyValuePair<string, Control>[] { new KeyValuePair<string,Control>("Overall portfolio",olsd), //new KeyValuePair<string,Control>("Position persistence",olpd), new KeyValuePair<string,Control>("Per Currency",lsrd), new KeyValuePair<string,Control>("Regional Pnl / Positioning",rspc), //new KeyValuePair<string,Control>("Region Concentration",uwrbd) }.DisplayInShowForm(string.Format("{0} ({1} to {2})", name, startDate.ToString("dd-MMM-yy"), endDate.ToString("dd-MMM-yy"))); } }