Exemple #1
0
        public void TransferBoundsToLayoutObjects()
        {
            PlotLayoutBase @object = base.Object;

            @object.Bounds     = base.BoundsScreen;
            @object.BoundsClip = base.BoundsClip;
        }
        int IComparer.Compare(object x, object y)
        {
            PlotLayoutBase plotLayoutBase  = x as PlotLayoutBase;
            PlotLayoutBase plotLayoutBase2 = y as PlotLayoutBase;

            if (plotLayoutBase == null)
            {
                throw new Exception("x is not a PlotLayoutBase object");
            }
            if (plotLayoutBase2 == null)
            {
                throw new Exception("y is not a PlotLayoutBase object");
            }
            return(plotLayoutBase.DockOrder.CompareTo(plotLayoutBase2.DockOrder));
        }
        public bool IsDocked(PlotLayoutBase value)
        {
            PlotLayoutDockableDataView plotLayoutDockableDataView = value as PlotLayoutDockableDataView;

            if (plotLayoutDockableDataView == null)
            {
                return(false);
            }
            if (!plotLayoutDockableDataView.DocksToDataView)
            {
                return(false);
            }
            if (plotLayoutDockableDataView.DockDataViewName.ToUpper() != base.Name.ToUpper())
            {
                return(false);
            }
            return(true);
        }
        int IComparer.Compare(object x, object y)
        {
            PlotLayoutBase plotLayoutBase  = x as PlotLayoutBase;
            PlotLayoutBase plotLayoutBase2 = y as PlotLayoutBase;

            if (plotLayoutBase == null)
            {
                throw new Exception("x is not a PlotLayoutBase object");
            }
            if (plotLayoutBase2 == null)
            {
                throw new Exception("y is not a PlotLayoutBase object");
            }
            int num   = (plotLayoutBase.DockRight || plotLayoutBase.DockTop) ? (1000000 + plotLayoutBase.DockOrder) : (-plotLayoutBase.DockOrder);
            int value = (plotLayoutBase2.DockRight || plotLayoutBase2.DockTop) ? (1000000 + plotLayoutBase2.DockOrder) : (-plotLayoutBase2.DockOrder);

            if (plotLayoutBase.DockOrientation != plotLayoutBase2.DockOrientation)
            {
                return(0);
            }
            return(num.CompareTo(value));
        }
Exemple #5
0
        public void CalcualteDimensions(PaintArgs p)
        {
            this.TotalStackingPixels = 0;
            this.MaxDepthScreen      = 0;
            this.MaxDepthLayout      = 0;
            this.MaxDockMargin       = -10000;
            this.OverlapStart        = 0;
            PlotLayoutBase plotLayoutBase  = null;
            PlotLayoutBase plotLayoutBase2 = null;

            for (int i = 0; i < this.Items.Count; i++)
            {
                PlotLayoutBase @object = this.Items[i].Object;
                this.MaxDepthLayout            = Math.Max(this.MaxDepthLayout, 21);
                @object.TextOverlapPixelsStart = 0;
                @object.TextOverlapPixelsStop  = 0;
                @object.StackingPixelsStart    = 0;
                @object.StackingPixelsStop     = 0;
                if (@object.Visible)
                {
                    this.MaxDepthScreen = Math.Max(this.MaxDepthScreen, @object.DockDepthPixels);
                    this.MaxDockMargin  = Math.Max(this.MaxDockMargin, @object.DockMargin);
                    if (plotLayoutBase == null)
                    {
                        plotLayoutBase = @object;
                    }
                    plotLayoutBase2 = @object;
                }
            }
            if (this.MaxDockMargin == -10000)
            {
                this.MaxDockMargin = 0;
            }
            foreach (PlotLayoutBlockItem item in this.Items)
            {
                PlotAxis plotAxis = item.Object as PlotAxis;
                if (plotAxis != null)
                {
                    bool flag = plotLayoutBase != plotLayoutBase2;
                    if (plotAxis.DockForceStacking)
                    {
                        flag = true;
                    }
                    if (flag)
                    {
                        int num;
                        if (plotAxis.DockVertical)
                        {
                            num = (int)Math.Round((double)p.Graphics.MeasureString("0", plotAxis.ScaleDisplay.TickMajor.Font).Height *plotAxis.DockStackingEndsMargin);
                        }
                        num = (int)Math.Round((double)p.Graphics.MeasureString("0", plotAxis.ScaleDisplay.TickMajor.Font).Width *plotAxis.DockStackingEndsMargin);
                        if (plotAxis == plotLayoutBase && !plotAxis.DockForceStacking)
                        {
                            plotAxis.TextOverlapPixelsStop = plotAxis.ScaleDisplay.TextOverlapPixels;
                            plotAxis.StackingPixelsStop    = num;
                            this.TotalStackingPixels      += plotAxis.ScaleDisplay.TextOverlapPixels + num;
                        }
                        else if (plotAxis == plotLayoutBase2 && !plotAxis.DockForceStacking)
                        {
                            plotAxis.TextOverlapPixelsStart = plotAxis.ScaleDisplay.TextOverlapPixels;
                            plotAxis.StackingPixelsStart    = num;
                            this.TotalStackingPixels       += plotAxis.ScaleDisplay.TextOverlapPixels + num;
                        }
                        else
                        {
                            plotAxis.TextOverlapPixelsStart = plotAxis.ScaleDisplay.TextOverlapPixels;
                            plotAxis.TextOverlapPixelsStop  = plotAxis.ScaleDisplay.TextOverlapPixels;
                            plotAxis.StackingPixelsStart    = num;
                            plotAxis.StackingPixelsStop     = num;
                            this.TotalStackingPixels       += 2 * plotAxis.ScaleDisplay.TextOverlapPixels + 2 * num;
                        }
                    }
                }
            }
            if (plotLayoutBase != null)
            {
                PlotAxis plotAxis = plotLayoutBase as PlotAxis;
                if (plotAxis != null)
                {
                    this.OverlapStart = plotAxis.ScaleDisplay.TextOverlapPixels;
                }
            }
            if (plotLayoutBase2 != null)
            {
                PlotAxis plotAxis = plotLayoutBase2 as PlotAxis;
                if (plotAxis != null)
                {
                    this.OverlapStop = plotAxis.ScaleDisplay.TextOverlapPixels;
                }
            }
        }
 public int IndexOf(PlotLayoutBase value)
 {
     return(this.m_List.IndexOf(value));
 }
 public int Add(PlotLayoutBase value)
 {
     return(this.m_List.Add(value));
 }