예제 #1
0
 /// <summary>
 ///     Construct the url to make an API call get a list of plugins in the requested category
 /// </summary>
 /// <param name="pluginCategory">The category to list</param>
 /// <param name="field">the fields to retrieve</param>
 /// <param name="sortField">the PluginInfoField to sort the results</param>
 /// <param name="negateSort">should the results list be reversed?</param>
 /// <param name="limit">the maximum amount or results</param>
 /// <returns>The URL to make the api call to, as a string</returns>
 public static string ConstructUrl(
     PluginCategory pluginCategory,
     PluginInfoField[] field,
     PluginInfoField sortField,
     Boolean negateSort,
     int limit)
 {
     return(ConstructUrl(pluginCategory, field, limit) + GetSortUrlValue(sortField, negateSort));
 }
예제 #2
0
        /// <summary>
        ///     Get the URL value for a sort command
        /// </summary>
        /// <param name="sortfield">the PluginInfoField to sort</param>
        /// <param name="negate">should the sort direction be reversed?</param>
        /// <returns>the url value for the sort command</returns>
        private static string GetSortUrlValue(PluginInfoField sortfield, Boolean negate)
        {
            String result = "&sort=";

            if (negate)
            {
                result += "-";
            }
            result += GetFieldUrlValue(sortfield);
            return(result);
        }
예제 #3
0
		/// <summary>
		///     Construct the url to make an API call to get a list of all plugins
		/// </summary>
		/// <param name="field">the fields to retrieve</param>
		/// <param name="sortField">the PluginInfoField to sort the results</param>
		/// <param name="negateSort">should the results list be reversed?</param>
		/// <param name="limit">the maximum amount or results</param>
		/// <returns>The URL to make the api call to, as a string</returns>
		public static string ConstructUrl(PluginInfoField[] field, PluginInfoField sortField, Boolean negateSort,
			int limit)
		{
			return ConstructUrl(field, limit) + GetSortUrlValue(sortField, negateSort);
		}
예제 #4
0
		/// <summary>
		///     Construct the url to make an API call to get a list of all plugins
		/// </summary>
		/// <param name="field">the fields to retrieve</param>
		/// <param name="sortField">the PluginInfoField to sort the results</param>
		/// <param name="limit">the maximum amount or results</param>
		/// <returns>The URL to make the api call to, as a string</returns>
		public static string ConstructUrl(PluginInfoField[] field, PluginInfoField sortField, int limit)
		{
			return ConstructUrl(field, sortField, false, limit);
		}
예제 #5
0
		/// <summary>
		///     Construct the url to make an API call to get a list of all plugins
		/// </summary>
		/// <param name="field">the fields to retrieve</param>
		/// <param name="limit">the maximum amount or results</param>
		/// <returns>The URL to make the api call to, as a string</returns>
		public static string ConstructUrl(PluginInfoField[] field, int limit)
		{
			return ConstructUrl(field) + GetLimitUrlValue(limit);
		}
예제 #6
0
		/// <summary>
		///     Construct the url to make an API call to get a list of all plugins
		/// </summary>
		/// <param name="field">the fields to retrieve</param>
		/// <returns>The URL to make the api call to, as a string</returns>
		public static string ConstructUrl(PluginInfoField[] field)
		{
			return ConstructUrl() + GetFieldArrayUrlValue(field);
		}
예제 #7
0
		/// <summary>
		///     Get the URL value for a sort command
		/// </summary>
		/// <param name="sortfield">the PluginInfoField to sort</param>
		/// <param name="negate">should the sort direction be reversed?</param>
		/// <returns>the url value for the sort command</returns>
		private static string GetSortUrlValue(PluginInfoField sortfield, Boolean negate)
		{
			String result = "&sort=";
			if (negate)
			{
				result += "-";
			}
			result += GetFieldUrlValue(sortfield);
			return result;
		}
예제 #8
0
		/// <summary>
		///     Convert enum to string for API usage
		/// </summary>
		/// <param name="field"></param>
		/// <returns></returns>
		private static string GetFieldUrlValue(PluginInfoField field)
		{
			return field.ToString().ToLower().Replace("vf_", "versions.").Replace("pop_", "popularity.");
		}
예제 #9
0
		/// <summary>
		///     Construct the url to make an API call to search for a given value in the selected PluginInfoField
		/// </summary>
		/// <param name="searchField">The PluginInfoField to search</param>
		/// <param name="action">The relation between the given value and the result</param>
		/// <param name="value">the value to search for</param>
		/// <param name="limit">the maximum amount of results</param>
		/// <returns>The URL to make the api call to, as a string</returns>
		public static string ConstructUrl(PluginInfoField searchField, SearchAction action, String value, int limit)
		{
			return ConstructBaseUrl() + "/search/" + GetFieldUrlValue(searchField) + "/"
			       + GetSearchActionUrlValue(action) + "/" + value + GetFieldArrayUrlValue(FieldsSimple);
		}
예제 #10
0
		/// <summary>
		///     Construct the url to make an API call to search for a given value in the selected PluginInfoField
		/// </summary>
		/// <param name="searchField">The PluginInfoField to search</param>
		/// <param name="action">The relation between the given value and the result</param>
		/// <param name="value">the value to search for</param>
		/// <returns>The URL to make the api call to, as a string</returns>
		public static string ConstructUrl(PluginInfoField searchField, SearchAction action, String value)
		{
			return ConstructUrl(searchField, action, value, DefaultLimit);
		}
예제 #11
0
		/// <summary>
		///     Construct the url to make an API call get a list of plugins in the requested category
		/// </summary>
		/// <param name="pluginCategory">The category to list</param>
		/// <param name="field">the fields to retrieve</param>
		/// <returns>The URL to make the api call to, as a string</returns>
		public static string ConstructUrl(PluginCategory pluginCategory, PluginInfoField[] field)
		{
			return ConstructUrl(pluginCategory) + GetFieldArrayUrlValue(field);
		}
예제 #12
0
 /// <summary>
 ///     Construct the url to make an API call to get a list of all plugins
 /// </summary>
 /// <param name="field">the fields to retrieve</param>
 /// <param name="sortField">the PluginInfoField to sort the results</param>
 /// <param name="limit">the maximum amount or results</param>
 /// <returns>The URL to make the api call to, as a string</returns>
 public static string ConstructUrl(PluginInfoField[] field, PluginInfoField sortField, int limit)
 {
     return(ConstructUrl(field, sortField, false, limit));
 }
예제 #13
0
 /// <summary>
 ///     Convert enum to string for API usage
 /// </summary>
 /// <param name="field"></param>
 /// <returns></returns>
 private static string GetFieldUrlValue(PluginInfoField field)
 {
     return(field.ToString().ToLower().Replace("vf_", "versions.").Replace("pop_", "popularity."));
 }
예제 #14
0
 /// <summary>
 ///     Construct the url to make an API call to search for a given value in the selected PluginInfoField
 /// </summary>
 /// <param name="searchField">The PluginInfoField to search</param>
 /// <param name="action">The relation between the given value and the result</param>
 /// <param name="value">the value to search for</param>
 /// <param name="limit">the maximum amount of results</param>
 /// <returns>The URL to make the api call to, as a string</returns>
 public static string ConstructUrl(PluginInfoField searchField, SearchAction action, String value, int limit)
 {
     return(ConstructBaseUrl() + "/search/" + GetFieldUrlValue(searchField) + "/"
            + GetSearchActionUrlValue(action) + "/" + value + GetFieldArrayUrlValue(FieldsSimple));
 }
예제 #15
0
 /// <summary>
 ///     Construct the url to make an API call to search for a given value in the selected PluginInfoField
 /// </summary>
 /// <param name="searchField">The PluginInfoField to search</param>
 /// <param name="action">The relation between the given value and the result</param>
 /// <param name="value">the value to search for</param>
 /// <returns>The URL to make the api call to, as a string</returns>
 public static string ConstructUrl(PluginInfoField searchField, SearchAction action, String value)
 {
     return(ConstructUrl(searchField, action, value, DefaultLimit));
 }