Browse Source

Revert "Lock view contents when debugger starts and refresh icon since we don't support EnC (yet)."

This reverts commit a491d12952.
pull/15/head
Eusebiu Marcu 15 years ago
parent
commit
7acf7a7e42
  1. 2
      src/AddIns/BackendBindings/Scripting/Test/Utils/MockTextEditor.cs
  2. 2
      src/AddIns/BackendBindings/WixBinding/Test/Utils/MockTextEditor.cs
  3. 4
      src/AddIns/BackendBindings/WixBinding/Test/Utils/MockWorkbenchWindow.cs
  4. 61
      src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs
  5. 2
      src/AddIns/DisplayBindings/XmlEditor/Test/Utils/MockTextEditor.cs
  6. 5
      src/Main/Base/Project/Src/Editor/AvalonEdit/AvalonEditTextEditorAdapter.cs
  7. 2
      src/Main/Base/Project/Src/Editor/ITextEditor.cs
  8. 5
      src/Main/Base/Project/Src/Gui/IWorkbenchWindow.cs
  9. 2
      src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonWorkbenchWindow.cs

2
src/AddIns/BackendBindings/Scripting/Test/Utils/MockTextEditor.cs

@ -62,8 +62,6 @@ namespace ICSharpCode.Scripting.Tests.Utils
} }
} }
public bool IsReadOnly { get; set; }
public int SelectionLength { get; set; } public int SelectionLength { get; set; }
public string SelectedText { get; set; } public string SelectedText { get; set; }

2
src/AddIns/BackendBindings/WixBinding/Test/Utils/MockTextEditor.cs

@ -110,8 +110,6 @@ namespace WixBinding.Tests.Utils
} }
} }
public bool IsReadOnly { get; set; }
public FileName FileName { public FileName FileName {
get { get {
throw new NotImplementedException(); throw new NotImplementedException();

4
src/AddIns/BackendBindings/WixBinding/Test/Utils/MockWorkbenchWindow.cs

@ -69,10 +69,6 @@ namespace WixBinding.Tests.Utils
get { return selectWindowMethodCalled; } get { return selectWindowMethodCalled; }
} }
public void UpdateActiveViewContent()
{
}
public event EventHandler ActiveViewContentChanged; public event EventHandler ActiveViewContentChanged;
protected virtual void OnActiveViewContentChanged(EventArgs e) protected virtual void OnActiveViewContentChanged(EventArgs e)

61
src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs

@ -22,8 +22,6 @@ 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;
@ -144,12 +142,12 @@ namespace ICSharpCode.SharpDevelop.Services
if (FileUtility.IsUrl(processStartInfo.FileName)) { if (FileUtility.IsUrl(processStartInfo.FileName)) {
var project = ProjectService.OpenSolution.Preferences.StartupProject as CompilableProject; var project = ProjectService.OpenSolution.Preferences.StartupProject as CompilableProject;
var options = WebProjectsOptions.Instance.GetWebProjectOptions(project.Name); var options = WebProjectsOptions.Instance.GetWebProjectOptions(project.Name);
if (!CheckWebProjectStartInfo(project, options)) if (!CheckWebProjectStartInfo(project, options))
return; return;
System.Diagnostics.Process defaultAppProcess = null; System.Diagnostics.Process defaultAppProcess = null;
if (options.Data.WebServer != WebServer.None) { if (options.Data.WebServer != WebServer.None) {
string processName = WebProjectService.WorkerProcessName; string processName = WebProjectService.WorkerProcessName;
// try find the worker process directly or using the process monitor callback // try find the worker process directly or using the process monitor callback
@ -296,7 +294,7 @@ namespace ICSharpCode.SharpDevelop.Services
{ {
if (FileUtility.IsUrl(processStartInfo.FileName)) { if (FileUtility.IsUrl(processStartInfo.FileName)) {
var project = ProjectService.OpenSolution.Preferences.StartupProject as CompilableProject; var project = ProjectService.OpenSolution.Preferences.StartupProject as CompilableProject;
var options = WebProjectsOptions.Instance.GetWebProjectOptions(project.Name); var options = WebProjectsOptions.Instance.GetWebProjectOptions(project.Name);
if (!CheckWebProjectStartInfo(project, options)) if (!CheckWebProjectStartInfo(project, options))
return; return;
@ -766,59 +764,16 @@ 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 {
@ -931,7 +886,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)
@ -939,9 +894,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) }));
} }
} }
} }

2
src/AddIns/DisplayBindings/XmlEditor/Test/Utils/MockTextEditor.cs

@ -95,8 +95,6 @@ namespace XmlEditor.Tests.Utils
} }
} }
public bool IsReadOnly { get; set; }
public FileName FileName { public FileName FileName {
get { return fileName; } get { return fileName; }
set { fileName = value; } set { fileName = value; }

5
src/Main/Base/Project/Src/Editor/AvalonEdit/AvalonEditTextEditorAdapter.cs

@ -26,11 +26,6 @@ namespace ICSharpCode.SharpDevelop.Editor.AvalonEdit
readonly TextEditor textEditor; readonly TextEditor textEditor;
AvalonEditDocumentAdapter document; AvalonEditDocumentAdapter document;
public bool IsReadOnly {
get { return textEditor.IsReadOnly; }
set { textEditor.IsReadOnly = value; }
}
public TextEditor TextEditor { public TextEditor TextEditor {
get { return textEditor; } get { return textEditor; }
} }

2
src/Main/Base/Project/Src/Editor/ITextEditor.cs

@ -24,8 +24,6 @@ namespace ICSharpCode.SharpDevelop.Editor
/// </summary> /// </summary>
public interface ITextEditor : IServiceProvider public interface ITextEditor : IServiceProvider
{ {
bool IsReadOnly { get; set; }
/// <summary> /// <summary>
/// Gets the primary view if split-view is active. /// Gets the primary view if split-view is active.
/// If split-view is disabled, the current ITextEditor instance is returned. /// If split-view is disabled, the current ITextEditor instance is returned.

5
src/Main/Base/Project/Src/Gui/IWorkbenchWindow.cs

@ -76,10 +76,5 @@ namespace ICSharpCode.SharpDevelop.Gui
/// Is called when the title of this window has changed. /// Is called when the title of this window has changed.
/// </summary> /// </summary>
event EventHandler TitleChanged; event EventHandler TitleChanged;
/// <summary>
/// Updates the content.
/// </summary>
void UpdateActiveViewContent();
} }
} }

2
src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonWorkbenchWindow.cs

@ -137,7 +137,7 @@ namespace ICSharpCode.SharpDevelop.Gui
IViewContent oldActiveViewContent; IViewContent oldActiveViewContent;
public void UpdateActiveViewContent() void UpdateActiveViewContent()
{ {
UpdateTitleAndInfoTip(); UpdateTitleAndInfoTip();

Loading…
Cancel
Save