コード例 #1
0
 public void SetValue(string[] value)
 {
     Ext.EnsureAjaxEvent();
     if (this.ParentGrid != null)
     {
         this.ParentGrid.AddScript("{0}.getFilterPlugin().getFilter({1}).setValue({2});", this.ParentGrid.ClientID, JSON.Serialize(this.DataIndex), JSON.Serialize(value));
     }
 }
コード例 #2
0
 public void SetValue(float?eqValue)
 {
     Ext.EnsureAjaxEvent();
     if (this.ParentGrid != null)
     {
         string value = string.Concat("{eq:", eqValue.HasValue ? JSON.Serialize(eqValue.Value) : "undefined", "}");
         this.ParentGrid.AddScript("{0}.getFilterPlugin().getFilter({1}).setValue({2});", this.ParentGrid.ClientID, JSON.Serialize(this.DataIndex), value);
     }
 }
コード例 #3
0
 public override string ToString()
 {
     return string.Format("{0}:{1}", JSON.Serialize(Name), Mode == ParameterMode.Value ? JSON.Serialize(this.Value) : Value);
 }
コード例 #4
0
        public virtual void StartEdit(string el, string value)
        {
            string template = "{0}.startEdit(Coolite.Ext.getEl({1}), {2});";

            this.AddScript(template, this.ClientID, this.ParseTarget(el), JSON.Serialize(value));
        }
コード例 #5
0
        public string ToJson()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("[");

            foreach (KeyValuePair <string, ConfirmationRecord> pair in this)
            {
                sb.AppendFormat("{{s:{0},oldId:{1},newId:{2}}},", pair.Value.Confirm.ToString().ToLower(), JSON.Serialize(pair.Value.OldId), JSON.Serialize(pair.Value.NewId ?? pair.Value.OldId));
            }
            sb.Remove(sb.Length - 1, 1);
            sb.Append("]");

            return(sb.ToString());
        }
コード例 #6
0
        internal virtual void SetValue(string value)
        {
            string template = "{0}.setValue({1});";

            this.AddScript(template, this.ClientID, JSON.Serialize(value));
        }
コード例 #7
0
        public virtual void SetSize(int width, int height)
        {
            string template = "{0}.setSize({1},{2});";

            this.AddScript(template, this.ClientID, JSON.Serialize(width), JSON.Serialize(height));
        }
コード例 #8
0
        public virtual void Realign()
        {
            string template = "{0}.alignment={1};{0}.realign();";

            this.AddScript(template, this.ClientID, JSON.Serialize(this.Alignment.ToString()));
        }
コード例 #9
0
        public virtual void CompleteEdit(bool remainVisible)
        {
            string template = "{0}.completeEdit({1});";

            this.AddScript(template, this.ClientID, JSON.Serialize(remainVisible));
        }
コード例 #10
0
        public string GetScript(WebControl c, PropertyInfo property)
        {
            StringBuilder sb = new StringBuilder();

            if (!c.CallbackValues.ContainsKey(property.Name))
            {
                return(null);
            }

            object value = c.CallbackValues[property.Name];

            if (!string.IsNullOrEmpty(this.Script))
            {
                sb.AppendFormat(this.Script, c.ClientID, JSON.Serialize(value));
            }
            else if (!string.IsNullOrEmpty(this.MethodName))
            {
                MethodInfo method = c.GetType().GetMethod(this.MethodName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null, new Type[] { property.PropertyType }, null);
                if (method != null)
                {
                    method.Invoke(c, new object[] { value });
                }
            }
            else //simple script generating
            {
                switch (this.GenerateMode)
                {
                case AutoGeneratingScript.Simple:
                    sb.AppendFormat(AjaxEventUpdateAttribute.AutoGenerateFormat, c.ClientID, JSON.Serialize(value), StringUtils.ToLowerCamelCase(property.Name));
                    break;

                case AutoGeneratingScript.WithSet:
                    sb.AppendFormat("{0}.set{2}({1});", c.ClientID, JSON.Serialize(value), property.Name);
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }

            return(sb.ToString());
        }