|
|
|
@ -22,6 +22,8 @@ using ICSharpCode.NRefactory.Ast;
@@ -22,6 +22,8 @@ using ICSharpCode.NRefactory.Ast;
|
|
|
|
|
using ICSharpCode.NRefactory.Visitors; |
|
|
|
|
using ICSharpCode.SharpDevelop.Bookmarks; |
|
|
|
|
using ICSharpCode.SharpDevelop.Debugging; |
|
|
|
|
using ICSharpCode.SharpDevelop.Editor; |
|
|
|
|
using ICSharpCode.SharpDevelop.Editor.AvalonEdit; |
|
|
|
|
using ICSharpCode.SharpDevelop.Gui; |
|
|
|
|
using ICSharpCode.SharpDevelop.Gui.OptionPanels; |
|
|
|
|
using ICSharpCode.SharpDevelop.Project; |
|
|
|
@ -764,16 +766,59 @@ namespace ICSharpCode.SharpDevelop.Services
@@ -764,16 +766,59 @@ namespace ICSharpCode.SharpDevelop.Services
|
|
|
|
|
if (debugger.Processes.Count == 1) { |
|
|
|
|
if (DebugStarted != null) { |
|
|
|
|
DebugStarted(this, EventArgs.Empty); |
|
|
|
|
SetActiveViewsReadonly(true); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
e.Item.LogMessage += LogMessage; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SetActiveViewsReadonly(bool readOnly) |
|
|
|
|
{ |
|
|
|
|
// TODO: don't forget about EnC
|
|
|
|
|
//if (DebuggingOptions.Instance.EnableEditAndContinue)
|
|
|
|
|
// return;
|
|
|
|
|
|
|
|
|
|
if (WorkbenchSingleton.Workbench == null) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
if (WorkbenchSingleton.Workbench.WorkbenchWindowCollection.Count > 0) { |
|
|
|
|
foreach(var window in WorkbenchSingleton.Workbench.WorkbenchWindowCollection) { |
|
|
|
|
foreach (var content in window.ViewContents) { |
|
|
|
|
if (content is ITextEditorProvider) { |
|
|
|
|
((ITextEditorProvider)content).TextEditor.IsReadOnly = readOnly; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// refresh tab icon
|
|
|
|
|
window.UpdateActiveViewContent(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// make readonly the newly opened views
|
|
|
|
|
if (readOnly) |
|
|
|
|
WorkbenchSingleton.Workbench.ViewOpened += OnViewOpened; |
|
|
|
|
else |
|
|
|
|
WorkbenchSingleton.Workbench.ViewOpened -= OnViewOpened; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void OnViewOpened(object sender, ViewContentEventArgs e) |
|
|
|
|
{ |
|
|
|
|
if (!IsDebugging) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
// TODO: don't forget about EnC
|
|
|
|
|
//if (!DebuggingOptions.Instance.EnableEditAndContinue)
|
|
|
|
|
if (e.Content is ITextEditorProvider) { |
|
|
|
|
((ITextEditorProvider)e.Content).TextEditor.IsReadOnly = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void debugger_ProcessExited(object sender, CollectionItemEventArgs<Process> e) |
|
|
|
|
{ |
|
|
|
|
if (debugger.Processes.Count == 0) { |
|
|
|
|
if (DebugStopped != null) { |
|
|
|
|
DebugStopped(this, e); |
|
|
|
|
SetActiveViewsReadonly(false); |
|
|
|
|
} |
|
|
|
|
SelectProcess(null); |
|
|
|
|
} else { |
|
|
|
|