Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 /// <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);
 }
Esempio n. 3
0
        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);
            }
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
 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));
     }
 }