示例#1
0
        /// <summary>
        /// for Form
        /// </summary>
        private void DoForForm()
        {
            string dataName = "";
            var    theTag   = TagList.FirstOrDefault(a => a is FormTag);

            if (theTag != null)
            {
                FormTag form = theTag as FormTag;
                dataName = form.DataName;
                FieldTag        field  = null;
                List <FieldTag> Fields = new List <FieldTag>();
                foreach (var c in TagList.Where(a => a is FieldTag))
                {
                    if (c is FieldTag)
                    {
                        field = c as FieldTag;
                        if (field.Type == FieldType.form_value)
                        {
                            field.SetDataName(dataName, FieldType.form_value);
                            form.AddField(field);
                        }
                    }
                }

                theTag = TagList.FirstOrDefault(a => a is MethodTag && (a as MethodTag).Type == MethodType.form_method);
                if (theTag != null)
                {
                    MethodTag method = theTag as MethodTag;
                    form.SetMethod(method);
                }
            }
        }