コード例 #1
0
ファイル: FloatingObjectLayer.cs プロジェクト: Daoting/dt
        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();
                    }
                }
            }
        }
コード例 #2
0
ファイル: FloatingObjectLayer.cs プロジェクト: Daoting/dt
        public void SetFlotingObjectZIndex(string name, int zIndex)
        {
            FloatingObjectContainer floatingObjectContainer = GetFloatingObjectContainer(name);

            if (floatingObjectContainer != null)
            {
                Canvas.SetZIndex(floatingObjectContainer, zIndex);
            }
        }
コード例 #3
0
ファイル: FloatingObjectLayer.cs プロジェクト: Daoting/dt
        public int GetFlotingObjectZIndex(string name)
        {
            FloatingObjectContainer floatingObjectContainer = GetFloatingObjectContainer(name);

            if (floatingObjectContainer != null)
            {
                return(Canvas.GetZIndex(floatingObjectContainer));
            }
            return(-1);
        }
コード例 #4
0
 internal SpreadChartView GetSpreadChartView(string chartName)
 {
     if (FloatingObjectsPanel != null)
     {
         FloatingObjectContainer floatingObjectContainer = FloatingObjectsPanel.GetFloatingObjectContainer(chartName);
         if ((floatingObjectContainer != null) && (floatingObjectContainer is SpreadChartContainer))
         {
             return((floatingObjectContainer as SpreadChartContainer).SpreadChartView);
         }
     }
     return(null);
 }
コード例 #5
0
ファイル: FloatingObjectLayer.cs プロジェクト: Daoting/dt
 internal void Refresh(object parameter)
 {
     if (!IsSuspendFloatingObjectInvalidate)
     {
         FloatingObject chart = null;
         if (parameter is ChartChangedEventArgs)
         {
             chart = (parameter as ChartChangedEventArgs).Chart;
         }
         else if (parameter is FloatingObjectChangedEventArgs)
         {
             chart = (parameter as FloatingObjectChangedEventArgs).FloatingObject;
         }
         else if (parameter is PictureChangedEventArgs)
         {
             chart = (parameter as PictureChangedEventArgs).Picture;
         }
         if (chart != null)
         {
             FloatingObjectContainer floatingObjectContainer = GetFloatingObjectContainer(chart.Name);
             if (floatingObjectContainer != null)
             {
                 floatingObjectContainer.Refresh(parameter);
             }
         }
         else
         {
             using (Dictionary <string, SpreadChartContainer> .Enumerator enumerator = _cachedCharts.GetEnumerator())
             {
                 while (enumerator.MoveNext())
                 {
                     enumerator.Current.Value.Refresh(parameter);
                 }
             }
             using (Dictionary <string, PictureContainer> .Enumerator enumerator2 = _cachedPictures.GetEnumerator())
             {
                 while (enumerator2.MoveNext())
                 {
                     enumerator2.Current.Value.Refresh(parameter);
                 }
             }
             using (Dictionary <string, FloatingObjectContainer> .Enumerator enumerator3 = _cachedFloatingObjects.GetEnumerator())
             {
                 while (enumerator3.MoveNext())
                 {
                     enumerator3.Current.Value.Refresh(parameter);
                 }
             }
         }
     }
 }
コード例 #6
0
ファイル: FloatingObjectLayer.cs プロジェクト: Daoting/dt
        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);
        }
コード例 #7
0
ファイル: FloatingObjectLayer.cs プロジェクト: Daoting/dt
        void MeasureFloatingObjects()
        {
            var floatingObjects = ActiveSheet.FloatingObjects;

            if (floatingObjects.Count == 0)
            {
                if (_cachedFloatingObjects.Count > 0)
                {
                    _cachedFloatingObjects.Clear();
                }
                return;
            }

            var oldObjects = _cachedFloatingObjects;

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

            for (int i = 0; i < floatingObjects.Count; i++)
            {
                FloatingObjectContainer container;
                FloatingObject          floatingObject = floatingObjects[i];
                if (!oldObjects.TryGetValue(floatingObject.Name, out container))
                {
                    FrameworkElement content = null;
                    if (floatingObject is CustomFloatingObject)
                    {
                        content = (floatingObject as CustomFloatingObject).Content;
                    }
                    container = new FloatingObjectContainer(floatingObject, ParentViewport);
                    if (content != null)
                    {
                        container.Content = content;
                    }
                    int maxZIndex = GetMaxZIndex();
                    Canvas.SetZIndex(container, maxZIndex + 1);
                    Children.Add(container);
                }
                else
                {
                    oldObjects.Remove(floatingObject.Name);
                }
                _cachedFloatingObjects.Add(floatingObject.Name, container);

                Size empty = _szEmpty;
                FloatingObjectLayout layout = viewportFloatingObjectLayoutModel.Find(floatingObject.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 (oldObjects.Count > 0)
            {
                foreach (var item in oldObjects)
                {
                    Children.Remove(item.Value);
                }
            }
        }