Class RenderContext
Context used for rendering a media item
Inheritance
System.Object
RenderContext
Assembly: ImageVault.Common.dll
Syntax
public class RenderContext : Object
Constructors
RenderContext()
Declaration
RenderContext(Media)
Declaration
public RenderContext(Media media)
Parameters
Type |
Name |
Description |
Media |
media |
|
RenderContext(String)
Declaration
public RenderContext(string renderData)
Parameters
Type |
Name |
Description |
System.String |
renderData |
|
Properties
DefaultHtml
Default html to use in case no renderer is defined
Declaration
public string DefaultHtml { get; set; }
Property Value
Type |
Description |
System.String |
|
ImageVaultUrl
Url to ImageVault instance
Declaration
public string ImageVaultUrl { get; }
Property Value
Type |
Description |
System.String |
|
Keys
Declaration
public IEnumerable<string> Keys { get; }
Property Value
Type |
Description |
System.Collections.Generic.IEnumerable<System.String> |
|
MediaKey
Declaration
public string MediaKey { get; }
Property Value
Type |
Description |
System.String |
|
Name
Declaration
public string Name { get; }
Property Value
Type |
Description |
System.String |
|
PublishedMedia
True if the renderer should produce links to published media
Declaration
public bool PublishedMedia { get; }
Property Value
Type |
Description |
System.Boolean |
|
RendererId
Declaration
public string RendererId { get; set; }
Property Value
Type |
Description |
System.String |
|
Methods
CreateAuxiliaryContentUrl(String)
Creates an auxiliary content url
Declaration
public string CreateAuxiliaryContentUrl(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
Type |
Description |
System.String |
|
CreateEmbedUrl()
Creates the url to the embed handler of the current media
Declaration
public string CreateEmbedUrl()
Returns
Type |
Description |
System.String |
|
CreateMediaEndpointUrl(String)
Creates an url to the supplied media
Declaration
public string CreateMediaEndpointUrl(string mediaKeyAndName)
Parameters
Type |
Name |
Description |
System.String |
mediaKeyAndName |
|
Returns
Type |
Description |
System.String |
|
ExportRenderData()
Declaration
public string ExportRenderData()
Returns
Type |
Description |
System.String |
|
Get(ContextKey)
Gets the value associated with the supplied key
Declaration
public string Get(ContextKey key)
Parameters
Returns
Type |
Description |
System.String |
|
Get(String)
Gets the value associated with the supplied key
Declaration
public string Get(string key)
Parameters
Type |
Name |
Description |
System.String |
key |
|
Returns
Type |
Description |
System.String |
|
Get<T>(ContextKey, T)
Declaration
public T Get<T>(ContextKey key, T defaultValue = null)
Parameters
Type |
Name |
Description |
ContextKey |
key |
|
T |
defaultValue |
|
Returns
Type Parameters
Get<T>(String, T)
Declaration
public T Get<T>(string key, T defaultValue = null)
Parameters
Type |
Name |
Description |
System.String |
key |
|
T |
defaultValue |
|
Returns
Type Parameters
ImportRenderData(String)
Imports and replaces the current data
Declaration
public void ImportRenderData(string renderData)
Parameters
Type |
Name |
Description |
System.String |
renderData |
|
Set(ContextKey, Boolean)
Sets the supplied key to a boolean value
Declaration
public void Set(ContextKey key, bool value = true)
Parameters
Type |
Name |
Description |
ContextKey |
key |
|
System.Boolean |
value |
The value to set, defaults to true
|
Set(ContextKey, Object)
Sets the supplied key-value pair of the context
Declaration
public void Set(ContextKey key, object value)
Parameters
Type |
Name |
Description |
ContextKey |
key |
Key of the pair
|
System.Object |
value |
Value of the pair
|
Set(String, Boolean)
Sets the supplied key to a boolean value
Declaration
public void Set(string key, bool value = true)
Parameters
Type |
Name |
Description |
System.String |
key |
|
System.Boolean |
value |
The value to set, defaults to true
|
Set(String, Object)
Sets the supplied key-value pair of the context
Declaration
public void Set(string key, object value)
Parameters
Type |
Name |
Description |
System.String |
key |
Key of the pair
|
System.Object |
value |
Value of the pair
|
UpdateFromDictionary(IDictionary<String, String>)
Declaration
public void UpdateFromDictionary(IDictionary<string, string> dict)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IDictionary<System.String, System.String> |
dict |
|
UpdateFromMedia(Media)
Updates the context based on the information found in the media object
Declaration
public void UpdateFromMedia(Media media)
Parameters
Type |
Name |
Description |
Media |
media |
|
UpdateFromNameValueCollection(NameValueCollection)
Declaration
public void UpdateFromNameValueCollection(NameValueCollection qs)
Parameters
Type |
Name |
Description |
System.Collections.Specialized.NameValueCollection |
qs |
|
UpdateFromUrl(String)
Declaration
public void UpdateFromUrl(string mediaUrl)
Parameters
Type |
Name |
Description |
System.String |
mediaUrl |
|
Exceptions
Type |
Condition |
System.ArgumentException |
|
Extension Methods