예제 #1
0
        /// <summary>
        /// 使 jQuery 中包含的页面元素具有某种交互效果.
        /// </summary>
        /// <param name="setting">交互相关设置, 为 DraggableSetting, DroppableSetting 等.</param>
        /// <returns>更新后的 JQueryUI.</returns>
        public JQueryUI Interaction(InteractionSetting setting)
        {
            if (null == setting)
            {
                return(this);
            }

            return(this.Execute(setting.InteractionType.ToString( ), MakeOptionExpression(setting.SettingHelper.CreateOptions( ))) as JQueryUI);
        }
예제 #2
0
		/// <summary>
		/// 使页面上指定选择器的元素具有交互效果.
		/// </summary>
		/// <param name="selector">用于指定页面上元素的选择器.</param>
		/// <param name="setting">交互设置, 比如: DraggableSetting, DroppableSetting 等.</param>
		/// <param name="variableName">如果不为空, 则生成同名的 javascript 脚本变量.</param>
		public void Interaction ( string selector, InteractionSetting setting, string variableName = null )
		{

			if ( string.IsNullOrEmpty ( selector ) )
				throw new ArgumentNullException ( "selector", "选择器不能为空" );

			if ( null == setting )
				throw new ArgumentNullException ( "setting", "Interaction 设置不能为空" );

			this.code += "$(function(){" + ( string.IsNullOrEmpty ( variableName ) ? string.Empty : ( "window['" + variableName + "'] = " ) ) + new JQueryUI ( selector ).Interaction ( setting ).Code + "});";
		}
예제 #3
0
        /// <summary>
        /// 使页面上指定选择器的元素具有交互效果.
        /// </summary>
        /// <param name="selector">用于指定页面上元素的选择器.</param>
        /// <param name="setting">交互设置, 比如: DraggableSetting, DroppableSetting 等.</param>
        /// <param name="variableName">如果不为空, 则生成同名的 javascript 脚本变量.</param>
        public void Interaction(string selector, InteractionSetting setting, string variableName = null)
        {
            if (string.IsNullOrEmpty(selector))
            {
                throw new ArgumentNullException("selector", "选择器不能为空");
            }

            if (null == setting)
            {
                throw new ArgumentNullException("setting", "Interaction 设置不能为空");
            }

            this.code += "$(function(){" + (string.IsNullOrEmpty(variableName) ? string.Empty : ("window['" + variableName + "'] = ")) + new JQueryUI(selector).Interaction(setting).Code + "});";
        }
예제 #4
0
		/// <summary>
		/// 使 jQuery 中包含的页面元素具有某种交互效果.
		/// </summary>
		/// <param name="setting">交互相关设置, 为 DraggableSetting, DroppableSetting 等.</param>
		/// <returns>更新后的 JQueryUI.</returns>
		public JQueryUI Interaction ( InteractionSetting setting )
		{

			if ( null == setting )
				return this;

			return this.Execute ( setting.InteractionType.ToString ( ), MakeOptionExpression ( setting.SettingHelper.CreateOptions ( ) ) ) as JQueryUI;
		}