public void CloseScope() { Debug.Assert(_scopeDepth == _currentScopeDepth); _currentScopeDepth--; _currentCreationScope = _prevScope; ElementTabSet = null; }
public ElementTab(ScriptScope scope, string directory, string source, ElementTabSet tabset, bool isWindow) { _isWindow = isWindow; _tabset = tabset; Scope = scope; _directory = directory; _controlScope = Control.CreateScope(_directory, scope.Engine); Scope.SetVariable("bindings", new BindingFactory()); Scope.SetVariable("model", new ExpandoDependencyObject()); DataContext = this; InitializeComponent(); _variableList.ItemsSource = Scope.GetVariable("model"); Source = source; }
public void OpenScope(ElementTabSet tabset) { foreach (var scope in Scopes().ToList()) { tabset.RemoveTab(scope); } Clear(); _prevScope = _currentCreationScope; _currentScopeDepth++; if (_currentScopeDepth > 20) { throw new StackOverflowException("Cannot controls within controls 20 levels deep. Do you have control recursion?"); } _scopeDepth = _currentScopeDepth; ElementTabSet = tabset; _currentCreationScope = this; }