(. attributes.Add(section); .) }
+ (
+ "AddHandler" [ "(" [ FormalParameterList ] ")" ] EOL
+ Block "End" "AddHandler" EOL
+ (.
+ eventAccessorDeclaration = new EventAccessorDeclaration((BlockStatement)stmt, p, EventAccessorType.AddHandlerAccessor, attributes);
+ .)
+ |
+ "RemoveHandler" [ "(" [ FormalParameterList ] ")" ] EOL
+ Block "End" "RemoveHandler" EOL
+ (.
+ eventAccessorDeclaration = new EventAccessorDeclaration((BlockStatement)stmt, p, EventAccessorType.RemoveHandlerAccessor, attributes);
+ .)
+ |
+ "RaiseEvent" [ "(" [ FormalParameterList ] ")" ] EOL
+ Block "End" "RaiseEvent" EOL
+ (.
+ eventAccessorDeclaration = new EventAccessorDeclaration((BlockStatement)stmt, p, EventAccessorType.RaiseEventAccessor, attributes);
+ .)
+ )
.
/* 9.7 */
diff --git a/src/Libraries/NRefactory/Test/NRefactoryTests.csproj b/src/Libraries/NRefactory/Test/NRefactoryTests.csproj
index 619e622935..8957460053 100644
--- a/src/Libraries/NRefactory/Test/NRefactoryTests.csproj
+++ b/src/Libraries/NRefactory/Test/NRefactoryTests.csproj
@@ -8,7 +8,6 @@
ICSharpCode.NRefactory.Tests
ICSharpCode.NRefactory.Tests
Library
- 4
False
False
OnSuccessfulBuild
@@ -16,11 +15,9 @@
True
- False
- False
True
DEBUG
- ..\..\..\..\bin\
+ C:\corsavy\trunk\SharpDevelop\bin
True
@@ -34,7 +31,14 @@
-
+
+ ..\..\..\..\bin\nunit.framework.dll
+ False
+
+
+ ..\..\..\..\bin\nunit.core.dll
+ False
+
@@ -127,6 +131,7 @@
+
diff --git a/src/Libraries/NRefactory/Test/Parser/TypeLevel/CustomEventTests.cs b/src/Libraries/NRefactory/Test/Parser/TypeLevel/CustomEventTests.cs
new file mode 100644
index 0000000000..008ef802a6
--- /dev/null
+++ b/src/Libraries/NRefactory/Test/Parser/TypeLevel/CustomEventTests.cs
@@ -0,0 +1,52 @@
+//
+// 2002-2005 AlphaSierraPapa
+// GNU General Public License
+//
+// $Revision: 230 $
+//
+
+using System;
+using System.IO;
+using NUnit.Framework;
+using ICSharpCode.NRefactory.Parser;
+using ICSharpCode.NRefactory.Parser.AST;
+
+namespace ICSharpCode.NRefactory.Tests.AST
+{
+ [TestFixture]
+ public class CustomEventTests
+ {
+ #region C#
+ // No C# representation
+ #endregion
+
+ #region VB.NET
+ [Test]
+ public void VBNetContinueStatementTest()
+ {
+ string code = @" Public Custom Event TestEvent As EventHandler
+ AddHandler(ByVal value As EventHandler)
+ Handlers = CType([Delegate].Combine(Handlers, value), _
+ EventHandler)
+ End AddHandler
+
+ RemoveHandler(ByVal value as EventHandler)
+ Handlers = CType([Delegate].Remove(Handlers, value), _
+ EventHandler)
+ End RemoveHandler
+
+ RaiseEvent(ByVal sender As Object, ByVal e As EventArgs)
+ Dim TempHandlers As EventHandler = Handlers
+
+ If TempHandlers IsNot Nothing Then
+ TempHandlers(sender, e)
+ End If
+ End RaiseEvent
+ End Event";
+ CustomEventDeclaration customEventDecl = (CustomEventDeclaration)ParseUtilVBNet.ParseTypeMember(code, typeof(ContinueStatement));
+ Assert.IsNotNull(customEventDecl);
+ Assert.AreEqual("TestEvent", customEventDecl.Name);
+ }
+ #endregion
+ }
+}