Author: krasnov
Date: 2007-01-16 10:20:18 -0500 (Tue, 16 Jan 2007)
New Revision: 71139

Modified:
   trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
   trunk/mcs/class/System.Web/System.Web.UI/Control.cs
   trunk/mcs/class/System.Web/System.Web.UI/TemplateControl.jvm.cs
Log:
* TemplateControl.jvm.cs: remover TemplateSourceDirectory propery
* Control.cs: moved TemplateSourceDirectory from TemplateControl for 
TARGET_JVM, fixed AppRelativeTemplateSourceDirectory

Modified: trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/ChangeLog  2007-01-16 14:54:59 UTC 
(rev 71138)
+++ trunk/mcs/class/System.Web/System.Web.UI/ChangeLog  2007-01-16 15:20:18 UTC 
(rev 71139)
@@ -1,5 +1,11 @@
-2007-01-08  Vladimir Krasnov  <[EMAIL PROTECTED]>
+2007-01-16  Vladimir Krasnov  <[EMAIL PROTECTED]>
 
+       * TemplateControl.jvm.cs: remover TemplateSourceDirectory propery
+       * Control.cs: moved TemplateSourceDirectory from TemplateControl for
+       TARGET_JVM, fixed AppRelativeTemplateSourceDirectory
+
+2007-01-16  Vladimir Krasnov  <[EMAIL PROTECTED]>
+
        * TemplateControl.jvm.cs: added 2.0 event names for wiring up
 
 2007-01-15  Ilya Kharmatsky <ilya - at - decode-systems.com>

Modified: trunk/mcs/class/System.Web/System.Web.UI/Control.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/Control.cs 2007-01-16 14:54:59 UTC 
(rev 71138)
+++ trunk/mcs/class/System.Web/System.Web.UI/Control.cs 2007-01-16 15:20:18 UTC 
(rev 71139)
@@ -162,14 +162,22 @@
                        }
                }
 
-               string _appRelativeTemplateSourceDirectory = "~/";
+               string _appRelativeTemplateSourceDirectory = null;
 
                [EditorBrowsable (EditorBrowsableState.Advanced)]
                [Browsable (false)]
                [DesignerSerializationVisibility 
(DesignerSerializationVisibility.Hidden)]
                public string AppRelativeTemplateSourceDirectory 
                {
-                       get { return _appRelativeTemplateSourceDirectory; }
+                       get {
+                               if (_appRelativeTemplateSourceDirectory != null)
+                                       return 
_appRelativeTemplateSourceDirectory;
+
+                               if (Parent != null)
+                                       return 
Parent.AppRelativeTemplateSourceDirectory;
+
+                               return "~/";
+                       }
                        [EditorBrowsable (EditorBrowsableState.Never)]
                        set     { _appRelativeTemplateSourceDirectory = value; }
                }
@@ -373,12 +381,48 @@
                }
 #endif         
 
+#if TARGET_JVM
+                       private string _templateSourceDir;
+                       public virtual string TemplateSourceDirectory
+                       {
+                               get
+                               {
+                                       int location = 0;
+                                       if (_templateSourceDir == null) {
+                                               string tempSrcDir = 
_appRelativeTemplateSourceDirectory;
+                                               if (tempSrcDir == null && 
Parent != null)
+                                                       tempSrcDir = 
Parent.TemplateSourceDirectory;
+                                               if (tempSrcDir != null && 
tempSrcDir.Length > 1) {
+                                                       location = 
tempSrcDir.IndexOf ('/', 1);
+                                                       if (location != -1)
+                                                               tempSrcDir = 
tempSrcDir.Substring (location + 1);
+                                                       else
+                                                               tempSrcDir = 
string.Empty;
+                                               }
+                                               string answer = 
HttpRuntime.AppDomainAppVirtualPath;
+                                               if (tempSrcDir == null)
+                                                       tempSrcDir = "";
+
+                                               if (tempSrcDir.Length > 0 && 
tempSrcDir [tempSrcDir.Length - 1] == '/')
+                                                       tempSrcDir = 
tempSrcDir.Substring (0, tempSrcDir.Length - 1);
+
+                                               if (tempSrcDir.StartsWith ("/") 
|| tempSrcDir.Length == 0)
+                                                       _templateSourceDir = 
answer + tempSrcDir;
+                                               else
+                                                       _templateSourceDir = 
answer + "/" + tempSrcDir;
+                                       }
+                                       return _templateSourceDir;
+                               }
+                       }
+
+#else
                [DesignerSerializationVisibility 
(DesignerSerializationVisibility.Hidden)]
                [Browsable (false)]
                [WebSysDescription ("A virtual directory containing the parent 
of the control.")]
                 public virtual string TemplateSourceDirectory {
                        get { return (_parent == null) ? String.Empty : 
_parent.TemplateSourceDirectory; }
                 }
+#endif
 
                [DesignerSerializationVisibility 
(DesignerSerializationVisibility.Hidden)]
                [Browsable (false)]

Modified: trunk/mcs/class/System.Web/System.Web.UI/TemplateControl.jvm.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/TemplateControl.jvm.cs     
2007-01-16 14:54:59 UTC (rev 71138)
+++ trunk/mcs/class/System.Web/System.Web.UI/TemplateControl.jvm.cs     
2007-01-16 15:20:18 UTC (rev 71139)
@@ -63,7 +63,6 @@
                                                BindingFlags.NonPublic |
                                                BindingFlags.Instance;
 
-               private string _templateSourceDir;
                private static string hashTableMutex = "lock"; //used to sync 
access ResourceHash property
                private byte [] GetResourceBytes (Type type)
                {
@@ -118,49 +117,6 @@
                        get { return null; }
                }
 
-               [MonoTODO]
-               // This shouldnt be there, Page.TemplateSourceDirectory must 
know to get 
-               // the right directory of the control.
-               public override string TemplateSourceDirectory
-               {
-                       get
-                       {
-#if NET_2_0
-                               if (this is MasterPage)
-                                       // because MasterPage also has 
implementation of this property,
-                                       // but not always gets the right 
directory, in case where master page
-                                       // is in the root of webapp and the 
page that uses it is in sub folder.
-                                       return base.TemplateSourceDirectory;
-#endif
-                               int location = 0;
-                               if (_templateSourceDir == null) {
-                                       string tempSrcDir = 
AppRelativeTemplateSourceDirectory;
-                                       if (tempSrcDir == null && Parent != 
null)
-                                               tempSrcDir = 
Parent.TemplateSourceDirectory;
-                                       if (tempSrcDir != null && 
tempSrcDir.Length > 1) {
-                                               location = tempSrcDir.IndexOf 
('/', 1);
-                                               if (location != -1)
-                                                       tempSrcDir = 
tempSrcDir.Substring (location + 1);
-                                               else
-                                                       tempSrcDir = 
string.Empty;
-                                       }
-                                       string answer = 
HttpRuntime.AppDomainAppVirtualPath;
-                                       if (tempSrcDir == null)
-                                               tempSrcDir = "";
-
-                                       if (tempSrcDir.Length > 0 && tempSrcDir 
[tempSrcDir.Length - 1] == '/')
-                                               tempSrcDir = 
tempSrcDir.Substring (0, tempSrcDir.Length - 1);
-
-                                       if (tempSrcDir.StartsWith ("/") || 
tempSrcDir.Length == 0)
-                                               _templateSourceDir = answer + 
tempSrcDir;
-                                       else
-                                               _templateSourceDir = answer + 
"/" + tempSrcDir;
-                               }
-                               return _templateSourceDir;
-                       }
-               }
-
-
                #region Constructor
                protected TemplateControl ()
                {

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to