public override bool ScopeTryGetVariable(Scope scope, string name, out dynamic value) { var storage = scope.Storage as ScopeStorage; if (storage != null && storage.TryGetValue(name, false, out value)) { return(true); } StringDictionaryExpando dictStorage = scope.Storage as StringDictionaryExpando; if (dictStorage != null && dictStorage.Dictionary.TryGetValue(name, out value)) { return(true); } return(base.ScopeTryGetVariable(scope, name, out value)); }
public override dynamic ScopeGetVariable(Scope scope, string name) { var storage = scope.Storage as ScopeStorage; object res; if (storage != null && storage.TryGetValue(name, false, out res)) { return(res); } StringDictionaryExpando dictStorage = scope.Storage as StringDictionaryExpando; if (dictStorage != null && dictStorage.Dictionary.TryGetValue(name, out res)) { return(res); } return(base.ScopeGetVariable(scope, name)); }
public override void ScopeSetVariable(Scope scope, string name, object value) { var storage = scope.Storage as ScopeStorage; if (storage != null) { storage.SetValue(name, false, value); return; } StringDictionaryExpando dictStorage = scope.Storage as StringDictionaryExpando; if (dictStorage != null) { dictStorage.Dictionary[name] = value; return; } base.ScopeSetVariable(scope, name, value); }