C# Class Microsoft.Scripting.Runtime.Scope

Represents a context of execution. A context of execution has a set of variables associated with it (its dictionary) and a parent context. When looking up a name from a context first the local context is searched. If the name is not found there the name lookup will be done against the parent context. Scopes, like IAttrbibuteCollections, support both being indexed by SymbolId for fast access as well as being indexed by object. The preferred access is via SymbolId and object access is provided for languages which require additional semantics. All features supported for feature IDs are also supported for objects (e.g. context-sentsitivity and attributes) but the object API does not contain all the same sets of overloads provided for convenience. TODO: Thread safety
Mostrar archivo Open project: jschementi/iron Class Usage Examples

Public Methods

Method Description
GetExtension ( ContextId languageContextId ) : Microsoft.Scripting.Runtime.ScopeExtension

Gets the ScopeExtension associated with the provided ContextId.

Scope ( ) : System.Linq.Expressions

Creates a new scope with a new empty thread-safe dictionary.

Scope ( object>.IDictionary dictionary ) : System.Linq.Expressions
Scope ( IDynamicMetaObjectProvider storage ) : System.Linq.Expressions

Creates a new scope which is backed by an arbitrary object for it's storage.

SetExtension ( ContextId languageContextId, Microsoft.Scripting.Runtime.ScopeExtension extension ) : Microsoft.Scripting.Runtime.ScopeExtension

Sets the ScopeExtension to the provided value for the given ContextId. The extension can only be set once. The returned value is either the new ScopeExtension if no value was previously set or the previous value.

Private Methods

Method Description
IDynamicMetaObjectProvider ( Expression parameter ) : DynamicMetaObject

Method Details

GetExtension() public method

Gets the ScopeExtension associated with the provided ContextId.
public GetExtension ( ContextId languageContextId ) : Microsoft.Scripting.Runtime.ScopeExtension
languageContextId ContextId
return Microsoft.Scripting.Runtime.ScopeExtension

Scope() public method

Creates a new scope with a new empty thread-safe dictionary.
public Scope ( ) : System.Linq.Expressions
return System.Linq.Expressions

Scope() public method

public Scope ( object>.IDictionary dictionary ) : System.Linq.Expressions
dictionary object>.IDictionary
return System.Linq.Expressions

Scope() public method

Creates a new scope which is backed by an arbitrary object for it's storage.
public Scope ( IDynamicMetaObjectProvider storage ) : System.Linq.Expressions
storage IDynamicMetaObjectProvider
return System.Linq.Expressions

SetExtension() public method

Sets the ScopeExtension to the provided value for the given ContextId. The extension can only be set once. The returned value is either the new ScopeExtension if no value was previously set or the previous value.
public SetExtension ( ContextId languageContextId, Microsoft.Scripting.Runtime.ScopeExtension extension ) : Microsoft.Scripting.Runtime.ScopeExtension
languageContextId ContextId
extension Microsoft.Scripting.Runtime.ScopeExtension
return Microsoft.Scripting.Runtime.ScopeExtension