forked from grandnode/grandnode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIWebHelper.cs
More file actions
121 lines (106 loc) · 4.15 KB
/
Copy pathIWebHelper.cs
File metadata and controls
121 lines (106 loc) · 4.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
using Microsoft.AspNetCore.Http;
namespace Grand.Core
{
/// <summary>
/// Represents a common helper
/// </summary>
public partial interface IWebHelper
{
/// <summary>
/// Get URL referrer
/// </summary>
/// <returns>URL referrer</returns>
string GetUrlReferrer();
/// <summary>
/// Get context IP address
/// </summary>
/// <returns>URL referrer</returns>
string GetCurrentIpAddress();
/// <summary>
/// Gets this page name
/// </summary>
/// <param name="includeQueryString">Value indicating whether to include query strings</param>
/// <returns>Page name</returns>
string GetThisPageUrl(bool includeQueryString);
/// <summary>
/// Gets this page name
/// </summary>
/// <param name="includeQueryString">Value indicating whether to include query strings</param>
/// <param name="useSsl">Value indicating whether to get SSL protected page</param>
/// <returns>Page name</returns>
string GetThisPageUrl(bool includeQueryString, bool useSsl);
/// <summary>
/// Gets a value indicating whether current connection is secured
/// </summary>
/// <returns>true - secured, false - not secured</returns>
bool IsCurrentConnectionSecured();
/// <summary>
/// Gets store host location
/// </summary>
/// <param name="useSsl">Use SSL</param>
/// <returns>Store host location</returns>
string GetStoreHost(bool useSsl);
/// <summary>
/// Gets store location
/// </summary>
/// <param name="useSsl">Whether to get SSL secured URL; pass null to determine automatically</param>
/// <returns>Store location</returns>
string GetStoreLocation(bool? useSsl = null);
/// <summary>
/// Returns true if the requested resource is one of the typical resources that needn't be processed by the cms engine.
/// </summary>
/// <param name="request">HTTP Request</param>
/// <returns>True if the request targets a static resource file.</returns>
/// <remarks>
/// These are the file extensions considered to be static resources:
/// .css
/// .gif
/// .png
/// .jpg
/// .jpeg
/// .js
/// .axd
/// .ashx
/// </remarks>
bool IsStaticResource();
/// <summary>
/// Modifies query string
/// </summary>
/// <param name="url">Url to modify</param>
/// <param name="key">Query parameter key to add/remove</param>
/// <param name="value">Query parameter values to add</param>
/// <returns>New url</returns>
string ModifyQueryString(string url, string key, string value);
/// <summary>
/// Gets query string value by name
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="name">Parameter name</param>
/// <returns>Query string value</returns>
T QueryString<T>(string name);
/// <summary>
/// Restart application domain
/// </summary>
void RestartAppDomain();
/// <summary>
/// Gets a value that indicates whether the client is being redirected to a new location
/// </summary>
bool IsRequestBeingRedirected { get; }
/// <summary>
/// Gets or sets a value that indicates whether the client is being redirected to a new location using POST
/// </summary>
bool IsPostBeingDone { get; set; }
/// <summary>
/// Gets whether the specified http request uri references the local host.
/// </summary>
/// <param name="req">Http request</param>
/// <returns>True, if http request uri references to the local host</returns>
bool IsLocalRequest(HttpRequest req);
/// <summary>
/// Get the raw path and full query of request
/// </summary>
/// <param name="request">Http request</param>
/// <returns>Raw URL</returns>
string GetRawUrl(HttpRequest request);
}
}