private static string[] InitFmlaErr() { Array ErrCodes = TCompactFramework.EnumGetValues(typeof(TFlxFormulaErrorValue)); string[] Result = new string[64]; //It should be the real number but... foreach (TFlxFormulaErrorValue ErrCode in ErrCodes) { Result[(int)ErrCode] = rm.GetString("fm" + ErrCode.ToString()); } return(Result); }
/// <summary> /// Creates a bitmap. /// </summary> /// <param name="height">Height of the bitmap in pixels.</param> /// <param name="width">Width of the bitmap in pixels.</param> /// <param name="aPixelFormat">Pixel Format.</param> /// <returns></returns> public static Bitmap CreateBitmap(int height, int width, PixelFormat aPixelFormat) { try { return(new Bitmap(height, width, aPixelFormat)); } catch (ArgumentException) { FlxMessages.ThrowException(FlxErr.ErrCreatingImage, height, width, TCompactFramework.EnumGetName(typeof(PixelFormat), aPixelFormat)); } return(null); }
internal static void CheckImgValid(ref byte[] data, ref TXlsImgType imgType, bool AllowBmp) { TXlsImgType bmp = AllowBmp ? TXlsImgType.Unknown : TXlsImgType.Bmp; if (imgType == TXlsImgType.Unknown || imgType == bmp || imgType == TXlsImgType.Gif || imgType == TXlsImgType.Tiff) //We will try to convert bmps to png. We can't on CF { data = TCompactFramework.ImgConvert(data, ref imgType); } if (imgType == TXlsImgType.Unknown || imgType == TXlsImgType.Gif || imgType == TXlsImgType.Tiff) { FlxMessages.ThrowException(FlxErr.ErrInvalidImage); } }
private static string[] InitFmlaToken() { Array Tokens = TCompactFramework.EnumGetValues(typeof(TFormulaToken)); string[] Result = new string[255]; foreach (TFormulaToken Token in Tokens) { string s = rm.GetString(Token.ToString()); if ((s.Length == 0)) { s = " "; //Xml resource does not save a single space! } Result[(int)Token] = s; } return(Result); }
private static Dictionary <string, TShapeType> CreateStringToShapeType() { Dictionary <string, TShapeType> Result = new Dictionary <string, TShapeType>(); foreach (TShapeType st in TCompactFramework.EnumGetValues(typeof(TShapeType))) { if (st == TShapeType.NotPrimitive) { continue; } if (FromShapeType.ContainsKey(st)) { Result.Add(FromShapeType[st], st); } } return(Result); }
private void CheckColorType(string PropName, TColorType aColorType) { if (aColorType != ColorType) { FlxMessages.ThrowException(FlxErr.ErrInvalidColorType, "TExcelColor." + PropName, TCompactFramework.EnumGetName(typeof(TColorType), ColorType), TCompactFramework.EnumGetName(typeof(TColorType), aColorType)); } }