Class AbstractStockHelper<THelper>
Abstract class for the stock helpers
public abstract class AbstractStockHelper<THelper> where THelper : AbstractStockHelper<THelper>, new()
Type Parameters
THelper
- Inheritance
-
objectAbstractStockHelper<THelper>
- Derived
- Extension Methods
Constructors
AbstractStockHelper()
protected AbstractStockHelper()
Fields
Instance
Helper instance
protected static THelper Instance
Field Value
- THelper
Properties
CurrentItems
Current items collection.
protected abstract IThreadContextItems CurrentItems { get; }
Property Value
Methods
Add(string, object, bool)
Add item.
public static void Add(string key, object value, bool caseSensitive = false)
Parameters
keystringKey to add
valueobjectValue to add
caseSensitiveboolIf true, the key is case sensitive, otherwise key is converted to lowercase before use
AddToStorage(string, string, object, bool)
Adds item to specific storage specified by storageKey.
public static void AddToStorage(string storageKey, string key, object value, bool caseSensitive = true)
Parameters
storageKeystringStorage key
keystringKey to add
valueobjectValue to add
caseSensitiveboolIf true, the key is case sensitive, otherwise key is converted to lowercase before use
Contains(string, bool)
Check if stock contain item.
public static bool Contains(string key, bool caseSensitive = false)
Parameters
keystringObject key
caseSensitiveboolIf true, the key is case sensitive, otherwise key is converted to lowercase before use
Returns
- bool
Contains(string, string, bool)
Check if stock contain item.
public static bool Contains(string storageKey, string key, bool caseSensitive = true)
Parameters
storageKeystringStorage key
keystringObject key
caseSensitiveboolIf true, the key is case sensitive, otherwise key is converted to lowercase before use
Returns
- bool
DropStorage(string, bool)
Drops the storage
public static void DropStorage(string key, bool caseSensitive = true)
Parameters
keystringStorage key
caseSensitiveboolIf true, the key is case sensitive, otherwise key is converted to lowercase before use
GetItem(string, bool)
Returns object which matches by key.
public static object GetItem(string key, bool caseSensitive = false)
Parameters
keystringObject key
caseSensitiveboolIf true, the key is case sensitive, otherwise key is converted to lowercase before use
Returns
- object
GetItem(string, string, bool)
Returns object which matches by key.
public static object GetItem(string storageKey, string key, bool caseSensitive = true)
Parameters
storageKeystringStorage key
keystringObject key
caseSensitiveboolIf true, the key is case sensitive, otherwise key is converted to lowercase before use
Returns
- object
GetStorage(string, bool, bool)
Gets the storage
public static SafeDictionary<string, object> GetStorage(string key, bool caseSensitive = true, bool ensure = true)
Parameters
keystringStorage key
caseSensitiveboolIf true, the key is case sensitive, otherwise key is converted to lowercase before use
ensureboolIf true, the storage is ensured if it doesn't exist
Returns
- SafeDictionary<string, object>
Remove(string, bool)
Remove item.
public static void Remove(string key, bool caseSensitive = false)
Parameters
keystringObject key
caseSensitiveboolIf true, the key is case sensitive, otherwise key is converted to lowercase before use
Remove(string, string, bool)
Remove item.
public static void Remove(string storageKey, string key, bool caseSensitive = true)
Parameters
storageKeystringStorage key
keystringObject key
caseSensitiveboolIf true, the key is case sensitive, otherwise key is converted to lowercase before use