|
static Uri | Append (this Uri uri, params string[] paths) |
|
static Uri | Append (this Uri uri, Uri relativeUri, params string[] paths) |
|
static Uri | Append (this Uri uri, Uri relativeUri, string path) |
|
static Uri | AppendExtension (this Uri uri, string extension) |
|
static string | DebugInfo (this Uri uri) |
|
static string | ToHtmlString (this Uri uri) |
|
|
static void | GetBase (Uri uri, out string basePath, out UriKind uriKind) |
|
Definition at line 29 of file UriExtensions.cs.
static Uri Ntp.Common.Web.UriExtensions.Append |
( |
this Uri |
uri, |
|
|
params string[] |
paths |
|
) |
| |
|
inlinestatic |
Definition at line 31 of file UriExtensions.cs.
36 GetBase(uri, out basePath, out uriKind);
37 string resPath = paths.Aggregate(
39 (current, path) => $
"{current.TrimEnd('/')}/{path.TrimStart('/')}");
40 Uri newUri =
new Uri(resPath, uriKind);
static void GetBase(Uri uri, out string basePath, out UriKind uriKind)
static Uri Ntp.Common.Web.UriExtensions.Append |
( |
this Uri |
uri, |
|
|
Uri |
relativeUri, |
|
|
params string[] |
paths |
|
) |
| |
|
inlinestatic |
Definition at line 45 of file UriExtensions.cs.
47 string relativeUriText = relativeUri.IsAbsoluteUri
48 ? relativeUri.AbsolutePath
49 : relativeUri.ToString();
50 var list =
new List<string> {relativeUriText};
52 return uri.Append(list.ToArray());
static Uri Ntp.Common.Web.UriExtensions.Append |
( |
this Uri |
uri, |
|
|
Uri |
relativeUri, |
|
|
string |
path |
|
) |
| |
|
inlinestatic |
Definition at line 55 of file UriExtensions.cs.
57 string relativeUriText = relativeUri.IsAbsoluteUri
58 ? relativeUri.AbsolutePath
59 : relativeUri.ToString();
60 var list =
new List<string> {relativeUriText, path};
61 return uri.Append(list.ToArray());
static Uri Ntp.Common.Web.UriExtensions.AppendExtension |
( |
this Uri |
uri, |
|
|
string |
extension |
|
) |
| |
|
inlinestatic |
Definition at line 64 of file UriExtensions.cs.
69 GetBase(uri, out basePath, out uriKind);
70 basePath = basePath.TrimEnd(
'/') + extension;
71 Uri newUri =
new Uri(basePath, uriKind);
static void GetBase(Uri uri, out string basePath, out UriKind uriKind)
static string Ntp.Common.Web.UriExtensions.DebugInfo |
( |
this Uri |
uri | ) |
|
|
inlinestatic |
Definition at line 76 of file UriExtensions.cs.
References b.
78 StringBuilder
b =
new StringBuilder();
79 b.AppendLine($
"ToString(): {uri}");
80 b.AppendLine($
"IsAbsoluteUri: {uri.IsAbsoluteUri}");
81 b.AppendLine($
"OriginalString: {uri.OriginalString}");
83 if (uri.IsAbsoluteUri)
85 b.AppendLine($
"AbsolutePath: {uri.AbsolutePath}");
86 b.AppendLine($
"AbsoluteUri: {uri.AbsoluteUri}");
87 b.AppendLine($
"Authority: {uri.Authority}");
88 b.AppendLine($
"DnsSafeHost: {uri.DnsSafeHost}");
89 b.AppendLine($
"Fragment: {uri.Fragment}");
90 b.AppendLine($
"Host: {uri.Host}");
91 b.AppendLine($
"HostNameType: {uri.HostNameType}");
92 b.AppendLine($
"IsDefaultPort {uri.IsDefaultPort}");
93 b.AppendLine($
"IsFile: {uri.IsFile}");
94 b.AppendLine($
"IsLoopback: {uri.IsLoopback}");
95 b.AppendLine($
"IsUnc: {uri.IsUnc}");
96 b.AppendLine($
"LocalPath: {uri.LocalPath}");
97 b.AppendLine($
"PathAndQuery: {uri.PathAndQuery}");
98 b.AppendLine($
"Port: {uri.Port}");
99 b.AppendLine($
"Query: {uri.Query}");
100 b.AppendLine($
"Scheme: {uri.Scheme}");
101 b.AppendLine($
"Segments: {uri.Segments}");
102 b.AppendLine($
"UserEscaped: {uri.UserEscaped}");
103 b.AppendLine($
"UserInfo: {uri.UserInfo}");
static void Ntp.Common.Web.UriExtensions.GetBase |
( |
Uri |
uri, |
|
|
out string |
basePath, |
|
|
out UriKind |
uriKind |
|
) |
| |
|
inlinestaticprivate |
Definition at line 114 of file UriExtensions.cs.
116 string orig = uri.OriginalString.TrimStart();
117 if (orig.StartsWith(
"/") && !orig.StartsWith(
"//"))
119 basePath = uri.IsAbsoluteUri
122 uriKind = UriKind.Relative;
126 basePath = uri.ToString();
127 uriKind = UriKind.Absolute;
static string Ntp.Common.Web.UriExtensions.ToHtmlString |
( |
this Uri |
uri | ) |
|
|
inlinestatic |
Definition at line 109 of file UriExtensions.cs.
111 return Uri.EscapeUriString(uri.ToString());
The documentation for this class was generated from the following file: