C# Class Microsoft.Scripting.ScopeStorage

Provides optimized and cacheable support for scope storage. This is the default object used for storing values in a scope.
The implementation uses a case-insensitive dictionary which holds onto ScopeVariableIgnoreCase objects. The SVIC's hold onto ScopeVariable objects for each possible casing.
Inheritance: IDynamicMetaObjectProvider
Mostrar archivo Open project: jschementi/iron Class Usage Examples

Public Methods

Method Description
DeleteValue ( string name, bool ignoreCase ) : bool

Deletes the named value from the scope optionally ignoring the case.

GetItems ( ) : dynamic>>.IList

Returns all of the member names and their associated values from the scope. The list contains all available casings.

GetMemberNames ( ) : IList

Returns all of the member names which currently have values in the scope. The list contains all available casings.

GetMetaObject ( Expression parameter ) : DynamicMetaObject
GetScopeVariable ( string name, bool ignoreCase ) : IScopeVariable

Gets the IScopeVariable for the scope optionally ignoring case. The IScopeVariable can be held onto and get/set/deleted without performing a dictionary lookup on subsequent accesses.

GetScopeVariable ( string name ) : ScopeVariable

Gets the ScopeVariable for the scope in a case-sensitive manner. The ScopeVariable can be held onto and get/set/deleted without performing a dictionary lookup on subsequent accesses.

GetScopeVariableIgnoreCase ( string name ) : ScopeVariableIgnoreCase

Gets the ScopeVariableIgnoreCase for the scope in a case-insensitive manner. The ScopeVariable can be held onto and get/set/deleted without performing a dictionary lookup on subsequent accesses.

GetValue ( string name, bool ignoreCase ) : Object

Gets the named value from the scope optionally ignoring case. If the named value is not present an InvalidOperationException is raised.

HasValue ( string name, bool ignoreCase ) : bool

Checks if the named value is present in the scope optionally ignoring the case.

SetValue ( string name, bool ignoreCase, object value ) : void

Sets the named value in the scope optionally ignoring the case.

TryGetValue ( string name, bool ignoreCase, Object &value ) : bool

Attempts to get the named value from the scope optionally ignoring the case. Returns true if the value is present, false if it is not.

this ( string index ) : Object

Provides convenient case-sensitive value access.

Private Methods

Method Description
HasVariable ( string name ) : bool

Method Details

DeleteValue() public method

Deletes the named value from the scope optionally ignoring the case.
public DeleteValue ( string name, bool ignoreCase ) : bool
name string
ignoreCase bool
return bool

GetItems() public method

Returns all of the member names and their associated values from the scope. The list contains all available casings.
public GetItems ( ) : dynamic>>.IList
return dynamic>>.IList

GetMemberNames() public method

Returns all of the member names which currently have values in the scope. The list contains all available casings.
public GetMemberNames ( ) : IList
return IList

GetMetaObject() public method

public GetMetaObject ( Expression parameter ) : DynamicMetaObject
parameter Expression
return DynamicMetaObject

GetScopeVariable() public method

Gets the IScopeVariable for the scope optionally ignoring case. The IScopeVariable can be held onto and get/set/deleted without performing a dictionary lookup on subsequent accesses.
public GetScopeVariable ( string name, bool ignoreCase ) : IScopeVariable
name string
ignoreCase bool
return IScopeVariable

GetScopeVariable() public method

Gets the ScopeVariable for the scope in a case-sensitive manner. The ScopeVariable can be held onto and get/set/deleted without performing a dictionary lookup on subsequent accesses.
public GetScopeVariable ( string name ) : ScopeVariable
name string
return ScopeVariable

GetScopeVariableIgnoreCase() public method

Gets the ScopeVariableIgnoreCase for the scope in a case-insensitive manner. The ScopeVariable can be held onto and get/set/deleted without performing a dictionary lookup on subsequent accesses.
public GetScopeVariableIgnoreCase ( string name ) : ScopeVariableIgnoreCase
name string
return ScopeVariableIgnoreCase

GetValue() public method

Gets the named value from the scope optionally ignoring case. If the named value is not present an InvalidOperationException is raised.
public GetValue ( string name, bool ignoreCase ) : Object
name string
ignoreCase bool
return System.Object

HasValue() public method

Checks if the named value is present in the scope optionally ignoring the case.
public HasValue ( string name, bool ignoreCase ) : bool
name string
ignoreCase bool
return bool

SetValue() public method

Sets the named value in the scope optionally ignoring the case.
public SetValue ( string name, bool ignoreCase, object value ) : void
name string
ignoreCase bool
value object
return void

TryGetValue() public method

Attempts to get the named value from the scope optionally ignoring the case. Returns true if the value is present, false if it is not.
public TryGetValue ( string name, bool ignoreCase, Object &value ) : bool
name string
ignoreCase bool
value System.Object
return bool

this() public method

Provides convenient case-sensitive value access.
public this ( string index ) : Object
index string
return System.Object