Author: jackson
Date: 2007-08-08 17:24:56 -0400 (Wed, 08 Aug 2007)
New Revision: 83696
Modified:
trunk/olive/class/System.Silverlight/System.Windows.Browser/ChangeLog
trunk/olive/class/System.Silverlight/System.Windows.Browser/HtmlPage.cs
Log:
* HtmlPage.cs: implement CurrentBookmark
* NavigateToBookmark and
submit the pages 'default' form.
Modified: trunk/olive/class/System.Silverlight/System.Windows.Browser/ChangeLog
===================================================================
--- trunk/olive/class/System.Silverlight/System.Windows.Browser/ChangeLog
2007-08-08 21:16:42 UTC (rev 83695)
+++ trunk/olive/class/System.Silverlight/System.Windows.Browser/ChangeLog
2007-08-08 21:24:56 UTC (rev 83696)
@@ -1,3 +1,8 @@
+2007-08-08 Jackson Harper <[EMAIL PROTECTED]>
+
+ * HtmlPage.cs: implement CurrentBookmark NavigateToBookmark and
+ submit the pages 'default' form.
+
2007-08-07 Jb Evain <[EMAIL PROTECTED]>
* BrowserRuntimeSettings.cs: NonSerialized on fields
Modified:
trunk/olive/class/System.Silverlight/System.Windows.Browser/HtmlPage.cs
===================================================================
--- trunk/olive/class/System.Silverlight/System.Windows.Browser/HtmlPage.cs
2007-08-08 21:16:42 UTC (rev 83695)
+++ trunk/olive/class/System.Silverlight/System.Windows.Browser/HtmlPage.cs
2007-08-08 21:24:56 UTC (rev 83696)
@@ -65,10 +65,19 @@
}
}
- [MonoTODO]
public static string CurrentBookmark {
- get { return null; }
- set { ; }
+ get {
+ IntPtr loc = GetPropertyInternal<IntPtr>
(Document.Handle, "location");
+ string hash = GetPropertyInternal<string> (loc,
"hash");
+
+ if (hash == null || hash [0] != '#')
+ return null;
+ return hash.Substring (1, hash.Length - 1);
+ }
+ set {
+ IntPtr loc = GetPropertyInternal<IntPtr>
(Document.Handle, "location");
+ SetPropertyInternal (loc, "hash", String.Concat
("#", value));
+ }
}
public static HtmlDocument Document {
@@ -139,16 +148,17 @@
return new HtmlWindow (InvokeInternal<IntPtr>
(Window.Handle, "open", navigateToUri, target, targetFeatures));
}
- [MonoTODO ("Not sure this can be done from JS. I think I will
need to add a plugin function for this.")]
public static void NavigateToBookmark (string bookmark)
{
-
+ CurrentBookmark = bookmark;
}
- [MonoTODO ("How do i get the default form")]
public static void Submit ()
{
- // Submit (WebApplication.Current.PluginHandle, null);
+ HtmlElementCollection forms =
Document.GetElementsByTagName ("form");
+ if (forms.Count < 1)
+ return;
+ InvokeInternal<object> (forms [0].Handle, "submit");
}
public static void Submit (string formId)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches