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


C# UltravioletContext.ValidateResource方法代码示例

本文整理汇总了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;
        }
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:24,代码来源:SpriteFont.cs

示例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;
            }
        }
开发者ID:prshreshtha,项目名称:ultraviolet,代码行数:33,代码来源:OpenGLCursor.cs


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