Ejemplo n.º 1
0
        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();
                    }
                }
            }
        }
Ejemplo n.º 2
0
        void MeasurePictures()
        {
            var pictures = ActiveSheet.Pictures;

            if (pictures.Count == 0)
            {
                if (_cachedPictures.Count > 0)
                {
                    _cachedPictures.Clear();
                }
                return;
            }

            var oldPics = _cachedPictures;

            _cachedPictures = new Dictionary <string, PictureContainer>();
            FloatingObjectLayoutModel viewportFloatingObjectLayoutModel = ParentViewport.Excel.GetViewportFloatingObjectLayoutModel(RowViewportIndex, ColumnViewportIndex);

            for (int i = 0; i < pictures.Count; i++)
            {
                PictureContainer container;
                Picture          picture = pictures[i];
                if (!oldPics.TryGetValue(picture.Name, out container))
                {
                    container = new PictureContainer(picture, ParentViewport);
                    int maxZIndex = GetMaxZIndex();
                    Canvas.SetZIndex(container, maxZIndex + 1);
                    Children.Add(container);
                }
                else
                {
                    oldPics.Remove(picture.Name);
                }
                _cachedPictures.Add(picture.Name, container);

                Size empty = _szEmpty;
                FloatingObjectLayout layout = viewportFloatingObjectLayoutModel.Find(picture.Name);
                if (layout != null)
                {
                    double num3 = 7.0;
                    empty = new Size(layout.Width + (2.0 * num3), layout.Height + (2.0 * num3));
                }

#if !IOS
                container.InvalidateMeasure();
#endif
                container.Measure(empty);
            }

            if (oldPics.Count > 0)
            {
                foreach (var item in oldPics)
                {
                    Children.Remove(item.Value);
                }
            }
        }
Ejemplo n.º 3
0
        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);
        }