Пример #1
0
        /// <summary>
        /// Registers a script with a debugger.
        /// </summary>
        public ScriptDebugger AddDebugger(LuaSourceContainer script)
        {
            var debugger = new ScriptDebugger(script);

            lock (_locker)
            {
                _debuggers.Add(debugger);
            }
            return(debugger);
        }
Пример #2
0
        public CodeEditorViewModel(LuaSourceContainer luaSourceContainer)
        {
            LuaSourceContainer = luaSourceContainer;
            NotifyOfPropertyChange(() => LuaSourceContainer);
            NotifyOfPropertyChange(() => DisplayName);

            UpdateTheme();

            InsertBreakpointCommand = new InsertBreakpointCommand(this);
        }
Пример #3
0
        public BreakpointMargin(LuaSourceContainer script, TextEditor editor)
        {
            _script = script;
            _editor = editor;

            _pen = new Pen(Brushes.White, 4);

            _debugger = script.Debugger;

            _debugger.BreakpointAdded.Event += bp =>
            {
                var line = _editor.Document.GetLineByNumber(bp.Line);

                var offset = _editor.Document.GetOffset(bp.Line, 1);
                var anchor = _editor.Document.CreateAnchor(offset);
                anchor.MovementType = AnchorMovementType.AfterInsertion;
                anchor.Deleted     += (s, e) => bp.Destroy();
                bp.Tag = anchor;
            };

            _debugger.BreakpointRemoved.Event += bp => { };
        }
Пример #4
0
 internal Execution(LuaSourceContainer script = null)
 {
     Script     = script;
     _semaphore = new SemaphoreSlim(0, 1);
 }
Пример #5
0
 internal WaitExecution(LuaSourceContainer source, LuaThread thread, double seconds, Action continueAction = null) : base(source)
 {
     _luaThread      = thread;
     _continueAction = continueAction;
     _destination    = System.DateTime.Now + System.TimeSpan.FromSeconds(seconds);
 }
Пример #6
0
 public StartExecution(LuaSourceContainer script, object[] args = null) : base(script)
 {
     Args = args ?? new object[0];
 }
Пример #7
0
 internal CustomCompileOptions(LuaSourceContainer script)
 {
     _script = script;
 }
Пример #8
0
 public void OpenScript(LuaSourceContainer script, int lineNumber = 0)
 {
     ScriptService.AssertIdentity(ScriptIdentity.Plugin);
     CodeEditorViewModel.TryOpenScript(script, lineNumber);
 }
Пример #9
0
        public static void TryOpenScript(LuaSourceContainer script, int lineNumber = 0)
        {
            var editor = IoC.Get <ICodeEditor>(script.InstanceId);

            Editor.Current.Shell.ActiveDocument = (CodeEditorViewModel)editor;
        }
Пример #10
0
 public override int GetHashCode()
 {
     return(LuaSourceContainer.GetHashCode());
 }
Пример #11
0
 public virtual Task OnSave(LuaSourceContainer container)
 {
     return(Task.FromResult(true));
 }