Class RenderContext
Context used for rendering a media item
Inheritance
System.Object
RenderContext
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: ImageVault.Common.dll
Syntax
public class RenderContext
Constructors
RenderContext()
Declaration
RenderContext(Media)
Declaration
public RenderContext(Media media)
Parameters
Type |
Name |
Description |
Media |
media |
|
RenderContext(Media, MediaRendererOptions)
Declaration
[Obsolete("Use RenderContext(Media) instead")]
public RenderContext(Media media, MediaRendererOptions options)
Parameters
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 |
|
Options
Options passed to the renderer
Declaration
[Obsolete("Use Get/Set methods instead")]
public MediaRendererOptions Options { get; set; }
Property Value
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
GetAsBoolean(ContextKey, Boolean)
Gets a context value as boolean. If not exists or not parseable, defaultValue is returned instead
Declaration
[Obsolete("Use Get<bool>(ContextKey) instead")]
public bool GetAsBoolean(ContextKey key, bool defaultValue = false)
Parameters
Type |
Name |
Description |
ContextKey |
key |
|
System.Boolean |
defaultValue |
|
Returns
Type |
Description |
System.Boolean |
|
GetAsBoolean(String, Boolean)
Gets a context value as boolean. If not exists or not parseable, defaultValue is returned instead
Declaration
[Obsolete("Use Get<bool>(string) instead")]
public bool GetAsBoolean(string key, bool defaultValue = false)
Parameters
Type |
Name |
Description |
System.String |
key |
|
System.Boolean |
defaultValue |
|
Returns
Type |
Description |
System.Boolean |
|
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
|
SetJson(String, Object)
Declaration
[Obsolete("Use Set(string,object) instead")]
public void SetJson(string key, object value)
Parameters
Type |
Name |
Description |
System.String |
key |
|
System.Object |
value |
|
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 |
|
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