Author: igorz
Date: 2008-01-03 04:51:38 -0500 (Thu, 03 Jan 2008)
New Revision: 92162
Modified:
trunk/mcs/class/System.Web.Extensions/System.Web.UI/RegisteredDisposeScript.cs
trunk/mcs/class/System.Web.Extensions/System.Web.UI/ScriptManager.cs
Log:
implement GetRegisteredDisposeScripts()
Modified:
trunk/mcs/class/System.Web.Extensions/System.Web.UI/RegisteredDisposeScript.cs
===================================================================
---
trunk/mcs/class/System.Web.Extensions/System.Web.UI/RegisteredDisposeScript.cs
2008-01-03 09:34:53 UTC (rev 92161)
+++
trunk/mcs/class/System.Web.Extensions/System.Web.UI/RegisteredDisposeScript.cs
2008-01-03 09:51:38 UTC (rev 92162)
@@ -34,11 +34,13 @@
public sealed class RegisteredDisposeScript
{
readonly Control _control;
+ readonly UpdatePanel _updatePanel;
readonly string _script;
- internal RegisteredDisposeScript (Control control, string
script) {
+ internal RegisteredDisposeScript (Control control, string
script, UpdatePanel updatePanel) {
_control = control;
_script = script;
+ _updatePanel = updatePanel;
}
public Control Control {
@@ -48,5 +50,9 @@
public string Script {
get { return _script; }
}
+
+ internal UpdatePanel UpdatePanel {
+ get { return _updatePanel; }
+ }
}
}
Modified: trunk/mcs/class/System.Web.Extensions/System.Web.UI/ScriptManager.cs
===================================================================
--- trunk/mcs/class/System.Web.Extensions/System.Web.UI/ScriptManager.cs
2008-01-03 09:34:53 UTC (rev 92161)
+++ trunk/mcs/class/System.Web.Extensions/System.Web.UI/ScriptManager.cs
2008-01-03 09:51:38 UTC (rev 92162)
@@ -117,7 +117,7 @@
string _controlIDToFocus;
bool _allowCustomErrorsRedirect = true;
string _asyncPostBackErrorMessage;
- List<DisposeScriptEntry> _disposeScripts;
+ List<RegisteredDisposeScript> _disposeScripts;
List<ScriptReferenceEntry> _scriptToRegister;
bool _loadScriptsBeforeUI = true;
AuthenticationServiceManager _authenticationService;
@@ -488,7 +488,7 @@
StringBuilder sb = new StringBuilder ();
sb.AppendLine ();
for (int i = 0; i <
_disposeScripts.Count; i++) {
- DisposeScriptEntry entry =
_disposeScripts [i];
+ RegisteredDisposeScript entry =
_disposeScripts [i];
if (IsMultiForm)
sb.Append
("Sys.WebForms.PageRequestManager.getInstance($get(\"" + Page.Form.ClientID +
"\"))._registerDisposeScript(\"");
else
@@ -640,7 +640,9 @@
}
public ReadOnlyCollection<RegisteredDisposeScript>
GetRegisteredDisposeScripts () {
- throw new NotImplementedException ();
+ if (_disposeScripts == null)
+ _disposeScripts = new
List<RegisteredDisposeScript> ();
+ return new ReadOnlyCollection<RegisteredDisposeScript>
(_disposeScripts);
}
public ReadOnlyCollection<RegisteredExpandoAttribute>
GetRegisteredExpandoAttributes () {
@@ -893,8 +895,8 @@
return;
if (_disposeScripts == null)
- _disposeScripts = new List<DisposeScriptEntry>
();
- _disposeScripts.Add (new DisposeScriptEntry
(updatePanel, disposeScript));
+ _disposeScripts = new
List<RegisteredDisposeScript> ();
+ _disposeScripts.Add (new RegisteredDisposeScript
(control, disposeScript, updatePanel));
}
static UpdatePanel GetUpdatePanel (Control control) {
@@ -1248,7 +1250,7 @@
if (_disposeScripts != null)
for (int i = 0; i < _disposeScripts.Count; i++)
{
- DisposeScriptEntry entry =
_disposeScripts [i];
+ RegisteredDisposeScript entry =
_disposeScripts [i];
if ((_panelsToRefresh != null &&
_panelsToRefresh.IndexOf (entry.UpdatePanel) >= 0) || (_childUpdatePanels !=
null && _childUpdatePanels.IndexOf (entry.UpdatePanel) >= 0))
WriteCallbackOutput (output,
scriptDispose, entry.UpdatePanel.ClientID, entry.Script);
}
@@ -1607,20 +1609,6 @@
}
}
- sealed class DisposeScriptEntry
- {
- readonly UpdatePanel _updatePanel;
- readonly string _script;
-
- public UpdatePanel UpdatePanel { get { return
_updatePanel; } }
- public string Script { get { return _script; } }
-
- public DisposeScriptEntry (UpdatePanel updatePanel,
string script) {
- _updatePanel = updatePanel;
- _script = script;
- }
- }
-
internal void RegisterProxy (ScriptManagerProxy
scriptManagerProxy) {
if (_proxies == null)
_proxies = new List<ScriptManagerProxy> ();
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches