本文整理汇总了C#中UltravioletContext.ValidateResource方法的典型用法代码示例。如果您正苦于以下问题:C# UltravioletContext.ValidateResource方法的具体用法?C# UltravioletContext.ValidateResource怎么用?C# UltravioletContext.ValidateResource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UltravioletContext
的用法示例。
在下文中一共展示了UltravioletContext.ValidateResource方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SpriteFont
/// <summary>
/// Initializes a new instance of the <see cref="SpriteFont"/> class.
/// </summary>
/// <param name="uv">The Ultraviolet context.</param>
/// <param name="faceRegular">The <see cref="SpriteFontFace"/> that represents the font's regular style.</param>
/// <param name="faceBold">The <see cref="SpriteFontFace"/> that represents the font's bold style.</param>
/// <param name="faceItalic">The <see cref="SpriteFontFace"/> that represents the font's italic style.</param>
/// <param name="faceBoldItalic">The <see cref="SpriteFontFace"/> that represents the font's bold/italic style.</param>
public SpriteFont(UltravioletContext uv, SpriteFontFace faceRegular, SpriteFontFace faceBold, SpriteFontFace faceItalic, SpriteFontFace faceBoldItalic)
: base(uv)
{
uv.ValidateResource(faceRegular);
uv.ValidateResource(faceBold);
uv.ValidateResource(faceItalic);
uv.ValidateResource(faceBoldItalic);
if (faceRegular == null && faceBold == null && faceItalic == null && faceBoldItalic == null)
throw new ArgumentException(UltravioletStrings.InvalidFontFaces);
this.faceRegular = faceRegular;
this.faceBold = faceBold;
this.faceItalic = faceItalic;
this.faceBoldItalic = faceBoldItalic;
}
示例2: OpenGLCursor
/// <summary>
/// Initializes a new instance of the OpenGLCursor class.
/// </summary>
/// <param name="uv">The UltravioletContext class.</param>
/// <param name="surface">The surface that contains the cursor image.</param>
/// <param name="hx">The x-coordinate of the cursor's hotspot.</param>
/// <param name="hy">The y-coordinate of the cursor's hotspot.</param>
public OpenGLCursor(UltravioletContext uv, Surface2D surface, Int32 hx, Int32 hy)
: base(uv)
{
Contract.Require(surface, "surface");
uv.ValidateResource(surface);
if (AreCursorsSupported(uv))
{
this.cursor = SDL.CreateColorCursor(((OpenGLSurface2D)surface).Native, hx, hy);
this.width = surface.Width;
this.height = surface.Height;
if (this.cursor == null)
{
this.width = 0;
this.height = 0;
}
}
else
{
this.cursor = null;
this.width = 0;
this.height = 0;
}
}