private bool IsEmbeddedView(string virtualPath) { /*old validation * it can cause issue if we have several views with the same full path: * for example: both Kore.Plugin.Plugin1 and Kore.Plugin.Plugin2 can have Views\Config\Configure.cshtml files * * That's why we specify FQN for views into plugin controllers */ //string virtualPathAppRelative = VirtualPathUtility.ToAppRelative(virtualPath); //return virtualPathAppRelative.StartsWith("~/Views/", StringComparison.InvariantCultureIgnoreCase) // && _embeddedViews.ContainsEmbeddedView(virtualPathAppRelative); if (string.IsNullOrEmpty(virtualPath)) { return(false); } string virtualPathAppRelative = VirtualPathUtility.ToAppRelative(virtualPath); if (!virtualPathAppRelative.StartsWith("~/Views/", StringComparison.InvariantCultureIgnoreCase)) { return(false); } var fullyQualifiedName = virtualPathAppRelative.Substring( virtualPathAppRelative.LastIndexOf("/") + 1, virtualPathAppRelative.Length - 1 - virtualPathAppRelative.LastIndexOf("/")); bool isEmbedded = embeddedViews.ContainsEmbeddedResource(fullyQualifiedName); return(isEmbedded); }
private bool IsEmbeddedStyle(string virtualPath) { if (string.IsNullOrEmpty(virtualPath)) { return(false); } string virtualPathAppRelative = VirtualPathUtility.ToAppRelative(virtualPath); if (!virtualPathAppRelative.StartsWith("~/Content/", StringComparison.InvariantCultureIgnoreCase)) { return(false); } var fullyQualifiedName = virtualPathAppRelative.Substring( virtualPathAppRelative.LastIndexOf("/") + 1, virtualPathAppRelative.Length - 1 - virtualPathAppRelative.LastIndexOf("/")); bool isEmbedded = embeddedStyles.ContainsEmbeddedResource(fullyQualifiedName); return(isEmbedded); }