当前位置: 首页>>代码示例>>C#>>正文


C# IRenderContext.CleanUp方法代码示例

本文整理汇总了C#中IRenderContext.CleanUp方法的典型用法代码示例。如果您正苦于以下问题:C# IRenderContext.CleanUp方法的具体用法?C# IRenderContext.CleanUp怎么用?C# IRenderContext.CleanUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IRenderContext的用法示例。


在下文中一共展示了IRenderContext.CleanUp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RenderOverride


//.........这里部分代码省略.........
        /// <param name="width">The width.</param>
        /// <param name="height">The height.</param>
        protected virtual void RenderOverride(IRenderContext rc, double width, double height)
        {
            lock (this.SyncRoot)
            {
                try
                {
                    if (this.updateException != null)
                    {
                        // There was an exception during plot model update.
                        // This could happen when OxyPlot is given invalid input data.
                        // The client application should be responsible for handling this.
                        // If the client application submitted invalid data, show the exception message and stack trace.
                        var errorMessage = string.Format(
                                "An exception of type {0} was thrown when updating the plot model.\r\n{1}",
                                this.updateException.GetType(),
                                this.updateException.GetBaseException().StackTrace);
                        this.RenderErrorMessage(rc, string.Format("OxyPlot exception: {0}", this.updateException.Message), errorMessage);
                        return;
                    }

                    var minimumWidth = this.Padding.Left + this.Padding.Right;
                    var minimumHeight = this.Padding.Top + this.Padding.Bottom;
                    if (width <= minimumWidth || height <= minimumHeight)
                    {
                        return;
                    }

                    if (this.RenderingDecorator != null)
                    {
                        rc = this.RenderingDecorator(rc);
                    }

                    this.Width = width;
                    this.Height = height;

                    this.ActualPlotMargins =
                        new OxyThickness(
                            double.IsNaN(this.PlotMargins.Left) ? 0 : this.PlotMargins.Left,
                            double.IsNaN(this.PlotMargins.Top) ? 0 : this.PlotMargins.Top,
                            double.IsNaN(this.PlotMargins.Right) ? 0 : this.PlotMargins.Right,
                            double.IsNaN(this.PlotMargins.Bottom) ? 0 : this.PlotMargins.Bottom);

                    this.EnsureLegendProperties();

                    while (true)
                    {
                        this.UpdatePlotArea(rc);
                        this.UpdateAxisTransforms();
                        this.UpdateIntervals();

                        if (!this.AdjustPlotMargins(rc))
                        {
                            break;
                        }
                    }

                    if (this.PlotType == PlotType.Cartesian)
                    {
                        this.EnforceCartesianTransforms();
                        this.UpdateIntervals();
                    }

                    foreach (var a in this.Axes)
                    {
                        a.ResetCurrentValues();
                    }

                    this.RenderBackgrounds(rc);
                    this.RenderAnnotations(rc, AnnotationLayer.BelowAxes);
                    this.RenderAxes(rc, AxisLayer.BelowSeries);
                    this.RenderAnnotations(rc, AnnotationLayer.BelowSeries);
                    this.RenderSeries(rc);
                    this.RenderAnnotations(rc, AnnotationLayer.AboveSeries);
                    this.RenderTitle(rc);
                    this.RenderBox(rc);
                    this.RenderAxes(rc, AxisLayer.AboveSeries);

                    if (this.IsLegendVisible)
                    {
                        this.RenderLegends(rc, this.LegendArea);
                    }
                }
                catch (Exception exception)
                {
                    // An exception was raised during rendering. This should not happen...
                    var errorMessage = string.Format(
                            "An exception of type {0} was thrown when rendering the plot model.\r\n{1}",
                            exception.GetType(),
                            exception.GetBaseException().StackTrace);
                    this.RenderErrorMessage(rc, string.Format("OxyPlot exception: {0}", exception.Message), errorMessage);
                }
                finally
                {
                    // Clean up unused images
                    rc.CleanUp();
                }
            }
        }
开发者ID:Keyabob,项目名称:MMG,代码行数:101,代码来源:PlotModel.Rendering.cs


注:本文中的IRenderContext.CleanUp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。