示例#1
0
 /// <summary>
 ///
 /// </summary>
 protected virtual void OnScriptValueGet(
     ScriptValueGetEventArgs args)
 {
     if (ScriptValueGet != null)
     {
         ScriptValueGet(this, args);
     }
 }
示例#2
0
        // ------------------------------------------------------------------
        #endregion

        #region Reading and writing values from a script to the web browser.
        // ------------------------------------------------------------------

        /// <summary>
        /// This can be called from JavaScript that is being loaded into
        /// the HTML control. See "WebBrowser.ObjectForScripting" in the
        /// documentation manual for further details.
        /// </summary>
        /// <remarks>
        /// Although this method is public, it should not be called from
        /// your C# code but only from your JavaScript on the HTML page.
        /// </remarks>
        public virtual string GetValueFromScript(
            string key)
        {
            var args = new ScriptValueGetEventArgs(key);

            OnScriptValueGet(args);

            return(args.Value);
        }
		/// <summary>
		/// 
		/// </summary>
		protected virtual void OnScriptValueGet(
			ScriptValueGetEventArgs args )
		{
			if ( ScriptValueGet != null )
			{
				ScriptValueGet( this, args );
			}
		}
		// ------------------------------------------------------------------
		#endregion

		#region Reading and writing values from a script to the web browser.
		// ------------------------------------------------------------------

		/// <summary>
		/// This can be called from JavaScript that is being loaded into
		/// the HTML control. See "WebBrowser.ObjectForScripting" in the 
		/// documentation manual for further details.
		/// </summary>
		/// <remarks>
		/// Although this method is public, it should not be called from
		/// your C# code but only from your JavaScript on the HTML page.
		/// </remarks>
		public virtual string GetValueFromScript(
			string key )
		{
			var args = new ScriptValueGetEventArgs( key );

			OnScriptValueGet( args );

			return args.Value;
		}