Namespace EasyXLS

Class ExcelCondition


  • public class ExcelCondition
    extends System.Object
    This class stores the condition of the conditional formatting information like type, operator, first and second formula, font, border and pattern style.
    • Constructor Summary

      Constructors 
      Constructor Description
      ExcelCondition()
      Defines an instance of the condition.
      ExcelCondition​(int nOperator, System.String firstFormula, System.String secondFormula)
      Defines an instance of the condition, having the specified operator and formula restrictions.
      ExcelCondition​(int nOperator, System.String firstFormula, System.String secondFormula, bool isBold, bool isItalic, System.Drawing.Color foreground)
      Defines an instance of the condition, having the specified operator, formula restrictions and font settings.
      ExcelCondition​(int nOperator, System.String firstFormula, System.String secondFormula, bool isBold, bool isItalic, System.Drawing.Color foreground, System.Drawing.Color background)
      Defines an instance of the condition, having the specified operator, formula restrictions, font settings and background.
      ExcelCondition​(int nOperator, System.String firstFormula, System.String secondFormula, System.Drawing.Color background)
      Defines an instance of the condition, having the specified operator, formula restrictions and background.
    • Constructor Detail

      • ExcelCondition

        public ExcelCondition()
        Defines an instance of the condition.
      • ExcelCondition

        public ExcelCondition​(int nOperator,
                              System.String firstFormula,
                              System.String secondFormula)
        Defines an instance of the condition, having the specified operator and formula restrictions.
        Parameters:
        nOperator - the conditional formatting operator. Possible values are available in ConditionalFormatting class.
        firstFormula - the conditional formatting first formula
        secondFormula - the conditional formatting second formula
      • ExcelCondition

        public ExcelCondition​(int nOperator,
                              System.String firstFormula,
                              System.String secondFormula,
                              System.Drawing.Color background)
        Defines an instance of the condition, having the specified operator, formula restrictions and background.
        Parameters:
        nOperator - the conditional formatting operator. Possible values are available in ConditionalFormatting class.
        firstFormula - the conditional formatting first formula
        secondFormula - the conditional formatting second formula
        background - the color of the conditional formatting background
      • ExcelCondition

        public ExcelCondition​(int nOperator,
                              System.String firstFormula,
                              System.String secondFormula,
                              bool isBold,
                              bool isItalic,
                              System.Drawing.Color foreground)
        Defines an instance of the condition, having the specified operator, formula restrictions and font settings.
        Parameters:
        nOperator - the conditional formatting operator. Possible values are available in ConditionalFormatting class.
        firstFormula - the conditional formatting first formula
        secondFormula - the conditional formatting second formula
        isBold - the bold setting of the conditional formatting font
        isItalic - the italic setting of the conditional formatting font
        foreground - the foreground of the conditional formatting font
      • ExcelCondition

        public ExcelCondition​(int nOperator,
                              System.String firstFormula,
                              System.String secondFormula,
                              bool isBold,
                              bool isItalic,
                              System.Drawing.Color foreground,
                              System.Drawing.Color background)
        Defines an instance of the condition, having the specified operator, formula restrictions, font settings and background.
        Parameters:
        nOperator - the conditional formatting operator. Possible values are available in ConditionalFormatting class.
        firstFormula - the conditional formatting first formula
        secondFormula - the conditional formatting second formula
        isBold - the bold setting of the conditional formatting font
        isItalic - the italic setting of the conditional formatting font
        foreground - the foreground of the conditional formatting font
        background - the color of the conditional formatting background
    • Method Detail

      • IsFontUnderlineModified

        public bool IsFontUnderlineModified()
        Returns true if the condition modifies the underline property of the cell font, false otherwise.
        Returns:
        true if the condition modifies the underline property of the cell font, false otherwise
        See Also:
        setUnderlineStyle(int), getUnderlineStyle()
      • IsFontBoldItalicModified

        public bool IsFontBoldItalicModified()
        Returns true if the condition modifies the style property of the cell font, false otherwise.
        Returns:
        true if the condition modifies the style property of the cell font, false otherwise
        See Also:
        setBold(bool), IsBold(), setItalic(bool), IsItalic()
      • IsFontStrikethroughModified

        public bool IsFontStrikethroughModified()
        Returns true if the condition modifies the strikethrough property of the cell font, false otherwise.
        Returns:
        true if the condition modifies the strikethrough property of the cell font, false otherwise
        See Also:
        setStrikethrough(bool), IsStrikethrough()
      • IsFontColorModified

        public bool IsFontColorModified()
        Returns true if the condition modifies the color of the cell font, false otherwise.
        Returns:
        true if the condition modifies the color of the cell font, false otherwise
        See Also:
        setForeground(System.Drawing.Color), getForeground()
      • clearFontSettings

        public void clearFontSettings()
        Removes all the font settings.
      • clearBorderSettings

        public void clearBorderSettings()
        Removes all the border settings.
      • IsBackgroundModified

        public bool IsBackgroundModified()
        Returns true if the condition modifies the background of the cell font, false otherwise.
        Returns:
        true if the condition modifies the background of the cell font, false otherwise
        See Also:
        setBackground(System.Drawing.Color), getBackground()
      • clearBackgroundSettings

        public void clearBackgroundSettings()
        Removes all the background settings.
      • ContainsFontFormatting

        public bool ContainsFontFormatting()
        Internal use only
      • ContainsPatternFormatting

        public bool ContainsPatternFormatting()
        Internal use only
      • ContainsBorderFormatting

        public bool ContainsBorderFormatting()
        Internal use only
      • getConditionType

        public int getConditionType()
        Returns the conditional formatting type. Possible values are available in ConditionalFormatting class.
        Returns:
        the conditional formatting type
        See Also:
        setConditionType(int)
      • setConditionType

        public void setConditionType​(int type)
        Sets the conditional formatting type. Possible values are available in ConditionalFormatting class.
        Parameters:
        type - the conditional formatting type
        See Also:
        getConditionType()
      • getOperator

        public int getOperator()
        Returns the conditional formatting operator. Possible values are available in ConditionalFormatting class.
        Returns:
        the conditional formatting operator
        See Also:
        setOperator(int)
      • setOperator

        public void setOperator​(int nOperator)
        Sets the conditional formatting operator. Possible values are available in ConditionalFormatting class.
        Parameters:
        nOperator - the conditional formatting operator
        See Also:
        getOperator()
      • getForeground

        public System.Drawing.Color getForeground()
        Returns the foreground of the conditional formatting font.
        Returns:
        the foreground of the conditional formatting font
        See Also:
        setForeground(Color), IsFontColorModified()
      • setForeground

        public void setForeground​(System.Drawing.Color color)
        Sets the foreground of the conditional formatting font.
        Parameters:
        color - the foreground of the conditional formatting font
        See Also:
        getForeground(), IsFontColorModified()
      • IsBold

        public bool IsBold()
        Returns the bold setting of the conditional formatting font.
        Returns:
        the bold setting of the conditional formatting font
        See Also:
        setBold(bool), IsFontBoldItalicModified()
      • setBold

        public void setBold​(bool isBold)
        Sets the bold setting of the conditional formatting font.
        Parameters:
        isBold - the bold setting of the conditional formatting font
        See Also:
        IsBold(), IsFontBoldItalicModified()
      • IsItalic

        public bool IsItalic()
        Returns the italic setting of the conditional formatting font.
        Returns:
        the italic setting of the conditional formatting font
        See Also:
        setItalic(bool), IsFontBoldItalicModified()
      • setItalic

        public void setItalic​(bool isItalic)
        Sets the italic setting of the conditional formatting font.
        Parameters:
        isItalic - the italic setting of the conditional formatting font
        See Also:
        IsItalic(), IsFontBoldItalicModified()
      • setStrikethrough

        public void setStrikethrough​(bool isStrikethrough)
        Sets the strikethrough setting of the conditional formatting font.
        Parameters:
        isStrikethrough - the strikethrough setting of the conditional formatting font
        See Also:
        IsStrikethrough(), IsFontStrikethroughModified()
      • setUnderlineStyle

        public void setUnderlineStyle​(int underlineStyle)
        Sets the underline style of the conditional formatting font. Possible values are available in FontSettings
        Parameters:
        underlineStyle - the underline style of the conditional formatting font
        See Also:
        getUnderlineStyle(), IsFontUnderlineModified()
      • getTopStyle_Border

        public int getTopStyle_Border()
        Returns the style of the conditional formatting top border. Possible values are available in Border class.
        Returns:
        the style of the conditional formatting top border
        See Also:
        setTopStyle_Border(int)
      • setTopStyle_Border

        public void setTopStyle_Border​(int borderStyle)
        Sets the style of the conditional formatting top border. Possible values are available in Border class.
        Parameters:
        borderStyle - the style of the conditional formatting top border
        See Also:
        getTopStyle_Border()
      • getBottomStyle_Border

        public int getBottomStyle_Border()
        Returns the style of the conditional formatting bottom border. Possible values are available in Border class.
        Returns:
        the style of the conditional formatting bottom border
        See Also:
        setBottomStyle_Border(int)
      • setBottomStyle_Border

        public void setBottomStyle_Border​(int borderStyle)
        Sets the style of the conditional formatting bottom border. Possible values are available in Border class.
        Parameters:
        borderStyle - the style of the conditional formatting bottom border
        See Also:
        getBottomStyle_Border()
      • getLeftStyle_Border

        public int getLeftStyle_Border()
        Returns the style of the conditional formatting left border. Possible values are available in Border class.
        Returns:
        the style of the conditional formatting left border
        See Also:
        setLeftStyle_Border(int)
      • setLeftStyle_Border

        public void setLeftStyle_Border​(int borderStyle)
        Sets the style of the conditional formatting left border. Possible values are available in Border class.
        Parameters:
        borderStyle - the style of the conditional formatting left border
        See Also:
        getLeftStyle_Border()
      • getRightStyle_Border

        public int getRightStyle_Border()
        Returns the style of the conditional formatting right border. Possible values are available in Border class.
        Returns:
        the style of the conditional formatting right border
        See Also:
        setRightStyle_Border(int)
      • setRightStyle_Border

        public void setRightStyle_Border​(int borderStyle)
        Sets the style of the conditional formatting right border. Possible values are available in Border class.
        Parameters:
        borderStyle - the style of the conditional formatting right border
        See Also:
        getRightStyle_Border()
      • setBorderColors

        public void setBorderColors​(System.Drawing.Color borderTop,
                                    System.Drawing.Color borderBottom,
                                    System.Drawing.Color borderLeft,
                                    System.Drawing.Color borderRight)
        Sets the color of the conditional formatting borders.
        Parameters:
        borderTop - the color of the conditional formatting top border
        borderBottom - the color of the conditional formatting bottom border
        borderLeft - the color of the conditional formatting left border
        borderRight - the color of the conditional formatting right border
        See Also:
        getTopColor_Border(), getBottomColor_Border(), getLeftColor_Border(), getRightColor_Border(), setBorderStyles(int, int, int, int)
      • getTopColor_Border

        public System.Drawing.Color getTopColor_Border()
        Returns the color of the conditional formatting top border.
        Returns:
        the color of the conditional formatting top border
        See Also:
        setTopColor_Border(Color)
      • getTopThemeColor_Border

        public ThemeColor getTopThemeColor_Border()
        Returns the color of the conditional formatting top border.
        Returns:
        the color of the conditional formatting top border
        See Also:
        setTopColor_Border(ThemeColor)
      • setTopColor_Border

        public void setTopColor_Border​(System.Drawing.Color color)
        Sets the color of the conditional formatting top border.
        Parameters:
        color - the color of the conditional formatting top border
        See Also:
        getTopColor_Border()
      • setTopColor_Border

        public void setTopColor_Border​(ThemeColor themeColor)
        Sets the color of the conditional formatting top border.
        Parameters:
        themeColor - the color of the conditional formatting top border
        See Also:
        getTopColor_Border()
      • getBottomColor_Border

        public System.Drawing.Color getBottomColor_Border()
        Returns the color of the conditional formatting bottom border.
        Returns:
        the color of the conditional formatting bottom border
        See Also:
        setBottomColor_Border(Color)
      • getBottomThemeColor_Border

        public ThemeColor getBottomThemeColor_Border()
        Returns the color of the conditional formatting bottom border.
        Returns:
        the color of the conditional formatting bottom border
        See Also:
        setBottomColor_Border(ThemeColor)
      • setBottomColor_Border

        public void setBottomColor_Border​(System.Drawing.Color color)
        Sets the color of the conditional formatting bottom border.
        Parameters:
        color - the color of the conditional formatting bottom border
        See Also:
        getBottomColor_Border()
      • setBottomColor_Border

        public void setBottomColor_Border​(ThemeColor themeColor)
        Sets the color of the conditional formatting bottom border.
        Parameters:
        themeColor - the color of the conditional formatting bottom border
        See Also:
        getBottomThemeColor_Border()
      • getLeftColor_Border

        public System.Drawing.Color getLeftColor_Border()
        Returns the color of the conditional formatting left border.
        Returns:
        the color of the conditional formatting left border
        See Also:
        setLeftColor_Border(Color)
      • getLeftThemeColor_Border

        public ThemeColor getLeftThemeColor_Border()
        Returns the color of the conditional formatting left border.
        Returns:
        the color of the conditional formatting left border
        See Also:
        setLeftColor_Border(ThemeColor)
      • setLeftColor_Border

        public void setLeftColor_Border​(System.Drawing.Color color)
        Sets the color of the conditional formatting left border.
        Parameters:
        color - the color of the conditional formatting left border
        See Also:
        getLeftColor_Border()
      • setLeftColor_Border

        public void setLeftColor_Border​(ThemeColor themeColor)
        Sets the color of the conditional formatting left border.
        Parameters:
        themeColor - the color of the conditional formatting left border
        See Also:
        getLeftThemeColor_Border()
      • getRightColor_Border

        public System.Drawing.Color getRightColor_Border()
        Returns the color of the conditional formatting right border.
        Returns:
        the color of the conditional formatting right border
        See Also:
        setRightColor_Border(Color)
      • getRightThemeColor_Border

        public ThemeColor getRightThemeColor_Border()
        Returns the color of the conditional formatting right border.
        Returns:
        the color of the conditional formatting right border
        See Also:
        setRightColor_Border(ThemeColor)
      • setRightColor_Border

        public void setRightColor_Border​(System.Drawing.Color color)
        Sets the color of the conditional formatting right border.
        Parameters:
        color - the color of the conditional formatting right border
        See Also:
        getRightColor_Border()
      • setRightColor_Border

        public void setRightColor_Border​(ThemeColor themeColor)
        Sets the color of the conditional formatting right border.
        Parameters:
        themeColor - the color of the conditional formatting right border
        See Also:
        getRightThemeColor_Border()
      • getBackground

        public System.Drawing.Color getBackground()
        Returns the color of the conditional formatting background.
        Returns:
        the color of the conditional formatting background
        See Also:
        setBackground(Color), IsBackgroundModified()
      • setBackground

        public void setBackground​(System.Drawing.Color color)
        Sets the color of the conditional formatting background.
        Parameters:
        color - the color of the conditional formatting background
        See Also:
        getBackground(), IsBackgroundModified()
      • Clone

        public ExcelCondition Clone()
        Creates and returns a copy of this object.
        Returns:
        a clone of this instance.