public static int TranslateStyle(StyleAttributeNames styleName, string styleString, IErrorContext errorContext, bool isChartStyle)
        {
            switch (styleName)
            {
            case StyleAttributeNames.BorderStyle:
            case StyleAttributeNames.BorderStyleTop:
            case StyleAttributeNames.BorderStyleLeft:
            case StyleAttributeNames.BorderStyleRight:
            case StyleAttributeNames.BorderStyleBottom:
                return((int)StyleTranslator.TranslateBorderStyle(styleString, errorContext));

            case StyleAttributeNames.BackgroundGradientType:
                return((int)StyleTranslator.TranslateBackgroundGradientType(styleString, errorContext));

            case StyleAttributeNames.BackgroundImageRepeat:
                return((int)StyleTranslator.TranslateBackgroundRepeat(styleString, errorContext, isChartStyle));

            case StyleAttributeNames.FontStyle:
                return((int)StyleTranslator.TranslateFontStyle(styleString, errorContext));

            case StyleAttributeNames.FontWeight:
                return((int)StyleTranslator.TranslateFontWeight(styleString, errorContext));

            case StyleAttributeNames.TextDecoration:
                return((int)StyleTranslator.TranslateTextDecoration(styleString, errorContext));

            case StyleAttributeNames.TextAlign:
                return((int)StyleTranslator.TranslateTextAlign(styleString, errorContext));

            case StyleAttributeNames.VerticalAlign:
                return((int)StyleTranslator.TranslateVerticalAlign(styleString, errorContext));

            case StyleAttributeNames.Direction:
                return((int)StyleTranslator.TranslateDirection(styleString, errorContext));

            case StyleAttributeNames.WritingMode:
                return((int)StyleTranslator.TranslateWritingMode(styleString, errorContext));

            case StyleAttributeNames.UnicodeBiDi:
                return((int)StyleTranslator.TranslateUnicodeBiDi(styleString, errorContext));

            case StyleAttributeNames.Calendar:
                return((int)StyleTranslator.TranslateCalendar(styleString, errorContext));

            case StyleAttributeNames.TextEffect:
                return((int)StyleTranslator.TranslateTextEffect(styleString, errorContext, isChartStyle));

            case StyleAttributeNames.BackgroundHatchType:
                return((int)StyleTranslator.TranslateBackgroundHatchType(styleString, errorContext, isChartStyle));

            case StyleAttributeNames.Position:
                return((int)StyleTranslator.TranslatePosition(styleString, errorContext, isChartStyle));

            default:
                throw new NotImplementedException("cannot translate style: " + styleName.ToString());
            }
        }