private static bool RemoveBadRoot(string path, out Uri uri)
{
const string badRoot = "file://" + PROJECT_DIR +"/";
bool removedBadRoot;
string removed;
if (path.StartsWith(badRoot, StringComparison.Ordinal))
{
removed = path.Substring(badRoot.Length);
removedBadRoot = true;
}
else
{
removed = path;
removedBadRoot = false;
}
uri = new Uri(removed, UriKind.RelativeOrAbsolute);
return removedBadRoot;
}