public int NumeralVariant; //(Integer) The variant of the digit format to use. /// <summary> /// Constructor using all defaults for the style. /// </summary> public StyleInfo() { BColorLeft = BColorRight = BColorTop = BColorBottom = System.Drawing.Color.Black; // (Color) Color of the bottom border BStyleLeft = BStyleRight = BStyleTop = BStyleBottom = BorderStyleEnum.None; // _BorderWdith BWidthLeft = BWidthRight = BWidthTop = BWidthBottom = 1; BackgroundColor = System.Drawing.Color.Empty; BackgroundColorText = string.Empty; BackgroundGradientType = BackgroundGradientTypeEnum.None; BackgroundGradientEndColor = System.Drawing.Color.Empty; BackgroundImage = null; FontStyle = FontStyleEnum.Normal; _FontFamily = "Arial"; FontSize = 10; FontWeight = FontWeightEnum.Normal; TextDecoration = TextDecorationEnum.None; TextAlign = TextAlignEnum.General; VerticalAlign = VerticalAlignEnum.Top; Color = System.Drawing.Color.Black; ColorText = "Black"; PaddingLeft = PaddingRight = PaddingTop = PaddingBottom = 0; LineHeight = 0; Direction = DirectionEnum.LTR; WritingMode = WritingModeEnum.lr_tb; Language = "en-US"; UnicodeBiDirectional = UnicodeBiDirectionalEnum.Normal; Calendar = CalendarEnum.Gregorian; NumeralLanguage = Language; NumeralVariant = 1; }
/// <summary> /// Gets the enumerated font weight. /// </summary> /// <param name="v"></param> /// <param name="def"></param> /// <returns></returns> static public FontWeightEnum GetFontWeight(string v, FontWeightEnum def) { FontWeightEnum fw; try { fw = (FontWeightEnum)System.Enum.Parse(typeof(FontWeightEnum), ToUpperFirstLetter(v)); } catch { fw = def; } return(fw); }
/// <summary> /// Gets the enumerated font weight. /// </summary> /// <param name="v"></param> /// <param name="def"></param> /// <returns></returns> static public FontWeightEnum GetFontWeight(string v, FontWeightEnum def) { FontWeightEnum fw; switch (v.ToLower()) { case "Lighter": fw = FontWeightEnum.Lighter; break; case "Normal": fw = FontWeightEnum.Normal; break; case "bold": fw = FontWeightEnum.Bold; break; case "bolder": fw = FontWeightEnum.Bolder; break; case "500": fw = FontWeightEnum.W500; break; case "600": fw = FontWeightEnum.W600; break; case "700": fw = FontWeightEnum.W700; break; case "800": fw = FontWeightEnum.W800; break; case "900": fw = FontWeightEnum.W900; break; default: fw = def; break; } return(fw); }
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer) { if (untypedValue == null) { serializer.Serialize(writer, null); return; } FontWeightEnum value = (FontWeightEnum)untypedValue; switch (value) { case FontWeightEnum.Bold: serializer.Serialize(writer, "bold"); return; case FontWeightEnum.Bolder: serializer.Serialize(writer, "bolder"); return; case FontWeightEnum.Lighter: serializer.Serialize(writer, "lighter"); return; case FontWeightEnum.Normal: serializer.Serialize(writer, "normal"); return; } throw new Exception("Cannot marshal type PurpleFontWeight"); }
public int NumeralVariant; //(Integer) The variant of the digit format to use. /// <summary> /// Constructor using all defaults for the style. /// </summary> public StyleInfo() { BColorLeft = BColorRight = BColorTop = BColorBottom = System.Drawing.Color.Black; // (Color) Color of the bottom border BStyleLeft = BStyleRight = BStyleTop = BStyleBottom = BorderStyleEnum.None; // _BorderWdith BWidthLeft = BWidthRight = BWidthTop = BWidthBottom = 1; BackgroundColor = System.Drawing.Color.Empty; BackgroundColorText = string.Empty; BackgroundGradientType = BackgroundGradientTypeEnum.None; BackgroundGradientEndColor = System.Drawing.Color.Empty; BackgroundImage = null; FontStyle = FontStyleEnum.Normal; _FontFamily = "Arial"; //WRP 291008 numFmtId should be 0 (Zero) for General format - will be interpreted as a string //It has default values in Excel07 as per ECMA-376 standard (SEction 3.8.30) for Office Open XML Excel07 _Format = "General"; FontSize = 10; FontWeight = FontWeightEnum.Normal; PatternType = patternTypeEnum.None; TextDecoration = TextDecorationEnum.None; TextAlign = TextAlignEnum.General; VerticalAlign = VerticalAlignEnum.Top; Color = System.Drawing.Color.Black; ColorText = "Black"; PaddingLeft = PaddingRight = PaddingTop = PaddingBottom = 0; LineHeight = 0; Direction = DirectionEnum.LTR; WritingMode = WritingModeEnum.lr_tb; Language = "en-US"; UnicodeBiDirectional = UnicodeBiDirectionalEnum.Normal; Calendar = CalendarEnum.Gregorian; NumeralLanguage = Language; NumeralVariant = 1; }
public short ConvertFontWeight(FontWeightEnum weight) { switch (weight) { case FontWeightEnum.W100: return(100); case FontWeightEnum.W200: return(200); case FontWeightEnum.Lighter: case FontWeightEnum.W300: return(300); case FontWeightEnum.W500: return(500); case FontWeightEnum.W600: return(600); case FontWeightEnum.Bold: case FontWeightEnum.W700: return(700); case FontWeightEnum.W800: return(800); case FontWeightEnum.Bolder: case FontWeightEnum.W900: return(900); case FontWeightEnum.Normal: case FontWeightEnum.W400: default: return(400); } }
/// <summary> /// Gets the enumerated font weight. /// </summary> /// <param name="v"></param> /// <param name="def"></param> /// <returns></returns> static public FontWeightEnum GetFontWeight(string v, FontWeightEnum def) { FontWeightEnum fw; try { fw = (FontWeightEnum)System.Enum.Parse(typeof(FontWeightEnum), ToUpperFirstLetter(v)); } catch { fw = def; } return fw; }
public int NumeralVariant; //(Integer) The variant of the digit format to use. /// <summary> /// Constructor using all defaults for the style. /// </summary> public StyleInfo() { BColorLeft = BColorRight = BColorTop = BColorBottom = System.Drawing.Color.Black; // (Color) Color of the bottom border BStyleLeft = BStyleRight = BStyleTop = BStyleBottom = BorderStyleEnum.None; // _BorderWdith BWidthLeft = BWidthRight = BWidthTop = BWidthBottom = 1; BackgroundColor = System.Drawing.Color.Empty; BackgroundColorText = string.Empty; BackgroundGradientType = BackgroundGradientTypeEnum.None; BackgroundGradientEndColor = System.Drawing.Color.Empty; BackgroundImage = null; FontStyle = FontStyleEnum.Normal; _FontFamily = "Arial"; //WRP 291008 numFmtId should be 0 (Zero) for General format - will be interpreted as a string //It has default values in Excel07 as per ECMA-376 standard (SEction 3.8.30) for Office Open XML Excel07 _Format = "General"; FontSize = 10; FontWeight = FontWeightEnum.Normal; PatternType = patternTypeEnum.None; TextDecoration = TextDecorationEnum.None; TextAlign = TextAlignEnum.General; VerticalAlign = VerticalAlignEnum.Top; Color = System.Drawing.Color.Black; ColorText = "Black"; PaddingLeft = PaddingRight = PaddingTop = PaddingBottom = 0; LineHeight = 0; Direction = DirectionEnum.LTR; WritingMode = WritingModeEnum.lr_tb; Language = "en-US"; UnicodeBiDirectional = UnicodeBiDirectionalEnum.Normal; Calendar = CalendarEnum.Gregorian; NumeralLanguage = Language; NumeralVariant=1; }
/// <summary> /// Gets the enumerated font weight. /// </summary> /// <param name="v"></param> /// <param name="def"></param> /// <returns></returns> static public FontWeightEnum GetFontWeight(string v, FontWeightEnum def) { FontWeightEnum fw; switch(v.ToLower()) { case "Lighter": fw = FontWeightEnum.Lighter; break; case "Normal": fw = FontWeightEnum.Normal; break; case "bold": fw = FontWeightEnum.Bold; break; case "bolder": fw = FontWeightEnum.Bolder; break; case "500": fw = FontWeightEnum.W500; break; case "600": fw = FontWeightEnum.W600; break; case "700": fw = FontWeightEnum.W700; break; case "800": fw = FontWeightEnum.W800; break; case "900": fw = FontWeightEnum.W900; break; default: fw = def; break; } return fw; }
public int NumeralVariant; //(Integer) The variant of the digit format to use. /// <summary> /// Constructor using all defaults for the style. /// </summary> public StyleInfo() { BColorLeft = BColorRight = BColorTop = BColorBottom = System.Drawing.Color.Black; // (Color) Color of the bottom border BStyleLeft = BStyleRight = BStyleTop = BStyleBottom = BorderStyleEnum.None; // _BorderWdith BWidthLeft = BWidthRight = BWidthTop = BWidthBottom = 1; BackgroundColor = System.Drawing.Color.Empty; BackgroundGradientType = BackgroundGradientTypeEnum.None; BackgroundGradientEndColor = System.Drawing.Color.Empty; BackgroundImage = null; FontStyle = FontStyleEnum.Normal; _FontFamily = "Arial"; FontSize = 10; FontWeight = FontWeightEnum.Normal; TextDecoration = TextDecorationEnum.None; TextAlign = TextAlignEnum.Left; VerticalAlign = VerticalAlignEnum.Top; Color = System.Drawing.Color.Black; PaddingLeft = PaddingRight = PaddingTop = PaddingBottom = 0; LineHeight = 0; Direction = DirectionEnum.LTR; WritingMode = WritingModeEnum.lr_tb; Language = "en-US"; UnicodeBiDirectional = UnicodeBiDirectionalEnum.Normal; Calendar = CalendarEnum.Gregorian; NumeralLanguage = Language; NumeralVariant=1; }
public void SetFontWeight(FontWeightEnum weight) { fontWeight = weight; }