예제 #1
0
        public static Key LocalUriToKey(this ILocalhost localhost, Uri uri)
        {
            string path  = localhost.GetOperationPath(uri);
            string _base = localhost.GetBaseOf(uri).ToString();

            return(Key.ParseOperationPath(path).WithBase(_base));
        }
예제 #2
0
        public static Key LocalUriToKey(this ILocalhost localhost, Uri uri)
        {
            string s     = uri.ToString();
            string _base = localhost.GetBaseOf(uri)?.ToString();
            string path  = s.Remove(0, _base == null ? 0 : _base.Length);

            return(Key.ParseOperationPath(path).WithBase(_base));
        }
예제 #3
0
        public static Key LocalUriToKey(this ILocalhost localhost, Uri uri)
        {
            var s     = uri.ToString();
            var @base = localhost.GetBaseOf(uri)?.ToString();
            var path  = s.Remove(0, @base?.Length ?? 0);

            return(Key.ParseOperationPath(path).WithBase(@base));
        }
        public static Uri RemoveBase(this ILocalhost localhost, Uri uri)
        {
            string s     = uri.ToString();
            string _base = localhost.GetBaseOf(uri)?.ToString();
            string path  = s.Remove(0, _base == null ? 0 : _base.Length);

            return(new Uri(path, UriKind.Relative));
        }
예제 #5
0
        public static Uri RemoveBase(this ILocalhost localhost, Uri uri)
        {
            var @base = localhost.GetBaseOf(uri)?.ToString();

            if (@base == null)
            {
                return(uri);
            }

            var s    = uri.ToString();
            var path = s.Remove(0, @base.Length);

            return(new Uri(path, UriKind.Relative));
        }