예제 #1
0
 ///
 ///	 <summary> * set the value of the family name to true
 ///	 *  </summary>
 ///	 * <param name="family"> </param>
 ///
 public virtual void setFamily(EnumFamily family)
 {
     if (family == null || EnumFamily.Response.Equals(family))
     {
         throw new JDFException("setFamily: illegal family:" + family);
     }
     setAttribute(family.getName(), true, null);
 }
예제 #2
0
파일: JDFJMF.cs 프로젝트: cip4/JDFLibNet
        ///
        ///	 <summary> * create a new response for all messages of this if the message is any message except response correctly fills
        ///	 * refId, type etc.
        ///	 *  </summary>
        ///	 * <returns> the newly created JMF with multiple responses </returns>
        ///
        public virtual JDFJMF createResponse()
        {
            VElement v   = getMessageVector(null, null);
            JDFJMF   jmf = new JDFDoc("JMF").getJMFRoot();

            for (int i = 0; i < v.Count; i++)
            {
                JDFMessage m      = (JDFMessage)v[i];
                EnumFamily family = m.getFamily();
                if (family != null && EnumFamily.Response != family && EnumFamily.Acknowledge != family)
                {
                    if (!m.hasAttribute(AttributeName.ID)) // in case someone sends
                    // crappy requests...
                    {
                        m.appendAnchor(null);
                    }
                    JDFResponse r = jmf.appendResponse();
                    r.setQuery(m);
                }
            }
            return(jmf);
        }