Browse Source

Fixed SD2-1522: Exception when double-clicking in empty first line.

Fixed some FxCop issues.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3786 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 17 years ago
parent
commit
be17ca8431
  1. 2
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextAreaMouseHandler.cs
  2. 3
      src/Main/Core/Project/Src/Services/PropertyService/Properties.cs
  3. 6
      src/Main/Core/Project/Src/Services/StringParser/StringParser.cs
  4. 2
      src/Main/ICSharpCode.SharpDevelop.BuildWorker/BuildJob.cs
  5. 17
      src/Main/ICSharpCode.SharpDevelop.BuildWorker/Program.cs
  6. 2
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Ambience.cs
  7. 52
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ExpressionContext.cs
  8. 6
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultMethod.cs
  9. 6
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultProperty.cs
  10. 22
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/TypeVisitor.cs
  11. 6
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Refactoring/NRefactoryRefactoringProvider.cs
  12. 5
      src/Main/ICSharpCode.SharpDevelop.Sda/Src/ExceptionBox.cs

2
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextAreaMouseHandler.cs

@ -454,6 +454,8 @@ namespace ICSharpCode.TextEditor
int FindWordEnd(IDocument document, int offset) int FindWordEnd(IDocument document, int offset)
{ {
LineSegment line = document.GetLineSegmentForOffset(offset); LineSegment line = document.GetLineSegmentForOffset(offset);
if (line.Length == 0)
return offset;
int endPos = line.Offset + line.Length; int endPos = line.Offset + line.Length;
offset = Math.Min(offset, endPos - 1); offset = Math.Min(offset, endPos - 1);

3
src/Main/Core/Project/Src/Services/PropertyService/Properties.cs

@ -9,6 +9,7 @@ using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Globalization;
using System.IO; using System.IO;
using System.Text; using System.Text;
using System.Xml; using System.Xml;
@ -64,7 +65,7 @@ namespace ICSharpCode.Core
public string this[string property] { public string this[string property] {
get { get {
return Convert.ToString(Get(property)); return Convert.ToString(Get(property), CultureInfo.InvariantCulture);
} }
set { set {
Set(property, value); Set(property, value);

6
src/Main/Core/Project/Src/Services/StringParser/StringParser.cs

@ -100,7 +100,7 @@ namespace ICSharpCode.Core
StringBuilder output = null; // don't use StringBuilder if input is a single property StringBuilder output = null; // don't use StringBuilder if input is a single property
do { do {
int oldPos = pos; int oldPos = pos;
pos = input.IndexOf("${", pos); pos = input.IndexOf("${", pos, StringComparison.Ordinal);
if (pos < 0) { if (pos < 0) {
if (output == null) { if (output == null) {
return input; return input;
@ -149,7 +149,7 @@ namespace ICSharpCode.Core
// most properties start with res: in lowercase, // most properties start with res: in lowercase,
// so we can save 2 string allocations here, in addition to all the jumps // so we can save 2 string allocations here, in addition to all the jumps
// All other prefixed properties {prefix:Key} shoulg get handled in the switch below. // All other prefixed properties {prefix:Key} shoulg get handled in the switch below.
if (propertyName.StartsWith("res:")) { if (propertyName.StartsWith("res:", StringComparison.OrdinalIgnoreCase)) {
try { try {
return Parse(ResourceService.GetString(propertyName.Substring(4)), customTags); return Parse(ResourceService.GetString(propertyName.Substring(4)), customTags);
} catch (ResourceNotFoundException) { } catch (ResourceNotFoundException) {
@ -235,7 +235,7 @@ namespace ICSharpCode.Core
static string GetProperty(string propertyName) static string GetProperty(string propertyName)
{ {
string defaultValue = ""; string defaultValue = "";
int pos = propertyName.LastIndexOf("??"); int pos = propertyName.LastIndexOf("??", StringComparison.Ordinal);
if (pos >= 0) { if (pos >= 0) {
defaultValue = propertyName.Substring(pos + 2); defaultValue = propertyName.Substring(pos + 2);
propertyName = propertyName.Substring(0, pos); propertyName = propertyName.Substring(0, pos);

2
src/Main/ICSharpCode.SharpDevelop.BuildWorker/BuildJob.cs

@ -50,7 +50,7 @@ namespace ICSharpCode.SharpDevelop.BuildWorker
get { return additionalImports; } get { return additionalImports; }
} }
HashSet<string> interestingTaskNames = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase); HashSet<string> interestingTaskNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
public ICollection<string> InterestingTaskNames { public ICollection<string> InterestingTaskNames {
get { return interestingTaskNames; } get { return interestingTaskNames; }

17
src/Main/ICSharpCode.SharpDevelop.BuildWorker/Program.cs

@ -10,12 +10,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Diagnostics; using System.Diagnostics;
using System.IO;
using System.Runtime.Serialization;
using System.Threading; using System.Threading;
using ICSharpCode.SharpDevelop.BuildWorker.Interprocess; using ICSharpCode.SharpDevelop.BuildWorker.Interprocess;
using Microsoft.Build.Framework;
using Microsoft.Build.BuildEngine; using Microsoft.Build.BuildEngine;
using Microsoft.Build.Framework;
namespace ICSharpCode.SharpDevelop.BuildWorker namespace ICSharpCode.SharpDevelop.BuildWorker
{ {
@ -107,7 +109,8 @@ namespace ICSharpCode.SharpDevelop.BuildWorker
} }
// Called with CallMethodOnWorker // Called with CallMethodOnWorker
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] //[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
// TODO: make use of CancelBuild
public void CancelBuild() public void CancelBuild()
{ {
lock (this) { lock (this) {
@ -442,6 +445,14 @@ namespace ICSharpCode.SharpDevelop.BuildWorker
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1064:ExceptionsShouldBePublic")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1064:ExceptionsShouldBePublic")]
sealed class BuildCancelException : Exception sealed class BuildCancelException : Exception
{ {
public BuildCancelException()
{
}
BuildCancelException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
} }
} }
} }

2
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Ambience.cs

@ -116,7 +116,7 @@ namespace ICSharpCode.SharpDevelop.Dom
{ {
#if DEBUG #if DEBUG
if (ownerThread != System.Threading.Thread.CurrentThread.ManagedThreadId) if (ownerThread != System.Threading.Thread.CurrentThread.ManagedThreadId)
throw new Exception("Ambience may only be used by the thread that created it"); throw new InvalidOperationException("Ambience may only be used by the thread that created it");
#endif #endif
} }

52
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/ExpressionContext.cs

@ -62,104 +62,104 @@ namespace ICSharpCode.SharpDevelop.Dom
#region C# specific contexts (public static fields) * MOVE TO ANOTHER CLASS * #region C# specific contexts (public static fields) * MOVE TO ANOTHER CLASS *
/// <summary>The context expects a new identifier</summary> /// <summary>The context expects a new identifier</summary>
/// <example>class *expr* {}; string *expr*;</example> /// <example>class *expr* {}; string *expr*;</example>
public static ExpressionContext IdentifierExpected = new DefaultExpressionContext("IdentifierExpected"); public readonly static ExpressionContext IdentifierExpected = new DefaultExpressionContext("IdentifierExpected");
/// <summary>The context is outside of any type declaration, expecting a global-level keyword.</summary> /// <summary>The context is outside of any type declaration, expecting a global-level keyword.</summary>
public static ExpressionContext Global = new DefaultExpressionContext("Global"); public readonly static ExpressionContext Global = new DefaultExpressionContext("Global");
/// <summary>The context is the body of a property declaration.</summary> /// <summary>The context is the body of a property declaration.</summary>
/// <example>string Name { *expr* }</example> /// <example>string Name { *expr* }</example>
public static ExpressionContext PropertyDeclaration = new DefaultExpressionContext("PropertyDeclaration"); public readonly static ExpressionContext PropertyDeclaration = new DefaultExpressionContext("PropertyDeclaration");
/// <summary>The context is the body of a property declaration inside an interface.</summary> /// <summary>The context is the body of a property declaration inside an interface.</summary>
/// <example>string Name { *expr* }</example> /// <example>string Name { *expr* }</example>
public static ExpressionContext InterfacePropertyDeclaration = new DefaultExpressionContext("InterfacePropertyDeclaration"); public readonly static ExpressionContext InterfacePropertyDeclaration = new DefaultExpressionContext("InterfacePropertyDeclaration");
/// <summary>The context is the body of a event declaration.</summary> /// <summary>The context is the body of a event declaration.</summary>
/// <example>event EventHandler NameChanged { *expr* }</example> /// <example>event EventHandler NameChanged { *expr* }</example>
public static ExpressionContext EventDeclaration = new DefaultExpressionContext("EventDeclaration"); public readonly static ExpressionContext EventDeclaration = new DefaultExpressionContext("EventDeclaration");
/// <summary>The context is the body of a method.</summary> /// <summary>The context is the body of a method.</summary>
/// <example>void Main () { *expr* }</example> /// <example>void Main () { *expr* }</example>
public static ExpressionContext MethodBody = new DefaultExpressionContext("MethodBody"); public readonly static ExpressionContext MethodBody = new DefaultExpressionContext("MethodBody");
/// <summary>The context is after the type parameters of a type/method declaration. /// <summary>The context is after the type parameters of a type/method declaration.
/// The only valid keyword is "where"</summary> /// The only valid keyword is "where"</summary>
/// <example>class &lt;T&gt; *expr*</example> /// <example>class &lt;T&gt; *expr*</example>
public static ExpressionContext ConstraintsStart = new DefaultExpressionContext("ConstraintsStart"); public readonly static ExpressionContext ConstraintsStart = new DefaultExpressionContext("ConstraintsStart");
/// <summary>The context is after the 'where' of a constraints list.</summary> /// <summary>The context is after the 'where' of a constraints list.</summary>
/// <example>class &lt;T&gt; where *expr*</example> /// <example>class &lt;T&gt; where *expr*</example>
public static ExpressionContext Constraints = new NonStaticTypeExpressionContext("Constraints", false); public readonly static ExpressionContext Constraints = new NonStaticTypeExpressionContext("Constraints", false);
/// <summary>The context is the body of a type declaration.</summary> /// <summary>The context is the body of a type declaration.</summary>
public static ExpressionContext TypeDeclaration = new NonStaticTypeExpressionContext("TypeDeclaration", true); public readonly static ExpressionContext TypeDeclaration = new NonStaticTypeExpressionContext("TypeDeclaration", true);
/// <summary>The context is the body of an interface declaration.</summary> /// <summary>The context is the body of an interface declaration.</summary>
public static ExpressionContext InterfaceDeclaration = new NonStaticTypeExpressionContext("InterfaceDeclaration", true); public readonly static ExpressionContext InterfaceDeclaration = new NonStaticTypeExpressionContext("InterfaceDeclaration", true);
/// <summary>Context expects "base" or "this".</summary> /// <summary>Context expects "base" or "this".</summary>
/// <example>public ClassName() : *expr*</example> /// <example>public ClassName() : *expr*</example>
public static ExpressionContext BaseConstructorCall = new DefaultExpressionContext("BaseConstructorCall"); public readonly static ExpressionContext BaseConstructorCall = new DefaultExpressionContext("BaseConstructorCall");
/// <summary>The first parameter</summary> /// <summary>The first parameter</summary>
/// <example>void MethodName(*expr*)</example> /// <example>void MethodName(*expr*)</example>
public static ExpressionContext FirstParameterType = new NonStaticTypeExpressionContext("FirstParameterType", false); public readonly static ExpressionContext FirstParameterType = new NonStaticTypeExpressionContext("FirstParameterType", false);
/// <summary>Another parameter</summary> /// <summary>Another parameter</summary>
/// <example>void MethodName(..., *expr*)</example> /// <example>void MethodName(..., *expr*)</example>
public static ExpressionContext ParameterType = new NonStaticTypeExpressionContext("ParameterType", false); public readonly static ExpressionContext ParameterType = new NonStaticTypeExpressionContext("ParameterType", false);
/// <summary>Context expects a fully qualified type name.</summary> /// <summary>Context expects a fully qualified type name.</summary>
/// <example>using Alias = *expr*;</example> /// <example>using Alias = *expr*;</example>
public static ExpressionContext FullyQualifiedType = new DefaultExpressionContext("FullyQualifiedType"); public readonly static ExpressionContext FullyQualifiedType = new DefaultExpressionContext("FullyQualifiedType");
/// <summary>Context expects is a property name in an object initializer.</summary> /// <summary>Context expects is a property name in an object initializer.</summary>
/// <example>new *type* [(args)] { *expr* = ... }</example> /// <example>new *type* [(args)] { *expr* = ... }</example>
public static ExpressionContext ObjectInitializer = new DefaultExpressionContext("ObjectInitializer"); public readonly static ExpressionContext ObjectInitializer = new DefaultExpressionContext("ObjectInitializer");
#endregion #endregion
#region Default contexts (public static fields) #region Default contexts (public static fields)
/// <summary>Default/unknown context</summary> /// <summary>Default/unknown context</summary>
public static ExpressionContext Default = new DefaultExpressionContext("Default"); public readonly static ExpressionContext Default = new DefaultExpressionContext("Default");
/// <summary>The context expects the base type of an enum.</summary> /// <summary>The context expects the base type of an enum.</summary>
/// <example>enum Name : *expr* {}</example> /// <example>enum Name : *expr* {}</example>
public static ExpressionContext EnumBaseType = new EnumBaseTypeExpressionContext(); public readonly static ExpressionContext EnumBaseType = new EnumBaseTypeExpressionContext();
/// <summary>Context expects a non-sealed type or interface</summary> /// <summary>Context expects a non-sealed type or interface</summary>
/// <example>class C : *expr* {}</example> /// <example>class C : *expr* {}</example>
public static ExpressionContext InheritableType = new InheritableTypeExpressionContext(); public readonly static ExpressionContext InheritableType = new InheritableTypeExpressionContext();
/// <summary>Context expects a namespace name</summary> /// <summary>Context expects a namespace name</summary>
/// <example>using *expr*;</example> /// <example>using *expr*;</example>
public static ExpressionContext Namespace = new ImportableExpressionContext(false); public readonly static ExpressionContext Namespace = new ImportableExpressionContext(false);
/// <summary>Context expects an importable type (namespace or class with public static members)</summary> /// <summary>Context expects an importable type (namespace or class with public static members)</summary>
/// <example>Imports *expr*;</example> /// <example>Imports *expr*;</example>
public static ExpressionContext Importable = new ImportableExpressionContext(true); public readonly static ExpressionContext Importable = new ImportableExpressionContext(true);
/// <summary>Context expects a type name</summary> /// <summary>Context expects a type name</summary>
/// <example>typeof(*expr*)</example> /// <example>typeof(*expr*)</example>
public static ExpressionContext Type = new TypeExpressionContext(null, false, true); public readonly static ExpressionContext Type = new TypeExpressionContext(null, false, true);
/// <summary>Context expects the name of a non-static, non-void type</summary> /// <summary>Context expects the name of a non-static, non-void type</summary>
/// <example>is *expr*, *expr* variableName</example> /// <example>is *expr*, *expr* variableName</example>
public static ExpressionContext NonStaticNonVoidType = new NonStaticTypeExpressionContext("NonStaticType", false); public readonly static ExpressionContext NonStaticNonVoidType = new NonStaticTypeExpressionContext("NonStaticType", false);
/// <summary>Context expects a non-abstract type that has accessible constructors</summary> /// <summary>Context expects a non-abstract type that has accessible constructors</summary>
/// <example>new *expr*();</example> /// <example>new *expr*();</example>
/// <remarks>When using this context, a resolver should treat the expression as object creation, /// <remarks>When using this context, a resolver should treat the expression as object creation,
/// even when the keyword "new" is not part of the expression.</remarks> /// even when the keyword "new" is not part of the expression.</remarks>
public static ExpressionContext ObjectCreation = new TypeExpressionContext(null, true, true); public readonly static ExpressionContext ObjectCreation = new TypeExpressionContext(null, true, true);
/// <summary>Context expects a type deriving from System.Attribute.</summary> /// <summary>Context expects a type deriving from System.Attribute.</summary>
/// <example>[*expr*()]</example> /// <example>[*expr*()]</example>
/// <remarks>When using this context, a resolver should try resolving typenames with an /// <remarks>When using this context, a resolver should try resolving typenames with an
/// appended "Attribute" suffix and treat "invocations" of the attribute type as /// appended "Attribute" suffix and treat "invocations" of the attribute type as
/// object creation.</remarks> /// object creation.</remarks>
public static ExpressionContext Attribute = new AttributeExpressionContext(); public readonly static ExpressionContext Attribute = new AttributeExpressionContext();
/// <summary>Context expects a type name which has special base type</summary> /// <summary>Context expects a type name which has special base type</summary>
/// <param name="baseClass">The class the expression must derive from.</param> /// <param name="baseClass">The class the expression must derive from.</param>
@ -173,11 +173,11 @@ namespace ICSharpCode.SharpDevelop.Dom
/// <summary>Context expects an interface</summary> /// <summary>Context expects an interface</summary>
/// <example>interface C : *expr* {}</example> /// <example>interface C : *expr* {}</example>
/// <example>Implements *expr*</example> /// <example>Implements *expr*</example>
public static ExpressionContext Interface = new ClassTypeExpressionContext(ClassType.Interface); public readonly static ExpressionContext Interface = new ClassTypeExpressionContext(ClassType.Interface);
/// <summary>Context expects a delegate</summary> /// <summary>Context expects a delegate</summary>
/// <example>public event *expr*</example> /// <example>public event *expr*</example>
public static ExpressionContext DelegateType = new ClassTypeExpressionContext(ClassType.Delegate); public readonly static ExpressionContext DelegateType = new ClassTypeExpressionContext(ClassType.Delegate);
#endregion #endregion

6
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultMethod.cs

@ -195,14 +195,10 @@ namespace ICSharpCode.SharpDevelop.Dom
public virtual int CompareTo(IMethod value) public virtual int CompareTo(IMethod value)
{ {
int cmp; int cmp = string.CompareOrdinal(this.FullyQualifiedName, value.FullyQualifiedName);
if (FullyQualifiedName != null) {
cmp = FullyQualifiedName.CompareTo(value.FullyQualifiedName);
if (cmp != 0) { if (cmp != 0) {
return cmp; return cmp;
} }
}
cmp = this.TypeParameters.Count - value.TypeParameters.Count; cmp = this.TypeParameters.Count - value.TypeParameters.Count;
if (cmp != 0) { if (cmp != 0) {

6
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/DefaultProperty.cs

@ -138,14 +138,10 @@ namespace ICSharpCode.SharpDevelop.Dom {
public virtual int CompareTo(IProperty value) public virtual int CompareTo(IProperty value)
{ {
int cmp; int cmp = string.CompareOrdinal(this.FullyQualifiedName, value.FullyQualifiedName);
if (FullyQualifiedName != null) {
cmp = FullyQualifiedName.CompareTo(value.FullyQualifiedName);
if (cmp != 0) { if (cmp != 0) {
return cmp; return cmp;
} }
}
return DiffUtility.Compare(Parameters, value.Parameters); return DiffUtility.Compare(Parameters, value.Parameters);
} }

22
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/TypeVisitor.cs

@ -70,8 +70,9 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver
break; break;
} }
} }
if (t == null && callingMember is IMethod && (callingMember as IMethod).TypeParameters != null) { IMethod callingMethod = callingMember as IMethod;
foreach (ITypeParameter tp in (callingMember as IMethod).TypeParameters) { if (t == null && callingMethod != null) {
foreach (ITypeParameter tp in callingMethod.TypeParameters) {
if (languageProperties.NameComparer.Equals(tp.Name, reference.Type)) { if (languageProperties.NameComparer.Equals(tp.Name, reference.Type)) {
t = new GenericReturnType(tp); t = new GenericReturnType(tp);
break; break;
@ -80,18 +81,17 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver
} }
} }
if (t == null) { if (t == null) {
if (reference.IsKeyword && reference.GenericTypes.Count == 0) { int typeParameterCount = reference.GenericTypes.Count;
if (reference.IsKeyword) {
// keyword-type like void, int, string etc. // keyword-type like void, int, string etc.
// check GenericTypes.Count to prevent use of this code path for nullables IClass c = projectContent.GetClass(reference.Type, typeParameterCount);
IClass c = projectContent.GetClass(reference.Type, 0);
if (c != null) if (c != null)
t = c.DefaultReturnType; t = c.DefaultReturnType;
else else
t = new GetClassReturnType(projectContent, reference.Type, 0); t = new GetClassReturnType(projectContent, reference.Type, typeParameterCount);
} else { } else {
int typeParameterCount = reference.GenericTypes.Count;
if (useLazyReturnType || isBaseTypeReference) { if (useLazyReturnType || isBaseTypeReference) {
if (reference.IsGlobal || reference.IsKeyword) { if (reference.IsGlobal) {
t = new GetClassReturnType(projectContent, reference.Type, typeParameterCount); t = new GetClassReturnType(projectContent, reference.Type, typeParameterCount);
} else if (callingClass != null) { } else if (callingClass != null) {
SearchClassReturnType scrt = new SearchClassReturnType(projectContent, callingClass, caretLine, caretColumn, reference.Type, typeParameterCount); SearchClassReturnType scrt = new SearchClassReturnType(projectContent, callingClass, caretLine, caretColumn, reference.Type, typeParameterCount);
@ -101,7 +101,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver
} }
} else { } else {
IClass c; IClass c;
if (reference.IsGlobal || reference.IsKeyword) { if (reference.IsGlobal) {
c = projectContent.GetClass(reference.Type, typeParameterCount); c = projectContent.GetClass(reference.Type, typeParameterCount);
t = (c != null) ? c.DefaultReturnType : null; t = (c != null) ? c.DefaultReturnType : null;
} else if (callingClass != null) { } else if (callingClass != null) {
@ -114,9 +114,9 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver
} }
} }
if (reference.GenericTypes.Count > 0) { if (reference.GenericTypes.Count > 0) {
List<IReturnType> para = new List<IReturnType>(reference.GenericTypes.Count); IReturnType[] para = new IReturnType[reference.GenericTypes.Count];
for (int i = 0; i < reference.GenericTypes.Count; ++i) { for (int i = 0; i < reference.GenericTypes.Count; ++i) {
para.Add(CreateReturnType(reference.GenericTypes[i], callingClass, callingMember, caretLine, caretColumn, projectContent, options)); para[i] = CreateReturnType(reference.GenericTypes[i], callingClass, callingMember, caretLine, caretColumn, projectContent, options);
} }
t = new ConstructedReturnType(t, para); t = new ConstructedReturnType(t, para);
} }

6
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Refactoring/NRefactoryRefactoringProvider.cs

@ -608,12 +608,14 @@ namespace ICSharpCode.SharpDevelop.Dom.Refactoring
static bool IsEndDirective(string trimLine) static bool IsEndDirective(string trimLine)
{ {
return trimLine.StartsWith("#endregion") || trimLine.StartsWith("#endif"); return trimLine.StartsWith("#endregion", StringComparison.Ordinal)
|| trimLine.StartsWith("#endif", StringComparison.Ordinal);
} }
static bool IsStartDirective(string trimLine) static bool IsStartDirective(string trimLine)
{ {
return trimLine.StartsWith("#region") || trimLine.StartsWith("#if"); return trimLine.StartsWith("#region", StringComparison.Ordinal)
|| trimLine.StartsWith("#if", StringComparison.Ordinal);
} }
#endregion #endregion
} }

5
src/Main/ICSharpCode.SharpDevelop.Sda/Src/ExceptionBox.cs

@ -155,11 +155,12 @@ namespace ICSharpCode.SharpDevelop.Sda
void CopyInfoToClipboard() void CopyInfoToClipboard()
{ {
if (copyErrorCheckBox.Checked) { if (copyErrorCheckBox.Checked) {
string exceptionText = exceptionTextBox.Text;
if (Application.OleRequired() == ApartmentState.STA) { if (Application.OleRequired() == ApartmentState.STA) {
ClipboardWrapper.SetText(getClipboardString()); ClipboardWrapper.SetText(exceptionText);
} else { } else {
Thread th = new Thread((ThreadStart)delegate { Thread th = new Thread((ThreadStart)delegate {
ClipboardWrapper.SetText(getClipboardString()); ClipboardWrapper.SetText(exceptionText);
}); });
th.Name = "CopyInfoToClipboard"; th.Name = "CopyInfoToClipboard";
th.SetApartmentState(ApartmentState.STA); th.SetApartmentState(ApartmentState.STA);

Loading…
Cancel
Save