Browse Source

Add ICSharpCode.SharpDevelop.Sda and SdaUser example application.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1624 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 19 years ago
parent
commit
3ab6c9973f
  1. 31
      AddIns/ICSharpCode.SharpDevelop.addin
  2. 31
      samples/SdaUser/AssemblyInfo.cs
  3. 136
      samples/SdaUser/MainForm.Designer.cs
  4. 125
      samples/SdaUser/MainForm.cs
  5. 120
      samples/SdaUser/MainForm.resx
  6. 238
      samples/SdaUser/SdaAddIns/SdaBase.addin
  7. 67
      samples/SdaUser/SdaUser.csproj
  8. 16
      samples/SdaUser/SdaUser.sln
  9. 2
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerLoader/FormsDesignerLoadException.cs
  10. 14
      src/AddIns/Misc/CodeCoverage/Project/Src/CodeCoverageException.cs
  11. 12
      src/AddIns/Misc/NAntAddIn/Project/Src/NAntAddInException.cs
  12. 11
      src/AddIns/Misc/SharpQuery/Src/Exceptions/ConnectionStringException.cs
  13. 10
      src/AddIns/Misc/SharpQuery/Src/Exceptions/ExecuteProcedureException.cs
  14. 9
      src/AddIns/Misc/SharpQuery/Src/Exceptions/ExecuteSQLException.cs
  15. 10
      src/AddIns/Misc/SharpQuery/Src/Exceptions/OpenConnectionException.cs
  16. 16
      src/AddIns/Misc/SharpQuery/Src/Exceptions/SharpQueryAbstractException.cs
  17. 1
      src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/HistoryViewPanel.cs
  18. 1
      src/AddIns/Misc/SubversionAddIn/Project/Src/SvnClient.cs
  19. 3
      src/Libraries/DockPanel_Src/WinFormsUI/WinFormsUI.csproj
  20. 16
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Document/HighlightingStrategy/HighlightingColorNotFoundException.cs
  21. 4
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  22. 25
      src/Main/Base/Project/Src/Commands/AutostartCommands.cs
  23. 3
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/AbstractBuildOptions.cs
  24. 28
      src/Main/Base/Project/Src/Gui/Dialogs/SharpDevelopAboutPanels.cs
  25. 27
      src/Main/Base/Project/Src/Gui/Workbench/Layouts/LayoutConfiguration.cs
  26. 2
      src/Main/Base/Project/Src/Gui/WorkbenchSingleton.cs
  27. 1
      src/Main/Base/Project/Src/Project/MSBuildEngine.cs
  28. 1
      src/Main/Base/Project/Src/Services/IconService.cs
  29. 13
      src/Main/Base/Project/Src/Services/ParserService/ParserService.cs
  30. 14
      src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs
  31. 1
      src/Main/Base/Project/Src/TextEditor/Gui/Dialogs/ExportProjectToHtmlDialog.cs
  32. 1
      src/Main/Base/Project/Src/Util/OutputReader.cs
  33. 19
      src/Main/Base/Project/Src/Util/ProcessRunnerException.cs
  34. 5
      src/Main/Core/Project/ICSharpCode.Core.csproj
  35. BIN
      src/Main/Core/Project/Resources/ICSharpCode.Core.snk
  36. 18
      src/Main/Core/Project/Src/AddInTree/AddIn/AddInLoadException.cs
  37. 15
      src/Main/Core/Project/Src/AddInTree/CoreStartup.cs
  38. 17
      src/Main/Core/Project/Src/AddInTree/TreePathNotFoundException.cs
  39. 7
      src/Main/Core/Project/Src/CoreException.cs
  40. 4
      src/Main/Core/Project/Src/Services/FileUtility/FileUtility.cs
  41. 2
      src/Main/Core/Project/Src/Services/LoggingService/LoggingService.cs
  42. 5
      src/Main/Core/Project/Src/Services/MenuService/MenuService.cs
  43. 3
      src/Main/Core/Project/Src/Services/MessageService/MessageService.cs
  44. 14
      src/Main/Core/Project/Src/Services/ResourceService/ResourceNotFoundException.cs
  45. 22
      src/Main/ICSharpCode.SharpDevelop.Sda/Configuration/AssemblyInfo.cs
  46. 85
      src/Main/ICSharpCode.SharpDevelop.Sda/ICSharpCode.SharpDevelop.Sda.csproj
  47. 72
      src/Main/ICSharpCode.SharpDevelop.Sda/ICSharpCode.SharpDevelop.Sda.dll.config
  48. 6
      src/Main/ICSharpCode.SharpDevelop.Sda/ICSharpCode.SharpDevelop.Sda.sln
  49. 260
      src/Main/ICSharpCode.SharpDevelop.Sda/Src/CallHelper.cs
  50. 78
      src/Main/ICSharpCode.SharpDevelop.Sda/Src/Document.cs
  51. 38
      src/Main/ICSharpCode.SharpDevelop.Sda/Src/EventArgs.cs
  52. 81
      src/Main/ICSharpCode.SharpDevelop.Sda/Src/ExceptionBox.cs
  53. 47
      src/Main/ICSharpCode.SharpDevelop.Sda/Src/RunWorkbenchException.cs
  54. 378
      src/Main/ICSharpCode.SharpDevelop.Sda/Src/SharpDevelopHost.cs
  55. 159
      src/Main/ICSharpCode.SharpDevelop.Sda/Src/StartupSettings.cs
  56. 59
      src/Main/ICSharpCode.SharpDevelop.Sda/Src/WorkbenchSettings.cs
  57. 0
      src/Main/ICSharpCode.SharpDevelop.snk
  58. BIN
      src/Main/StartUp/Project/Resources/StartUp.snk
  59. 155
      src/Main/StartUp/Project/SharpDevelopMain.cs
  60. 13
      src/Main/StartUp/Project/StartUp.csproj
  61. 7
      src/SharpDevelop.sln

31
AddIns/ICSharpCode.SharpDevelop.addin

@ -10,7 +10,36 @@ @@ -10,7 +10,36 @@
</Manifest>
<Runtime>
<Import assembly=":ICSharpCode.SharpDevelop"/>
<Import assembly=":ICSharpCode.SharpDevelop">
<ConditionEvaluator name="ActiveContentExtension" class="ICSharpCode.Core.ActiveContentExtensionConditionEvaluator"/>
<ConditionEvaluator name="ActiveViewContentUntitled" class="ICSharpCode.Core.ActiveViewContentUntitledConditionEvaluator"/>
<ConditionEvaluator name="ActiveWindowState" class="ICSharpCode.Core.ActiveWindowStateConditionEvaluator"/>
<ConditionEvaluator name="SolutionOpen" class="ICSharpCode.Core.SolutionOpenConditionEvaluator"/>
<ConditionEvaluator name="DebuggerSupports" class="ICSharpCode.Core.DebuggerSupportsConditionEvaluator"/>
<ConditionEvaluator name="IsProcessRunning" class="ICSharpCode.Core.IsProcessRunningConditionEvaluator"/>
<ConditionEvaluator name="OpenWindowState" class="ICSharpCode.Core.OpenWindowStateConditionEvaluator"/>
<ConditionEvaluator name="WindowActive" class="ICSharpCode.Core.WindowActiveConditionEvaluator"/>
<ConditionEvaluator name="WindowOpen" class="ICSharpCode.Core.WindowOpenConditionEvaluator"/>
<ConditionEvaluator name="ProjectActive" class="ICSharpCode.Core.ProjectActiveConditionEvaluator"/>
<ConditionEvaluator name="TextContent" class="ICSharpCode.SharpDevelop.DefaultEditor.Conditions.TextContentConditionEvaluator"/>
<ConditionEvaluator name="BrowserLocation" class="ICSharpCode.SharpDevelop.BrowserDisplayBinding.BrowserLocationConditionEvaluator"/>
<ConditionEvaluator name="RefactoringProviderSupports" class="ICSharpCode.SharpDevelop.Refactoring.RefactoringProviderSupportsConditionEvaluator"/>
<ConditionEvaluator name="CanNavigateBack" class="ICSharpCode.Core.CanNavigateBackConditionEvaluator"/>
<ConditionEvaluator name="CanNavigateForward" class="ICSharpCode.Core.CanNavigateForwardConditionEvaluator"/>
<Doozer name="DialogPanel" class="ICSharpCode.Core.DialogPanelDoozer"/>
<Doozer name="DisplayBinding" class="ICSharpCode.Core.DisplayBindingDoozer"/>
<Doozer name="Pad" class="ICSharpCode.Core.PadDoozer"/>
<Doozer name="LanguageBinding" class="ICSharpCode.Core.LanguageBindingDoozer"/>
<Doozer name="Parser" class="ICSharpCode.Core.ParserDoozer"/>
<Doozer name="EditAction" class="ICSharpCode.SharpDevelop.DefaultEditor.Codons.EditActionDoozer"/>
<Doozer name="SyntaxMode" class="ICSharpCode.SharpDevelop.DefaultEditor.Codons.SyntaxModeDoozer"/>
<Doozer name="BrowserSchemeExtension" class="ICSharpCode.SharpDevelop.BrowserDisplayBinding.SchemeExtensionDoozer"/>
<Doozer name="CodeCompletionBinding" class="ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.CodeCompletionBindingDoozer"/>
<Doozer name="Debugger" class="ICSharpCode.Core.DebuggerDoozer"/>
<Doozer name="Directory" class="ICSharpCode.Core.DirectoryDoozer"/>
<Doozer name="TaskBoundAdditionalLogger" class="ICSharpCode.SharpDevelop.Project.TaskBoundAdditionalLoggerDoozer"/>
</Import>
<Import assembly=":ICSharpCode.TextEditor"/>
</Runtime>

31
samples/SdaUser/AssemblyInfo.cs

@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Information about this assembly is defined by the following
// attributes.
//
// change them to the information which is associated with the assembly
// you compile.
[assembly: AssemblyTitle("SdaUser")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SdaUser")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
[assembly: AssemblyVersion("1.0.*")]

136
samples/SdaUser/MainForm.Designer.cs generated

@ -0,0 +1,136 @@ @@ -0,0 +1,136 @@
/*
* Created by SharpDevelop.
* User: Daniel Grunwald
* Date: 26.07.2006
* Time: 19:49
*/
namespace SdaUser
{
partial class MainForm : System.Windows.Forms.Form
{
/// <summary>
/// Designer variable used to keep track of non-visual components.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Disposes resources used by the form.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing) {
if (components != null) {
components.Dispose();
}
}
base.Dispose(disposing);
}
/// <summary>
/// This method is required for Windows Forms designer support.
/// Do not change the method contents inside the source code editor. The Forms designer might
/// not be able to load this method if it was changed manually.
/// </summary>
private void InitializeComponent()
{
this.runButton = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.closeButton = new System.Windows.Forms.Button();
this.visibleCheckBox = new System.Windows.Forms.CheckBox();
this.unloadHostDomainButton = new System.Windows.Forms.Button();
this.openFileButton = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// runButton
//
this.runButton.Location = new System.Drawing.Point(28, 57);
this.runButton.Name = "runButton";
this.runButton.Size = new System.Drawing.Size(221, 31);
this.runButton.TabIndex = 0;
this.runButton.Text = "Run Integrated SharpDevelop";
this.runButton.UseVisualStyleBackColor = true;
this.runButton.Click += new System.EventHandler(this.RunButtonClick);
//
// groupBox1
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.closeButton);
this.groupBox1.Controls.Add(this.visibleCheckBox);
this.groupBox1.Enabled = false;
this.groupBox1.Location = new System.Drawing.Point(12, 130);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(268, 92);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "groupBox1";
//
// closeButton
//
this.closeButton.Location = new System.Drawing.Point(6, 50);
this.closeButton.Name = "closeButton";
this.closeButton.Size = new System.Drawing.Size(123, 23);
this.closeButton.TabIndex = 1;
this.closeButton.Text = "Close Workbench";
this.closeButton.UseVisualStyleBackColor = true;
this.closeButton.Click += new System.EventHandler(this.CloseButtonClick);
//
// visibleCheckBox
//
this.visibleCheckBox.Checked = true;
this.visibleCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
this.visibleCheckBox.Location = new System.Drawing.Point(6, 20);
this.visibleCheckBox.Name = "visibleCheckBox";
this.visibleCheckBox.Size = new System.Drawing.Size(256, 24);
this.visibleCheckBox.TabIndex = 0;
this.visibleCheckBox.Text = "WorkbenchVisible";
this.visibleCheckBox.UseVisualStyleBackColor = true;
this.visibleCheckBox.CheckedChanged += new System.EventHandler(this.VisibleCheckBoxCheckedChanged);
//
// unloadHostDomainButton
//
this.unloadHostDomainButton.Enabled = false;
this.unloadHostDomainButton.Location = new System.Drawing.Point(28, 94);
this.unloadHostDomainButton.Name = "unloadHostDomainButton";
this.unloadHostDomainButton.Size = new System.Drawing.Size(221, 23);
this.unloadHostDomainButton.TabIndex = 2;
this.unloadHostDomainButton.Text = "Unload SharpDevelop AppDomain";
this.unloadHostDomainButton.UseVisualStyleBackColor = true;
this.unloadHostDomainButton.Click += new System.EventHandler(this.UnloadHostDomainButtonClick);
//
// openFileButton
//
this.openFileButton.Location = new System.Drawing.Point(18, 243);
this.openFileButton.Name = "openFileButton";
this.openFileButton.Size = new System.Drawing.Size(75, 23);
this.openFileButton.TabIndex = 3;
this.openFileButton.Text = "Open File";
this.openFileButton.UseVisualStyleBackColor = true;
this.openFileButton.Click += new System.EventHandler(this.OpenFileButtonClick);
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 334);
this.Controls.Add(this.openFileButton);
this.Controls.Add(this.unloadHostDomainButton);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.runButton);
this.Name = "MainForm";
this.Text = "SdaUser";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainFormFormClosing);
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
}
private System.Windows.Forms.Button openFileButton;
private System.Windows.Forms.Button unloadHostDomainButton;
private System.Windows.Forms.Button closeButton;
private System.Windows.Forms.CheckBox visibleCheckBox;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Button runButton;
}
}

125
samples/SdaUser/MainForm.cs

@ -0,0 +1,125 @@ @@ -0,0 +1,125 @@
/*
* Created by SharpDevelop.
* User: Daniel Grunwald
* Date: 26.07.2006
* Time: 19:49
*/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
using ICSharpCode.SharpDevelop.Sda;
namespace SdaUser
{
public partial class MainForm
{
[STAThread]
public static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
public MainForm()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
void RunButtonClick(object sender, EventArgs e)
{
Run();
}
SharpDevelopHost host;
void Run()
{
runButton.Enabled = false;
unloadHostDomainButton.Enabled = true;
System.Threading.ThreadPool.QueueUserWorkItem(ThreadedRun);
}
void ThreadedRun(object state)
{
RunWorkbench(new WorkbenchSettings());
}
void RunWorkbench(WorkbenchSettings wbSettings)
{
if (host == null) {
StartupSettings startup = new StartupSettings();
startup.ApplicationName = "HostedSharpDevelop";
startup.DataDirectory = Path.Combine(Path.GetDirectoryName(typeof(SharpDevelopHost).Assembly.Location), "../data");
string sdaDir = Path.Combine(Path.GetDirectoryName(typeof(MainForm).Assembly.Location), "SdaAddIns");
startup.AddAddInFile(Path.Combine(sdaDir, "SdaBase.addin"));
host = new SharpDevelopHost(startup);
host.InvokeTarget = this;
host.BeforeRunWorkbench += delegate { groupBox1.Enabled = true; };
host.WorkbenchClosed += delegate { groupBox1.Enabled = false; runButton.Enabled = true; };
}
host.RunWorkbench(wbSettings);
}
void VisibleCheckBoxCheckedChanged(object sender, System.EventArgs e)
{
host.WorkbenchVisible = visibleCheckBox.Checked;
}
void CloseButtonClick(object sender, System.EventArgs e)
{
if (!host.CloseWorkbench(false)) {
if (DialogResult.Yes == MessageBox.Show("Force close?", "Force", MessageBoxButtons.YesNo)) {
host.CloseWorkbench(true);
}
}
}
void MainFormFormClosing(object sender, FormClosingEventArgs e)
{
if (host != null && host.WorkbenchVisible == false) {
if (!host.CloseWorkbench(false)) {
host.WorkbenchVisible = true;
}
}
}
void UnloadHostDomainButtonClick(object sender, System.EventArgs e)
{
unloadHostDomainButton.Enabled = false;
host.UnloadDomain();
host = null;
}
void OpenFileButtonClick(object sender, System.EventArgs e)
{
using (OpenFileDialog dlg = new OpenFileDialog()) {
if (dlg.ShowDialog() == DialogResult.OK) {
if (runButton.Enabled) {
runButton.Enabled = false;
unloadHostDomainButton.Enabled = true;
WorkbenchSettings wbSettings = new WorkbenchSettings();
wbSettings.InitialFileList.Add(dlg.FileName);
RunWorkbench(wbSettings);
} else if (host != null) {
host.OpenDocument(dlg.FileName);
}
}
}
}
}
}

120
samples/SdaUser/MainForm.resx

@ -0,0 +1,120 @@ @@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

238
samples/SdaUser/SdaAddIns/SdaBase.addin

@ -0,0 +1,238 @@ @@ -0,0 +1,238 @@
<?xml version="1.0"?>
<AddIn name = "Hosted SharpDevelop"
author = "Daniel Grunwald"
copyright = "prj:///doc/copyright.txt"
url = "http://www.icsharpcode.net"
description = "SharpDevelop main module"
addInManagerHidden = "true">
<Manifest>
<Identity name = "HostedSharpDevelop" version = "@SharpDevelopCoreVersion"/>
</Manifest>
<Runtime>
<Import assembly=":ICSharpCode.SharpDevelop">
<!-- SharpDevelop defines more conditions and doozers, we just -->
<!-- import those we need here. -->
<ConditionEvaluator name="WindowActive" class="ICSharpCode.Core.WindowActiveConditionEvaluator"/>
<ConditionEvaluator name="ActiveWindowState" class="ICSharpCode.Core.ActiveWindowStateConditionEvaluator"/>
<ConditionEvaluator name="OpenWindowState" class="ICSharpCode.Core.OpenWindowStateConditionEvaluator"/>
<Doozer name="DialogPanel" class="ICSharpCode.Core.DialogPanelDoozer"/>
<Doozer name="DisplayBinding" class="ICSharpCode.Core.DisplayBindingDoozer"/>
</Import>
</Runtime>
<!-- This is the minimum AddIn required to use SharpDevelop -->
<!-- Every Application should provide this extension point, used by many addins (e.g. AddInManager) -->
<Path name = "/Workspace/Tools"></Path>
<!-- REQUIRED to load files -->
<Path name = "/SharpDevelop/Workbench/Combine/FileFilter">
<FileFilter id = "AllFiles"
name = "${res:SharpDevelop.FileFilter.AllFiles}"
extensions = "*.*"/>
</Path>
<!-- REQUIRED for the open and save file dialogs -->
<Path name = "/SharpDevelop/Workbench/FileFilter">
<FileFilter id = "AllFiles"
name = "${res:SharpDevelop.FileFilter.AllFiles}"
extensions = "*.*"/>
</Path>
<!-- REQUIRED to open views -->
<Path name = "/SharpDevelop/Workbench/DisplayBindings">
<DisplayBinding id = "Text"
supportedformats = "Text Files,Source Files"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.TextEditorDisplayBinding" />
</Path>
<!-- REQUIRED to open views -->
<Path name = "/SharpDevelop/Workbench/OpenFileTab/ContextMenu">
<MenuItem id = "Close"
label = "${res:OpenFileTabEventHandler.ContextMenu.Close}"
icon = "Icons.16x16.CloseFileIcon"
class = "ICSharpCode.SharpDevelop.Commands.TabStrip.CloseFileTab"/>
<MenuItem id = "CloseAll"
icon = "Icons.16x16.CloseAllDocuments"
label = "${res:XML.MainMenu.FileMenu.CloseAll}"
class = "ICSharpCode.SharpDevelop.Commands.CloseAllWindows" />
<MenuItem id = "CloseAllButThis"
label = "${res:OpenFileTabEventHandler.ContextMenu.CloseAllButThis}"
class = "ICSharpCode.SharpDevelop.Commands.TabStrip.CloseAllButThisFileTab" />
</Path>
<!-- REQUIRED if you use the default text editor (TextEditorDisplayBinding) -->
<Path name = "/SharpDevelop/ViewContent/DefaultTextEditor/ContextMenu">
<Include id = "Cut" item = "/SharpDevelop/Workbench/MainMenu/Edit/Cut"/>
<Include id = "Copy" item = "/SharpDevelop/Workbench/MainMenu/Edit/Copy"/>
<Include id = "Paste" item = "/SharpDevelop/Workbench/MainMenu/Edit/Paste"/>
<Include id = "Delete" item = "/SharpDevelop/Workbench/MainMenu/Edit/Delete"/>
<MenuItem id = "Separator1" type = "Separator" />
<MenuItem id = "Options"
label = "${res:XML.TextAreaContextMenu.BufferOptions}"
icon = "Icons.16x16.PropertiesIcon"
class ="ICSharpCode.SharpDevelop.DefaultEditor.Commands.ShowBufferOptions"/>
</Path>
<!-- required for BufferOptions command in text editor context menu -->
<Path name = "/SharpDevelop/ViewContent/DefaultTextEditor/OptionsDialog">
<DialogPanel id = "General"
label = "${res:Dialog.Options.IDEOptions.TextEditor.General.PanelName}"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Gui.OptionPanels.GeneralTextEditorPanel"/>
<DialogPanel id = "Markers"
label = "${res:Dialog.Options.IDEOptions.TextEditor.Markers.PanelName}"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Gui.OptionPanels.MarkersTextEditorPanel"/>
<DialogPanel id = "Behavior"
label = "${res:Dialog.Options.IDEOptions.TextEditor.Behaviour.PanelName}"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Gui.OptionPanels.BehaviorTextEditorPanel"/>
</Path>
<!-- required for main menu options command -->
<Path name = "/SharpDevelop/Dialogs/OptionsDialog">
<DialogPanel id = "ToolsOptions"
label = "${res:Dialog.Options.IDEOptions.ToolsOptionsText}">
<DialogPanel id = "ExternalTools"
label = "${res:Dialog.Options.ExternalToolsText}"
class = "ICSharpCode.SharpDevelop.Gui.OptionPanels.ExternalToolPane"/>
</DialogPanel>
<DialogPanel id = "TextEditorOptions"
label = "${res:Dialog.Options.IDEOptions.TextEditorOptionsText}">
<DialogPanel id = "General"
label = "${res:Dialog.Options.IDEOptions.TextEditor.General.PanelName}"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Gui.OptionPanels.GeneralTextEditorPanel"/>
<DialogPanel id = "Markers"
label = "${res:Dialog.Options.IDEOptions.TextEditor.Markers.PanelName}"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Gui.OptionPanels.MarkersTextEditorPanel"/>
<DialogPanel id = "Behavior"
label = "${res:Dialog.Options.IDEOptions.TextEditor.Behaviour.PanelName}"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Gui.OptionPanels.BehaviorTextEditorPanel"/>
</DialogPanel>
</Path>
<!-- Main menu -->
<Path name = "/SharpDevelop/Workbench/MainMenu">
<MenuItem id = "File" label = "${res:XML.MainMenu.FileMenu}" type="Menu">
<MenuItem id = "File"
label = "${res:XML.MainMenu.FileMenu.New} ${res:XML.MainMenu.FileMenu.New.File}"
icon = "Icons.16x16.NewDocumentIcon"
shortcut = "Control|N"
class = "ICSharpCode.SharpDevelop.Commands.CreateNewFile"/>
<MenuItem id = "File"
label = "${res:XML.MainMenu.FileMenu.Open} ${res:XML.MainMenu.FileMenu.Open.File}"
icon = "Icons.16x16.OpenFileIcon"
shortcut = "Control|O"
class = "ICSharpCode.SharpDevelop.Commands.OpenFile"/>
<Condition name = "WindowActive" activewindow="*" action="Disable">
<MenuItem id = "CloseFile"
label = "${res:XML.MainMenu.FileMenu.Close} ${res:XML.MainMenu.FileMenu.Close.File}"
icon = "Icons.16x16.CloseFileIcon"
shortcut = "Control|F4"
class ="ICSharpCode.SharpDevelop.Commands.CloseFile"/>
</Condition>
<MenuItem id = "SaveSeparator" type = "Separator" />
<Condition name = "ActiveWindowState" windowstate="Dirty, Untitled" nowindowstate="ViewOnly" action="Disable">
<MenuItem id = "Save"
label = "${res:XML.MainMenu.FileMenu.Save}"
icon = "Icons.16x16.SaveIcon"
shortcut = "Control|S"
class = "ICSharpCode.SharpDevelop.Commands.SaveFile"/>
</Condition>
<Condition name = "ActiveWindowState" windowstate="None" nowindowstate="ViewOnly" action="Disable">
<MenuItem id = "SaveAs"
label = "${res:XML.MainMenu.FileMenu.SaveAs}"
class = "ICSharpCode.SharpDevelop.Commands.SaveFileAs"/>
</Condition>
<Condition name = "OpenWindowState" openwindowstate="Dirty" action="Disable">
<MenuItem id = "SaveAll"
label = "${res:XML.MainMenu.FileMenu.SaveAll}"
icon = "Icons.16x16.SaveAllIcon"
shortcut = "Control|Shift|S"
class = "ICSharpCode.SharpDevelop.Commands.SaveAllFiles"/>
</Condition>
<MenuItem id = "ExitSeparator" type = "Separator" />
<MenuItem id = "Exit"
label = "${res:XML.MainMenu.FileMenu.Exit}"
icon = "Icons.16x16.CancelIcon"
class = "ICSharpCode.SharpDevelop.Commands.ExitWorkbenchCommand" />
</MenuItem> <!-- END File menu -->
<MenuItem id = "Edit" label = "${res:XML.MainMenu.EditMenu}" type="Menu">
<MenuItem id = "Undo"
label = "${res:XML.MainMenu.EditMenu.Undo}"
icon = "Icons.16x16.UndoIcon"
type = "Item"
shortcut = "Control|Z"
loadclasslazy = "false"
class = "ICSharpCode.SharpDevelop.Commands.Undo"/>
<MenuItem id = "Redo"
label = "${res:XML.MainMenu.EditMenu.Redo}"
icon = "Icons.16x16.RedoIcon"
type = "Item"
shortcut = "Control|Y"
loadclasslazy = "false"
class = "ICSharpCode.SharpDevelop.Commands.Redo"/>
<MenuItem id = "Separator1" type = "Separator" />
<MenuItem id = "Cut"
label = "${res:XML.MainMenu.EditMenu.Cut}"
icon = "Icons.16x16.CutIcon"
type = "Item"
shortcut = "Control|X"
loadclasslazy = "false"
class = "ICSharpCode.SharpDevelop.Commands.Cut"/>
<MenuItem id = "Copy"
label = "${res:XML.MainMenu.EditMenu.Copy}"
icon = "Icons.16x16.CopyIcon"
type = "Item"
shortcut = "Control|C"
loadclasslazy = "false"
class = "ICSharpCode.SharpDevelop.Commands.Copy"/>
<MenuItem id = "Paste"
label = "${res:XML.MainMenu.EditMenu.Paste}"
icon = "Icons.16x16.PasteIcon"
type = "Item"
shortcut = "Control|V"
loadclasslazy = "false"
class = "ICSharpCode.SharpDevelop.Commands.Paste"/>
<MenuItem id = "Delete"
label = "${res:XML.MainMenu.EditMenu.Delete}"
icon = "Icons.16x16.DeleteIcon"
type = "Item"
loadclasslazy = "false"
class = "ICSharpCode.SharpDevelop.Commands.Delete"/>
<MenuItem id = "SelectAll"
label = "${res:XML.MainMenu.EditMenu.SelectAll}"
type = "Item"
shortcut = "Control|A"
loadclasslazy = "false"
class = "ICSharpCode.SharpDevelop.Commands.SelectAll"/>
</MenuItem> <!-- end EDIT menu -->
<MenuItem id = "Tools" label = "${res:XML.MainMenu.ToolMenu}" type="Menu">
<!-- configurable tool list (Options Dialog > External Tools) -->
<MenuItem id = "ToolBuilder" type="Builder" class = "ICSharpCode.SharpDevelop.Commands.ToolMenuBuilder" />
<MenuItem id = "Separator1" type = "Separator" />
<!-- AddIns can add tool commands here-->
<Include id = "ToolList" path = "/Workspace/Tools" />
<MenuItem id = "LastSeparator" type = "Separator" />
<MenuItem id = "Options"
label = "${res:XML.MainMenu.ToolMenu.Options}"
icon = "Icons.16x16.Options"
class = "ICSharpCode.SharpDevelop.Commands.OptionsCommand"/>
</MenuItem>
</Path>
</AddIn>

67
samples/SdaUser/SdaUser.csproj

@ -0,0 +1,67 @@ @@ -0,0 +1,67 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<RootNamespace>SdaUser</RootNamespace>
<AssemblyName>SdaUser</AssemblyName>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3FF48818-69D2-4884-8F4F-62EC72F0D5F0}</ProjectGuid>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress>
<PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>4096</FileAlignment>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
<IntermediateOutputPath>obj\Debug\</IntermediateOutputPath>
<OutputPath>..\..\bin\</OutputPath>
<Optimize>False</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugSymbols>true</DebugSymbols>
<DebugType>Full</DebugType>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
<IntermediateOutputPath>obj\Release\</IntermediateOutputPath>
<OutputPath>bin\Release\</OutputPath>
<Optimize>True</Optimize>
<DefineConstants>TRACE</DefineConstants>
<DebugSymbols>False</DebugSymbols>
<DebugType>None</DebugType>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="ICSharpCode.SharpDevelop.Sda">
<HintPath>..\..\bin\ICSharpCode.SharpDevelop.Sda.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="MainForm.cs" />
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="AssemblyInfo.cs" />
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Folder Include="SdaAddIns" />
<Content Include="SdaAddIns\SdaBase.addin">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
</Project>

16
samples/SdaUser/SdaUser.sln

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# SharpDevelop 2.1.0.1602
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SdaUser", "SdaUser.csproj", "{3FF48818-69D2-4884-8F4F-62EC72F0D5F0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3FF48818-69D2-4884-8F4F-62EC72F0D5F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3FF48818-69D2-4884-8F4F-62EC72F0D5F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3FF48818-69D2-4884-8F4F-62EC72F0D5F0}.Release|Any CPU.Build.0 = Release|Any CPU
{3FF48818-69D2-4884-8F4F-62EC72F0D5F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
EndGlobal

2
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerLoader/FormsDesignerLoadException.cs

@ -11,7 +11,7 @@ using System.Runtime.Serialization; @@ -11,7 +11,7 @@ using System.Runtime.Serialization;
namespace ICSharpCode.FormsDesigner
{
[Serializable()]
public class FormsDesignerLoadException : ApplicationException
public class FormsDesignerLoadException : Exception
{
public FormsDesignerLoadException() : base()
{

14
src/AddIns/Misc/CodeCoverage/Project/Src/CodeCoverageException.cs

@ -6,14 +6,16 @@ @@ -6,14 +6,16 @@
// </file>
using System;
using System.Runtime.Serialization;
namespace ICSharpCode.CodeCoverage
{
/// <summary>
/// The exception that is thrown when a non-fatal
/// The exception that is thrown when a non-fatal
/// error occurs in the code coverage add-in.
/// </summary>
public class CodeCoverageException : ApplicationException
[Serializable()]
public class CodeCoverageException : Exception
{
public CodeCoverageException()
{
@ -23,5 +25,13 @@ namespace ICSharpCode.CodeCoverage @@ -23,5 +25,13 @@ namespace ICSharpCode.CodeCoverage
: base(message)
{
}
public CodeCoverageException(string message, Exception innerException) : base(message, innerException)
{
}
protected CodeCoverageException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}

12
src/AddIns/Misc/NAntAddIn/Project/Src/NAntAddInException.cs

@ -6,13 +6,15 @@ @@ -6,13 +6,15 @@
// </file>
using System;
using System.Runtime.Serialization;
namespace ICSharpCode.NAntAddIn
{
/// <summary>
/// The exception that is thrown when a non-fatal
/// The exception that is thrown when a non-fatal
/// error occurs in the NAnt add-in.
/// </summary>
[Serializable()]
public class NAntAddInException : ApplicationException
{
public NAntAddInException()
@ -23,5 +25,13 @@ namespace ICSharpCode.NAntAddIn @@ -23,5 +25,13 @@ namespace ICSharpCode.NAntAddIn
: base(message)
{
}
public NAntAddInException(string message, Exception innerException) : base(message, innerException)
{
}
protected NAntAddInException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}

11
src/AddIns/Misc/SharpQuery/Src/Exceptions/ConnectionStringException.cs

@ -8,9 +8,11 @@ @@ -8,9 +8,11 @@
using System;
using ICSharpCode.Core;
using SharpQuery.SchemaClass;
using System.Runtime.Serialization;
namespace SharpQuery.Exceptions
{
[Serializable()]
public class ConnectionStringException : Exception
{
public ConnectionStringException()
@ -38,6 +40,13 @@ namespace SharpQuery.Exceptions @@ -38,6 +40,13 @@ namespace SharpQuery.Exceptions
+ message)
{
}
public ConnectionStringException(string message, Exception innerException) : base(message, innerException)
{
}
protected ConnectionStringException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}

10
src/AddIns/Misc/SharpQuery/Src/Exceptions/ExecuteProcedureException.cs

@ -8,9 +8,11 @@ @@ -8,9 +8,11 @@
using System;
using ICSharpCode.Core;
using SharpQuery.SchemaClass;
using System.Runtime.Serialization;
namespace SharpQuery.Exceptions
{
[Serializable()]
public class ExecuteProcedureException : Exception
{
public ExecuteProcedureException()
@ -38,6 +40,14 @@ namespace SharpQuery.Exceptions @@ -38,6 +40,14 @@ namespace SharpQuery.Exceptions
+ message)
{
}
public ExecuteProcedureException(string message, Exception innerException) : base(message, innerException)
{
}
protected ExecuteProcedureException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}

9
src/AddIns/Misc/SharpQuery/Src/Exceptions/ExecuteSQLException.cs

@ -8,9 +8,11 @@ @@ -8,9 +8,11 @@
using System;
using ICSharpCode.Core;
using SharpQuery.SchemaClass;
using System.Runtime.Serialization;
namespace SharpQuery.Exceptions
{
[Serializable()]
public class ExecuteSQLException : Exception
{
public ExecuteSQLException()
@ -39,6 +41,13 @@ namespace SharpQuery.Exceptions @@ -39,6 +41,13 @@ namespace SharpQuery.Exceptions
{
}
public ExecuteSQLException(string message, Exception innerException) : base(message, innerException)
{
}
protected ExecuteSQLException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}

10
src/AddIns/Misc/SharpQuery/Src/Exceptions/OpenConnectionException.cs

@ -8,9 +8,11 @@ @@ -8,9 +8,11 @@
using System;
using ICSharpCode.Core;
using SharpQuery.SchemaClass;
using System.Runtime.Serialization;
namespace SharpQuery.Exceptions
{
[Serializable()]
public class OpenConnectionException : Exception
{
public OpenConnectionException()
@ -39,7 +41,13 @@ namespace SharpQuery.Exceptions @@ -39,7 +41,13 @@ namespace SharpQuery.Exceptions
{
}
public OpenConnectionException(string message, Exception innerException) : base(message, innerException)
{
}
protected OpenConnectionException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}

16
src/AddIns/Misc/SharpQuery/Src/Exceptions/SharpQueryAbstractException.cs

@ -6,11 +6,27 @@ @@ -6,11 +6,27 @@
// </file>
using System;
using System.Runtime.Serialization;
namespace SharpQuery.Exceptions
{
[Serializable()]
public abstract class SharpQueryAbstractException : Exception
{
public SharpQueryAbstractException() : base()
{
}
public SharpQueryAbstractException(string message) : base(message)
{
}
public SharpQueryAbstractException(string message, Exception innerException) : base(message, innerException)
{
}
protected SharpQueryAbstractException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}

1
src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/HistoryViewPanel.cs

@ -68,6 +68,7 @@ namespace ICSharpCode.Svn @@ -68,6 +68,7 @@ namespace ICSharpCode.Svn
Controls.Add(mainTab);
Thread logMessageThread = new Thread(new ThreadStart(GetLogMessages));
logMessageThread.Name = "svnLogMessage";
logMessageThread.IsBackground = true;
logMessageThread.Start();
}

1
src/AddIns/Misc/SubversionAddIn/Project/Src/SvnClient.cs

@ -186,6 +186,7 @@ namespace ICSharpCode.Svn @@ -186,6 +186,7 @@ namespace ICSharpCode.Svn
WriteMid(operationName);
Thread thread = new Thread(new ThreadStart(new ThreadStartWrapper(threadStart).Start));
thread.Name = "SvnOperation";
thread.IsBackground = true;
inOperationForm = new InOperationDialog(operationName, thread);
inOperationForm.Owner = (Form)WorkbenchSingleton.Workbench;

3
src/Libraries/DockPanel_Src/WinFormsUI/WinFormsUI.csproj

@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<AssemblyName>WeifenLuo.WinFormsUI.Docking</AssemblyName>
<AssemblyOriginatorKeyFile>..\..\..\Main\Core\Project\Resources\ICSharpCode.Core.snk</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile>..\..\..\Main\ICSharpCode.SharpDevelop.snk</AssemblyOriginatorKeyFile>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
<SignAssembly>true</SignAssembly>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
<PlatformTarget>AnyCPU</PlatformTarget>
<AssemblyOriginatorKeyMode>File</AssemblyOriginatorKeyMode>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>

16
src/Libraries/ICSharpCode.TextEditor/Project/Src/Document/HighlightingStrategy/HighlightingColorNotFoundException.cs

@ -6,12 +6,26 @@ @@ -6,12 +6,26 @@
// </file>
using System;
using System.Runtime.Serialization;
namespace ICSharpCode.TextEditor.Document
{
[Serializable()]
public class HighlightingColorNotFoundException : Exception
{
public HighlightingColorNotFoundException(string name) : base(name)
public HighlightingColorNotFoundException() : base()
{
}
public HighlightingColorNotFoundException(string message) : base(message)
{
}
public HighlightingColorNotFoundException(string message, Exception innerException) : base(message, innerException)
{
}
protected HighlightingColorNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}

4
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
<NoConfig>False</NoConfig>
<OutputType>Library</OutputType>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>Resources\ICSharpCode.SharpDevelop.snk</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile>..\..\ICSharpCode.SharpDevelop.snk</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyMode>File</AssemblyOriginatorKeyMode>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<RegisterForComInterop>False</RegisterForComInterop>
@ -20,6 +20,7 @@ @@ -20,6 +20,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>4096</FileAlignment>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<DelaySign>False</DelaySign>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<Optimize>False</Optimize>
@ -482,7 +483,6 @@ @@ -482,7 +483,6 @@
<EmbeddedResource Include="Resources\TaskListOptions.xfrm" />
<EmbeddedResource Include="Resources\TreeViewOptionsDialog.xfrm" />
<EmbeddedResource Include="Resources\WordCountDialog.xfrm" />
<EmbeddedResource Include="Resources\ICSharpCode.SharpDevelop.snk" />
<EmbeddedResource Include="Resources\BehaviorTextEditorPanel.xfrm" />
<EmbeddedResource Include="Resources\FindPanel.xfrm" />
<EmbeddedResource Include="Resources\GotoDialog.xfrm" />

25
src/Main/Base/Project/Src/Commands/AutostartCommands.cs

@ -1,32 +1,27 @@ @@ -1,32 +1,27 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.IO;
using System.Collections;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Reflection;
using System.Threading;
using System.Runtime.Remoting;
using System.Security.Policy;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.SharpDevelop.Dom;
namespace ICSharpCode.SharpDevelop.Commands
{
public class StartWorkbenchCommand // : AbstractCommand
public class StartWorkbenchCommand
{
const string workbenchMemento = "WorkbenchMemento";
public bool AllowTipOfTheDay = true;
public bool TipOfTheDayDefault = true;
/// <remarks>
/// The worst workaround in the whole project
/// </remarks>
@ -35,7 +30,7 @@ namespace ICSharpCode.SharpDevelop.Commands @@ -35,7 +30,7 @@ namespace ICSharpCode.SharpDevelop.Commands
Application.Idle -= ShowTipOfTheDay;
// show tip of the day
if (PropertyService.Get("ShowTipsAtStartup", true)) {
if (PropertyService.Get("ShowTipsAtStartup", TipOfTheDayDefault)) {
ViewTipOfTheDay dview = new ViewTipOfTheDay();
dview.Run();
}
@ -97,12 +92,14 @@ namespace ICSharpCode.SharpDevelop.Commands @@ -97,12 +92,14 @@ namespace ICSharpCode.SharpDevelop.Commands
}
}
public void Run(string[] fileList)
public void Run(IList<string> fileList)
{
Form f = (Form)WorkbenchSingleton.Workbench;
f.Show();
Application.Idle += ShowTipOfTheDay;
if (AllowTipOfTheDay) {
Application.Idle += ShowTipOfTheDay;
}
bool didLoadCombineOrFile = false;

3
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/AbstractBuildOptions.cs

@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Windows.Forms;
using ICSharpCode.SharpDevelop.Project;
@ -61,7 +62,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -61,7 +62,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
Get<TextBox>("xmlDocumentation").Enabled = Get<CheckBox>("xmlDocumentation").Checked;
if (Get<CheckBox>("xmlDocumentation").Checked) {
if (Get<TextBox>("xmlDocumentation").Text.Length == 0) {
Get<TextBox>("xmlDocumentation").Text = FileUtility.GetRelativePath(baseDirectory, project.OutputAssemblyFullPath) + ".xml";
Get<TextBox>("xmlDocumentation").Text = Path.ChangeExtension(FileUtility.GetRelativePath(baseDirectory, project.OutputAssemblyFullPath), ".xml");
}
} else {
Get<TextBox>("xmlDocumentation").Text = "";

28
src/Main/Base/Project/Src/Gui/Dialogs/SharpDevelopAboutPanels.cs

@ -6,17 +6,11 @@ @@ -6,17 +6,11 @@
// </file>
using System;
using System.Drawing;
using System.ComponentModel;
using System.Windows.Forms;
using System.Resources;
using System.IO;
using System.Text;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Text;
using System.Windows.Forms;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.Core;
namespace ICSharpCode.SharpDevelop.Gui
@ -84,8 +78,24 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -84,8 +78,24 @@ namespace ICSharpCode.SharpDevelop.Gui
}
}
[Serializable()]
class ClownFishException : System.Exception
{
public ClownFishException() : base()
{
}
public ClownFishException(string message) : base(message)
{
}
public ClownFishException(string message, Exception innerException) : base(message, innerException)
{
}
protected ClownFishException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
void ThrowExceptionButtonClick(object sender, EventArgs e)

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

@ -96,11 +96,6 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -96,11 +96,6 @@ namespace ICSharpCode.SharpDevelop.Gui
PropertyService.Set("Workbench.CurrentLayout", value);
WorkbenchSingleton.Workbench.WorkbenchLayout.LoadConfiguration();
OnLayoutChanged(EventArgs.Empty);
#if DEBUG
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
#endif
}
}
}
@ -148,20 +143,18 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -148,20 +143,18 @@ namespace ICSharpCode.SharpDevelop.Gui
return null;
}
static LayoutConfiguration()
internal static void LoadLayoutConfiguration()
{
LoadLayoutConfiguration();
}
static void LoadLayoutConfiguration()
{
string configPath = Path.Combine(PropertyService.ConfigDirectory, "layouts");
if (File.Exists(Path.Combine(configPath, configFile))) {
LoadLayoutConfiguration(Path.Combine(configPath, configFile));
if (Layouts.Count == 0) {
string configPath = Path.Combine(PropertyService.ConfigDirectory, "layouts");
if (File.Exists(Path.Combine(configPath, configFile))) {
LoadLayoutConfiguration(Path.Combine(configPath, configFile));
}
string dataPath = Path.Combine(PropertyService.DataDirectory, "resources" + Path.DirectorySeparatorChar + "layouts");
if (File.Exists(Path.Combine(dataPath, configFile))) {
LoadLayoutConfiguration(Path.Combine(dataPath, configFile));
}
}
string dataPath = Path.Combine(PropertyService.DataDirectory, "resources" + Path.DirectorySeparatorChar + "layouts");
LoadLayoutConfiguration(Path.Combine(dataPath, configFile));
}
static void LoadLayoutConfiguration(string layoutConfig)

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

@ -73,6 +73,8 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -73,6 +73,8 @@ namespace ICSharpCode.SharpDevelop.Gui
public static void InitializeWorkbench()
{
LayoutConfiguration.LoadLayoutConfiguration();
workbench = new DefaultWorkbench();
MessageService.MainForm = workbench;

1
src/Main/Base/Project/Src/Project/MSBuildEngine.cs

@ -207,6 +207,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -207,6 +207,7 @@ namespace ICSharpCode.SharpDevelop.Project
} else {
isRunning = true;
Thread thread = new Thread(new ThreadStarter(buildFile, targets, this, callback).Run);
thread.Name = "MSBuildEngine";
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
}

1
src/Main/Base/Project/Src/Services/IconService.cs

@ -32,6 +32,7 @@ namespace ICSharpCode.Core @@ -32,6 +32,7 @@ namespace ICSharpCode.Core
static IconService()
{
Thread myThread = new Thread(new ThreadStart(LoadThread));
myThread.Name = "IconLoader";
myThread.IsBackground = true;
myThread.Priority = ThreadPriority.Normal;
myThread.Start();

13
src/Main/Base/Project/Src/Services/ParserService/ParserService.cs

@ -107,6 +107,7 @@ namespace ICSharpCode.Core @@ -107,6 +107,7 @@ namespace ICSharpCode.Core
}
}
loadSolutionProjectsThread = new Thread(new ThreadStart(LoadSolutionProjects));
loadSolutionProjectsThread.Name = "loadSolutionProjects";
loadSolutionProjectsThread.Priority = ThreadPriority.BelowNormal;
loadSolutionProjectsThread.IsBackground = true;
loadSolutionProjectsThread.Start();
@ -244,6 +245,7 @@ namespace ICSharpCode.Core @@ -244,6 +245,7 @@ namespace ICSharpCode.Core
{
abortParserUpdateThread = false;
Thread parserThread = new Thread(new ThreadStart(ParserUpdateThread));
parserThread.Name = "parser";
parserThread.Priority = ThreadPriority.BelowNormal;
parserThread.IsBackground = true;
parserThread.Start();
@ -301,13 +303,12 @@ namespace ICSharpCode.Core @@ -301,13 +303,12 @@ namespace ICSharpCode.Core
object[] workbench;
try {
workbench = (object[])WorkbenchSingleton.SafeThreadCall(typeof(ParserService), "GetWorkbench");
} catch (ObjectDisposedException) {
} catch (InvalidOperationException) { // includes ObjectDisposedException
// maybe workbench has been disposed while waiting for the SafeThreadCall
LoggingService.Warn("ObjectDisposedException while trying to invoke GetWorkbench()");
if (abortParserUpdateThread)
return; // abort this thread
else
throw; // some other error -> re-raise
// can occur after workbench unload or after aborting SharpDevelop with
// Application.Exit()
LoggingService.Warn("InvalidOperationException while trying to invoke GetWorkbench()");
return; // abort this thread
}
if (workbench != null) {
IEditable editable = workbench[0] as IEditable;

14
src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs

@ -57,12 +57,12 @@ namespace ICSharpCode.SharpDevelop.Project @@ -57,12 +57,12 @@ namespace ICSharpCode.SharpDevelop.Project
public static void InitializeService()
{
if (initialized)
throw new InvalidOperationException("ProjectService already is initialized");
initialized = true;
WorkbenchSingleton.Workbench.ActiveWorkbenchWindowChanged += ActiveWindowChanged;
FileService.FileRenamed += FileServiceFileRenamed;
FileService.FileRemoved += FileServiceFileRemoved;
if (!initialized) {
initialized = true;
WorkbenchSingleton.Workbench.ActiveWorkbenchWindowChanged += ActiveWindowChanged;
FileService.FileRenamed += FileServiceFileRenamed;
FileService.FileRemoved += FileServiceFileRemoved;
}
}
/// <summary>
@ -93,7 +93,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -93,7 +93,7 @@ namespace ICSharpCode.SharpDevelop.Project
}
return null;
}
public static void LoadSolutionOrProject(string fileName)
{
IProjectLoader loader = GetProjectLoader(fileName);

1
src/Main/Base/Project/Src/TextEditor/Gui/Dialogs/ExportProjectToHtmlDialog.cs

@ -485,6 +485,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -485,6 +485,7 @@ namespace ICSharpCode.SharpDevelop.Gui
StartExporting();
exportFilesThread = new Thread(new ThreadStart(ExportFilesThread));
exportFilesThread.Name = "exportFiles";
exportFilesThread.IsBackground = true;
exportFilesThread.Start();
}

1
src/Main/Base/Project/Src/Util/OutputReader.cs

@ -36,6 +36,7 @@ namespace ICSharpCode.SharpDevelop.Util @@ -36,6 +36,7 @@ namespace ICSharpCode.SharpDevelop.Util
public void Start()
{
thread = new Thread(new ThreadStart(ReadOutput));
thread.Name = "OutputReader";
thread.Start();
}

19
src/Main/Base/Project/Src/Util/ProcessRunnerException.cs

@ -1,11 +1,12 @@ @@ -1,11 +1,12 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Runtime.Serialization;
namespace ICSharpCode.SharpDevelop.Util
{
@ -13,10 +14,22 @@ namespace ICSharpCode.SharpDevelop.Util @@ -13,10 +14,22 @@ namespace ICSharpCode.SharpDevelop.Util
/// An exception thrown by a <see cref="ProcessRunner"/>
/// instance.
/// </summary>
[Serializable()]
public class ProcessRunnerException : ApplicationException
{
public ProcessRunnerException(string message)
: base(message)
public ProcessRunnerException() : base()
{
}
public ProcessRunnerException(string message) : base(message)
{
}
public ProcessRunnerException(string message, Exception innerException) : base(message, innerException)
{
}
protected ProcessRunnerException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}

5
src/Main/Core/Project/ICSharpCode.Core.csproj

@ -12,10 +12,12 @@ @@ -12,10 +12,12 @@
<NoConfig>False</NoConfig>
<OutputType>Library</OutputType>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>Resources\ICSharpCode.Core.snk</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile>..\..\ICSharpCode.SharpDevelop.snk</AssemblyOriginatorKeyFile>
<BaseAddress>83886080</BaseAddress>
<PreBuildEvent>..\src\Tools\UpdateAssemblyInfo\bin\Debug\UpdateAssemblyInfo.exe</PreBuildEvent>
<RunPostBuildEvent>Always</RunPostBuildEvent>
<DelaySign>False</DelaySign>
<AssemblyOriginatorKeyMode>File</AssemblyOriginatorKeyMode>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -48,7 +50,6 @@ @@ -48,7 +50,6 @@
</ItemGroup>
<ItemGroup>
<None Include="Resources\ICSharpCode.Core.doc" />
<None Include="Resources\ICSharpCode.Core.snk" />
<Compile Include="Configuration\AssemblyInfo.cs" />
<Compile Include="Src\AddInTree\AddIn\AddIn.cs" />
<Compile Include="Src\AddInTree\AddIn\AddInLoadException.cs" />

BIN
src/Main/Core/Project/Resources/ICSharpCode.Core.snk

Binary file not shown.

18
src/Main/Core/Project/Src/AddInTree/AddIn/AddInLoadException.cs

@ -1,21 +1,35 @@ @@ -1,21 +1,35 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Runtime.Serialization;
namespace ICSharpCode.Core
{
/// <summary>
/// Description of AddInLoadException.
/// Exception used when loading an AddIn fails.
/// </summary>
[Serializable]
public class AddInLoadException : CoreException
{
public AddInLoadException() : base()
{
}
public AddInLoadException(string message) : base(message)
{
}
public AddInLoadException(string message, Exception innerException) : base(message, innerException)
{
}
protected AddInLoadException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}

15
src/Main/Core/Project/Src/AddInTree/CoreStartup.cs

@ -76,11 +76,26 @@ namespace ICSharpCode.Core @@ -76,11 +76,26 @@ namespace ICSharpCode.Core
MessageService.ProductName = applicationName;
}
/// <summary>
/// Find AddIns by searching all .addin files recursively in <paramref name="addInDir"/>.
/// </summary>
public void AddAddInsFromDirectory(string addInDir)
{
if (addInDir == null)
throw new ArgumentNullException("addInDir");
addInFiles.AddRange(FileUtility.SearchDirectory(addInDir, "*.addin"));
}
/// <summary>
/// Add the specified .addin file.
/// </summary>
public void AddAddInFile(string addInFile)
{
if (addInFile == null)
throw new ArgumentNullException("addInFile");
addInFiles.Add(addInFile);
}
public void ConfigureExternalAddIns(string addInConfigurationFile)
{
AddInManager.ConfigurationFileName = addInConfigurationFile;

17
src/Main/Core/Project/Src/AddInTree/TreePathNotFoundException.cs

@ -1,17 +1,19 @@ @@ -1,17 +1,19 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Runtime.Serialization;
namespace ICSharpCode.Core
{
/// <summary>
/// Is thrown when the AddInTree could not find the requested path.
/// </summary>
[Serializable()]
public class TreePathNotFoundException : CoreException
{
/// <summary>
@ -20,5 +22,18 @@ namespace ICSharpCode.Core @@ -20,5 +22,18 @@ namespace ICSharpCode.Core
public TreePathNotFoundException(string path) : base("Treepath not found: " + path)
{
}
// Required for Serialization
public TreePathNotFoundException() : base()
{
}
public TreePathNotFoundException(string message, Exception innerException) : base(message, innerException)
{
}
protected TreePathNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}

7
src/Main/Core/Project/Src/CoreException.cs

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
@ -10,8 +10,11 @@ using System.Runtime.Serialization; @@ -10,8 +10,11 @@ using System.Runtime.Serialization;
namespace ICSharpCode.Core
{
/// <summary>
/// Base class for exceptions thrown by the SharpDevelop core.
/// </summary>
[Serializable()]
public class CoreException : ApplicationException
public class CoreException : Exception
{
public CoreException() : base()
{

4
src/Main/Core/Project/Src/Services/FileUtility/FileUtility.cs

@ -45,7 +45,7 @@ namespace ICSharpCode.Core @@ -45,7 +45,7 @@ namespace ICSharpCode.Core
// Call it only when necessary. (see IsEqualFile)
readonly static char[] separators = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar, Path.VolumeSeparatorChar };
static string applicationRootPath = Environment.CurrentDirectory;
static string applicationRootPath = AppDomain.CurrentDomain.BaseDirectory;
const string fileNameRegEx = @"^([a-zA-Z]:)?[^:]+$";
public static string ApplicationRootPath {
@ -165,7 +165,7 @@ namespace ICSharpCode.Core @@ -165,7 +165,7 @@ namespace ICSharpCode.Core
// Optimized for performance:
//return Path.GetFullPath(fileName1.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)).ToLower() == Path.GetFullPath(fileName2.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)).ToLower();
if (fileName1.Length == 0 || fileName2.Length == 0) return false;
if (string.IsNullOrEmpty(fileName1) || string.IsNullOrEmpty(fileName2)) return false;
char lastChar;
lastChar = fileName1[fileName1.Length - 1];

2
src/Main/Core/Project/Src/Services/LoggingService/LoggingService.cs

@ -15,7 +15,7 @@ namespace ICSharpCode.Core @@ -15,7 +15,7 @@ namespace ICSharpCode.Core
{
public static class LoggingService
{
static readonly ILog log = LogManager.GetLogger(typeof(LoggingService));
static ILog log = LogManager.GetLogger(typeof(LoggingService));
static LoggingService()
{

5
src/Main/Core/Project/Src/Services/MenuService/MenuService.cs

@ -90,7 +90,10 @@ namespace ICSharpCode.Core @@ -90,7 +90,10 @@ namespace ICSharpCode.Core
public static void ShowContextMenu(object owner, string addInTreePath, Control parent, int x, int y)
{
CreateContextMenu(owner, addInTreePath).Show(parent, new Point(x, y));
ContextMenuStrip menu = CreateContextMenu(owner, addInTreePath);
if (menu != null) {
menu.Show(parent, new Point(x, y));
}
}
class QuickInsertMenuHandler

3
src/Main/Core/Project/Src/Services/MessageService/MessageService.cs

@ -49,8 +49,7 @@ namespace ICSharpCode.Core @@ -49,8 +49,7 @@ namespace ICSharpCode.Core
/// <summary>
/// Gets/Sets the custom error reporter. If this property is null, the default
/// messagebox is used (except for debug builds of ICSharpCode.Core, where the
/// message is only logged to the LoggingService).
/// messagebox is used.
/// </summary>
public static ShowErrorDelegate CustomErrorReporter {
get {

14
src/Main/Core/Project/Src/Services/ResourceService/ResourceNotFoundException.cs

@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
// </file>
using System;
using System.Runtime.Serialization;
namespace ICSharpCode.Core
{
@ -13,10 +14,23 @@ namespace ICSharpCode.Core @@ -13,10 +14,23 @@ namespace ICSharpCode.Core
/// Is thrown when the GlobalResource manager can't find a requested
/// resource.
/// </summary>
[Serializable()]
public class ResourceNotFoundException : CoreException
{
public ResourceNotFoundException(string resource) : base("Resource not found : " + resource)
{
}
public ResourceNotFoundException() : base()
{
}
public ResourceNotFoundException(string message, Exception innerException) : base(message, innerException)
{
}
protected ResourceNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}

22
src/Main/ICSharpCode.SharpDevelop.Sda/Configuration/AssemblyInfo.cs

@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security.Permissions;
using System.Diagnostics.CodeAnalysis;
[assembly: CLSCompliant(true)]
[assembly: StringFreezing()]
[assembly: AssemblyTitle("ICSharpCode.SharpDevelop.Sda")]
[assembly: AssemblyDescription("SharpDevelop for Applications")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, Unrestricted=true)]

85
src/Main/ICSharpCode.SharpDevelop.Sda/ICSharpCode.SharpDevelop.Sda.csproj

@ -0,0 +1,85 @@ @@ -0,0 +1,85 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OutputType>Library</OutputType>
<RootNamespace>ICSharpCode.SharpDevelop.Sda</RootNamespace>
<AssemblyName>ICSharpCode.SharpDevelop.Sda</AssemblyName>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{80318B5F-A25D-45AB-8A95-EF31D2370A4C}</ProjectGuid>
<OutputPath>..\..\..\bin\</OutputPath>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress>
<PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>4096</FileAlignment>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<DocumentationFile>..\..\..\bin\ICSharpCode.SharpDevelop.Sda.xml</DocumentationFile>
<RunCodeAnalysis>True</RunCodeAnalysis>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\ICSharpCode.SharpDevelop.snk</AssemblyOriginatorKeyFile>
<DelaySign>False</DelaySign>
<AssemblyOriginatorKeyMode>File</AssemblyOriginatorKeyMode>
<CodeAnalysisRules>-Microsoft.Naming#CA1704;-Microsoft.Performance#CA1822</CodeAnalysisRules>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
<IntermediateOutputPath>obj\Debug\</IntermediateOutputPath>
<Optimize>False</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugSymbols>true</DebugSymbols>
<DebugType>Full</DebugType>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
<IntermediateOutputPath>obj\Release\</IntermediateOutputPath>
<Optimize>True</Optimize>
<DefineConstants>TRACE</DefineConstants>
<DebugSymbols>False</DebugSymbols>
<DebugType>None</DebugType>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\GlobalAssemblyInfo.cs">
<Link>Configuration\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Configuration\AssemblyInfo.cs" />
<Compile Include="Src\CallHelper.cs" />
<Compile Include="Src\SharpDevelopHost.cs" />
<Compile Include="Src\ExceptionBox.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Src\StartupSettings.cs" />
<Compile Include="Src\EventArgs.cs" />
<Compile Include="Src\WorkbenchSettings.cs" />
<Compile Include="Src\Document.cs" />
<Compile Include="Src\RunWorkbenchException.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Base\Project\ICSharpCode.SharpDevelop.csproj">
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project>
<Name>ICSharpCode.SharpDevelop</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\Core\Project\ICSharpCode.Core.csproj">
<Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project>
<Name>ICSharpCode.Core</Name>
<Private>False</Private>
</ProjectReference>
<Folder Include="Configuration" />
<Content Include="ICSharpCode.SharpDevelop.Sda.dll.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Folder Include="Src" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
</Project>

72
src/Main/ICSharpCode.SharpDevelop.Sda/ICSharpCode.SharpDevelop.Sda.dll.config

@ -0,0 +1,72 @@ @@ -0,0 +1,72 @@
<configuration>
<configSections>
<section name="log4net" type="System.Configuration.IgnoreSectionHandler" />
</configSections>
<runtime>
<!--
WARNING!
This file is automatically generated and will be overwritten every time SharpDevelop is compiled.
Change the template file "app.template.config" instead!
-->
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="ICSharpCode.Core" publicKeyToken="f829da5c02be14ee" culture="neutral"/>
<bindingRedirect oldVersion="2.1.0.1-2.1.0.1609" newVersion="2.1.0.1609"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="ICSharpCode.SharpDevelop" publicKeyToken="f829da5c02be14ee" culture="neutral"/>
<bindingRedirect oldVersion="2.1.0.1-2.1.0.1609" newVersion="2.1.0.1609"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="ICSharpCode.TextEditor" publicKeyToken="4d61825e8dd49f1a" culture="neutral"/>
<bindingRedirect oldVersion="2.1.0.1-2.1.0.1609" newVersion="2.1.0.1609"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="ICSharpCode.NRefactory" publicKeyToken="efe927acf176eea2" culture="neutral"/>
<bindingRedirect oldVersion="2.1.0.1-2.1.0.1609" newVersion="2.1.0.1609"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<log4net>
<appender name="ColoredConsoleAppender" type="log4net.Appender.ColoredConsoleAppender">
<mapping>
<level value="FATAL" />
<foreColor value="Red, HighIntensity" />
</mapping>
<mapping>
<level value="ERROR" />
<foreColor value="Red" />
</mapping>
<mapping>
<level value="WARN" />
<foreColor value="Yellow" />
</mapping>
<mapping>
<level value="INFO" />
<foreColor value="White" />
</mapping>
<mapping>
<level value="DEBUG" />
<foreColor value="Green" />
</mapping>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level- %message%newline" />
</layout>
</appender>
<appender name="FileAppender" type="log4net.Appender.FileAppender">
<file value="SharpDevelopLog.txt" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level- %message%newline" />
</layout>
</appender>
<root>
<level value="DEBUG" />
<appender-ref ref="ColoredConsoleAppender" />
</root>
</log4net>
</configuration>

6
src/Main/ICSharpCode.SharpDevelop.Sda/ICSharpCode.SharpDevelop.Sda.sln

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# SharpDevelop 2.1.0.1602
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.Sda", "ICSharpCode.SharpDevelop.Sda.csproj", "{80318B5F-A25D-45AB-8A95-EF31D2370A4C}"
EndProject
Global
EndGlobal

260
src/Main/ICSharpCode.SharpDevelop.Sda/Src/CallHelper.cs

@ -0,0 +1,260 @@ @@ -0,0 +1,260 @@
/*
* Created by SharpDevelop.
* User: Daniel Grunwald
* Date: 27.07.2006
* Time: 20:28
*/
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Reflection;
using System.Resources;
using System.Threading;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Commands;
using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.SharpDevelop.Sda
{
internal sealed class CallHelper : MarshalByRefObject
{
private static readonly object[] emptyObjectArray = new object[0];
SharpDevelopHost.CallbackHelper callback;
bool useSharpDevelopErrorHandler;
#region Initialize Core
public void InitSharpDevelopCore(SharpDevelopHost.CallbackHelper callback, StartupSettings properties)
{
LoggingService.Info("InitSharpDevelop...");
this.callback = callback;
CoreStartup startup = new CoreStartup(properties.ApplicationName);
if (properties.UseSharpDevelopErrorHandler) {
this.useSharpDevelopErrorHandler = true;
ExceptionBox.RegisterExceptionBoxForUnhandledExceptions();
}
startup.ConfigDirectory = properties.ConfigDirectory;
startup.DataDirectory = properties.DataDirectory;
if (properties.PropertiesName != null) {
startup.PropertiesName = properties.PropertiesName;
}
// disable RTL: translations for the RTL languages are inactive
RightToLeftConverter.RightToLeftLanguages = new string[0];
if (properties.ApplicationRootPath != null) {
FileUtility.ApplicationRootPath = properties.ApplicationRootPath;
}
startup.StartCoreServices();
Assembly exe = Assembly.Load("SharpDevelop");
ResourceService.RegisterNeutralStrings(new ResourceManager("Resources.StringResources", exe));
ResourceService.RegisterNeutralImages(new ResourceManager("Resources.BitmapResources", exe));
MenuCommand.LinkCommandCreator = delegate(string link) { return new LinkCommand(link); };
StringParser.RegisterStringTagProvider(new SharpDevelopStringTagProvider());
LoggingService.Info("Looking for AddIns...");
foreach (string file in properties.addInFiles) {
startup.AddAddInFile(file);
}
foreach (string dir in properties.addInDirectories) {
startup.AddAddInsFromDirectory(dir);
}
if (properties.AllowAddInConfigurationAndExternalAddIns) {
startup.ConfigureExternalAddIns(Path.Combine(PropertyService.ConfigDirectory, "AddIns.xml"));
}
if (properties.AllowUserAddIns) {
startup.ConfigureUserAddIns(Path.Combine(PropertyService.ConfigDirectory, "AddInInstallTemp"),
Path.Combine(PropertyService.ConfigDirectory, "AddIns"));
}
LoggingService.Info("Loading AddInTree...");
startup.RunInitialization();
// Register events to marshal back
Project.ProjectService.StartBuild += delegate { this.callback.StartBuild(); };
Project.ProjectService.EndBuild += delegate { this.callback.EndBuild(); };
Project.ProjectService.SolutionLoaded += delegate { this.callback.SolutionLoaded(); };
Project.ProjectService.SolutionClosed += delegate { this.callback.SolutionClosed(); };
Project.ProjectService.SolutionConfigurationChanged += delegate { this.callback.SolutionConfigurationChanged(); };
FileUtility.FileLoaded += delegate(object sender, FileNameEventArgs e) { this.callback.FileLoaded(e.FileName); };
FileUtility.FileSaved += delegate(object sender, FileNameEventArgs e) { this.callback.FileSaved(e.FileName); };
LoggingService.Info("InitSharpDevelop finished");
}
#endregion
#region Initialize and run Workbench
public void RunWorkbench(WorkbenchSettings settings)
{
if (settings.RunOnNewThread) {
Thread t = new Thread(RunWorkbenchInternal);
t.SetApartmentState(ApartmentState.STA);
t.Name = "SDmain";
t.Start(settings);
} else {
RunWorkbenchInternal(settings);
}
}
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
void RunWorkbenchInternal(object settings)
{
WorkbenchSettings wbSettings = (WorkbenchSettings)settings;
LoggingService.Info("Initializing workbench...");
WorkbenchSingleton.InitializeWorkbench();
// initialize workbench-dependent services:
Project.ProjectService.InitializeService();
LoggingService.Info("Starting workbench...");
Exception exception = null;
// finally start the workbench.
try {
StartWorkbenchCommand wbc = new StartWorkbenchCommand();
wbc.AllowTipOfTheDay = wbSettings.UseTipOfTheDay;
callback.BeforeRunWorkbench();
wbc.Run(wbSettings.InitialFileList);
} catch (Exception ex) {
exception = ex;
} finally {
LoggingService.Info("Unloading services...");
try {
Project.ProjectService.CloseSolution();
FileService.Unload();
PropertyService.Save();
} catch (Exception ex) {
LoggingService.Warn("Exception during unloading", ex);
if (exception != null) {
exception = ex;
}
}
}
LoggingService.Info("Finished running workbench.");
callback.WorkbenchClosed();
if (exception != null) {
const string errorText = "Unhandled exception terminated the workbench";
LoggingService.Fatal(exception);
if (useSharpDevelopErrorHandler) {
System.Windows.Forms.Application.Run(new ExceptionBox(exception, errorText, true));
} else {
throw new RunWorkbenchException(errorText, exception);
}
}
}
#endregion
delegate T Func<T>();
delegate T Func<S, T>(S arg);
public List<Document> OpenDocuments {
get {
List<Document> l = new List<Document>();
if (WorkbenchSingleton.InvokeRequired) {
WorkbenchSingleton.SafeThreadCall(new Action<List<Document>>(GetOpenDocuments), l);
} else {
GetOpenDocuments(l);
}
return l;
}
}
void GetOpenDocuments(List<Document> l)
{
foreach (IViewContent vc in WorkbenchSingleton.Workbench.ViewContentCollection) {
Document d = Document.FromWindow(vc.WorkbenchWindow);
if (d != null) {
l.Add(d);
}
}
}
/// <summary>
/// Opens the document with the specified file name.
/// </summary>
public Document OpenDocument(string fileName)
{
if (WorkbenchSingleton.InvokeRequired) {
return (Document)WorkbenchSingleton.SafeThreadCall(new Func<string, Document>(OpenDocumentInternal), new object[] { fileName });
} else {
return OpenDocumentInternal(fileName);
}
}
Document OpenDocumentInternal(string fileName)
{
return Document.FromWindow(FileService.OpenFile(fileName));
}
public void OpenProject(string fileName)
{
if (WorkbenchSingleton.InvokeRequired) {
WorkbenchSingleton.SafeThreadCall(new Action<string>(OpenProjectInternal), new object[] { fileName });
} else {
OpenProjectInternal(fileName);
}
}
void OpenProjectInternal(string fileName)
{
Project.ProjectService.LoadSolutionOrProject(fileName);
}
public bool IsSolutionOrProject(string fileName)
{
return Project.ProjectService.HasProjectLoader(fileName);
}
public bool CloseWorkbench(bool force)
{
if (WorkbenchSingleton.InvokeRequired) {
return (bool)WorkbenchSingleton.SafeThreadCall(new Func<bool, bool>(CloseWorkbenchInternal), new object[] { force });
} else {
return CloseWorkbenchInternal(force);
}
}
bool CloseWorkbenchInternal(bool force)
{
if (force) {
foreach (IViewContent vc in WorkbenchSingleton.Workbench.ViewContentCollection.ToArray()) {
vc.WorkbenchWindow.CloseWindow(true);
}
}
WorkbenchSingleton.MainForm.Close();
return WorkbenchSingleton.MainForm.IsDisposed;
}
public void KillWorkbench()
{
System.Windows.Forms.Application.Exit();
}
public bool WorkbenchVisible {
get {
if (WorkbenchSingleton.InvokeRequired) {
return (bool)WorkbenchSingleton.SafeThreadCall(new Func<bool>(GetWorkbenchVisibleInternal), emptyObjectArray);
} else {
return GetWorkbenchVisibleInternal();
}
}
set {
if (WorkbenchSingleton.InvokeRequired) {
WorkbenchSingleton.SafeThreadCall(new Action<bool>(SetWorkbenchVisibleInternal), new object[] { value });
} else {
SetWorkbenchVisibleInternal(value);
}
}
}
bool GetWorkbenchVisibleInternal()
{
return WorkbenchSingleton.MainForm.Visible;
}
void SetWorkbenchVisibleInternal(bool value)
{
WorkbenchSingleton.MainForm.Visible = value;
}
}
}

78
src/Main/ICSharpCode.SharpDevelop.Sda/Src/Document.cs

@ -0,0 +1,78 @@ @@ -0,0 +1,78 @@
/*
* Created by SharpDevelop.
* User: Daniel Grunwald
* Date: 27.07.2006
* Time: 21:54
*/
using System;
using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.SharpDevelop.Sda
{
/// <summary>
/// Wraps a file opened in SharpDevelop.
/// </summary>
public sealed class Document : MarshalByRefObject
{
internal static Document FromWindow(IWorkbenchWindow window)
{
if (window != null && window.ViewContent is IEditable) {
return new Document(window, ((IEditable)window.ViewContent));
} else {
return null;
}
}
IWorkbenchWindow window;
IEditable editable;
private Document(IWorkbenchWindow window, IEditable editable)
{
this.window = window;
this.editable = editable;
}
/// <summary>
/// Gets the file name assigned to this document. Can be null.
/// </summary>
public string FileName {
get {
return window.ViewContent.FileName;
}
}
/// <summary>
/// Gets/Sets the text displayed in the document.
/// </summary>
public string Text {
// IEditable implementor is responsible for thread-safety
get {
return editable.Text;
}
set {
editable.Text = value;
}
}
/// <summary>
/// Gets if the document tab has been disposed because the document has been closed.
/// </summary>
public bool IsDisposed {
get {
return window.IsDisposed;
}
}
/// <summary>
/// Closes the document.
/// </summary>
/// <param name="force">If true, the window is closed without giving the user
/// a change to save changes if there were modifications.</param>
/// <returns>true, if the window has been closed</returns>
public bool Close(bool force)
{
return window.CloseWindow(force);
}
}
}

38
src/Main/ICSharpCode.SharpDevelop.Sda/Src/EventArgs.cs

@ -0,0 +1,38 @@ @@ -0,0 +1,38 @@
/*
* Created by SharpDevelop.
* User: Daniel Grunwald
* Date: 27.07.2006
* Time: 21:05
*/
using System;
namespace ICSharpCode.SharpDevelop.Sda
{
/// <summary>
/// EventArgs for the <see cref="SharpDevelopHost.FileLoaded">SharpDevelopHost.FileLoaded</see>
/// and <see cref="SharpDevelopHost.FileSaved">SharpDevelopHost.FileSaved</see> events.
/// </summary>
[Serializable]
public class FileEventArgs : EventArgs
{
string fileName;
/// <summary>
/// Gets the file name.
/// </summary>
public string FileName {
get {
return fileName;
}
}
/// <summary>
/// Creates a new instance of the FileEventArgs class.
/// </summary>
public FileEventArgs(string fileName)
{
this.fileName = fileName;
}
}
}

81
src/Main/StartUp/Project/Dialogs/ExceptionBox.cs → src/Main/ICSharpCode.SharpDevelop.Sda/Src/ExceptionBox.cs

@ -7,18 +7,22 @@ @@ -7,18 +7,22 @@
// project created on 2/6/2003 at 11:10 AM
using System;
using System.Windows.Forms;
using System.Diagnostics;
using System.Resources;
using System.Reflection;
using System.Diagnostics.CodeAnalysis;
using System.Drawing;
using System.Threading;
using System.Globalization;
using System.Resources;
using System.Threading;
using System.Windows.Forms;
using ICSharpCode.Core;
namespace ICSharpCode.SharpDevelop
namespace ICSharpCode.SharpDevelop.Sda
{
public class ExceptionBox : System.Windows.Forms.Form
/// <summary>
/// Form used to display display unhandled errors in SharpDevelop.
/// </summary>
public class ExceptionBox : Form
{
private System.Windows.Forms.TextBox exceptionTextBox;
private System.Windows.Forms.CheckBox copyErrorCheckBox;
@ -32,6 +36,60 @@ namespace ICSharpCode.SharpDevelop @@ -32,6 +36,60 @@ namespace ICSharpCode.SharpDevelop
Exception exceptionThrown;
string message;
internal static void RegisterExceptionBoxForUnhandledExceptions()
{
Application.ThreadException += ShowErrorBox;
AppDomain.CurrentDomain.UnhandledException += ShowErrorBox;
MessageService.CustomErrorReporter = ShowErrorBox;
}
static void ShowErrorBox(object sender, ThreadExceptionEventArgs e)
{
LoggingService.Error("ThreadException caught", e.Exception);
ShowErrorBox(e.Exception, null);
}
[SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters")]
static void ShowErrorBox(object sender, UnhandledExceptionEventArgs e)
{
Exception ex = e.ExceptionObject as Exception;
LoggingService.Fatal("UnhandledException caught", ex);
if (e.IsTerminating)
LoggingService.Fatal("Runtime is terminating because of unhandled exception.");
ShowErrorBox(ex, "Unhandled exception", e.IsTerminating);
}
static void ShowErrorBox(Exception exception, string message)
{
ShowErrorBox(exception, message, false);
}
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
static void ShowErrorBox(Exception exception, string message, bool mustTerminate)
{
try {
using (ExceptionBox box = new ExceptionBox(exception, message, mustTerminate)) {
try {
box.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm);
} catch (InvalidOperationException) {
box.ShowDialog();
}
}
} catch (Exception ex) {
LoggingService.Warn("Error showing ExceptionBox", ex);
MessageBox.Show(exception.ToString(), message, MessageBoxButtons.OK,
MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
}
}
/// <summary>
/// Creates a new ExceptionBox instance.
/// </summary>
/// <param name="e">The exception to display</param>
/// <param name="message">An additional message to display</param>
/// <param name="mustTerminate">If <paramref name="mustTerminate"/> is true, the
/// continue button is not available.</param>
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
public ExceptionBox(Exception e, string message, bool mustTerminate)
{
this.exceptionThrown = e;
@ -51,8 +109,7 @@ namespace ICSharpCode.SharpDevelop @@ -51,8 +109,7 @@ namespace ICSharpCode.SharpDevelop
exceptionTextBox.Text = getClipboardString();
try {
ResourceManager resources = new ResourceManager("Resources.BitmapResources", typeof(ExceptionBox).Assembly);
this.pictureBox.Image = (Bitmap)resources.GetObject("ErrorReport");
this.pictureBox.Image = ResourceService.GetBitmap("ErrorReport");
} catch {}
}
@ -64,6 +121,7 @@ namespace ICSharpCode.SharpDevelop @@ -64,6 +121,7 @@ namespace ICSharpCode.SharpDevelop
}
}
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
string getClipboardString()
{
string str = "";
@ -114,6 +172,7 @@ namespace ICSharpCode.SharpDevelop @@ -114,6 +172,7 @@ namespace ICSharpCode.SharpDevelop
Thread th = new Thread((ThreadStart)delegate {
ClipboardWrapper.SetText(getClipboardString());
});
th.Name = "CopyInfoToClipboard";
th.SetApartmentState(ApartmentState.STA);
th.Start();
}
@ -155,6 +214,7 @@ namespace ICSharpCode.SharpDevelop @@ -155,6 +214,7 @@ namespace ICSharpCode.SharpDevelop
*/
}
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
static void StartUrl(string url)
{
try {
@ -172,11 +232,14 @@ namespace ICSharpCode.SharpDevelop @@ -172,11 +232,14 @@ namespace ICSharpCode.SharpDevelop
void CloseButtonClick(object sender, EventArgs e)
{
if (MessageBox.Show(StringParser.Parse("${res:ICSharpCode.SharpDevelop.ExceptionBox.QuitWarning}"), "SharpDevelop", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) {
if (MessageBox.Show(StringParser.Parse("${res:ICSharpCode.SharpDevelop.ExceptionBox.QuitWarning}"), MessageService.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2, MessageBoxOptions.DefaultDesktopOnly)
== DialogResult.Yes)
{
Application.Exit();
}
}
[SuppressMessage("Microsoft.Globalization", "CA1303")]
void InitializeComponent()
{
this.closeButton = new System.Windows.Forms.Button();

47
src/Main/ICSharpCode.SharpDevelop.Sda/Src/RunWorkbenchException.cs

@ -0,0 +1,47 @@ @@ -0,0 +1,47 @@
/*
* Created by SharpDevelop.
* User: Daniel Grunwald
* Date: 27.07.2006
* Time: 22:37
*/
using System;
using System.Runtime.Serialization;
namespace ICSharpCode.SharpDevelop.Sda
{
/// <summary>
/// Exception used when there's an unhandled exception running the workbench.
/// </summary>
[Serializable()]
public class RunWorkbenchException : Exception
{
/// <summary>
/// Create a new RunWorkbenchException instance.
/// </summary>
public RunWorkbenchException() : base()
{
}
/// <summary>
/// Create a new RunWorkbenchException instance.
/// </summary>
public RunWorkbenchException(string message) : base(message)
{
}
/// <summary>
/// Create a new RunWorkbenchException instance.
/// </summary>
public RunWorkbenchException(string message, Exception innerException) : base(message, innerException)
{
}
/// <summary>
/// Create a new RunWorkbenchException instance.
/// </summary>
protected RunWorkbenchException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}

378
src/Main/ICSharpCode.SharpDevelop.Sda/Src/SharpDevelopHost.cs

@ -0,0 +1,378 @@ @@ -0,0 +1,378 @@
/*
* Created by SharpDevelop.
* User: Daniel Grunwald
* Date: 26.07.2006
* Time: 19:20
*/
using System;
using System.Collections.ObjectModel;
using System.IO;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
namespace ICSharpCode.SharpDevelop.Sda
{
/// <summary>
/// This class can host an instance of SharpDevelop inside another
/// AppDomain.
/// </summary>
public sealed class SharpDevelopHost
{
#region CreateDomain
/// <summary>
/// Create an AppDomain capable of hosting SharpDevelop.
/// </summary>
public static AppDomain CreateDomain()
{
return AppDomain.CreateDomain("SharpDevelop.Sda", null, CreateDomainSetup());
}
/// <summary>
/// Creates an AppDomainSetup specifying properties for an AppDomain capable of
/// hosting SharpDevelop.
/// </summary>
public static AppDomainSetup CreateDomainSetup()
{
AppDomainSetup s = new AppDomainSetup();
s.ApplicationBase = Path.GetDirectoryName(SdaAssembly.Location);
s.ConfigurationFile = SdaAssembly.Location + ".config";
s.ApplicationName = "SharpDevelop.Sda";
return s;
}
#endregion
#region Static helpers
internal static Assembly SdaAssembly {
get {
return typeof(SharpDevelopHost).Assembly;
}
}
#endregion
#region SDInitStatus enum
enum SDInitStatus
{
None,
CoreInitialized,
WorkbenchInitialized,
Busy,
AppDomainUnloaded
}
#endregion
AppDomain appDomain;
CallHelper helper;
SDInitStatus initStatus;
#region Constructors
/// <summary>
/// Create a new AppDomain to host SharpDevelop.
/// </summary>
public SharpDevelopHost(StartupSettings startup)
{
if (startup == null) {
throw new ArgumentNullException("startup");
}
this.appDomain = CreateDomain();
helper = (CallHelper)appDomain.CreateInstanceAndUnwrap(SdaAssembly.FullName, typeof(CallHelper).FullName);
helper.InitSharpDevelopCore(new CallbackHelper(this), startup);
initStatus = SDInitStatus.CoreInitialized;
}
/// <summary>
/// Host SharpDevelop in the existing AppDomain.
/// </summary>
public SharpDevelopHost(AppDomain appDomain, StartupSettings startup)
{
if (appDomain == null) {
throw new ArgumentNullException("appDomain");
}
if (startup == null) {
throw new ArgumentNullException("startup");
}
this.appDomain = appDomain;
helper = (CallHelper)appDomain.CreateInstanceAndUnwrap(SdaAssembly.FullName, typeof(CallHelper).FullName);
helper.InitSharpDevelopCore(new CallbackHelper(this), startup);
initStatus = SDInitStatus.CoreInitialized;
}
#endregion
#region Workbench Initialization and startup
/// <summary>
/// Initializes the workbench (create the MainForm instance, construct menu from AddInTree etc.)
/// and runs it using the supplied settings.
/// This starts a new message loop for the workbench. By default the message loop
/// is created on a new thread, but you can change the settings so that
/// it is created on the thread calling RunWorkbench.
/// In that case, RunWorkbench will block until SharpDevelop is shut down!
/// </summary>
public void RunWorkbench(WorkbenchSettings settings)
{
if (settings == null) {
throw new ArgumentNullException("settings");
}
if (initStatus == SDInitStatus.CoreInitialized) {
initStatus = SDInitStatus.Busy;
helper.RunWorkbench(settings);
if (settings.RunOnNewThread) {
initStatus = SDInitStatus.WorkbenchInitialized;
}
} else {
throw new InvalidOperationException();
}
}
#endregion
#region Application control
/// <summary>
/// Gets the list of currently opened documents.
/// </summary>
public ReadOnlyCollection<Document> OpenDocuments {
get {
if (initStatus != SDInitStatus.WorkbenchInitialized) {
return new ReadOnlyCollection<Document>(new Document[0]);
}
return new ReadOnlyCollection<Document>(helper.OpenDocuments);
}
}
/// <summary>
/// Opens the document with the specified file name.
/// Requires that the workbench is running.
/// </summary>
public Document OpenDocument(string fileName)
{
if (initStatus != SDInitStatus.WorkbenchInitialized) {
throw new InvalidOperationException();
}
return helper.OpenDocument(fileName);
}
/// <summary>
/// Opens the project or solution with the specified file name.
/// Requires that the workbench is running.
/// </summary>
public void OpenProject(string fileName)
{
if (initStatus != SDInitStatus.WorkbenchInitialized) {
throw new InvalidOperationException();
}
helper.OpenProject(fileName);
}
/// <summary>
/// Gets if the specified file is a project or solution file.
/// </summary>
public bool IsSolutionOrProject(string fileName)
{
return helper.IsSolutionOrProject(fileName);
}
/// <summary>
/// Gets/Sets whether the workbench is visible.
/// Requires that the workbench is running.
/// </summary>
public bool WorkbenchVisible {
get {
if (initStatus != SDInitStatus.WorkbenchInitialized) {
return false;
} else {
return helper.WorkbenchVisible;
}
}
set {
if (initStatus != SDInitStatus.WorkbenchInitialized) {
throw new InvalidOperationException();
}
helper.WorkbenchVisible = value;
}
}
/// <summary>
/// Closes and unloads the workbench. The user is asked to save his work
/// and can abort closing.
/// Requires that the workbench is running.
/// </summary>
/// <param name="force">When force is used (=true), unsaved changes to documents
/// are lost, but SharpDevelop still terminates correctly and saves changed
/// settings.</param>
/// <returns>True when the workbench was closed.</returns>
public bool CloseWorkbench(bool force)
{
if (initStatus == SDInitStatus.CoreInitialized) {
// Workbench not loaded/already closed: do nothing
return true;
}
if (initStatus != SDInitStatus.WorkbenchInitialized) {
throw new InvalidOperationException();
}
return helper.CloseWorkbench(force);
}
/// <summary>
/// Unload the SharpDevelop AppDomain. This will force SharpDevelop to close
/// without saving open files or changed settings.
/// Call CloseWorkbench before UnloadDomain to prompt the user to save documents and settings.
/// </summary>
public void UnloadDomain()
{
if (initStatus != SDInitStatus.AppDomainUnloaded) {
if (initStatus == SDInitStatus.WorkbenchInitialized) {
helper.KillWorkbench();
}
AppDomain.Unload(appDomain);
initStatus = SDInitStatus.AppDomainUnloaded;
}
}
#endregion
#region Callback Events
System.ComponentModel.ISynchronizeInvoke invokeTarget;
/// <summary>
/// Gets/Sets an object to use to synchronize all events with a thread.
/// Use null (default) to handle all events on the thread they were
/// raised on.
/// </summary>
public System.ComponentModel.ISynchronizeInvoke InvokeTarget {
get {
return invokeTarget;
}
set {
invokeTarget = value;
}
}
/// <summary>
/// Event before the workbench has been unloaded.
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1713:EventsShouldNotHaveBeforeOrAfterPrefix")]
public event EventHandler BeforeRunWorkbench;
/// <summary>
/// Event after the workbench has been unloaded. Occurs on the thread
/// </summary>
public event EventHandler WorkbenchClosed;
/// <summary>
/// Event when SharpDevelop starts to compile a project or solution.
/// </summary>
public event EventHandler StartBuild;
/// <summary>
/// Event when SharpDevelop finishes to compile a project or solution.
/// </summary>
public event EventHandler EndBuild;
/// <summary>
/// Event when a solution was loaded inside SharpDevelop.
/// </summary>
public event EventHandler SolutionLoaded;
/// <summary>
/// Event when the current solution was closed.
/// </summary>
public event EventHandler SolutionClosed;
/// <summary>
/// Event when the active solution configuration was changed.
/// </summary>
public event EventHandler SolutionConfigurationChanged;
/// <summary>
/// Event when a file was loaded inside SharpDevelop.
/// </summary>
public event EventHandler<FileEventArgs> FileLoaded;
/// <summary>
/// Event when a file was saved inside SharpDevelop.
/// </summary>
public event EventHandler<FileEventArgs> FileSaved;
internal sealed class CallbackHelper : MarshalByRefObject
{
private static readonly object[] emptyObjectArray = new object[0];
readonly SharpDevelopHost host;
public CallbackHelper(SharpDevelopHost host)
{
this.host = host;
}
private bool InvokeRequired {
get {
return host.invokeTarget != null && host.invokeTarget.InvokeRequired;
}
}
private void Invoke(System.Windows.Forms.MethodInvoker method)
{
host.invokeTarget.BeginInvoke(method, emptyObjectArray);
}
private void Invoke(Action<string> method, string argument)
{
host.invokeTarget.BeginInvoke(method, new object[] { argument });
}
internal void BeforeRunWorkbench()
{
if (InvokeRequired) { Invoke(BeforeRunWorkbench); return; }
host.initStatus = SDInitStatus.WorkbenchInitialized;
if (host.BeforeRunWorkbench != null) host.BeforeRunWorkbench(host, EventArgs.Empty);
}
internal void WorkbenchClosed()
{
if (InvokeRequired) { Invoke(WorkbenchClosed); return; }
host.initStatus = SDInitStatus.CoreInitialized;
if (host.WorkbenchClosed != null) host.WorkbenchClosed(host, EventArgs.Empty);
}
internal void StartBuild()
{
if (InvokeRequired) { Invoke(StartBuild); return; }
if (host.StartBuild != null) host.StartBuild(host, EventArgs.Empty);
}
internal void EndBuild()
{
if (InvokeRequired) { Invoke(EndBuild); return; }
if (host.EndBuild != null) host.EndBuild(host, EventArgs.Empty);
}
internal void SolutionLoaded()
{
if (InvokeRequired) { Invoke(SolutionLoaded); return; }
if (host.SolutionLoaded != null) host.SolutionLoaded(host, EventArgs.Empty);
}
internal void SolutionClosed()
{
if (InvokeRequired) { Invoke(SolutionClosed); return; }
if (host.SolutionClosed != null) host.SolutionClosed(host, EventArgs.Empty);
}
internal void SolutionConfigurationChanged()
{
if (InvokeRequired) { Invoke(SolutionConfigurationChanged); return; }
if (host.SolutionConfigurationChanged != null) host.SolutionConfigurationChanged(host, EventArgs.Empty);
}
internal void FileLoaded(string fileName)
{
if (InvokeRequired) { Invoke(FileLoaded, fileName); return; }
if (host.FileLoaded != null) host.FileLoaded(host, new FileEventArgs(fileName));
}
internal void FileSaved(string fileName)
{
if (InvokeRequired) { Invoke(FileSaved, fileName); return; }
if (host.FileSaved != null) host.FileSaved(host, new FileEventArgs(fileName));
}
}
#endregion
}
}

159
src/Main/ICSharpCode.SharpDevelop.Sda/Src/StartupSettings.cs

@ -0,0 +1,159 @@ @@ -0,0 +1,159 @@
/*
* Created by SharpDevelop.
* User: Daniel Grunwald
* Date: 26.07.2006
* Time: 19:45
*/
using System;
using System.Collections.Generic;
namespace ICSharpCode.SharpDevelop.Sda
{
/// <summary>
/// This class contains properties you can use to control how SharpDevelop is launched.
/// </summary>
[Serializable]
public sealed class StartupSettings
{
bool useSharpDevelopErrorHandler = true;
string applicationName = "SharpDevelop";
string applicationRootPath;
bool allowAddInConfigurationAndExternalAddIns = true;
bool allowUserAddIns;
string propertiesName;
string configDirectory;
string dataDirectory;
internal List<string> addInDirectories = new List<string>();
internal List<string> addInFiles = new List<string>();
/// <summary>
/// Gets/Sets whether the SharpDevelop exception box should be used for
/// unhandled exceptions. The default is true.
/// </summary>
public bool UseSharpDevelopErrorHandler {
get {
return useSharpDevelopErrorHandler;
}
set {
useSharpDevelopErrorHandler = value;
}
}
/// <summary>
/// Use the file <see cref="ConfigDirectory"/>\AddIns.xml to maintain
/// a list of deactivated AddIns and list of AddIns to load from
/// external locations.
/// The default value is true.
/// </summary>
public bool AllowAddInConfigurationAndExternalAddIns {
get {
return allowAddInConfigurationAndExternalAddIns;
}
set {
allowAddInConfigurationAndExternalAddIns = value;
}
}
/// <summary>
/// Allow user AddIns stored in the "application data" directory.
/// The default is false.
/// </summary>
public bool AllowUserAddIns {
get {
return allowUserAddIns;
}
set {
allowUserAddIns = value;
}
}
/// <summary>
/// Gets/Sets the application name used by the MessageService and some
/// SharpDevelop windows. The default is "SharpDevelop".
/// </summary>
public string ApplicationName {
get {
return applicationName;
}
set {
if (value == null)
throw new ArgumentNullException("value");
applicationName = value;
}
}
/// <summary>
/// Gets/Sets the application root path to use.
/// Use null (default) to use the base directory of the SharpDevelop AppDomain.
/// </summary>
public string ApplicationRootPath {
get {
return applicationRootPath;
}
set {
applicationRootPath = value;
}
}
/// <summary>
/// Gets/Sets the directory used to store SharpDevelop properties,
/// settings and user AddIns.
/// Use null (default) to use "ApplicationData\ApplicationName"
/// </summary>
public string ConfigDirectory {
get {
return configDirectory;
}
set {
configDirectory = value;
}
}
/// <summary>
/// Sets the data directory used to load resources.
/// Use null (default) to use the default path "ApplicationRootPath\data".
/// </summary>
public string DataDirectory {
get {
return dataDirectory;
}
set {
dataDirectory = value;
}
}
/// <summary>
/// Sets the name used for the properties file (without path or extension).
/// Use null (default) to use the default name.
/// </summary>
public string PropertiesName {
get {
return propertiesName;
}
set {
propertiesName = value;
}
}
/// <summary>
/// Find AddIns by searching all .addin files recursively in <paramref name="addInDir"/>.
/// </summary>
public void AddAddInsFromDirectory(string addInDir)
{
if (addInDir == null)
throw new ArgumentNullException("addInDir");
addInDirectories.Add(addInDir);
}
/// <summary>
/// Add the specified .addin file.
/// </summary>
public void AddAddInFile(string addInFile)
{
if (addInFile == null)
throw new ArgumentNullException("addInFile");
addInFiles.Add(addInFile);
}
}
}

59
src/Main/ICSharpCode.SharpDevelop.Sda/Src/WorkbenchSettings.cs

@ -0,0 +1,59 @@ @@ -0,0 +1,59 @@
/*
* Created by SharpDevelop.
* User: Daniel Grunwald
* Date: 27.07.2006
* Time: 21:17
*/
using System;
using System.Collections.ObjectModel;
namespace ICSharpCode.SharpDevelop.Sda
{
/// <summary>
/// This class contains properties to control how the SharpDevelop
/// workbench is being run.
/// </summary>
[Serializable]
public sealed class WorkbenchSettings
{
bool runOnNewThread = true;
bool useTipOfTheDay;
Collection<string> fileList = new Collection<string>();
/// <summary>
/// Gets/Sets whether to create a new thread to run the workbench on.
/// The default value is true.
/// </summary>
public bool RunOnNewThread {
get {
return runOnNewThread;
}
set {
runOnNewThread = value;
}
}
/// <summary>
/// Gets/Sets whether the tip of the day is supported.
/// The default is false.
/// </summary>
public bool UseTipOfTheDay {
get {
return useTipOfTheDay;
}
set {
useTipOfTheDay = value;
}
}
/// <summary>
/// Put files to open at workbench startup into this collection.
/// </summary>
public Collection<string> InitialFileList {
get {
return fileList;
}
}
}
}

0
src/Main/Base/Project/Resources/ICSharpCode.SharpDevelop.snk → src/Main/ICSharpCode.SharpDevelop.snk

BIN
src/Main/StartUp/Project/Resources/StartUp.snk

Binary file not shown.

155
src/Main/StartUp/Project/SharpDevelopMain.cs

@ -9,14 +9,13 @@ using System; @@ -9,14 +9,13 @@ using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Resources;
using System.Threading;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Commands;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.SharpDevelop.Sda;
namespace ICSharpCode.SharpDevelop
{
@ -33,42 +32,6 @@ namespace ICSharpCode.SharpDevelop @@ -33,42 +32,6 @@ namespace ICSharpCode.SharpDevelop
}
}
static void ShowErrorBox(object sender, ThreadExceptionEventArgs e)
{
LoggingService.Error("ThreadException caught", e.Exception);
ShowErrorBox(e.Exception, null);
}
static void ShowErrorBox(object sender, UnhandledExceptionEventArgs e)
{
Exception ex = e.ExceptionObject as Exception;
LoggingService.Fatal("UnhandledException caught", ex);
if (e.IsTerminating)
LoggingService.Fatal("Runtime is terminating because of unhandled exception.");
ShowErrorBox(ex, "Unhandled exception", e.IsTerminating);
}
static void ShowErrorBox(Exception exception, string message)
{
ShowErrorBox(exception, message, false);
}
static void ShowErrorBox(Exception exception, string message, bool mustTerminate)
{
try {
using (ExceptionBox box = new ExceptionBox(exception, message, mustTerminate)) {
try {
box.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm);
} catch (InvalidOperationException) {
box.ShowDialog();
}
}
} catch (Exception ex) {
LoggingService.Warn("Error showing ExceptionBox", ex);
MessageBox.Show(exception.ToString());
}
}
/// <summary>
/// Starts the core of SharpDevelop.
/// </summary>
@ -143,46 +106,20 @@ namespace ICSharpCode.SharpDevelop @@ -143,46 +106,20 @@ namespace ICSharpCode.SharpDevelop
{
LoggingService.Info("Starting SharpDevelop...");
try {
StartupSettings startup = new StartupSettings();
#if DEBUG
if (!Debugger.IsAttached) {
Application.ThreadException += ShowErrorBox;
AppDomain.CurrentDomain.UnhandledException += ShowErrorBox;
}
#else
Application.ThreadException += ShowErrorBox;
AppDomain.CurrentDomain.UnhandledException += ShowErrorBox;
MessageService.CustomErrorReporter = ShowErrorBox;
startup.UseSharpDevelopErrorHandler = !Debugger.IsAttached;
#endif
// disable RTL: translations for the RTL languages are inactive
RightToLeftConverter.RightToLeftLanguages = new string[0];
Assembly exe = typeof(SharpDevelopMain).Assembly;
startup.ApplicationRootPath = Path.Combine(Path.GetDirectoryName(exe.Location), "..");
startup.AllowUserAddIns = true;
startup.ConfigDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
".ICSharpCode/SharpDevelop2.1");
FileUtility.ApplicationRootPath = Path.Combine(Path.GetDirectoryName(exe.Location), "..");
CoreStartup c = new CoreStartup("SharpDevelop");
c.ConfigDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
".ICSharpCode/SharpDevelop2.1");
LoggingService.Info("Starting core services...");
c.StartCoreServices();
startup.AddAddInsFromDirectory(Path.Combine(startup.ApplicationRootPath, "AddIns"));
ResourceService.RegisterNeutralStrings(new ResourceManager("Resources.StringResources", exe));
ResourceService.RegisterNeutralImages(new ResourceManager("Resources.BitmapResources", exe));
RegisterDoozers();
StringParser.RegisterStringTagProvider(new SharpDevelopStringTagProvider());
LoggingService.Info("Looking for AddIns...");
c.AddAddInsFromDirectory(Path.Combine(FileUtility.ApplicationRootPath, "AddIns"));
c.ConfigureExternalAddIns(Path.Combine(PropertyService.ConfigDirectory, "AddIns.xml"));
c.ConfigureUserAddIns(Path.Combine(PropertyService.ConfigDirectory, "AddInInstallTemp"),
Path.Combine(PropertyService.ConfigDirectory, "AddIns"));
LoggingService.Info("Loading AddInTree...");
c.RunInitialization();
SharpDevelopHost host = new SharpDevelopHost(AppDomain.CurrentDomain, startup);
string[] fileList = SplashScreenForm.GetRequestedFileList();
if (fileList.Length > 0) {
@ -192,37 +129,16 @@ namespace ICSharpCode.SharpDevelop @@ -192,37 +129,16 @@ namespace ICSharpCode.SharpDevelop
}
}
LoggingService.Info("Initializing workbench...");
// .NET base autostarts
// taken out of the add-in tree for performance reasons (every tick in startup counts)
WorkbenchSingleton.InitializeWorkbench();
// initialize workbench-dependent services:
ProjectService.InitializeService();
if (SplashScreenForm.SplashScreen != null) {
SplashScreenForm.SplashScreen.Dispose();
}
bool exception = true;
// finally start the workbench.
try {
LoggingService.Info("Starting workbench...");
new StartWorkbenchCommand().Run(fileList);
exception = false;
} finally {
LoggingService.Info("Unloading services...");
try {
ProjectService.CloseSolution();
FileService.Unload();
PropertyService.Save();
} catch (Exception ex) {
if (exception)
LoggingService.Warn("Exception during unloading after exception", ex);
else
MessageService.ShowError(ex);
host.BeforeRunWorkbench += delegate {
if (SplashScreenForm.SplashScreen != null) {
SplashScreenForm.SplashScreen.BeginInvoke(new MethodInvoker(SplashScreenForm.SplashScreen.Dispose));
}
}
};
WorkbenchSettings workbenchSettings = new WorkbenchSettings();
workbenchSettings.RunOnNewThread = false;
workbenchSettings.UseTipOfTheDay = true;
host.RunWorkbench(workbenchSettings);
} finally {
LoggingService.Info("Leaving RunApplication()");
}
@ -242,40 +158,5 @@ namespace ICSharpCode.SharpDevelop @@ -242,40 +158,5 @@ namespace ICSharpCode.SharpDevelop
return false;
}
}
static void RegisterDoozers()
{
AddInTree.ConditionEvaluators.Add("ActiveContentExtension", new ActiveContentExtensionConditionEvaluator());
AddInTree.ConditionEvaluators.Add("ActiveViewContentUntitled", new ActiveViewContentUntitledConditionEvaluator());
AddInTree.ConditionEvaluators.Add("ActiveWindowState", new ActiveWindowStateConditionEvaluator());
AddInTree.ConditionEvaluators.Add("SolutionOpen", new SolutionOpenConditionEvaluator());
AddInTree.ConditionEvaluators.Add("DebuggerSupports", new DebuggerSupportsConditionEvaluator());
AddInTree.ConditionEvaluators.Add("IsProcessRunning", new IsProcessRunningConditionEvaluator());
AddInTree.ConditionEvaluators.Add("OpenWindowState", new OpenWindowStateConditionEvaluator());
AddInTree.ConditionEvaluators.Add("WindowActive", new WindowActiveConditionEvaluator());
AddInTree.ConditionEvaluators.Add("WindowOpen", new WindowOpenConditionEvaluator());
AddInTree.ConditionEvaluators.Add("ProjectActive", new ProjectActiveConditionEvaluator());
AddInTree.ConditionEvaluators.Add("TextContent", new ICSharpCode.SharpDevelop.DefaultEditor.Conditions.TextContentConditionEvaluator());
AddInTree.ConditionEvaluators.Add("BrowserLocation", new ICSharpCode.SharpDevelop.BrowserDisplayBinding.BrowserLocationConditionEvaluator());
AddInTree.ConditionEvaluators.Add("RefactoringProviderSupports", new Refactoring.RefactoringProviderSupportsConditionEvaluator());
// TODO: is there a way to automate ConditionEvaluator registration via reflection? or to specify it in the .addin files?
AddInTree.ConditionEvaluators.Add("CanNavigateBack", new CanNavigateBackConditionEvaluator());
AddInTree.ConditionEvaluators.Add("CanNavigateForward", new CanNavigateForwardConditionEvaluator());
AddInTree.Doozers.Add("DialogPanel", new DialogPanelDoozer());
AddInTree.Doozers.Add("DisplayBinding", new DisplayBindingDoozer());
AddInTree.Doozers.Add("Pad", new PadDoozer());
AddInTree.Doozers.Add("LanguageBinding", new LanguageBindingDoozer());
AddInTree.Doozers.Add("Parser", new ParserDoozer());
AddInTree.Doozers.Add("EditAction", new ICSharpCode.SharpDevelop.DefaultEditor.Codons.EditActionDoozer());
AddInTree.Doozers.Add("SyntaxMode", new ICSharpCode.SharpDevelop.DefaultEditor.Codons.SyntaxModeDoozer());
AddInTree.Doozers.Add("BrowserSchemeExtension", new ICSharpCode.SharpDevelop.BrowserDisplayBinding.SchemeExtensionDoozer());
AddInTree.Doozers.Add("CodeCompletionBinding", new ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.CodeCompletionBindingDoozer());
AddInTree.Doozers.Add("Debugger", new DebuggerDoozer());
AddInTree.Doozers.Add("Directory", new DirectoryDoozer());
AddInTree.Doozers.Add("TaskBoundAdditionalLogger", new TaskBoundAdditionalLoggerDoozer());
MenuCommand.LinkCommandCreator = delegate(string link) { return new LinkCommand(link); };
}
}
}

13
src/Main/StartUp/Project/StartUp.csproj

@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
<NoStdLib>False</NoStdLib>
<NoConfig>False</NoConfig>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>Resources\StartUp.snk</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile>..\..\ICSharpCode.SharpDevelop.snk</AssemblyOriginatorKeyFile>
<ApplicationIcon>.\Resources\SharpDevelop.ico</ApplicationIcon>
<RunPostBuildEvent>Always</RunPostBuildEvent>
<BaseAddress>4194304</BaseAddress>
@ -20,6 +20,8 @@ @@ -20,6 +20,8 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>4096</FileAlignment>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<DelaySign>False</DelaySign>
<AssemblyOriginatorKeyMode>File</AssemblyOriginatorKeyMode>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>Full</DebugType>
@ -42,18 +44,13 @@ @@ -42,18 +44,13 @@
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.XML" />
</ItemGroup>
<ItemGroup>
<Compile Include="Dialogs\SplashScreen.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="SharpDevelopMain.cs" />
<Compile Include="Dialogs\ExceptionBox.cs">
<SubType>Form</SubType>
</Compile>
<EmbeddedResource Include="Resources\BitmapResources.resources" />
<None Include="Resources\StartUp.snk" />
<None Include="SharpDevelop.exe.manifest">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
@ -81,6 +78,10 @@ @@ -81,6 +78,10 @@
<Link>Configuration\GlobalAssemblyInfo.template</Link>
</Content>
<Content Include="app.template.config" />
<ProjectReference Include="..\..\ICSharpCode.SharpDevelop.Sda\ICSharpCode.SharpDevelop.Sda.csproj">
<Project>{80318B5F-A25D-45AB-8A95-EF31D2370A4C}</Project>
<Name>ICSharpCode.SharpDevelop.Sda</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
</Project>

7
src/SharpDevelop.sln

@ -120,6 +120,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Main", "Main", "{5A3EBEBA-0 @@ -120,6 +120,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Main", "Main", "{5A3EBEBA-0
ProjectSection(SolutionItems) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.Sda", "Main\ICSharpCode.SharpDevelop.Sda\ICSharpCode.SharpDevelop.Sda.csproj", "{80318B5F-A25D-45AB-8A95-EF31D2370A4C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop", "Main\Base\Project\ICSharpCode.SharpDevelop.csproj", "{2748AD25-9C63-4E12-877B-4DCE96FBED54}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core", "Main\Core\Project\ICSharpCode.Core.csproj", "{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}"
@ -326,6 +328,10 @@ Global @@ -326,6 +328,10 @@ Global
{413A467D-7EA1-4C40-B10B-D6832B94DD6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{413A467D-7EA1-4C40-B10B-D6832B94DD6E}.Release|Any CPU.Build.0 = Release|Any CPU
{413A467D-7EA1-4C40-B10B-D6832B94DD6E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{80318B5F-A25D-45AB-8A95-EF31D2370A4C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80318B5F-A25D-45AB-8A95-EF31D2370A4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{80318B5F-A25D-45AB-8A95-EF31D2370A4C}.Release|Any CPU.Build.0 = Release|Any CPU
{80318B5F-A25D-45AB-8A95-EF31D2370A4C}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{CE5B42B7-6E8C-4385-9E97-F4023FC16BF2} = {14A277EE-7DF1-4529-B639-7D1EF334C1C5}
@ -379,5 +385,6 @@ Global @@ -379,5 +385,6 @@ Global
{1152B71B-3C05-4598-B20D-823B5D40559E} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486}
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486}
{2748AD25-9C63-4E12-877B-4DCE96FBED54} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486}
{80318B5F-A25D-45AB-8A95-EF31D2370A4C} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486}
EndGlobalSection
EndGlobal

Loading…
Cancel
Save