|
| Presets (Dictionary< string, ResizeSettings > defaults, Dictionary< string, ResizeSettings > settings, bool onlyAllowPresets) |
|
IPlugin | Install (Configuration.Config c) |
|
ResizeSettings | Modify (ResizeSettings s) |
| Implementations should support being called on their own result multiple times without behavioral differences. Currently only executed in the managed API, too late to affect the disk cache, but that will probably change (it's likely all ISettingsModifiers will get executed twice, once after PostRewrite and once before the managed API executes). More...
|
|
bool | Uninstall (Configuration.Config c) |
|
IEnumerable< string > | GetSupportedQuerystringKeys () |
| If the plugin reads any values from the querystring, the names of the keys should be specified here. This information is required so that the HttpModule knows when to handle an image request. More...
|
|
IEnumerable< IIssue > | GetIssues () |
|
IPlugin | Install (Config c) |
| Installs the plugin in the specified Config instance. The plugin must handle all the work of loading settings, registering the plugin etc. More...
|
|
bool | Uninstall (Config c) |
| Uninstalls the plugin. Should reverse all changes made during Install More...
|
|
|
static NameValueCollection | FilterQuerystring (NameValueCollection s, bool keepHmacAndUrl64) |
| Returns an new NameValueCollection instance that only includes the "preset" and ("hmac" and "urlb64", if specified) querystring pairs from the specified instance. More...
|
|
Definition at line 11 of file Presets.cs.
static NameValueCollection ImageResizer.Plugins.Basic.Presets.FilterQuerystring |
( |
NameValueCollection |
s, |
|
|
bool |
keepHmacAndUrl64 |
|
) |
| |
|
inlinestatic |
Returns an new NameValueCollection instance that only includes the "preset" and ("hmac" and "urlb64", if specified) querystring pairs from the specified instance.
- Parameters
-
- Returns
Definition at line 59 of file Presets.cs.
60 NameValueCollection q =
new NameValueCollection();
61 string preset = s[
"preset"];
62 string hmac = s[
"hmac"];
63 string urlb64 = s[
"urlb64"];
64 if (preset != null) q[
"preset"] = preset.ToLowerInvariant();
65 if (keepHmacAndUrl64 && hmac != null) q[
"hmac"] = hmac;
66 if (keepHmacAndUrl64&& urlb64 != null) q[
"urlb64"] = urlb64;
IEnumerable<string> ImageResizer.Plugins.Basic.Presets.GetSupportedQuerystringKeys |
( |
| ) |
|
|
inline |
If the plugin reads any values from the querystring, the names of the keys should be specified here. This information is required so that the HttpModule knows when to handle an image request.
- Returns
Implements ImageResizer.Plugins.IQuerystringPlugin.
Definition at line 151 of file Presets.cs.
152 return new string[] {
"preset" };
Implementations should support being called on their own result multiple times without behavioral differences. Currently only executed in the managed API, too late to affect the disk cache, but that will probably change (it's likely all ISettingsModifiers will get executed twice, once after PostRewrite and once before the managed API executes).
- Parameters
-
- Returns
Implements ImageResizer.Plugins.ISettingsModifier.
Definition at line 83 of file Presets.cs.
84 if (!
string.IsNullOrEmpty(s[
"preset"])) {
85 string[] presets = s[
"preset"].Split(
new char[] {
',' }, StringSplitOptions.RemoveEmptyEntries);
86 foreach (
string p
in presets) {
88 if (defaults.ContainsKey(p)) {
89 ResizeSettings dq = defaults[p];
90 foreach (
string key
in dq.Keys) {
91 if (s[key] == null) s[key] = dq[key];
95 if (settings.ContainsKey(p)) {
96 ResizeSettings sq = settings[p];
97 foreach (
string key
in sq.Keys) {
bool ImageResizer.Plugins.Basic.Presets.OnlyAllowPresets |
|
getset |
If true, the plugin will block all commands except those specified in a preset, and the &preset command itself. Only applies to InterceptModule (the URL API). Does not apply to ImageBuilder.Build calls. To replicate the behavior, simply prevent any querystring keys except 'preset' from being passed to ImageBuilder.Build.
Definition at line 124 of file Presets.cs.
The documentation for this class was generated from the following file:
- C:/Users/nathanael/Documents/resizer/Core/Plugins/Basic/Presets.cs