/// <summary> /// /// </summary> /// <param name="position"></param> ///<param name="ruleType"></param> /// <param name="topNode"></param> /// <param name="nameSpaceManager"></param> /// <returns></returns> public static XmlNode GetCfvoNodeByPosition( eExcelConditionalFormattingValueObjectPosition position, eExcelConditionalFormattingRuleType ruleType, XmlNode topNode, XmlNamespaceManager nameSpaceManager) { // Get the corresponding <cfvo> node (by the position) var node = topNode.SelectSingleNode( string.Format( "{0}[position()={1}]", // {0} ExcelConditionalFormattingConstants.Paths.Cfvo, // {1} ExcelConditionalFormattingValueObjectType.GetOrderByPosition(position, ruleType)), nameSpaceManager); if (node == null) { throw new Exception( ExcelConditionalFormattingConstants.Errors.MissingCfvoNode); } return(node); }
/****************************************************************************************/ #region Methods /// <summary> /// Get the node order (1, 2 ou 3) according to the Position (Low, Middle and High) /// and the Rule Type (TwoColorScale ou ThreeColorScale). /// </summary> /// <returns></returns> private int GetNodeOrder() { return(ExcelConditionalFormattingValueObjectType.GetOrderByPosition( Position, RuleType)); }