Browse Source

Fix some code issues.

newNRvisualizers
Daniel Grunwald 14 years ago
parent
commit
aad679fd78
  1. 2
      src/AddIns/Analysis/UnitTesting/Model/TestResult.cs
  2. 4
      src/AddIns/Analysis/UnitTesting/NUnit/NUnitConsoleApplication.cs
  3. 2
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Project/CSharpMyNamespaceBuilder.cs
  4. 2
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditDisplayBinding.cs
  5. 15
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin/ChangeMarkerMargin.cs
  6. 2
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin/DefaultChangeWatcher.cs
  7. 9
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin/DiffControl.xaml.cs
  8. 1
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin/DocumentSequence.cs
  9. 2
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SharpDevelopCompletionWindow.cs
  10. 1
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SyntaxHighlighting/CustomizingHighlighter.cs
  11. 2
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SyntaxHighlighting/FixedHighlighter.cs
  12. 2
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SyntaxHighlighting/SyntaxModeDoozer.cs

2
src/AddIns/Analysis/UnitTesting/Model/TestResult.cs

@ -45,7 +45,7 @@ namespace ICSharpCode.UnitTesting @@ -45,7 +45,7 @@ namespace ICSharpCode.UnitTesting
this.name = ParseName(name, out values);
}
string ParseName(string name, out string values)
static string ParseName(string name, out string values)
{
int i = name.IndexOf('(');
values = "";

4
src/AddIns/Analysis/UnitTesting/NUnit/NUnitConsoleApplication.cs

@ -234,7 +234,7 @@ namespace ICSharpCode.UnitTesting @@ -234,7 +234,7 @@ namespace ICSharpCode.UnitTesting
/// <summary>
/// Checks that the project's PlatformTarget is x32 for the active configuration.
/// </summary>
bool IsPlatformTarget32BitOrAnyCPU(IProject project)
static bool IsPlatformTarget32BitOrAnyCPU(IProject project)
{
MSBuildBasedProject msbuildProject = project as MSBuildBasedProject;
if (msbuildProject != null) {
@ -245,7 +245,7 @@ namespace ICSharpCode.UnitTesting @@ -245,7 +245,7 @@ namespace ICSharpCode.UnitTesting
return false;
}
bool ProjectUsesDotnet20Runtime(IProject project)
static bool ProjectUsesDotnet20Runtime(IProject project)
{
var p = project as ICSharpCode.SharpDevelop.Project.Converter.IUpgradableProject;
if (p != null && p.CurrentTargetFramework != null) {

2
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Project/CSharpMyNamespaceBuilder.cs

@ -78,7 +78,7 @@ namespace CSharpBinding @@ -78,7 +78,7 @@ namespace CSharpBinding
output.AppendLine(indentation);
}
}
} else if (trimmedLine.StartsWith("#if ")) {
} else if (trimmedLine.StartsWith("#if ", StringComparison.Ordinal)) {
outputActive = trimmedLine.Substring(4) == projectType;
} else {
output.AppendLine(StringParser.Parse(line.Replace("MyNamespace", ns)));

2
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditDisplayBinding.cs

@ -51,7 +51,7 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -51,7 +51,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
public double AutoDetectFileContent(FileName fileName, Stream fileContent, string detectedMimeType)
{
return detectedMimeType.StartsWith("text/") ? 0.5 : 0;
return detectedMimeType.StartsWith("text/", StringComparison.Ordinal) ? 0.5 : 0;
}
}

15
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin/ChangeMarkerMargin.cs

@ -2,7 +2,6 @@ @@ -2,7 +2,6 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
@ -13,7 +12,6 @@ using ICSharpCode.AvalonEdit.Document; @@ -13,7 +12,6 @@ using ICSharpCode.AvalonEdit.Document;
using ICSharpCode.AvalonEdit.Editing;
using ICSharpCode.AvalonEdit.Highlighting;
using ICSharpCode.AvalonEdit.Rendering;
using ICSharpCode.Core;
using ICSharpCode.NRefactory.Editor;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Editor;
@ -36,7 +34,7 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -36,7 +34,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
changeWatcher.ChangeOccurred += ChangeOccurred;
}
bool disposed = false;
bool disposed;
public void Dispose()
{
@ -156,7 +154,7 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -156,7 +154,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
#region Diffs tooltip
Popup tooltip = new Popup() { StaysOpen = false };
Popup tooltip = new Popup { StaysOpen = false };
ITextMarker marker;
ITextMarkerService markerService;
MouseHoverLogic hoverLogic;
@ -230,8 +228,8 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -230,8 +228,8 @@ namespace ICSharpCode.AvalonEdit.AddIn
differ.editor.Visibility = Visibility.Collapsed;
differ.copyButton.Visibility = Visibility.Collapsed;
} else {
var baseDocument = new ReadOnlyDocument(changeWatcher.BaseDocument, TextView.Document.FileName);
if (differ.editor.SyntaxHighlighting != null) {
var baseDocument = new ReadOnlyDocument(changeWatcher.BaseDocument, TextView.Document.FileName);
var mainHighlighter = new DocumentHighlighter(baseDocument, differ.editor.SyntaxHighlighting);
var popupHighlighter = differ.editor.TextArea.GetService(typeof(IHighlighter)) as DocumentHighlighter;
@ -246,10 +244,11 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -246,10 +244,11 @@ namespace ICSharpCode.AvalonEdit.AddIn
}
};
tooltip.Child = new Border() {
const double borderThickness = 1;
tooltip.Child = new Border {
Child = differ,
BorderBrush = editor.TextArea.Foreground,
BorderThickness = new Thickness(1)
BorderThickness = new Thickness(borderThickness)
};
if (tooltip.IsOpen)
@ -258,7 +257,7 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -258,7 +257,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
tooltip.Closed += delegate {
if (marker != null) markerService.Remove(marker);
};
tooltip.HorizontalOffset = -10;
tooltip.HorizontalOffset = -borderThickness - TextView.ScrollOffset.X;
tooltip.VerticalOffset =
TextView.GetVisualTopByDocumentLine(startLine) - TextView.ScrollOffset.Y;
tooltip.Placement = PlacementMode.Top;

2
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin/DefaultChangeWatcher.cs

@ -191,7 +191,7 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -191,7 +191,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
{
}
bool disposed = false;
bool disposed;
public void Dispose()
{

9
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin/DiffControl.xaml.cs

@ -2,19 +2,10 @@ @@ -2,19 +2,10 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using ICSharpCode.AvalonEdit.AddIn.Options;
using ICSharpCode.AvalonEdit.Highlighting;
using ICSharpCode.AvalonEdit.Rendering;
using ICSharpCode.Core.Presentation;
using ICSharpCode.SharpDevelop;
namespace ICSharpCode.AvalonEdit.AddIn

1
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin/DocumentSequence.cs

@ -4,7 +4,6 @@ @@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
using ICSharpCode.NRefactory.Editor;
using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Widgets.MyersDiff;
namespace ICSharpCode.AvalonEdit.AddIn

2
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SharpDevelopCompletionWindow.cs

@ -39,7 +39,7 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -39,7 +39,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
set {
// Disable virtualization if we use automatic width - this prevents the window from resizing
// when the user scrolls.
VirtualizingStackPanel.SetIsVirtualizing(this.CompletionList.ListBox, !double.IsNaN(value));
VirtualizingPanel.SetIsVirtualizing(this.CompletionList.ListBox, !double.IsNaN(value));
this.Width = value;
if (double.IsNaN(value)) {
// enable size-to-width:

1
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SyntaxHighlighting/CustomizingHighlighter.cs

@ -6,7 +6,6 @@ using System.Collections.Generic; @@ -6,7 +6,6 @@ using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Media;
using System.Windows.Threading;
using ICSharpCode.AvalonEdit.Editing;
using ICSharpCode.AvalonEdit.Highlighting;

2
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SyntaxHighlighting/FixedHighlighter.cs

@ -51,7 +51,7 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -51,7 +51,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
/// Moves the section start by <paramref name="delta"/> positions;
/// and removes the sections outside the (newLineStart,newLineEnd) range.
/// </summary>
static void MoveSections(IEnumerable<HighlightedSection> sections, int delta, int newLineStart, int newLineEnd, IList<HighlightedSection> result)
static void MoveSections(IEnumerable<HighlightedSection> sections, int delta, int newLineStart, int newLineEnd, ICollection<HighlightedSection> result)
{
foreach (var section in sections) {
int newOffset = section.Offset + delta;

2
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SyntaxHighlighting/SyntaxModeDoozer.cs

@ -2,10 +2,8 @@ @@ -2,10 +2,8 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Xml;
using ICSharpCode.AvalonEdit.Highlighting;

Loading…
Cancel
Save