예제 #1
0
        public int control()
        {
            HttpContext c = HttpContext.Current;

            if (Xml != null && Xml.Url != null)
            {
                Req = Xml.Url.Request();
            }
            else
            {
                Req = new StringDictionary();
                foreach (String k in c.Request.QueryString)
                {
                    Req[k] = c.Request.QueryString[k];
                }
                foreach (String k in c.Request.Form)
                {
                    Req[k] = c.Request.Form[k];
                }
            }
            if (debug)
            {
                QU.rw("<b>Starting with state : " + _state + "</b><br/>");
            }
            _v        = new Hashtable();
            _run_done = new Hashtable();
            _run_todo = new ArrayList(q_state_split(QState));
            while (_run_todo.Count > 0)
            {
                string s = (string)_run_todo[0];
                string m = s + "control";
                _run_todo.RemoveAt(0);
                _run_done[s] = 1;
                if (debug)
                {
                    QU.rw("Executing control state :" + m + "<br/>");
                }
                MethodInfo mi = GetType().GetMethod(m);
                if (mi != null)
                {
                    mi.Invoke(this, new Object[] { c, _v });
                }
            }
            return(0);
        }
예제 #2
0
 public string view()
 {
     foreach (string s in q_state_split(QState))
     {
         string m = s + "view";
         if (debug)
         {
             QU.rw("Executing view state : " + m + "<br/>");
         }
         if (GetType().GetMethod(m) != null)
         {
             Object o = GetType().GetMethod(m).Invoke(this, new Object[] { _v });
             if (o is string)
             {
                 return((string)o);
             }
         }
     }
     return("qweb: no view returned a string.");
 }