Esempio n. 1
0
        public void Page_Loaded(object o, EventArgs e)
        {
            // Required to initialize variables
            InitializeComponent();

            Canvas c = o as Canvas;
            _hidApi = HtmlPage.Document.GetElementByID("hidAPI");
            _hidSecret = HtmlPage.Document.GetElementByID("hidSecret");
            _hidSession = HtmlPage.Document.GetElementByID("hidSession");
            _hidUser = HtmlPage.Document.GetElementByID("hidUser");

            facebookProxy.UserJSON[] friends = CallWS(_hidApi.GetProperty<string>("Value"), _hidSecret.GetProperty<string>("Value"), _hidSession.GetProperty<string>("Value"), _hidUser.GetProperty<string>("Value"));

            tb.Text = "You have " + friends.Length + " friends.";//CallWS(_hidApi.GetProperty<string>("Value"), _hidSecret.GetProperty<string>("Value"), _hidSession.GetProperty<string>("Value"), _hidUser.GetProperty<string>("Value"));
        }
Esempio n. 2
0
		public ScriptableTest ()
		{
			plugin = HtmlPage.Plugin;
			window = HtmlPage.Window;
			content = plugin.GetProperty ("Content") as ScriptObject;

			//bool ispopupon = HtmlPage.IsPopupWindowAllowed;
			//HtmlWindow popup = HtmlPage.PopupWindow (new Uri ("about:blank"), "_blank", new HtmlPopupWindowOptions ());
			calc = new Calculator ();
			scriptable = new Scriptable ();
			scriptabletype = new ScriptableType ();

			HtmlPage.RegisterScriptableObject ("calc", calc);
			HtmlPage.RegisterScriptableObject ("scriptable", scriptable);
			HtmlPage.RegisterScriptableObject ("scriptabletype", scriptabletype);
			HtmlPage.RegisterCreateableType ("createable", typeof (CreateableType));

			if (Environment.OSVersion.Platform == PlatformID.Unix)
				strplugin = "document.getElementById('silverlight')";
			else
				strplugin = "document.getElementById('silverlightControlHost').getElementsByTagName('object')[0]";
		}
Esempio n. 3
0
 public static object GetBoundMember(HtmlElement element, string name) {
     return element.GetProperty(name);
 }
Esempio n. 4
0
 internal void AppendTextInElement(string str, HtmlElement e) {
     var toPrepend = e.GetProperty("innerHTML").ToString();
     e.SetProperty("innerHTML", toPrepend + EscapeHtml(str));
 }