Пример #1
0
        /// <summary>
        /// Creates a doOnce context instruction.
        /// </summary>
        /// <param name="xn">The XML repersentation of the instruction to be checked</param>
        /// <param name="con">The current context object</param>
        static DoOnceContext CreateDoOnceContext(XmlNode xn, Context con)
        {
            string maxWait = XmlFiler.getAttribute(xn, "until");

//			Assert.IsTrue(maxWait == null || maxWait.Length == 0, "Do-Once context must have an until attribute.");

            Logger.getOnly().isNotNull(maxWait, "Do-Once context must have an until attribute.");
            Logger.getOnly().isTrue(maxWait != "", "Do-Once context must have a non-empty 'until' attribute.");

            DoOnceContext doOnce = new DoOnceContext(Convert.ToInt32(maxWait));

            doOnce.WaitingFor = XmlFiler.getAttribute(xn, "waiting-for");
            doOnce.OnPass     = XmlFiler.getAttribute(xn, "on-pass");
            doOnce.OnFail     = XmlFiler.getAttribute(xn, "on-fail");
            doOnce.ModelNode  = con.ModelNode;
            AddInstruction(xn, doOnce, con);

/*			foreach (XmlNode xnChild in xn.ChildNodes)
 *                      {
 *                              InterpretChild(xnChild, doOnce);
 *                      }
 */
            return(doOnce);
        }
Пример #2
0
		/// <summary>
		/// Creates a doOnce context instruction.
		/// </summary>
		/// <param name="xn">The XML repersentation of the instruction to be checked</param>
		/// <param name="con">The current context object</param>
		static DoOnceContext CreateDoOnceContext(XmlNode xn, Context con)
		{
			string maxWait = XmlFiler.getAttribute(xn, "until");
//			Assert.IsTrue(maxWait == null || maxWait.Length == 0, "Do-Once context must have an until attribute.");

			Logger.getOnly().isNotNull(maxWait, "Do-Once context must have an until attribute.");
			Logger.getOnly().isTrue(maxWait != "", "Do-Once context must have a non-empty 'until' attribute.");

			DoOnceContext doOnce = new DoOnceContext(Convert.ToInt32(maxWait));
			doOnce.WaitingFor = XmlFiler.getAttribute(xn, "waiting-for");
			doOnce.OnPass = XmlFiler.getAttribute(xn, "on-pass");
			doOnce.OnFail = XmlFiler.getAttribute(xn, "on-fail");
			doOnce.ModelNode = con.ModelNode;
			AddInstruction(xn, doOnce, con);
/*			foreach (XmlNode xnChild in xn.ChildNodes)
			{
				InterpretChild(xnChild, doOnce);
			}
*/
			return doOnce;
		}