Browse Source

Fixed some bugs.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@459 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
ee32c33db4
  1. 13
      src/AddIns/Misc/MbUnitPad/Project/Src/MbUnitPad.cs
  2. 8
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/GutterMargin.cs
  3. 20
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  4. 5
      src/Main/Base/Project/Src/Dom/ExpressionContext.cs
  5. 1
      src/Main/Base/Project/Src/Dom/NRefactoryResolver/NRefactoryResolver.cs
  6. 11
      src/Main/Base/Project/Src/Services/ParserService/ProjectContentRegistry.cs

13
src/AddIns/Misc/MbUnitPad/Project/Src/MbUnitPad.cs

@ -1,4 +1,4 @@
// <file> // <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright> // <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license> // <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/> // <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
@ -31,6 +31,7 @@ namespace ICSharpCode.MbUnitPad
} }
TestTreeView treeView; TestTreeView treeView;
ToolStrip toolStrip;
Control ctl; Control ctl;
public TestTreeView TreeView { public TestTreeView TreeView {
@ -49,10 +50,11 @@ namespace ICSharpCode.MbUnitPad
treeView.Dock = DockStyle.Fill; treeView.Dock = DockStyle.Fill;
ctl.Controls.Add(treeView); ctl.Controls.Add(treeView);
ToolStrip toolStrip = ToolbarService.CreateToolStrip(this, "/SharpDevelop/Pads/MbUnitPad/Toolbar"); toolStrip = ToolbarService.CreateToolStrip(this, "/SharpDevelop/Pads/MbUnitPad/Toolbar");
toolStrip.GripStyle = ToolStripGripStyle.Hidden; toolStrip.GripStyle = ToolStripGripStyle.Hidden;
ctl.Controls.Add(toolStrip); ctl.Controls.Add(toolStrip);
ProjectService.SolutionLoaded += OnSolutionLoaded;
ProjectService.SolutionClosed += OnSolutionClosed; ProjectService.SolutionClosed += OnSolutionClosed;
} }
@ -61,12 +63,19 @@ namespace ICSharpCode.MbUnitPad
/// </summary> /// </summary>
public override void Dispose() public override void Dispose()
{ {
ProjectService.SolutionLoaded -= OnSolutionLoaded;
ProjectService.SolutionClosed -= OnSolutionClosed; ProjectService.SolutionClosed -= OnSolutionClosed;
ctl.Dispose(); ctl.Dispose();
} }
void OnSolutionLoaded(object sender, EventArgs e)
{
ToolbarService.UpdateToolbar(toolStrip);
}
void OnSolutionClosed(object sender, EventArgs e) void OnSolutionClosed(object sender, EventArgs e)
{ {
ToolbarService.UpdateToolbar(toolStrip);
treeView.NewConfig(); treeView.NewConfig();
} }

8
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/GutterMargin.cs

@ -124,7 +124,7 @@ namespace ICSharpCode.TextEditor
if (realmousepos.Y < textArea.Document.TotalNumberOfLines) { if (realmousepos.Y < textArea.Document.TotalNumberOfLines) {
if (selectionStartPos.Y == realmousepos.Y) { if (selectionStartPos.Y == realmousepos.Y) {
// this setselection defaults for a upward moving selection // this setselection defaults for a upward moving selection
textArea.SelectionManager.SetSelection(new DefaultSelection(textArea.Document, realmousepos, new Point(textArea.Document.GetLineSegment(realmousepos.Y).Length + 1, realmousepos.Y))); textArea.SelectionManager.SetSelection(new DefaultSelection(textArea.Document, realmousepos, new Point(0, realmousepos.Y + 1)));
selectionGutterDirectionDown = false; selectionGutterDirectionDown = false;
} else if (selectionStartPos.Y < realmousepos.Y && textArea.SelectionManager.HasSomethingSelected) { } else if (selectionStartPos.Y < realmousepos.Y && textArea.SelectionManager.HasSomethingSelected) {
// this fixes the selection for moving the selection down // this fixes the selection for moving the selection down
@ -132,17 +132,17 @@ namespace ICSharpCode.TextEditor
selectionGutterDirectionDown = true; selectionGutterDirectionDown = true;
textArea.SelectionManager.SetSelection(new DefaultSelection(textArea.Document, selectionStartPos, new Point(0, selectionStartPos.Y))); textArea.SelectionManager.SetSelection(new DefaultSelection(textArea.Document, selectionStartPos, new Point(0, selectionStartPos.Y)));
// this enforces the screen area update // this enforces the screen area update
textArea.SelectionManager.ExtendSelection(textArea.SelectionManager.SelectionCollection[0].EndPosition, new Point(textArea.Document.GetLineSegment(realmousepos.Y).Length + 1, realmousepos.Y)); textArea.SelectionManager.ExtendSelection(textArea.SelectionManager.SelectionCollection[0].EndPosition, new Point(0, realmousepos.Y + 1));
} else { } else {
// selection is extended to the end of the current line // selection is extended to the end of the current line
textArea.SelectionManager.ExtendSelection(textArea.SelectionManager.SelectionCollection[0].EndPosition, new Point(textArea.Document.GetLineSegment(realmousepos.Y).Length + 1, realmousepos.Y)); textArea.SelectionManager.ExtendSelection(textArea.SelectionManager.SelectionCollection[0].EndPosition, new Point(0, realmousepos.Y + 1));
} }
} else { } else {
if(textArea.SelectionManager.HasSomethingSelected) { if(textArea.SelectionManager.HasSomethingSelected) {
// this fixes the selection for moving the selection up // this fixes the selection for moving the selection up
if (selectionGutterDirectionDown) { // selectionStartPos.Y - realmousepos.Y == 1) { // only fix for first line movement if (selectionGutterDirectionDown) { // selectionStartPos.Y - realmousepos.Y == 1) { // only fix for first line movement
selectionGutterDirectionDown = false; selectionGutterDirectionDown = false;
textArea.SelectionManager.SetSelection(new DefaultSelection(textArea.Document, selectionStartPos, new Point(textArea.Document.GetLineSegment(selectionStartPos.Y).Length + 1, selectionStartPos.Y))); textArea.SelectionManager.SetSelection(new DefaultSelection(textArea.Document, selectionStartPos, new Point(0, realmousepos.Y + 1)));
// move the extendselection to here to fix textarea update issues // move the extendselection to here to fix textarea update issues
textArea.SelectionManager.ExtendSelection(selectionStartPos, realmousepos); textArea.SelectionManager.ExtendSelection(selectionStartPos, realmousepos);
} else { } else {

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

@ -176,7 +176,7 @@
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
<Compile Include="Src\Gui\Dialogs\CommonAboutDialog.cs"> <Compile Include="Src\Gui\Dialogs\CommonAboutDialog.cs">
<SubType>UserControl</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="Src\Gui\Dialogs\DirtyFilesDialog.cs" /> <Compile Include="Src\Gui\Dialogs\DirtyFilesDialog.cs" />
<Compile Include="Src\Gui\Dialogs\FolderDialog.cs" /> <Compile Include="Src\Gui\Dialogs\FolderDialog.cs" />
@ -191,7 +191,7 @@
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="Src\Gui\Dialogs\TipOfTheDay.cs"> <Compile Include="Src\Gui\Dialogs\TipOfTheDay.cs">
<SubType>Form</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
<Compile Include="Src\Gui\Dialogs\TreeViewOptions.cs"> <Compile Include="Src\Gui\Dialogs\TreeViewOptions.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
@ -682,13 +682,21 @@
<Compile Include="Src\Project\Solution\SolutionPreferences.cs" /> <Compile Include="Src\Project\Solution\SolutionPreferences.cs" />
<Compile Include="Src\Project\ConfigurationGuiHelper.cs" /> <Compile Include="Src\Project\ConfigurationGuiHelper.cs" />
<Compile Include="Src\Gui\ContentInterfaces\ICanBeDirty.cs" /> <Compile Include="Src\Gui\ContentInterfaces\ICanBeDirty.cs" />
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\AbstractProjectOptionPanel.cs" /> <Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\AbstractProjectOptionPanel.cs">
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\CreateKey.cs" /> <SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\CreateKey.cs">
<SubType>Form</SubType>
</Compile>
<EmbeddedResource Include="Resources\ProjectOptions\CreateKey.xfrm" /> <EmbeddedResource Include="Resources\ProjectOptions\CreateKey.xfrm" />
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\AbstractBuildOptions.cs" /> <Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\AbstractBuildOptions.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\Services\RefactoringService\RefactoringMenuBuilder.cs" /> <Compile Include="Src\Services\RefactoringService\RefactoringMenuBuilder.cs" />
<EmbeddedResource Include="Resources\FullscreenPanel.xfrm" /> <EmbeddedResource Include="Resources\FullscreenPanel.xfrm" />
<Compile Include="Src\Gui\Dialogs\OptionPanels\IDEOptions\FullscreenPanel.cs" /> <Compile Include="Src\Gui\Dialogs\OptionPanels\IDEOptions\FullscreenPanel.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\Dom\MemberLookupHelper.cs" /> <Compile Include="Src\Dom\MemberLookupHelper.cs" />
<Compile Include="Src\Gui\Components\AutoHide\AutoHideMenuStripContainer.cs" /> <Compile Include="Src\Gui\Components\AutoHide\AutoHideMenuStripContainer.cs" />
<Compile Include="Src\Gui\Components\AutoHide\AutoHideStatusStripContainer.cs" /> <Compile Include="Src\Gui\Components\AutoHide\AutoHideStatusStripContainer.cs" />

5
src/Main/Base/Project/Src/Dom/ExpressionContext.cs

@ -1,4 +1,4 @@
// <file> // <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright> // <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license> // <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/> // <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
@ -148,7 +148,8 @@ namespace ICSharpCode.SharpDevelop.Dom
return false; return false;
if (isObjectCreation) { if (isObjectCreation) {
if (c.IsAbstract || c.IsStatic) return false; if (c.IsAbstract || c.IsStatic) return false;
if (c.ClassType == ClassType.Enum) return false; if (c.ClassType == ClassType.Enum || c.ClassType == ClassType.Interface)
return false;
} }
if (baseClass == null) if (baseClass == null)
return true; return true;

1
src/Main/Base/Project/Src/Dom/NRefactoryResolver/NRefactoryResolver.cs

@ -864,6 +864,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver
} }
} }
result.Add("Global"); result.Add("Global");
result.Add("New");
} else { } else {
foreach (KeyValuePair<string, string> pair in TypeReference.GetPrimitiveTypesCSharp()) { foreach (KeyValuePair<string, string> pair in TypeReference.GetPrimitiveTypesCSharp()) {
result.Add(GetPrimitiveClass(pair.Value, pair.Key)); result.Add(GetPrimitiveClass(pair.Value, pair.Key));

11
src/Main/Base/Project/Src/Services/ParserService/ProjectContentRegistry.cs

@ -1,4 +1,4 @@
// <file> // <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright> // <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license> // <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/> // <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
@ -197,15 +197,12 @@ namespace ICSharpCode.Core
LoggingService.Debug("ProjectContentRegistry.AssemblyResolve " + e.Name); LoggingService.Debug("ProjectContentRegistry.AssemblyResolve " + e.Name);
string path = Path.Combine(lookupDirectory, name.Name); string path = Path.Combine(lookupDirectory, name.Name);
if (File.Exists(path + ".dll")) { if (File.Exists(path + ".dll")) {
LoggingService.Debug("AssemblyResolve ReflectionOnlyLoadFrom .dll file");
return LoadReflectionOnlyAssemblyFrom(path + ".dll"); return LoadReflectionOnlyAssemblyFrom(path + ".dll");
} }
if (File.Exists(path + ".exe")) { if (File.Exists(path + ".exe")) {
LoggingService.Debug("AssemblyResolve ReflectionOnlyLoadFrom .exe file");
return LoadReflectionOnlyAssemblyFrom(path + ".exe"); return LoadReflectionOnlyAssemblyFrom(path + ".exe");
} }
if (File.Exists(path)) { if (File.Exists(path)) {
LoggingService.Debug("AssemblyResolve ReflectionOnlyLoadFrom file");
return LoadReflectionOnlyAssemblyFrom(path); return LoadReflectionOnlyAssemblyFrom(path);
} }
try { try {
@ -225,11 +222,15 @@ namespace ICSharpCode.Core
static Assembly LoadReflectionOnlyAssemblyFrom(string fileName) static Assembly LoadReflectionOnlyAssemblyFrom(string fileName)
{ {
fileName = Path.GetFullPath(fileName);
if (loadFromCache == null) { if (loadFromCache == null) {
loadFromCache = new Dictionary<string, Assembly>(StringComparer.InvariantCultureIgnoreCase); loadFromCache = new Dictionary<string, Assembly>(StringComparer.InvariantCultureIgnoreCase);
} }
if (loadFromCache.ContainsKey(fileName)) if (loadFromCache.ContainsKey(fileName)) {
LoggingService.Debug("Use " + fileName + " from cache.");
return loadFromCache[fileName]; return loadFromCache[fileName];
}
LoggingService.Debug("Load " + fileName);
Assembly asm = InternalLoadReflectionOnlyAssemblyFrom(fileName); Assembly asm = InternalLoadReflectionOnlyAssemblyFrom(fileName);
if (loadFromCache.ContainsKey(asm.FullName)) { if (loadFromCache.ContainsKey(asm.FullName)) {
loadFromCache.Add(fileName, loadFromCache[asm.FullName]); loadFromCache.Add(fileName, loadFromCache[asm.FullName]);

Loading…
Cancel
Save