Exemplo n.º 1
0
        /// <summary>
        /// Creates a match-strings instruction and parses its content.
        /// </summary>
        /// <param name="xn">The XML repersentation of the instruction to be checked</param>
        /// <param name="con">The current context object</param>
        static MatchStrings CreateMatchStrings(XmlNode xn, Context con)
        {
            MatchStrings ms = new MatchStrings();

            ms.Of = XmlFiler.getAttribute(xn, "of");
            Logger.getOnly().isNotNull(ms.Of, "Match-strings instruction must have an 'of'.");
            Logger.getOnly().isTrue(ms.Of != "", "Match-strings instruction must have a non-empty 'of'.");
            ms.To = XmlFiler.getAttribute(xn, "to");
            Logger.getOnly().isNotNull(ms.To, "Match-strings instruction must have a 'to'.");
            Logger.getOnly().isTrue(ms.To != "", "Match-strings instruction must have a non-empty 'to'.");
            ms.Expect = XmlFiler.getAttribute(xn, "expect");
            ms.OnPass = XmlFiler.getAttribute(xn, "on-pass");
            ms.OnFail = XmlFiler.getAttribute(xn, "on-fail");
            string rest = XmlFiler.getAttribute(xn, "wait");

            if (rest != null)
            {
                ms.Rest = Convert.ToInt32(rest);
            }
            InterpretMessage(ms, xn.ChildNodes);
            AddInstruction(xn, ms, con);
            return(ms);
        }
Exemplo n.º 2
0
		/// <summary>
		/// Creates a match-strings instruction and parses its content.
		/// </summary>
		/// <param name="xn">The XML repersentation of the instruction to be checked</param>
		/// <param name="con">The current context object</param>
		static MatchStrings CreateMatchStrings(XmlNode xn, Context con)
		{
			MatchStrings ms = new MatchStrings();
			ms.Of = XmlFiler.getAttribute(xn, "of");
			Logger.getOnly().isNotNull(ms.Of, "Match-strings instruction must have an 'of'.");
			Logger.getOnly().isTrue(ms.Of != "", "Match-strings instruction must have a non-empty 'of'.");
			ms.To  = XmlFiler.getAttribute(xn, "to");
			Logger.getOnly().isNotNull(ms.To, "Match-strings instruction must have a 'to'.");
			Logger.getOnly().isTrue(ms.To != "", "Match-strings instruction must have a non-empty 'to'.");
			ms.Expect = XmlFiler.getAttribute(xn, "expect");
			ms.OnPass = XmlFiler.getAttribute(xn, "on-pass");
			ms.OnFail = XmlFiler.getAttribute(xn, "on-fail");
			string rest = XmlFiler.getAttribute(xn, "wait");
			if (rest != null) ms.Rest = Convert.ToInt32(rest);
			InterpretMessage(ms,xn.ChildNodes);
			AddInstruction(xn, ms, con);
			return ms;
		}