/// /// <summary> * Returns a list of element names matching the requested validity for the specified JDF version. /// * </summary> /// * <param name="EnumElementValidity"> elemValidity: requested validity </param> /// * <returns> VString: list of strings containing the names of the matching elements </returns> /// private VString conformingElements(EnumElementValidity elemValidity1, EnumElementValidity elemValidity2, EnumElementValidity elemValidity3, EnumElementValidity elemValidity4) { VString matchingElements = new VString(); IEnumerator iter = elementInfoTable.Keys.GetEnumerator(); long l2 = JDFVersions.getTheMask(version); long v2 = JDFVersions.getTheOffset(version); while (iter.MoveNext()) { string theKey = (string)iter.Current; ElemInfo ei = (ElemInfo)elementInfoTable[theKey]; long eiValStatus = ei.getElemValidityStatus() & l2; if (eiValStatus == ((long)elemValidity1.getValue() << (int)v2)) { matchingElements.Add(theKey); } else if (eiValStatus == ((long)elemValidity2.getValue() << (int)v2)) { matchingElements.Add(theKey); } else if (eiValStatus == ((long)elemValidity3.getValue() << (int)v2)) { matchingElements.Add(theKey); } else if (eiValStatus == ((long)elemValidity4.getValue() << (int)v2)) { matchingElements.Add(theKey); } } return(matchingElements); }
public virtual void testgetFirstLastVersion() { ElemInfo ai = new ElemInfo(0x44433211); Assert.AreEqual(EnumVersion.Version_1_2, ai.getFirstVersion(), ""); Assert.AreEqual(EnumVersion.Version_1_4, ai.getLastVersion(), ""); ai = new ElemInfo(0x33333222); Assert.AreEqual(EnumVersion.Version_1_0, ai.getFirstVersion(), ""); Assert.AreEqual(EnumVersion.Version_1_7, ai.getLastVersion(), ""); }