private static bool CheckFilter(CXmlDriverParamRawNodes param, string filterXPath) { // check whether or not the item is implemented, // don't use VirtualNode here to reduce total time for parsing the control file string implemented = CXmlDriverParam.GetTopLevelAttributeValue_Inline(param, "Implemented"); if (implemented != null && !bool.Parse(implemented)) { return(false); } if (filterXPath == null) { return(true); } // execute xpath XElement tmp = param.Virtual.Element(filterXPath); bool res = tmp != null; return(res); }
// 'inline' implementation without using Virtual node for perf improvement (only for internal use) internal static string GetTopLevelAttributeValue_Inline(CXmlDriverParamRawNodes param, string attrName) { XAttribute attr = null; if (param.Variation != null) { attr = param.Variation.Attribute(attrName); } if (attr == null && param.TestCase != null) { attr = param.TestCase.Attribute(attrName); } if (attr == null && param.TestModule != null) { attr = param.TestModule.Attribute(attrName); } if (attr == null) { return(null); } return(attr.Value); }
internal CXmlDriverParam(CXmlDriverParamRawNodes rawNodes, string defaultSection) { _rawNodes = rawNodes; _defaultSection = defaultSection; }
internal CXmlDriverParamRawNodes_Variation(XElement variationNode, XElement virtualNode, CXmlDriverParamRawNodes parentParams) : base(variationNode, virtualNode, parentParams) { }
internal CXmlDriverParamRawNodes_TestCase(XElement testCaseNode, XElement virtualNode, CXmlDriverParamRawNodes parentParams) : base(testCaseNode, virtualNode, parentParams) { }
// 'inline' implementation without using Virtual node for perf improvement (only for internal use) internal static string GetTopLevelAttributeValue_Inline(CXmlDriverParamRawNodes param, string attrName) { XAttribute attr = null; if (param.Variation != null) attr = param.Variation.Attribute(attrName); if (attr == null && param.TestCase != null) attr = param.TestCase.Attribute(attrName); if (attr == null && param.TestModule != null) attr = param.TestModule.Attribute(attrName); if (attr == null) return null; return attr.Value; }
internal CXmlDriverParamRawNodes(XElement originalNode, XElement virtualNode, CXmlDriverParamRawNodes parentParams) { this.poriginalNode = originalNode; this.pvirtualNode = virtualNode; this.pparentParams = parentParams; }
private static bool CheckFilter(CXmlDriverParamRawNodes param, string filterXPath) { // check whether or not the item is implemented, // don't use VirtualNode here to reduce total time for parsing the control file string implemented = CXmlDriverParam.GetTopLevelAttributeValue_Inline(param, "Implemented"); if (implemented != null && !bool.Parse(implemented)) return false; if (filterXPath == null) return true; // execute xpath XElement tmp = param.Virtual.Element(filterXPath); bool res = tmp != null; return res; }