-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathIWebHelper.cs
132 lines (116 loc) · 4.62 KB
/
IWebHelper.cs
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
122
123
124
125
126
127
128
129
130
131
132
using System.Web;
namespace SmartStore.Core
{
/// <summary>
/// Represents a common helper
/// </summary>
public partial interface IWebHelper
{
/// <summary>
/// Get URL referrer
/// </summary>
/// <returns>URL referrer</returns>
string GetUrlReferrer();
/// <summary>
/// Gets a unique client identifier
/// </summary>
/// <returns>A unique identifier</returns>
/// <remarks>
/// The client identifier is a hashed combination of client ip address and user agent.
/// This method returns <c>null</c> if IP or user agent (or both) cannot be determined.
/// </remarks>
string GetClientIdent();
/// <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 server variable by name
/// </summary>
/// <param name="name">Name</param>
/// <returns>Server variable</returns>
string ServerVariables(string name);
/// <summary>
/// Gets store location
/// </summary>
/// <returns>Store location</returns>
string GetStoreLocation();
/// <summary>
/// Gets store location
/// </summary>
/// <param name="useSsl">Use SSL</param>
/// <returns>Store location</returns>
string GetStoreLocation(bool useSsl);
/// <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(HttpRequest request);
/// <summary>
/// Maps a virtual path to a physical disk path.
/// </summary>
/// <param name="path">The path to map. E.g. "~/bin"</param>
/// <returns>The physical path. E.g. "c:\inetpub\wwwroot\bin"</returns>
string MapPath(string path);
/// <summary>
/// Modifies query string
/// </summary>
/// <param name="url">Url to modify</param>
/// <param name="queryStringModification">Query string modification</param>
/// <param name="anchor">Anchor</param>
/// <returns>New url</returns>
string ModifyQueryString(string url, string queryStringModification, string anchor);
/// <summary>
/// Remove query string from url
/// </summary>
/// <param name="url">Url to modify</param>
/// <param name="queryString">Query string to remove</param>
/// <returns>New url</returns>
string RemoveQueryString(string url, string queryString);
/// <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>
/// <param name="makeRedirect">A value indicating whether </param>
/// <param name="redirectUrl">Redirect URL; empty string if you want to redirect to the current page URL</param>
/// <param name="aggressive">Usually <c>true</c> after a new plugin was installed (nukes the MVC cache)</param>
void RestartAppDomain(bool makeRedirect = false, string redirectUrl = "", bool aggressive = false);
}
}