Ejemplo n.º 1
0
 public void SetInnerScope_IsFlat_CreatesTwoExtraScopesIfScopeIsInTheMiddle2()
 {
     scope = new Scope("abcd");
     Scope inner = scope.DefineInnerScope(1, 2);
     Scope[] innerScopes = scope.GetInnerScopes();
     Assert.AreEqual(3, innerScopes.Length);
 }
Ejemplo n.º 2
0
 public void SetInnerScope_IsFlat_CreatesOneExtraScopesIfScopeIsInTheEnd()
 {
     scope = new Scope("abc");
     Scope inner = scope.DefineInnerScope(2, 1);
     Scope[] innerScopes = scope.GetInnerScopes();
     Assert.AreEqual(2, innerScopes.Length);
 }
Ejemplo n.º 3
0
 public void GetInnetScopes_Returns0ByDefault()
 {
     Scope s = new Scope("1");
     Assert.AreEqual(0, s.GetInnerScopes().Length);
 }
Ejemplo n.º 4
0
 public void RemoveInnerScope_leftIsTheOnlyExplicit_AllScopesAreRemoved()
 {
     scope = new Scope("abc");
     Scope inner = scope.DefineInnerScope(0, 1);
     scope.RemoveInnerScope(scope.InnerLeftScope);
     Assert.AreEqual(0,scope.GetInnerScopes().Length);
 }
        private void DrawScope(Scope scopeToDraw)
        {
            if (!CanDrawScopes || scopeToDraw == null)
                return;

            VisualScopeMarker visualScopeMarker = GetVisualScopeMarker(scopeToDraw);
            if (visualScopeMarker!=null)
            {
                visualScopeMarker.Redraw(currentGraphics);
            }
            // makeDebuggerMarker(scopeToDraw).DrawCustomForSingleSurroundingRect(Rectangle.Empty, scopeToDraw);

            foreach (Scope innerScope in scopeToDraw.GetInnerScopes())
            {
                if (innerScope == null)
                {
                    continue;
                }

                if (!innerScope.IsFlat)
                {
                    DrawScope(innerScope);
                }
                VisualScopeMarker innerVisual = GetVisualScopeMarker(innerScope);
                if(innerVisual!=null)
                {
                    innerVisual.Redraw(currentGraphics);
                }
            }
        }