From 21b9e13f0559f0be5b1573fd256dab0ee82d6ec7 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Wed, 18 Feb 2009 13:40:40 +0000 Subject: [PATCH] Removed some obsolete methods. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@3814 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Project/Src/Loaders/CodeDesignerLoader.cs | 2 +- .../NRefactoryASTGenerator/AST/Expressions.cs | 3 - .../NRefactory/Project/Src/Ast/Generated.cs | 70 +++++++++---------- .../Project/Src/Ast/TypeReference.cs | 14 ---- .../Project/Src/Gui/Workbench/WpfWorkbench.cs | 2 +- .../Project/Src/Project/Solution/Solution.cs | 5 -- .../Services/ProjectService/ProjectService.cs | 2 - .../CompletionWindow/CodeCompletionData.cs | 6 -- .../Base/Project/Src/Util/ExtensionMethods.cs | 8 +-- src/Main/Core/Project/ICSharpCode.Core.csproj | 1 - .../Project/Src/Util/AppDomainLaunchHelper.cs | 54 -------------- .../Src/NRefactoryResolver/TypeVisitor.cs | 11 --- 12 files changed, 35 insertions(+), 143 deletions(-) delete mode 100644 src/Main/Core/Project/Src/Util/AppDomainLaunchHelper.cs diff --git a/src/AddIns/DisplayBindings/WorkflowDesigner/Project/Src/Loaders/CodeDesignerLoader.cs b/src/AddIns/DisplayBindings/WorkflowDesigner/Project/Src/Loaders/CodeDesignerLoader.cs index f4e829def5..70b0e29596 100644 --- a/src/AddIns/DisplayBindings/WorkflowDesigner/Project/Src/Loaders/CodeDesignerLoader.cs +++ b/src/AddIns/DisplayBindings/WorkflowDesigner/Project/Src/Loaders/CodeDesignerLoader.cs @@ -272,7 +272,7 @@ namespace WorkflowDesigner.Loaders { if (type == null) return; - if (type.SystemType != type.Type) + if (type.IsKeyword) return; foreach (TypeReference tref in type.GenericTypes) { FixTypeReference(tref, location, domCu); diff --git a/src/Libraries/NRefactory/NRefactoryASTGenerator/AST/Expressions.cs b/src/Libraries/NRefactory/NRefactoryASTGenerator/AST/Expressions.cs index 045b1adc31..d41f173ed0 100644 --- a/src/Libraries/NRefactory/NRefactoryASTGenerator/AST/Expressions.cs +++ b/src/Libraries/NRefactory/NRefactoryASTGenerator/AST/Expressions.cs @@ -104,7 +104,6 @@ namespace NRefactoryASTGenerator.Ast public CastExpression(TypeReference castTo, Expression expression, CastType castType) {} } - [IncludeMember("[Obsolete] public string FieldName { get { return MemberName; } set { MemberName = value; } }")] class MemberReferenceExpression : Expression { Expression targetObject; @@ -114,7 +113,6 @@ namespace NRefactoryASTGenerator.Ast public MemberReferenceExpression(Expression targetObject, string memberName) {} } - [IncludeMember("[Obsolete] public string Identifier { get { return MemberName; } set { MemberName = value; } }")] class PointerReferenceExpression : Expression { Expression targetObject; string memberName; @@ -152,7 +150,6 @@ namespace NRefactoryASTGenerator.Ast public TypeOfExpression(TypeReference typeReference) {} } - [IncludeMember("[Obsolete] public TypeReferenceExpression(string typeName) : this(new TypeReference(typeName)) {}")] class TypeReferenceExpression : Expression { TypeReference typeReference; diff --git a/src/Libraries/NRefactory/Project/Src/Ast/Generated.cs b/src/Libraries/NRefactory/Project/Src/Ast/Generated.cs index e0a5e9f504..640db220c9 100644 --- a/src/Libraries/NRefactory/Project/Src/Ast/Generated.cs +++ b/src/Libraries/NRefactory/Project/Src/Ast/Generated.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3053 +// Runtime Version:2.0.50727.3074 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -1582,15 +1582,15 @@ namespace ICSharpCode.NRefactory.Ast { initializer = Expression.Null; } - public bool HasRemoveRegion { + public bool HasRaiseRegion { get { - return !removeRegion.IsNull; + return !raiseRegion.IsNull; } } - public bool HasRaiseRegion { + public bool HasRemoveRegion { get { - return !raiseRegion.IsNull; + return !removeRegion.IsNull; } } @@ -2339,13 +2339,6 @@ namespace ICSharpCode.NRefactory.Ast { } - public IfElseStatement(Expression condition, Statement trueStatement) - : this(condition) { - this.trueStatement.Add(Statement.CheckNull(trueStatement)); - if (trueStatement != null) trueStatement.Parent = this; - } - - public IfElseStatement(Expression condition, Statement trueStatement, Statement falseStatement) : this(condition) { this.trueStatement.Add(Statement.CheckNull(trueStatement)); @@ -2360,6 +2353,13 @@ namespace ICSharpCode.NRefactory.Ast { } } + + public IfElseStatement(Expression condition, Statement trueStatement) + : this(condition) { + this.trueStatement.Add(Statement.CheckNull(trueStatement)); + if (trueStatement != null) trueStatement.Parent = this; + } + public bool HasElseIfSections { get { return elseIfSections.Count > 0; @@ -2482,21 +2482,15 @@ namespace ICSharpCode.NRefactory.Ast { setRegion = PropertySetRegion.Null; } - public bool IsReadOnly { - get { - return HasGetRegion && !HasSetRegion; - } - } - public bool HasSetRegion { get { return !setRegion.IsNull; } } - public bool HasGetRegion { + public bool IsReadOnly { get { - return !getRegion.IsNull; + return HasGetRegion && !HasSetRegion; } } @@ -2506,6 +2500,12 @@ namespace ICSharpCode.NRefactory.Ast { } } + public bool HasGetRegion { + get { + return !getRegion.IsNull; + } + } + public override object AcceptVisitor(IAstVisitor visitor, object data) { return visitor.VisitIndexerDeclaration(this, data); } @@ -2829,8 +2829,6 @@ public Location ExtendedEndLocation { get; set; } typeArguments = new List(); } -[Obsolete] public string FieldName { get { return MemberName; } set { MemberName = value; } } - public override object AcceptVisitor(IAstVisitor visitor, object data) { return visitor.VisitMemberReferenceExpression(this, data); } @@ -3340,8 +3338,6 @@ public Location ExtendedEndLocation { get; set; } typeArguments = new List(); } -[Obsolete] public string Identifier { get { return MemberName; } set { MemberName = value; } } - public override object AcceptVisitor(IAstVisitor visitor, object data) { return visitor.VisitPointerReferenceExpression(this, data); } @@ -3410,9 +3406,9 @@ public Location ExtendedEndLocation { get; set; } setRegion = PropertySetRegion.Null; } - public bool HasGetRegion { + public bool IsReadOnly { get { - return !getRegion.IsNull; + return HasGetRegion && !HasSetRegion; } } @@ -3422,9 +3418,9 @@ public Location ExtendedEndLocation { get; set; } } } - public bool IsReadOnly { + public bool IsWriteOnly { get { - return HasGetRegion && !HasSetRegion; + return !HasGetRegion && HasSetRegion; } } @@ -3440,9 +3436,9 @@ public Location ExtendedEndLocation { get; set; } } } - public bool IsWriteOnly { + public bool HasGetRegion { get { - return !HasGetRegion && HasSetRegion; + return !getRegion.IsNull; } } @@ -5033,8 +5029,6 @@ public Location ExtendedEndLocation { get; set; } TypeReference = typeReference; } -[Obsolete] public TypeReferenceExpression(string typeName) : this(new TypeReference(typeName)) {} - public override object AcceptVisitor(IAstVisitor visitor, object data) { return visitor.VisitTypeReferenceExpression(this, data); } @@ -5236,10 +5230,10 @@ public Location ExtendedEndLocation { get; set; } Usings = usings; } -public UsingDeclaration(string @namespace) : this(@namespace, null) {} - public UsingDeclaration(string @namespace, TypeReference alias) { usings = new List(1); usings.Add(new Using(@namespace, alias)); } +public UsingDeclaration(string @namespace) : this(@namespace, null) {} + public override object AcceptVisitor(IAstVisitor visitor, object data) { return visitor.VisitUsingDeclaration(this, data); } @@ -5415,15 +5409,15 @@ public UsingDeclaration(string @namespace, TypeReference alias) { usings = new L Statement = statement; } - public bool IsYieldBreak { + public bool IsYieldReturn { get { - return statement is BreakStatement; + return statement is ReturnStatement; } } - public bool IsYieldReturn { + public bool IsYieldBreak { get { - return statement is ReturnStatement; + return statement is BreakStatement; } } diff --git a/src/Libraries/NRefactory/Project/Src/Ast/TypeReference.cs b/src/Libraries/NRefactory/Project/Src/Ast/TypeReference.cs index 467bbae7c1..b3878da1d8 100644 --- a/src/Libraries/NRefactory/Project/Src/Ast/TypeReference.cs +++ b/src/Libraries/NRefactory/Project/Src/Ast/TypeReference.cs @@ -185,13 +185,6 @@ namespace ICSharpCode.NRefactory.Ast } } - [Obsolete("Use 'Type' instead - it now contains the SystemType for primitive types.")] - public string SystemType { - get { - return this.Type; - } - } - public int PointerNestingLevel { get { return pointerNestingLevel; @@ -266,13 +259,6 @@ namespace ICSharpCode.NRefactory.Ast this.Type = type; } - [Obsolete("Type and SystemType are no longer distinguished - use the (string type, bool isKeyword) constructor instead!")] - public TypeReference(string type, string systemType) - { - this.Type = systemType; - this.IsKeyword = type != systemType; - } - public TypeReference(string type, bool isKeyword) { this.Type = type; diff --git a/src/Main/Base/Project/Src/Gui/Workbench/WpfWorkbench.cs b/src/Main/Base/Project/Src/Gui/Workbench/WpfWorkbench.cs index e662c6b224..4f68d92dff 100644 --- a/src/Main/Base/Project/Src/Gui/Workbench/WpfWorkbench.cs +++ b/src/Main/Base/Project/Src/Gui/Workbench/WpfWorkbench.cs @@ -51,7 +51,7 @@ namespace ICSharpCode.SharpDevelop.Gui } public System.Windows.Forms.IWin32Window MainWin32Window { get; private set; } - public ISynchronizeInvoke SynchronizingObject { get; set; } + public ISynchronizeInvoke SynchronizingObject { get; private set; } public Window MainWindow { get { return this; } } List padViewContentCollection = new List(); diff --git a/src/Main/Base/Project/Src/Project/Solution/Solution.cs b/src/Main/Base/Project/Src/Project/Solution/Solution.cs index a92d5d2dcc..5fe22dac56 100644 --- a/src/Main/Base/Project/Src/Project/Solution/Solution.cs +++ b/src/Main/Base/Project/Src/Project/Solution/Solution.cs @@ -31,11 +31,6 @@ namespace ICSharpCode.SharpDevelop.Project public const int SolutionVersionVS2005 = 9; public const int SolutionVersionVS2008 = 10; - [Obsolete("Use SolutionVersionVS2005 instead")] - public const int SolutionVersionVS05 = 9; - [Obsolete("Use SolutionVersionVS2008 instead")] - public const int SolutionVersionVS08 = 10; - /// contains <GUID, (IProject/ISolutionFolder)> pairs. Dictionary guidDictionary = new Dictionary(); diff --git a/src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs b/src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs index 0b7bd71e33..4c79df00f2 100644 --- a/src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs +++ b/src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs @@ -649,8 +649,6 @@ namespace ICSharpCode.SharpDevelop.Project public static event EventHandler StartBuild; public static event EventHandler EndBuild; - [Obsolete("This event is never raised.")] - public static event ProjectConfigurationEventHandler ProjectConfigurationChanged { add {} remove {} } public static event SolutionConfigurationEventHandler SolutionConfigurationChanged; public static event EventHandler SolutionCreated; diff --git a/src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/CodeCompletionData.cs b/src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/CodeCompletionData.cs index 3de5e63aa0..21556ac1a9 100644 --- a/src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/CodeCompletionData.cs +++ b/src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/CodeCompletionData.cs @@ -201,12 +201,6 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor return false; } - [Obsolete("Use 'ConvertDocumentation' instead.")] - public static string GetDocumentation(string doc) - { - return ConvertDocumentation(doc); - } - static readonly Regex whitespace = new Regex(@"\s+"); /// diff --git a/src/Main/Base/Project/Src/Util/ExtensionMethods.cs b/src/Main/Base/Project/Src/Util/ExtensionMethods.cs index b57a10daba..7dce1ef302 100644 --- a/src/Main/Base/Project/Src/Util/ExtensionMethods.cs +++ b/src/Main/Base/Project/Src/Util/ExtensionMethods.cs @@ -36,12 +36,6 @@ namespace ICSharpCode.SharpDevelop } } - [Obsolete("Use ForEach instead.")] - public static void Foreach(this IEnumerable input, Action action) - { - ForEach(input, action); - } - /// /// Adds all to . /// @@ -111,7 +105,7 @@ namespace ICSharpCode.SharpDevelop sealed class Win32WindowAdapter : WinForms.IWin32Window { - System.Windows.Interop.IWin32Window window; + readonly System.Windows.Interop.IWin32Window window; public Win32WindowAdapter(System.Windows.Interop.IWin32Window window) { diff --git a/src/Main/Core/Project/ICSharpCode.Core.csproj b/src/Main/Core/Project/ICSharpCode.Core.csproj index 5899a27430..aab6794bd4 100644 --- a/src/Main/Core/Project/ICSharpCode.Core.csproj +++ b/src/Main/Core/Project/ICSharpCode.Core.csproj @@ -113,7 +113,6 @@ Configuration\GlobalAssemblyInfo.cs - diff --git a/src/Main/Core/Project/Src/Util/AppDomainLaunchHelper.cs b/src/Main/Core/Project/Src/Util/AppDomainLaunchHelper.cs deleted file mode 100644 index 6f42ec9ef6..0000000000 --- a/src/Main/Core/Project/Src/Util/AppDomainLaunchHelper.cs +++ /dev/null @@ -1,54 +0,0 @@ -// -// -// -// -// $Revision$ -// - -using System; -using System.Globalization; -using System.Reflection; - -namespace ICSharpCode.Core -{ - /// - /// Because AddIn assemblies are loaded into the LoadFrom context, creating AppDomains in them that - /// use an arbitrary ApplicationBase path does not work correctly. - /// This class contains a static method that helps launching a static method on a type in a new AppDomain. - /// - /// - /// - /// public static class CurrentClass { // is NOT MarshalByRef - /// public static ResultClass[] GetResults() - /// { - /// AppDomainSetup setup = new AppDomainSetup(); - /// setup.ApplicationBase = myApplicationBase; - /// AppDomain domain = AppDomain.CreateDomain("Display name for domain", AppDomain.CurrentDomain.Evidence, setup); - /// try { - /// return (ResultClass[])AppDomainLaunchHelper.LaunchInAppDomain(domain, typeof(CurrentClass), "GetResultsDirectly", requestObject); - /// } finally { - /// AppDomain.Unload(domain); - /// } - /// } - /// public static ResultClass[] GetResultsDirectly(Request requestObject) { ... } - /// } - /// [Serializable] class Request { ... } // must be serializable !!! - /// [Serializable] class ResultClass { ... } // must be serializable !!! - /// - [Obsolete("This class is broken, serialization does not work and addin dependencies are not loaded in the AppDomain")] - public class AppDomainLaunchHelper : MarshalByRefObject - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - object LaunchMethod(string assemblyFile, string typeName, string methodName, object[] arguments) - { - Type t = Assembly.LoadFrom(assemblyFile).GetType(typeName); - return t.InvokeMember(methodName, (BindingFlags.Public | BindingFlags.Static | BindingFlags.InvokeMethod), null, null, arguments, CultureInfo.InvariantCulture); - } - - public static object LaunchInAppDomain(AppDomain domain, Type type, string methodName, params object[] arguments) - { - AppDomainLaunchHelper h = (AppDomainLaunchHelper)domain.CreateInstanceFromAndUnwrap(typeof(AppDomainLaunchHelper).Assembly.Location, typeof(AppDomainLaunchHelper).FullName); - return h.LaunchMethod(type.Assembly.Location, type.FullName, methodName, arguments); - } - } -} diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/TypeVisitor.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/TypeVisitor.cs index 4e2ac8cdcf..516c9f30dd 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/TypeVisitor.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/TypeVisitor.cs @@ -36,17 +36,6 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver resolver.ProjectContent, ReturnTypeOptions.None); } - [Obsolete("Use the overload with ReturnTypeOptions instead")] - public static IReturnType CreateReturnType(TypeReference reference, IClass callingClass, - IMember callingMember, int caretLine, int caretColumn, - IProjectContent projectContent, - bool useLazyReturnType) - { - return CreateReturnType(reference, callingClass, callingMember, caretLine, caretColumn, - projectContent, - useLazyReturnType ? ReturnTypeOptions.Lazy : ReturnTypeOptions.None); - } - public static IReturnType CreateReturnType(TypeReference reference, IClass callingClass, IMember callingMember, int caretLine, int caretColumn, IProjectContent projectContent,