Пример #1
0
 /// <summary>
 /// sets the content of the object from a cBaseXL object
 /// if object contains more than one trace data first one will be used for instantitaion
 /// </summary>
 /// <param name="traceXML">cbaseXML object contaning one trace point data</param>
 private void SetFromXML(cBaseXML traceXML)
 {
     try
     {
         SetFromInnerText(traceXML.NodeData(TracePoint.thetag));
     }
     catch { }
 }
Пример #2
0
 /// <summary>
 /// Loads from an string containing all tags representing
 /// </summary>
 /// <param name="strXML"></param>
 /// <returns></returns>
 private bool fromXML(string strXML)
 {
     try
     {
         cBaseXML inXML = new cBaseXML(strXML);
         // get task info
         this.task_id = inXML.NodeData(tags[(int)TagNames.TaskID]);
         // get shape
         this.shape = (TaskShapes)GetShape(inXML.NodeData(tags[(int)TagNames.Shape]));
         // get back color
         this.back_color = GetColor(inXML.NodeData(tags[(int)TagNames.BackColor]));
         // get border color
         this.border_color = GetColor(inXML.NodeData(tags[(int)TagNames.BorderColor]));
         // get target location
         this.target_location = GetPoint(inXML.NodeData(tags[(int)TagNames.TargetLocation]));
         // get cursor location
         this.cursor_location = GetPoint(inXML.NodeData(tags[(int)TagNames.CursorLocation]));
         // get cursor location
         this.target_size = GetSize(inXML.NodeData(tags[(int)TagNames.TargetSize]));
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Пример #3
0
 /// <summary>
 /// Loads from an string containing all tags representing
 /// </summary>
 /// <param name="strXML"></param>
 /// <returns></returns>
 private bool fromXML(string strXML)
 {
     try
     {
         cBaseXML inXML = new cBaseXML(strXML);
         // get the user info
         this.user_id = inXML.NodeData(tags[(int)TagNames.User]);
         // get task id
         this.task_id = inXML.NodeData(tags[(int)TagNames.TaskID]);
         // get input device
         this.input_device = GetDevice(inXML.NodeData(tags[(int)TagNames.InputDevice]));
         // get screen resolution
         this.test_screen = GetScreenSize(inXML.NodeData(tags[(int)TagNames.TestScreenResolution]));
         // get if test completed
         this.test_completed = Convert.ToBoolean(inXML.NodeData(tags[(int)TagNames.TestCompleted]));
         // finally get all the mouse trace points
         cBaseXML   trcXML = new cBaseXML(inXML.NodeData(tags[(int)TagNames.MouseTrail]));
         string     trc    = "notyet";
         TracePoint tp;
         do
         {
             // update trace
             trc = trcXML.NodeData(TracePoint.TheTag);
             if (trc != "")
             {
                 tp = new TracePoint(trc);
                 this.AddTracePoint(tp);
                 trcXML.Remove(TracePoint.TheTag);
             }
         } while (trc != "");
         return(true);
     }
     catch
     {
         return(false);
     }
 }