Example #1
0
 public override void internalExecute(Agent agent)
 {
     if (null != ElementLocator)
     {
         HtmlElement element = ElementLocator.locate(agent);
         if (null != element)
         {
             element.InvokeMember(Method);
         }
     }
 }
Example #2
0
 public override void internalExecute(Agent agent)
 {
     if (null != Parameters)
     {
         foreach (string key in Parameters.Keys)
         {
             HtmlElement element = agent.WebBrowser.Document.GetElementById(key);
             if (null != element)
             {
                 string value    = Parameters[key];
                 Object valueObj = agent.RequestContext.ContainsKey(value) ? agent.RequestContext[value] : null;
                 Object exprObj  = null;
                 try
                 {
                     exprObj = DataBinder.Eval(agent, value);
                     if (null != exprObj)
                     {
                         value = exprObj.ToString();
                     }
                 }
                 catch (Exception e)
                 {
                     //NOOP
                 }
                 if (null == exprObj)
                 {
                     if (null != valueObj)
                     {
                         value = valueObj.ToString();
                     }
                 }
                 else
                 {
                     value = exprObj.ToString();
                 }
                 element.SetAttribute("value", value);
             }
         }
     }
     if (null != PreElementLocatorCallback)
     {
         PreElementLocatorCallback.callback(agent);
     }
     if (null != ElementLocator)
     {
         HtmlElement element = ElementLocator.locate(agent);
         if (null != element)
         {
             element.InvokeMember(Method);
         }
     }
 }