- current_function.AppendFormat ("\t\t\tthis.__BuildControl_{0} ();\n" +
- "\t\t\t__{1}.Add{2} (this.{0});\n\n",
- control_id, ctrl_name, parsed);
- }
- else if (controls.PeekChildKind () == ChildrenKind.LISTITEM){
- old_function.Append ("\n\t\t}\n\n");
- init_funcs.Append (old_function); // Closes the BuildList function
- old_function = (StringBuilder) functions.Pop ();
- current_function = (StringBuilder) functions.Peek ();
- old_function.AppendFormat ("\n\t\t\tthis.__BuildControl_{0} (__ctrl.{1});\n\t\t\t" +
- "return __ctrl;\n\t\t}}\n\n",
- control_id, controls.PeekDefaultPropertyName ());
-
- controls.Pop ();
- control_id = controls.PeekControlID ();
- current_function.AppendFormat ("\t\t\tthis.__BuildControl_{0} ();\n\t\t\t__parser." +
- "AddParsedSubObject (this.{0});\n\n", control_id);
- }
- else {
- old_function.Append ("\n\t\t\treturn __ctrl;\n\t\t}\n\n");
- current_function.AppendFormat ("\t\t\tthis.__BuildControl_{0} ();\n\t\t\t__parser." +
- "AddParsedSubObject (this.{0});\n\n", control_id);
- }
-
- if (useCodeRender)
- RemoveLiterals (old_function);
-
- init_funcs.Append (old_function);
- if (useCodeRender)
- AddCodeRenderFunction (controls.CodeRenderFunction.ToString (), control_id);
-
- if (hasDataBindFunction){
- StringBuilder db_function = controls.DataBindFunction;
- db_function.Append ("\t\t}\n\n");
- init_funcs.Append (db_function);
- }
-
- // Avoid getting empty stacks for unbalanced open/close tags
- if (controls.Count > 1){
- controls.Pop ();
- AddCodeRenderControl (controls.CodeRenderFunction, controls.ChildIndex);
- }
-
- return true;
- }
-
- private void ProcessHtmlControlTag ()
- {
- HtmlControlTag html_ctrl = (HtmlControlTag) elements.Current;
- if (html_ctrl.TagID.ToUpper () == "SCRIPT"){
- //FIXME: if the is script is to be read from disk, do it!
- if (html_ctrl.SelfClosing)
- throw new ApplicationException ("Read script from file not supported yet.");
-
- if (elements.MoveNext () == false)
- throw new ApplicationException ("Error after " + html_ctrl.ToString ());
-
- if (elements.Current is PlainText){
- script.Append (((PlainText) elements.Current).Text);
- if (!elements.MoveNext ())
- throw new ApplicationException ("Error after " +
- elements.Current.ToString ());