Beispiel #1
0
 private void OnEditorOptionsChanged(EditorChangedEventArgs args)
 {
     if (args.Changes.TryGetValue(Languages.CSharp, out var isEnable))
     {
         _isEnable = isEnable;
     }
 }
Beispiel #2
0
        static void OnChangedPSFile(object sender, EditorChangedEventArgs e)
        {
            if (e.Kind == EditorChangeKind.LineChanged)
            {
                return;
            }

            var editor = (IEditor)sender;
            var script = editor.FileName;
            var line   = e.Line + 1;

            IEnumerable <LineBreakpoint> bps = null;
            int delta = 0;

            if (e.Kind == EditorChangeKind.LineAdded)
            {
                delta = 1;
                bps   = A.Psf.Breakpoints.Where(x => x.Line >= line && x.Script.Equals(script, StringComparison.OrdinalIgnoreCase)).ToArray();
            }
            else
            {
                var bp = A.Psf.Breakpoints.FirstOrDefault(x => x.Line == line && x.Script.Equals(script, StringComparison.OrdinalIgnoreCase));
                if (bp != null)
                {
                    A.RemoveBreakpoint(bp);
                }

                delta = -1;
                bps   = A.Psf.Breakpoints.Where(x => x.Line > line && x.Script.Equals(script, StringComparison.OrdinalIgnoreCase)).ToArray();
            }

            foreach (var bp in bps)
            {
                A.RemoveBreakpoint(bp);
                A.SetBreakpoint(bp.Script, bp.Line + delta, bp.Action);
            }
        }