예제 #1
0
        /// <summary>
        /// Renders a skin parameter.
        /// </summary>
        /// <param name="skinParameter">The skin parameter.</param>
        /// <param name="value">The value of the skin parameter.</param>
        /// <exception cref="ArgumentNullException"><paramref name="stringBuilder"/> is <c>null</c>.</exception>
        /// <exception cref="ArgumentOutOfRangeException"><paramref name="skinParameter"/> is not a <see cref="SkinParameter"/> value.</exception>
        public static void SkinParameter(this StringBuilder stringBuilder, SkinParameter skinParameter, string value)
        {
            if (!Enum.IsDefined(typeof(SkinParameter), skinParameter))
            {
                throw new ArgumentOutOfRangeException(nameof(skinParameter), "A defined enum value should be provided");
            }

            stringBuilder.SkinParameter(skinParameter.ToString(), value);
        }
예제 #2
0
 /// <summary>
 /// Renders a skin parameter.
 /// </summary>
 /// <param name="skinParameter">The skin parameter.</param>
 /// <param name="value">The value of the skin parameter.</param>
 /// <exception cref="ArgumentNullException"><paramref name="stringBuilder"/> is <c>null</c>.</exception>
 /// <exception cref="ArgumentOutOfRangeException"><paramref name="skinParameter"/> is not a <see cref="SkinParameter"/> value.</exception>
 public static void SkinParameter(this StringBuilder stringBuilder, SkinParameter skinParameter, bool value)
 {
     stringBuilder.SkinParameter(skinParameter.ToString(), value.ToString().ToLowerInvariant());
 }
예제 #3
0
 /// <summary>
 /// Renders a skin parameter.
 /// </summary>
 /// <param name="skinParameter">The skin parameter.</param>
 /// <param name="value">The value of the skin parameter.</param>
 /// <exception cref="ArgumentNullException"><paramref name="stringBuilder"/> is <c>null</c>.</exception>
 /// <exception cref="ArgumentOutOfRangeException"><paramref name="skinParameter"/> is not a <see cref="SkinParameter"/> value.</exception>
 public static void SkinParameter(this StringBuilder stringBuilder, SkinParameter skinParameter, int value)
 {
     stringBuilder.SkinParameter(skinParameter.ToString(), value.ToString());
 }