ImageResizer  3.4.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
ImageResizer.Configuration.Config Class Reference
Collaboration diagram for ImageResizer.Configuration.Config:
Collaboration graph
[legend]

Public Member Functions

 Config (ResizerSection config)
 
void UpgradeImageBuilder (ImageBuilder replacement)
 Allows subclasses to be used instead of ImageBuilder. Replacements must override the Create method and call their own constructor instead. More...
 
void BuildImage (object source, object dest, string settings)
 Shortuct to CurrentImageBuilder.Build (Useful for COM clients). Also creates a destination folder if needed, unlike the normal .Build() call. More...
 
string get (string selector, string defaultValue)
 
int get (string selector, int defaultValue)
 
bool get (string selector, bool defaultValue)
 
get< T > (string selector, T defaultValue)
 
Node getNode (string selector)
 Returns a deep copy of the specified node More...
 
Node getConfigXml ()
 Returns a deep copy if the current state of the configuration tree (starting with the 'resizer' element as the root) More...
 
void setConfigXml (Node n)
 Replaces the configuration tree with the specified alternative More...
 
void setConfigXmlText (String xml)
 Replaces the configuration tree with the specified alternative More...
 
void WriteDiagnosticsTo (string path)
 Writes a diagnostic page to the specified physical path More...
 
string GetDiagnosticsPage ()
 Returns a string of the diagnostics page More...
 

Protected Member Functions

void InvalidateImageBuilder ()
 

Protected Attributes

PluginConfig plugins = null
 
volatile ImageBuilder _imageBuilder = null
 
volatile object _imageBuilderSync = new object()
 

Properties

static Config Current [get]
 Gets the current (app-wide) config instance. More...
 
PluginConfig Plugins [get]
 Access and modify plugins More...
 
PipelineConfig Pipeline [get]
 Access and modify settings related to the HttpModule pipline. Register URL rewriting hooks, etc. More...
 
ImageBuilder CurrentImageBuilder [get]
 Returns a shared instance of ImageManager, (or a subclass if it has been upgraded). Instances change whenever ImageBuilderExtensions change. More...
 
ResizerSection cs [get]
 The ResizeConfigrationSection is not thread safe, and should not be modified Dynamically loads the ResizerSection from web.config when accessed for the first time. If the resizer node doesn't exist, an empty configuration object is created with just the root resizer node. More...
 
IssueSink configurationSectionIssues [get]
 
IIssueProvider AllIssues [get]
 Returns a list of all issues reported by the resizing core, as well as by all the plugins More...
 

Detailed Description

Definition at line 22 of file Config.cs.

Member Function Documentation

void ImageResizer.Configuration.Config.BuildImage ( object  source,
object  dest,
string  settings 
)
inline

Shortuct to CurrentImageBuilder.Build (Useful for COM clients). Also creates a destination folder if needed, unlike the normal .Build() call.

Parameters
source
dest
settings

Definition at line 133 of file Config.cs.

133  {
134  if (dest is string) {
135  string d = dest as string;
136  //If it's not a virtual path, make sure the directory exists.
137  if (!string.IsNullOrEmpty(d) && !d.StartsWith("~") && !(d.Contains("/")) && d.Contains("\\")) {
138  d = Path.GetDirectoryName(d);
139  if (!Directory.Exists(d)) Directory.CreateDirectory(d);
140  }
141 
142  }
143  CurrentImageBuilder.Build(source, dest, new ResizeSettings(settings));
144  }
Node ImageResizer.Configuration.Config.getConfigXml ( )
inline

Returns a deep copy if the current state of the configuration tree (starting with the 'resizer' element as the root)

Definition at line 238 of file Config.cs.

238  {
239  return cs.getCopyOfRootNode();
240  }
string ImageResizer.Configuration.Config.GetDiagnosticsPage ( )
inline

Returns a string of the diagnostics page

Returns

Definition at line 267 of file Config.cs.

267  {
268  return new ImageResizer.Plugins.Basic.DiagnosticPageHandler(this).GenerateOutput(HttpContext.Current, this);
269  }
Node ImageResizer.Configuration.Config.getNode ( string  selector)
inline

Returns a deep copy of the specified node

Parameters
selector

Definition at line 231 of file Config.cs.

231  {
232  return cs.getCopyOfNode(selector);
233  }
void ImageResizer.Configuration.Config.setConfigXml ( Node  n)
inline

Replaces the configuration tree with the specified alternative

Parameters
n

Definition at line 245 of file Config.cs.

245  {
246  cs.replaceRootNode(n);
247  }
void ImageResizer.Configuration.Config.setConfigXmlText ( String  xml)
inline

Replaces the configuration tree with the specified alternative

Parameters
xml

Definition at line 252 of file Config.cs.

252  {
253  cs.replaceRootNode(Node.FromXmlFragment(xml, cs.IssueSink));
254  }
void ImageResizer.Configuration.Config.UpgradeImageBuilder ( ImageBuilder  replacement)
inline

Allows subclasses to be used instead of ImageBuilder. Replacements must override the Create method and call their own constructor instead.

Parameters
replacement

Definition at line 106 of file Config.cs.

106  {
107  lock (_imageBuilderSync) _imageBuilder = replacement.Create(plugins.ImageBuilderExtensions, plugins,pipeline, pipeline);
108  }
void ImageResizer.Configuration.Config.WriteDiagnosticsTo ( string  path)
inline

Writes a diagnostic page to the specified physical path

Parameters
path

Definition at line 260 of file Config.cs.

260  {
261  System.IO.File.WriteAllText(path, GetDiagnosticsPage());
262  }
string GetDiagnosticsPage()
Returns a string of the diagnostics page
Definition: Config.cs:267

Property Documentation

IIssueProvider ImageResizer.Configuration.Config.AllIssues
get

Returns a list of all issues reported by the resizing core, as well as by all the plugins

Definition at line 176 of file Config.cs.

ResizerSection ImageResizer.Configuration.Config.cs
getprotected

The ResizeConfigrationSection is not thread safe, and should not be modified Dynamically loads the ResizerSection from web.config when accessed for the first time. If the resizer node doesn't exist, an empty configuration object is created with just the root resizer node.

Definition at line 159 of file Config.cs.

Config ImageResizer.Configuration.Config.Current
staticget

Gets the current (app-wide) config instance.

Returns

Definition at line 31 of file Config.cs.

ImageBuilder ImageResizer.Configuration.Config.CurrentImageBuilder
get

Returns a shared instance of ImageManager, (or a subclass if it has been upgraded). Instances change whenever ImageBuilderExtensions change.

Returns

Definition at line 115 of file Config.cs.

PipelineConfig ImageResizer.Configuration.Config.Pipeline
get

Access and modify settings related to the HttpModule pipline. Register URL rewriting hooks, etc.

Definition at line 93 of file Config.cs.

PluginConfig ImageResizer.Configuration.Config.Plugins
get

The documentation for this class was generated from the following file: