Example #1
0
        public void UpdateOptionItems(string itemname, string val)
        {
            FormItem item = itemlist.Find(x => x.Name == itemname);

            if (item != null)
            {
                item.updateOptions(val);
            }
        }
Example #2
0
        public void FillData(string itemname, object value)
        {
            FormItem item = itemlist.Find(x => x.Name == itemname);

            if (item != null)
            {
                item.setValue(value);
            }
        }
Example #3
0
        public void FillData <T>(T data)
        {
            Type t          = data.GetType();
            var  properties = t.GetProperties();

            foreach (PropertyInfo pinfo in properties)
            {
                FormItem item = itemlist.Find(x => x.Name == pinfo.Name);
                if (item != null)
                {
                    item.setValue(pinfo.GetValue(data, null));
                }
            }
        }
Example #4
0
        public List <FormItem> FillFormItem()
        {
            List <FormItem> formitems = new List <FormItem>();

            foreach (InputItem item in Options.Items)
            {
                var fitem = new FormItem(item, Options);
                fitem.ValueChanged += (o, ev) => {
                    OnItemValueChanged(o, ev);
                };
                formitems.Add(fitem);
            }
            return(formitems);
        }
Example #5
0
        public T GetValues <T>(T data) where T : new()
        {
            Type t          = data.GetType();
            var  properties = t.GetProperties();

            foreach (PropertyInfo pinfo in properties)
            {
                FormItem item = itemlist.Find(x => x.Name == pinfo.Name);
                if (item != null)
                {
                    pinfo.SetValue(data, item.Value, null);
                }
            }
            return(data);
        }