Author: krasnov
Date: 2007-01-16 10:26:10 -0500 (Tue, 16 Jan 2007)
New Revision: 71140
Modified:
branches/mainsoft/gh20preview2/mcs/class/System.Web/System.Web.UI/ChangeLog
branches/mainsoft/gh20preview2/mcs/class/System.Web/System.Web.UI/Control.cs
branches/mainsoft/gh20preview2/mcs/class/System.Web/System.Web.UI/TemplateControl.jvm.cs
Log:
merge -r 71138:71139
Modified:
branches/mainsoft/gh20preview2/mcs/class/System.Web/System.Web.UI/ChangeLog
===================================================================
--- branches/mainsoft/gh20preview2/mcs/class/System.Web/System.Web.UI/ChangeLog
2007-01-16 15:20:18 UTC (rev 71139)
+++ branches/mainsoft/gh20preview2/mcs/class/System.Web/System.Web.UI/ChangeLog
2007-01-16 15:26:10 UTC (rev 71140)
@@ -1,5 +1,11 @@
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-08 Vladimir Krasnov <[EMAIL PROTECTED]>
Modified:
branches/mainsoft/gh20preview2/mcs/class/System.Web/System.Web.UI/Control.cs
===================================================================
---
branches/mainsoft/gh20preview2/mcs/class/System.Web/System.Web.UI/Control.cs
2007-01-16 15:20:18 UTC (rev 71139)
+++
branches/mainsoft/gh20preview2/mcs/class/System.Web/System.Web.UI/Control.cs
2007-01-16 15:26:10 UTC (rev 71140)
@@ -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:
branches/mainsoft/gh20preview2/mcs/class/System.Web/System.Web.UI/TemplateControl.jvm.cs
===================================================================
---
branches/mainsoft/gh20preview2/mcs/class/System.Web/System.Web.UI/TemplateControl.jvm.cs
2007-01-16 15:20:18 UTC (rev 71139)
+++
branches/mainsoft/gh20preview2/mcs/class/System.Web/System.Web.UI/TemplateControl.jvm.cs
2007-01-16 15:26:10 UTC (rev 71140)
@@ -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