internal void RefreshContainerIsSelected(FloatingObject floatingObject) { SpreadChartContainer container = null; if (_cachedCharts.TryGetValue(floatingObject.Name, out container)) { container.RefreshIsSelected(); } else { PictureContainer container2 = null; if (_cachedPictures.TryGetValue(floatingObject.Name, out container2)) { container2.RefreshIsSelected(); } else { FloatingObjectContainer container3 = null; if (_cachedFloatingObjects.TryGetValue(floatingObject.Name, out container3)) { container3.RefreshIsSelected(); } } } }
void MeasureCharts() { var charts = ActiveSheet.Charts; if (charts.Count == 0) { if (_cachedCharts.Count > 0) { _cachedCharts.Clear(); } return; } var oldCharts = _cachedCharts; _cachedCharts = new Dictionary <string, SpreadChartContainer>(); FloatingObjectLayoutModel layoutModel = ParentViewport.Excel.GetViewportFloatingObjectLayoutModel(RowViewportIndex, ColumnViewportIndex); for (int i = 0; i < charts.Count; i++) { SpreadChartContainer container; SpreadChart chart = charts[i]; if (!oldCharts.TryGetValue(chart.Name, out container)) { container = new SpreadChartContainer(chart, new Chart(), ParentViewport); int maxZIndex = GetMaxZIndex(); Canvas.SetZIndex(container, maxZIndex + 1); Children.Add(container); } else { oldCharts.Remove(chart.Name); } _cachedCharts.Add(chart.Name, container); Size size = _szEmpty; FloatingObjectLayout layout = layoutModel.Find(chart.Name); if (layout != null) { double num3 = 7.0; size = new Size(layout.Width + (2.0 * num3), layout.Height + (2.0 * num3)); } #if !IOS container.InvalidateMeasure(); #endif container.Measure(size); } if (oldCharts.Count > 0) { foreach (var item in oldCharts) { Children.Remove(item.Value); } } }
internal FloatingObjectContainer GetFloatingObjectContainer(string name) { SpreadChartContainer container = null; if (_cachedCharts.TryGetValue(name, out container)) { return(container); } PictureContainer container2 = null; if (_cachedPictures.TryGetValue(name, out container2)) { return(container2); } FloatingObjectContainer container3 = null; if (_cachedFloatingObjects.TryGetValue(name, out container3)) { return(container3); } return(null); }