本文整理汇总了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();
}
}
}