Ejemplo n.º 1
0
        /// <exception cref="ArgumentNullException">
        /// <paramref name="match" /> is null.
        /// </exception>
        /// <exception cref="ArgumentOutOfRangeException">
        /// <paramref name="index" /> is less than 0.-or- <paramref name="index" /> is equal to or
        /// greater than <see cref="P:System.Collections.Generic.List`1.Count" />.
        /// </exception>
        /// <exception cref="RiotGamesApiException">
        /// ParameterTypeAttribute not found
        /// </exception>
        /// <exception cref="ArgumentException">
        /// <paramref name="comparisonType" /> is not a <see cref="T:System.StringComparison" /> value.
        /// </exception>
        /// <exception cref="TypeLoadException">
        /// A custom attribute type cannot be loaded.
        /// </exception>
        /// <exception cref="AmbiguousMatchException">
        /// More than one of the requested attributes was found.
        /// </exception>
        /// <exception cref="NotSupportedException">
        /// <see cref="T:System.StringComparison" /> is not supported.
        /// </exception>
        /// <exception cref="InvalidOperationException">
        /// The method is invoked by reflection in a reflection-only context, -or-
        /// <paramref name="enumType" /> is a type from an assembly loaded in a reflection-only context.
        /// </exception>
        public static Type FindParameterType(this LolApiPath enumVal)
        {
            var selectedParamX = enumVal.GetStringValue().Split('{')[1].Split('}')[0];
            var array          = ((LolParameterType[])Enum.GetValues(typeof(LolParameterType))).ToList();
            var found          = array.FindIndex(p => string.Compare(p.ToString(), selectedParamX, StringComparison.OrdinalIgnoreCase) == 0);

            return(found > -1 ? array[found].GetParameterType() : null);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// url path parameter for apis
 /// </summary>
 /// <param name="subApiType">
 /// Name of UrlPath
 /// </param>
 /// <param name="value">
 /// value of UrlPath
 /// </param>
 public ApiParameter(LolApiPath subApiType, object value)
 {
     this.Type  = subApiType;
     this.Value = value;
 }