Subtext.Framework.Format.UrlFormats.IsInSpecialDirectory C# (CSharp) Method

IsInSpecialDirectory() public static method

Determines whether the current request is a request within a special directory.
public static IsInSpecialDirectory ( string folderName ) : bool
folderName string Name of the folder.
return bool
        public static bool IsInSpecialDirectory(string folderName)
        {
            // Either "" or "Subtext.Web" for ex...
            String appPath = StripSurroundingSlashes(HttpContext.Current.Request.ApplicationPath);
            if(appPath == null)
                appPath = string.Empty;

            if(appPath.Length == 0)
                appPath = "/" + folderName + "/";
            else
                appPath = "/" + appPath + "/" + folderName + "/";

            return HttpContext.Current.Request.Path.IndexOf(appPath, StringComparison.InvariantCultureIgnoreCase) >= 0;
        }