C# Class Rock.Web.Cache.GlobalAttributesCache

Mostrar archivo Open project: NewSpring/Rock Class Usage Examples

Private Properties

Property Type Description
CacheKey string
GetLegacyMergeFields object>.Dictionary
GetMergeFields object>.Dictionary
GetValue string
GlobalAttributesCache System
Load GlobalAttributesCache
Load2 GlobalAttributesCache
ResolveConfigValue string

Public Methods

Method Description
Flush ( ) : void

Removes Global Attributes from cache

GetOrAddExisting ( string key, Func valueFactory ) : GlobalAttributesCache

Gets the existing or a new item from cache

GetValue ( string key, RockContext rockContext = null ) : string

Gets the Global Attribute values for the specified key.

GetValueFormatted ( string key, RockContext rockContext = null ) : string

Gets the value formatted.

Read ( ) : GlobalAttributesCache

Returns Global Attributes from cache. If they are not already in cache, they will be read and added to cache

Read ( RockContext rockContext ) : GlobalAttributesCache

Reads the specified rock context.

SetValue ( string key, string value, bool saveValue ) : void

Sets the value.

SetValue ( string key, string value, bool saveValue, RockContext rockContext ) : void

Sets the value.

Value ( string key ) : string

Returns the global attribute value for the given key.

Private Methods

Method Description
CacheKey ( ) : string
GetLegacyMergeFields ( Person currentPerson ) : object>.Dictionary

Gets the legacy global attribute values as merge fields for dotLiquid merging. Note: You should use LavaHelper.GetCommonMergeFields instead of this

GetMergeFields ( Person currentPerson ) : object>.Dictionary
GetValue ( string key, Rock.Web.Cache.AttributeCache attributeCache, RockContext rockContext ) : string
GlobalAttributesCache ( ) : System

Use Static Read() method to instantiate a new Global Attributes object

Load ( RockContext rockContext ) : GlobalAttributesCache
Load2 ( RockContext rockContext ) : GlobalAttributesCache
ResolveConfigValue ( string value, object>.Dictionary configValues, Person currentPerson ) : string

Resolves the config value.

Method Details

Flush() public static method

Removes Global Attributes from cache
public static Flush ( ) : void
return void

GetOrAddExisting() public static method

Gets the existing or a new item from cache
public static GetOrAddExisting ( string key, Func valueFactory ) : GlobalAttributesCache
key string The key.
valueFactory Func The value factory.
return GlobalAttributesCache

GetValue() public method

Gets the Global Attribute values for the specified key.
public GetValue ( string key, RockContext rockContext = null ) : string
key string The key.
rockContext Rock.Data.RockContext The rock context.
return string

GetValueFormatted() public method

Gets the value formatted.
public GetValueFormatted ( string key, RockContext rockContext = null ) : string
key string The key.
rockContext Rock.Data.RockContext The rock context.
return string

Read() public static method

Returns Global Attributes from cache. If they are not already in cache, they will be read and added to cache
public static Read ( ) : GlobalAttributesCache
return GlobalAttributesCache

Read() public static method

Reads the specified rock context.
public static Read ( RockContext rockContext ) : GlobalAttributesCache
rockContext Rock.Data.RockContext The rock context.
return GlobalAttributesCache

SetValue() public method

Sets the value.
public SetValue ( string key, string value, bool saveValue ) : void
key string The key.
value string The value.
saveValue bool if set to true [save value].
return void

SetValue() public method

Sets the value.
public SetValue ( string key, string value, bool saveValue, RockContext rockContext ) : void
key string The key.
value string The value.
saveValue bool if set to true [save value].
rockContext Rock.Data.RockContext The rock context.
return void

Value() public static method

Returns the global attribute value for the given key.
public static Value ( string key ) : string
key string
return string