Fix problems with overlong directory names: phase #1
[mono.git] / mcs / class / System / System.CodeDom / CodeMethodReferenceExpression.cs
index c673beaa6539325e28e115e356ac53ede42e8fcf..0867344d656953892059c6af7200d35abae2b3c4 100644 (file)
@@ -4,10 +4,10 @@
 // Author:
 //   Miguel de Icaza (miguel@ximian.com)
 //   Daniel Stodden (stodden@in.tum.de)
+//   Marek Safar (marek.safar@seznam.cz)
 //
 // (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
@@ -41,6 +41,9 @@ namespace System.CodeDom
        {
                private string methodName;
                private CodeExpression targetObject;
+#if NET_2_0
+               CodeTypeReferenceCollection typeArguments;
+#endif
                
                //
                // Constructors
@@ -56,11 +59,24 @@ namespace System.CodeDom
                        this.methodName = methodName;
                }
 
+#if NET_2_0
+               public CodeMethodReferenceExpression (CodeExpression targetObject, 
+                       string methodName, params CodeTypeReference[] typeParameters) :
+                       this (targetObject, methodName)
+               {
+                       if (typeParameters != null && typeParameters.Length > 0)
+                               TypeArguments.AddRange (typeParameters);
+               }
+#endif
+
                //
                // Properties
                //
                public string MethodName {
                        get {
+                               if (methodName == null) {
+                                       return string.Empty;
+                               }
                                return methodName;
                        }
                        set {
@@ -76,5 +92,16 @@ namespace System.CodeDom
                                targetObject = value;
                        }
                }
+
+#if NET_2_0
+               [ComVisible (false)]
+               public CodeTypeReferenceCollection TypeArguments {
+                       get {
+                               if (typeArguments == null)
+                                       typeArguments = new CodeTypeReferenceCollection ();
+                               return typeArguments;
+                       }
+               }
+#endif
        }
 }