System.ComponentModel.Design.RuntimeLicenseContext.GetLocalPath C# (CSharp) Method

GetLocalPath() private method

This method takes a file URL and converts it to a local path. The trick here is that if there is a '#' in the path, everything after this is treated as a fragment. So we need to append the fragment to the end of the path.
private GetLocalPath ( string fileName ) : string
fileName string
return string
        private string GetLocalPath(string fileName)
        {
            System.Diagnostics.Debug.Assert(fileName != null && fileName.Length > 0, "Cannot get local path, fileName is not valid");

            Uri uri = new Uri(fileName);
            return uri.LocalPath + uri.Fragment;
        }