Exemplo n.º 1
0
        bool SetBackgroundRenderer()
        {
            List <FoldSegment> curFolds = new List <FoldSegment> (foldings);

            if (oldFolds != null && oldFolds.Count == curFolds.Count)
            {
                bool same = true;
                for (int i = 0; i < curFolds.Count; i++)
                {
                    if (oldFolds[i] != curFolds [i])
                    {
                        same = false;
                        break;
                    }
                }

                if (same)
                {
                    return(false);
                }
            }

            oldFolds = curFolds;
            editor.TextViewMargin.DisposeLayoutDict();
            editor.TextViewMargin.BackgroundRenderer = new FoldingScreenbackgroundRenderer(editor, foldings);
            editor.QueueDraw();
            timerId = 0;
            return(false);
        }
Exemplo n.º 2
0
 bool SetBackgroundRenderer()
 {
     editor.TextViewMargin.DisposeLayoutDict();
     editor.TextViewMargin.BackgroundRenderer = new FoldingScreenbackgroundRenderer(editor, foldings);
     editor.QueueDraw();
     timerId = 0;
     return(false);
 }
Exemplo n.º 3
0
 internal protected override void MousePressed(MarginMouseEventArgs args)
 {
     base.MousePressed(args);
     if (args.LineSegment == null)
     {
         return;
     }
     foreach (FoldSegment segment in editor.Document.GetStartFoldings(args.LineSegment))
     {
         segment.IsFolded = !segment.IsFolded;
     }
     editor.SetAdjustments();
     editor.Caret.MoveCaretBeforeFoldings();
     editor.QueueDraw();
 }
Exemplo n.º 4
0
        bool SetBackgroundRenderer()
        {
            editor.TextViewMargin.DisposeLayoutDict();

            var disposable = editor.TextViewMargin.BackgroundRenderer as IDisposable;

            if (disposable != null)
            {
                disposable.Dispose();
            }

            editor.TextViewMargin.BackgroundRenderer = new FoldingScreenbackgroundRenderer(editor, foldings);
            editor.QueueDraw();
            timerId = 0;
            return(false);
        }
Exemplo n.º 5
0
 public FoldingScreenbackgroundRenderer(TextEditor editor, IEnumerable <FoldSegment> foldSegments)
 {
     this.editor       = editor;
     this.foldSegments = new List <FoldSegment> (foldSegments);
     startTime         = DateTime.Now;
     timeout           = GLib.Timeout.Add(30, delegate {
         editor.QueueDraw();
         var cont = (DateTime.Now - startTime).TotalMilliseconds < animationLength;
         if (!cont)
         {
             timeout = 0;
         }
         return(cont);
     });
 }
Exemplo n.º 6
0
        void UpdateCurrentLineMarker(bool moveCaret)
        {
            editor.Document.RemoveMarker(currentDebugLineMarker);
            StackFrame sf = DebuggingService.CurrentFrame;
            int        line;

            if (addressLines.TryGetValue(GetAddrId(sf.Address, sf.AddressSpace), out line))
            {
                editor.Document.AddMarker(line, currentDebugLineMarker);
                if (moveCaret)
                {
                    editor.Caret.Line = line;
                    GLib.Timeout.Add(100, delegate {
                        editor.CenterToCaret();
                        return(false);
                    });
                }
                editor.QueueDraw();
            }
        }
Exemplo n.º 7
0
 void HandleVScroll(object sender, EventArgs e)
 {
     editor.QueueDraw();
 }
 public override void Update(TextEditor editor)
 {
     editor.QueueDraw();
 }