|
|
@ -22,6 +22,8 @@ using ICSharpCode.NRefactory.Ast; |
|
|
|
using ICSharpCode.NRefactory.Visitors; |
|
|
|
using ICSharpCode.NRefactory.Visitors; |
|
|
|
using ICSharpCode.SharpDevelop.Bookmarks; |
|
|
|
using ICSharpCode.SharpDevelop.Bookmarks; |
|
|
|
using ICSharpCode.SharpDevelop.Debugging; |
|
|
|
using ICSharpCode.SharpDevelop.Debugging; |
|
|
|
|
|
|
|
using ICSharpCode.SharpDevelop.Editor; |
|
|
|
|
|
|
|
using ICSharpCode.SharpDevelop.Editor.AvalonEdit; |
|
|
|
using ICSharpCode.SharpDevelop.Gui; |
|
|
|
using ICSharpCode.SharpDevelop.Gui; |
|
|
|
using ICSharpCode.SharpDevelop.Gui.OptionPanels; |
|
|
|
using ICSharpCode.SharpDevelop.Gui.OptionPanels; |
|
|
|
using ICSharpCode.SharpDevelop.Project; |
|
|
|
using ICSharpCode.SharpDevelop.Project; |
|
|
@ -764,16 +766,59 @@ namespace ICSharpCode.SharpDevelop.Services |
|
|
|
if (debugger.Processes.Count == 1) { |
|
|
|
if (debugger.Processes.Count == 1) { |
|
|
|
if (DebugStarted != null) { |
|
|
|
if (DebugStarted != null) { |
|
|
|
DebugStarted(this, EventArgs.Empty); |
|
|
|
DebugStarted(this, EventArgs.Empty); |
|
|
|
|
|
|
|
SetActiveViewsReadonly(true); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
e.Item.LogMessage += LogMessage; |
|
|
|
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) |
|
|
|
void debugger_ProcessExited(object sender, CollectionItemEventArgs<Process> e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (debugger.Processes.Count == 0) { |
|
|
|
if (debugger.Processes.Count == 0) { |
|
|
|
if (DebugStopped != null) { |
|
|
|
if (DebugStopped != null) { |
|
|
|
DebugStopped(this, e); |
|
|
|
DebugStopped(this, e); |
|
|
|
|
|
|
|
SetActiveViewsReadonly(false); |
|
|
|
} |
|
|
|
} |
|
|
|
SelectProcess(null); |
|
|
|
SelectProcess(null); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -886,7 +931,7 @@ namespace ICSharpCode.SharpDevelop.Services |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void process_Modules_Added(object sender, CollectionItemEventArgs<Module> e) |
|
|
|
void process_Modules_Added(object sender, CollectionItemEventArgs<Module> e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (ProjectService.OpenSolution == null || |
|
|
|
if (ProjectService.OpenSolution == null || |
|
|
|
ProjectService.OpenSolution.Projects == null || |
|
|
|
ProjectService.OpenSolution.Projects == null || |
|
|
|
ProjectService.OpenSolution.Projects.Count() == 0) |
|
|
|
ProjectService.OpenSolution.Projects.Count() == 0) |
|
|
@ -894,9 +939,9 @@ namespace ICSharpCode.SharpDevelop.Services |
|
|
|
|
|
|
|
|
|
|
|
if (e == null || e.Item == null) return; |
|
|
|
if (e == null || e.Item == null) return; |
|
|
|
|
|
|
|
|
|
|
|
ProjectService.OpenSolution.Projects |
|
|
|
ProjectService.OpenSolution.Projects |
|
|
|
.Where(p => e.Item.Name.IndexOf(p.Name) >= 0) |
|
|
|
.Where(p => e.Item.Name.IndexOf(p.Name) >= 0) |
|
|
|
.ForEach(p => e.Item.LoadSymbolsFromDisk(new []{ Path.GetDirectoryName(p.OutputAssemblyFullPath) })); |
|
|
|
.ForEach(p => e.Item.LoadSymbolsFromDisk(new []{ Path.GetDirectoryName(p.OutputAssemblyFullPath) })); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|