Browse Source

Layout configuration: Make "<Reset to defaults>" switch back to the Default layout.

Do not store active layout, always start with Default. (fixes SD2-1268)
Switch layout before starting the debugger (removes workaround for SD2-1325)
Add LINQ support to VBNetOutputVisitor (not tested to generate valid code, but better than "throw new NotImplementedException();")

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2751 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 18 years ago
parent
commit
85d7e3ab6b
  1. 4
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs
  2. 41
      src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockContentHandler.cs
  3. 6
      src/Libraries/DockPanel_Src/patchnotes.txt
  4. 2
      src/Libraries/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs
  5. 113
      src/Libraries/NRefactory/Project/Src/PrettyPrinter/VBNet/VBNetOutputVisitor.cs
  6. 6
      src/Main/Base/Project/Src/Commands/ChooseLayoutCommand.cs
  7. 16
      src/Main/Base/Project/Src/Gui/Workbench/Layouts/LayoutConfiguration.cs
  8. 6
      src/Main/Base/Project/Src/Gui/WorkbenchSingleton.cs
  9. 26
      src/Main/Base/Project/Src/Services/Debugger/DebuggerService.cs
  10. 11
      src/Main/Base/Project/Src/Services/Debugger/DefaultDebugger.cs
  11. 5
      src/Main/Base/Project/Src/Services/Debugger/IDebugger.cs

4
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs

@ -138,6 +138,9 @@ namespace ICSharpCode.SharpDevelop.Services
} else if (version == null || version.Length == 0) { } else if (version == null || version.Length == 0) {
MessageService.ShowMessage("${res:XML.MainMenu.DebugMenu.Error.BadAssembly}"); MessageService.ShowMessage("${res:XML.MainMenu.DebugMenu.Error.BadAssembly}");
} else { } else {
if (DebugStarting != null)
DebugStarting(this, EventArgs.Empty);
Debugger.Process process = debugger.Start(processStartInfo.FileName, Debugger.Process process = debugger.Start(processStartInfo.FileName,
processStartInfo.WorkingDirectory, processStartInfo.WorkingDirectory,
processStartInfo.Arguments); processStartInfo.Arguments);
@ -228,6 +231,7 @@ namespace ICSharpCode.SharpDevelop.Services
} }
} }
public event EventHandler DebugStarting;
public event EventHandler DebugStarted; public event EventHandler DebugStarted;
public event EventHandler DebugStopped; public event EventHandler DebugStopped;
public event EventHandler IsProcessRunningChanged; public event EventHandler IsProcessRunningChanged;

41
src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockContentHandler.cs

@ -704,17 +704,17 @@ namespace WeifenLuo.WinFormsUI.Docking
// Change the parent of a control with focus may result in the first // Change the parent of a control with focus may result in the first
// MDI child form get activated. // MDI child form get activated.
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
bool bRestoreFocus = false; // bool bRestoreFocus = false;
if (Form.ContainsFocus) // if (Form.ContainsFocus)
{ // {
if (value == null) // if (value == null)
DockPanel.ContentFocusManager.GiveUpFocus(this.Content); // DockPanel.ContentFocusManager.GiveUpFocus(this.Content);
else // else
{ // {
DockPanel.SaveFocus(); // DockPanel.SaveFocus();
bRestoreFocus = true; // bRestoreFocus = true;
} // }
} // }
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Form.Parent = value; Form.Parent = value;
@ -724,8 +724,27 @@ namespace WeifenLuo.WinFormsUI.Docking
// Change the parent of a control with focus may result in the first // Change the parent of a control with focus may result in the first
// MDI child form get activated. // MDI child form get activated.
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
/* Workaround disabled: in SharpDevelop, the Activate() call causes an exception on layout changes
iff no document is open and a pad has the focus.
I don't think we need this workaround because we don't use MDI.
System.InvalidOperationException: Invalid Content: ActiveContent must be one ofthe visible contents, or null if there is no visible content.
at WeifenLuo.WinFormsUI.Docking.DockPane.set_ActiveContent(IDockContent value) in d:\SD\3.0\SharpDevelop\src\Libraries\DockPanel_Src\WinFormsUI\Docking\DockPane.cs:line 162
at WeifenLuo.WinFormsUI.Docking.DockContentHandler.Activate() in d:\SD\3.0\SharpDevelop\src\Libraries\DockPanel_Src\WinFormsUI\Docking\DockContentHandler.cs:line 618
at WeifenLuo.WinFormsUI.Docking.DockContentHandler.SetParent(Control value) in d:\SD\3.0\SharpDevelop\src\Libraries\DockPanel_Src\WinFormsUI\Docking\DockContentHandler.cs:line 728
at WeifenLuo.WinFormsUI.Docking.DockContentHandler.SetPane(DockPane pane) in d:\SD\3.0\SharpDevelop\src\Libraries\DockPanel_Src\WinFormsUI\Docking\DockContentHandler.cs:line 674
at WeifenLuo.WinFormsUI.Docking.DockContentHandler.SetPaneAndVisible(DockPane pane) in d:\SD\3.0\SharpDevelop\src\Libraries\DockPanel_Src\WinFormsUI\Docking\DockContentHandler.cs:line 651
at WeifenLuo.WinFormsUI.Docking.DockContentHandler.SetDockState(Boolean isHidden, DockState visibleState, DockPane oldPane) in d:\SD\3.0\SharpDevelop\src\Libraries\DockPanel_Src\WinFormsUI\Docking\DockContentHandler.cs:line 504
at WeifenLuo.WinFormsUI.Docking.DockContentHandler.set_PanelPane(DockPane value) in d:\SD\3.0\SharpDevelop\src\Libraries\DockPanel_Src\WinFormsUI\Docking\DockContentHandler.cs:line 388
at WeifenLuo.WinFormsUI.Docking.DockPanel.Persistor.LoadFromXml(DockPanel dockPanel, Stream stream, DeserializeDockContent deserializeContent, Boolean closeStream) in d:\SD\3.0\SharpDevelop\src\Libraries\DockPanel_Src\WinFormsUI\Docking\DockPanel.Persistor.cs:line 614
at WeifenLuo.WinFormsUI.Docking.DockPanel.Persistor.LoadFromXml(DockPanel dockPanel, Stream stream, DeserializeDockContent deserializeContent) in d:\SD\3.0\SharpDevelop\src\Libraries\DockPanel_Src\WinFormsUI\Docking\DockPanel.Persistor.cs:line 378
at WeifenLuo.WinFormsUI.Docking.DockPanel.LoadFromXml(Stream stream, DeserializeDockContent deserializeContent) in d:\SD\3.0\SharpDevelop\src\Libraries\DockPanel_Src\WinFormsUI\Docking\DockPanel.Persistor.cs:line 772
at ICSharpCode.SharpDevelop.Gui.SdiWorkbenchLayout.LoadDockPanelLayout(String fileName) in d:\SD\3.0\SharpDevelop\src\Main\Base\Project\Src\Gui\Workbench\Layouts\SdiWorkspaceLayout.cs:line 213
at ICSharpCode.SharpDevelop.Gui.SdiWorkbenchLayout.LoadLayoutConfiguration()in d:\SD\3.0\SharpDevelop\src\Main\Base\Project\Src\Gui\Workbench\Layouts\SdiWorkspaceLayout.cs:line 190
if (bRestoreFocus) if (bRestoreFocus)
Activate(); Activate();
*/
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
} }

6
src/Libraries/DockPanel_Src/patchnotes.txt

@ -14,3 +14,9 @@ Patch #2:
that was active when SharpDevelop was closed does not exist anymore after an AddIn was removed that was active when SharpDevelop was closed does not exist anymore after an AddIn was removed
manually or SharpDevelop was updated) manually or SharpDevelop was updated)
Committed in revision 2732. Committed in revision 2732.
Patch #3:
Disable MDI focus workaround in DockContentHandler.cs
This fixes the System.InvalidOperationException: Invalid Content: ActiveContent must be one ofthe visible contents, or null if there is no visible content.
that occurs on layout changes iff no document is open and a pad has the focus.
Committed in revision 2751.

2
src/Libraries/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs

@ -2623,7 +2623,7 @@ namespace ICSharpCode.NRefactory.PrettyPrinter
public override object TrackedVisitQueryExpressionJoinClause(QueryExpressionJoinClause joinClause, object data) public override object TrackedVisitQueryExpressionJoinClause(QueryExpressionJoinClause joinClause, object data)
{ {
outputFormatter.PrintToken(Tokens.From); outputFormatter.PrintToken(Tokens.Join);
outputFormatter.Space(); outputFormatter.Space();
VisitQueryExpressionFromOrJoinClause(joinClause, data); VisitQueryExpressionFromOrJoinClause(joinClause, data);
outputFormatter.Space(); outputFormatter.Space();

113
src/Libraries/NRefactory/Project/Src/PrettyPrinter/VBNet/VBNetOutputVisitor.cs

@ -2775,47 +2775,126 @@ namespace ICSharpCode.NRefactory.PrettyPrinter
public override object TrackedVisitQueryExpression(QueryExpression queryExpression, object data) public override object TrackedVisitQueryExpression(QueryExpression queryExpression, object data)
{ {
throw new NotImplementedException(); outputFormatter.IndentationLevel++;
queryExpression.FromClause.AcceptVisitor(this, data);
queryExpression.FromLetWhereClauses.ForEach(PrintClause);
if (queryExpression.Orderings.Count > 0) {
outputFormatter.NewLine();
outputFormatter.Indent();
outputFormatter.PrintText("Order By");
outputFormatter.Space();
AppendCommaSeparatedList(queryExpression.Orderings);
}
PrintClause(queryExpression.SelectOrGroupClause);
PrintClause(queryExpression.IntoClause);
outputFormatter.IndentationLevel--;
return null;
}
void PrintClause(QueryExpressionClause clause)
{
if (!clause.IsNull) {
outputFormatter.PrintLineContinuation();
outputFormatter.Indent();
clause.AcceptVisitor(this, null);
}
} }
public override object TrackedVisitQueryExpressionFromClause(QueryExpressionFromClause queryExpressionFromClause, object data) public override object TrackedVisitQueryExpressionFromClause(QueryExpressionFromClause fromClause, object data)
{ {
throw new NotImplementedException(); outputFormatter.PrintText("From");
outputFormatter.Space();
VisitQueryExpressionFromOrJoinClause(fromClause, data);
return null;
}
public override object TrackedVisitQueryExpressionJoinClause(QueryExpressionJoinClause joinClause, object data)
{
outputFormatter.PrintText("Join");
outputFormatter.Space();
VisitQueryExpressionFromOrJoinClause(joinClause, data);
outputFormatter.Space();
outputFormatter.PrintToken(Tokens.On);
outputFormatter.Space();
joinClause.OnExpression.AcceptVisitor(this, data);
outputFormatter.Space();
outputFormatter.PrintToken(Tokens.Assign);
outputFormatter.Space();
joinClause.EqualsExpression.AcceptVisitor(this, data);
if (!string.IsNullOrEmpty(joinClause.IntoIdentifier)) {
outputFormatter.Space();
outputFormatter.PrintText("Into");
outputFormatter.Space();
outputFormatter.PrintIdentifier(joinClause.IntoIdentifier);
}
return null;
} }
public override object TrackedVisitQueryExpressionGroupClause(QueryExpressionGroupClause queryExpressionGroupClause, object data) void VisitQueryExpressionFromOrJoinClause(QueryExpressionFromOrJoinClause clause, object data)
{ {
throw new NotImplementedException(); outputFormatter.PrintIdentifier(clause.Identifier);
outputFormatter.Space();
outputFormatter.PrintToken(Tokens.In);
outputFormatter.Space();
clause.InExpression.AcceptVisitor(this, data);
} }
public override object TrackedVisitQueryExpressionIntoClause(QueryExpressionIntoClause queryExpressionIntoClause, object data) public override object TrackedVisitQueryExpressionLetClause(QueryExpressionLetClause letClause, object data)
{ {
throw new NotImplementedException(); outputFormatter.PrintToken(Tokens.Let);
outputFormatter.Space();
outputFormatter.PrintIdentifier(letClause.Identifier);
outputFormatter.Space();
outputFormatter.PrintToken(Tokens.Assign);
outputFormatter.Space();
return letClause.Expression.AcceptVisitor(this, data);
} }
public override object TrackedVisitQueryExpressionOrdering(QueryExpressionOrdering queryExpressionOrdering, object data) public override object TrackedVisitQueryExpressionGroupClause(QueryExpressionGroupClause groupClause, object data)
{ {
throw new NotImplementedException(); outputFormatter.PrintText("Group");
outputFormatter.Space();
groupClause.Projection.AcceptVisitor(this, data);
outputFormatter.Space();
outputFormatter.PrintText("By");
outputFormatter.Space();
return groupClause.GroupBy.AcceptVisitor(this, data);
} }
public override object TrackedVisitQueryExpressionSelectClause(QueryExpressionSelectClause queryExpressionSelectClause, object data) public override object TrackedVisitQueryExpressionIntoClause(QueryExpressionIntoClause intoClause, object data)
{ {
throw new NotImplementedException(); outputFormatter.PrintText("Into");
outputFormatter.Space();
outputFormatter.PrintIdentifier(intoClause.IntoIdentifier);
outputFormatter.Space();
return intoClause.ContinuedQuery.AcceptVisitor(this, data);
} }
public override object TrackedVisitQueryExpressionWhereClause(QueryExpressionWhereClause queryExpressionWhereClause, object data) public override object TrackedVisitQueryExpressionOrdering(QueryExpressionOrdering ordering, object data)
{ {
throw new NotImplementedException(); ordering.Criteria.AcceptVisitor(this, data);
if (ordering.Direction == QueryExpressionOrderingDirection.Ascending) {
outputFormatter.Space();
outputFormatter.PrintText("Ascending");
} else if (ordering.Direction == QueryExpressionOrderingDirection.Descending) {
outputFormatter.Space();
outputFormatter.PrintText("Descending");
}
return null;
} }
public override object TrackedVisitQueryExpressionJoinClause(QueryExpressionJoinClause queryExpressionJoinClause, object data) public override object TrackedVisitQueryExpressionSelectClause(QueryExpressionSelectClause selectClause, object data)
{ {
throw new NotImplementedException(); outputFormatter.PrintToken(Tokens.Select);
outputFormatter.Space();
return selectClause.Projection.AcceptVisitor(this, data);
} }
public override object TrackedVisitQueryExpressionLetClause(QueryExpressionLetClause queryExpressionLetClause, object data) public override object TrackedVisitQueryExpressionWhereClause(QueryExpressionWhereClause whereClause, object data)
{ {
throw new NotImplementedException(); outputFormatter.PrintText("Where");
outputFormatter.Space();
return whereClause.Condition.AcceptVisitor(this, data);
} }
} }
} }

6
src/Main/Base/Project/Src/Commands/ChooseLayoutCommand.cs

@ -39,6 +39,7 @@ namespace ICSharpCode.SharpDevelop.Commands
public override void Run() public override void Run()
{ {
if (editingLayout) return; if (editingLayout) return;
LoggingService.Debug("ChooseLayoutCommand.Run()");
ComboBox comboBox = ((ToolBarComboBox)Owner).ComboBox; ComboBox comboBox = ((ToolBarComboBox)Owner).ComboBox;
string dataPath = Path.Combine(PropertyService.DataDirectory, "resources" + Path.DirectorySeparatorChar + "layouts"); string dataPath = Path.Combine(PropertyService.DataDirectory, "resources" + Path.DirectorySeparatorChar + "layouts");
@ -147,15 +148,14 @@ namespace ICSharpCode.SharpDevelop.Commands
} catch (Exception) {} } catch (Exception) {}
} }
} }
WorkbenchSingleton.Workbench.WorkbenchLayout.LoadConfiguration(); LayoutConfiguration.ReloadDefaultLayout();
LayoutChanged(null, null);
} }
} }
void LayoutChanged(object sender, EventArgs e) void LayoutChanged(object sender, EventArgs e)
{ {
if (editingLayout) return; if (editingLayout) return;
LoggingService.Debug("ChooseLayoutCommand.LayoutChanged(object,EventArgs)");
ToolBarComboBox toolbarItem = (ToolBarComboBox)Owner; ToolBarComboBox toolbarItem = (ToolBarComboBox)Owner;
ComboBox comboBox = toolbarItem.ComboBox; ComboBox comboBox = toolbarItem.ComboBox;
for (int i = 0; i < comboBox.Items.Count; ++i) { for (int i = 0; i < comboBox.Items.Count; ++i) {

16
src/Main/Base/Project/Src/Gui/Workbench/Layouts/LayoutConfiguration.cs

@ -20,6 +20,8 @@ namespace ICSharpCode.SharpDevelop.Gui
const string configFile = "LayoutConfig.xml"; const string configFile = "LayoutConfig.xml";
public static readonly List<LayoutConfiguration> Layouts = new List<LayoutConfiguration>(); public static readonly List<LayoutConfiguration> Layouts = new List<LayoutConfiguration>();
const string DefaultLayoutName = "Default";
public static string[] DefaultLayouts = new string[] { public static string[] DefaultLayouts = new string[] {
"Default", "Default",
"Debug", "Debug",
@ -107,22 +109,30 @@ namespace ICSharpCode.SharpDevelop.Gui
return DisplayName; return DisplayName;
} }
static string currentLayoutName = DefaultLayoutName;
public static string CurrentLayoutName { public static string CurrentLayoutName {
get { get {
return currentLayoutName;
return PropertyService.Get("Workbench.CurrentLayout", "Default");
} }
set { set {
if (WorkbenchSingleton.InvokeRequired) if (WorkbenchSingleton.InvokeRequired)
throw new InvalidOperationException("Invoke required"); throw new InvalidOperationException("Invoke required");
if (value != CurrentLayoutName) { if (value != CurrentLayoutName) {
PropertyService.Set("Workbench.CurrentLayout", value); currentLayoutName = value;
WorkbenchSingleton.Workbench.WorkbenchLayout.LoadConfiguration(); WorkbenchSingleton.Workbench.WorkbenchLayout.LoadConfiguration();
OnLayoutChanged(EventArgs.Empty); OnLayoutChanged(EventArgs.Empty);
} }
} }
} }
public static void ReloadDefaultLayout()
{
currentLayoutName = DefaultLayoutName;
WorkbenchSingleton.Workbench.WorkbenchLayout.LoadConfiguration();
OnLayoutChanged(EventArgs.Empty);
}
public static string CurrentLayoutFileName { public static string CurrentLayoutFileName {
get { get {
string configPath = Path.Combine(PropertyService.ConfigDirectory, "layouts"); string configPath = Path.Combine(PropertyService.ConfigDirectory, "layouts");

6
src/Main/Base/Project/Src/Gui/WorkbenchSingleton.cs

@ -108,13 +108,13 @@ namespace ICSharpCode.SharpDevelop.Gui
NavigationService.InitializeService(); NavigationService.InitializeService();
workbench.ActiveContentChanged += delegate { workbench.ActiveContentChanged += delegate {
Console.WriteLine("ActiveContentChanged to " + workbench.ActiveContent); LoggingService.Debug("ActiveContentChanged to " + workbench.ActiveContent);
}; };
workbench.ActiveViewContentChanged += delegate { workbench.ActiveViewContentChanged += delegate {
Console.WriteLine("ActiveViewContentChanged to " + workbench.ActiveViewContent); LoggingService.Debug("ActiveViewContentChanged to " + workbench.ActiveViewContent);
}; };
workbench.ActiveWorkbenchWindowChanged += delegate { workbench.ActiveWorkbenchWindowChanged += delegate {
Console.WriteLine("ActiveWorkbenchWindowChanged to " + workbench.ActiveWorkbenchWindow); LoggingService.Debug("ActiveWorkbenchWindowChanged to " + workbench.ActiveWorkbenchWindow);
}; };
} }

26
src/Main/Base/Project/Src/Services/Debugger/DebuggerService.cs

@ -72,6 +72,7 @@ namespace ICSharpCode.SharpDevelop.Debugging
get { get {
if (currentDebugger == null) { if (currentDebugger == null) {
currentDebugger = GetCompatibleDebugger(); currentDebugger = GetCompatibleDebugger();
currentDebugger.DebugStarting += new EventHandler(OnDebugStarting);
currentDebugger.DebugStarted += new EventHandler(OnDebugStarted); currentDebugger.DebugStarted += new EventHandler(OnDebugStarted);
currentDebugger.DebugStopped += new EventHandler(OnDebugStopped); currentDebugger.DebugStopped += new EventHandler(OnDebugStopped);
} }
@ -97,25 +98,25 @@ namespace ICSharpCode.SharpDevelop.Debugging
} }
} }
public static event EventHandler DebugStarting;
public static event EventHandler DebugStarted; public static event EventHandler DebugStarted;
public static event EventHandler DebugStopped; public static event EventHandler DebugStopped;
static void OnDebugStarted(object sender, EventArgs e) static void OnDebugStarting(object sender, EventArgs e)
{
// OnDebugStarted runs on the main thread, but for some reason we
// have to delay the layout change a bit to work around SD2-1325
WorkbenchSingleton.SafeThreadAsyncCall(OnDebugStartedInvoked);
if (DebugStarted != null)
DebugStarted(null, EventArgs.Empty);
}
static void OnDebugStartedInvoked()
{ {
WorkbenchSingleton.Workbench.WorkbenchLayout.StoreConfiguration(); WorkbenchSingleton.Workbench.WorkbenchLayout.StoreConfiguration();
oldLayoutConfiguration = LayoutConfiguration.CurrentLayoutName;
LayoutConfiguration.CurrentLayoutName = "Debug"; LayoutConfiguration.CurrentLayoutName = "Debug";
ClearDebugMessages(); ClearDebugMessages();
if (DebugStarting != null)
DebugStarting(null, e);
}
static void OnDebugStarted(object sender, EventArgs e)
{
if (DebugStarted != null)
DebugStarted(null, e);
} }
static void OnDebugStopped(object sender, EventArgs e) static void OnDebugStopped(object sender, EventArgs e)
@ -311,7 +312,6 @@ namespace ICSharpCode.SharpDevelop.Debugging
} }
if (e.InDocument) { if (e.InDocument) {
// Query all registered tooltip providers using the AddInTree. // Query all registered tooltip providers using the AddInTree.
// The first one that does not return null will be used. // The first one that does not return null will be used.
ToolTipInfo ti = null; ToolTipInfo ti = null;
@ -335,7 +335,7 @@ namespace ICSharpCode.SharpDevelop.Debugging
} }
} catch (Exception ex) { } catch (Exception ex) {
ICSharpCode.Core.MessageService.ShowError(ex); ICSharpCode.Core.MessageService.ShowError(ex, "Error while requesting tooltip for location " + e.LogicalPosition);
} finally { } finally {
if (toolTipControl == null && CanCloseOldToolTip) if (toolTipControl == null && CanCloseOldToolTip)
CloseOldToolTip(); CloseOldToolTip();

11
src/Main/Base/Project/Src/Services/Debugger/DefaultDebugger.cs

@ -39,6 +39,7 @@ namespace ICSharpCode.SharpDevelop.Debugging
return; return;
} }
OnDebugStarting(EventArgs.Empty);
try { try {
attachedProcess = new Process(); attachedProcess = new Process();
attachedProcess.StartInfo = processStartInfo; attachedProcess.StartInfo = processStartInfo;
@ -47,6 +48,7 @@ namespace ICSharpCode.SharpDevelop.Debugging
attachedProcess.Start(); attachedProcess.Start();
OnDebugStarted(EventArgs.Empty); OnDebugStarted(EventArgs.Empty);
} catch (Exception) { } catch (Exception) {
OnDebugStopped(EventArgs.Empty);
throw new ApplicationException("Can't execute " + "\"" + processStartInfo.FileName + "\"\n"); throw new ApplicationException("Can't execute " + "\"" + processStartInfo.FileName + "\"\n");
} }
} }
@ -161,6 +163,15 @@ namespace ICSharpCode.SharpDevelop.Debugging
} }
} }
public event EventHandler DebugStarting;
protected virtual void OnDebugStarting(EventArgs e)
{
if (DebugStarting != null) {
DebugStarting(this, e);
}
}
public void Dispose() public void Dispose()
{ {
Stop(); Stop();

5
src/Main/Base/Project/Src/Services/Debugger/IDebugger.cs

@ -79,6 +79,11 @@ namespace ICSharpCode.SharpDevelop.Debugging
/// <returns>True if successful. False otherwise</returns> /// <returns>True if successful. False otherwise</returns>
bool SetInstructionPointer(string filename, int line, int column); bool SetInstructionPointer(string filename, int line, int column);
/// <summary>
/// Ocurrs when the debugger is starting.
/// </summary>
event EventHandler DebugStarting;
/// <summary> /// <summary>
/// Ocurrs after the debugger has started. /// Ocurrs after the debugger has started.
/// </summary> /// </summary>

Loading…
Cancel
Save