Fix problems with overlong directory names: phase #1
[mono.git] / mcs / class / System / System.CodeDom / CodeAttachEventStatement.cs
index 23e4b8f066a6d5beff7c2da18f81ff3c1a4eeaa4..0ca7cd6fbf1257cb501178507fbe75536b73ae11 100644 (file)
@@ -6,8 +6,7 @@
 //   Daniel Stodden (stodden@in.tum.de)
 //
 // (C) 2001 Ximian, Inc.
-//
-
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -60,16 +59,19 @@ namespace System.CodeDom
                                                 string eventName, 
                                                 CodeExpression listener)
                {
-                       this.eventRef = new CodeEventReferenceExpressiontargetObject,
-                                                                         eventName );
+                       this.eventRef = new CodeEventReferenceExpression (targetObject,
+                                                                                                                               eventName);
                        this.listener = listener;
                }
-                                                                 
+
                //
                // Properties
                //
                public CodeEventReferenceExpression Event {
                        get {
+                               if (eventRef == null) {
+                                       eventRef = new CodeEventReferenceExpression ();
+                               }
                                return eventRef;
                        }
                        set {