/// <summary> /// Resolves any application relative token (~/) to the application's virtual path. /// </summary> /// <param name="pathSetting">The PathSetting to evaluate.</param> private static void ResolveAppRelativeToken(PathSetting pathSetting) { if (!pathSetting.Path.StartsWith("~/")) { return; } // Get the application virtual path. string appVirtualPath = VirtualPathUtility.AppendTrailingSlash(HttpRuntime.AppDomainAppVirtualPath); // If the match type is Regex, be sure to escape the app virtual path. if (pathSetting.MatchType == PathMatchType.Regex) { appVirtualPath = Regex.Escape(appVirtualPath); } // Replace the app-relative token with the app virtual path. pathSetting.Path = pathSetting.Path.Replace("~/", appVirtualPath); }
/// <summary> /// Returns the index of a specified path setting in the collection. /// </summary> /// <param name="pathSetting">The path setting to find.</param> /// <returns>Returns the index of the path setting.</returns> public int IndexOf(PathSetting pathSetting) { return(pathSetting != null ? BaseIndexOf(pathSetting) : -1); }
/// <summary> /// Inserts the specified path setting at the index. /// </summary> /// <param name="index">The index location at which to insert the path setting.</param> /// <param name="pathSetting">The path setting to insert.</param> public void Insert(int index, PathSetting pathSetting) { BaseAdd(index, pathSetting); }
/// <summary> /// Adds the specified path setting. /// </summary> /// <param name="pathSetting">The path setting to add.</param> public void Add(PathSetting pathSetting) { BaseAdd(pathSetting); }
/// <summary> /// Returns the index of a specified path setting in the collection. /// </summary> /// <param name="pathSetting">The path setting to find.</param> /// <returns>Returns the index of the path setting.</returns> public int IndexOf(PathSetting pathSetting) { return (pathSetting != null ? BaseIndexOf(pathSetting) : -1); }