Beispiel #1
0
 internal static readonly ResourceManager rm = new ResourceManager("FlexCel.XlsAdapter.xlsmsg", Assembly.GetExecutingAssembly()); //STATIC*
 public static string GetString(XlsErr ResName, params object[] args)
 {
     if (args.Length == 0)
     {
         return(rm.GetString(ResName.ToString()));                            //To test without args
     }
     return(String.Format(rm.GetString(ResName.ToString()), args));
 }
Beispiel #2
0
 private static void MoveOne(ref int r, int Delta, int MaxAll, XlsErr ErrorWhenTooMany)
 {
     r += Delta;
     if (r > MaxAll)
     {
         XlsMessages.ThrowException(ErrorWhenTooMany, r + 1, MaxAll + 1);
     }
 }
Beispiel #3
0
        private void InitState(XlsErr aErrorCode)
        {
            FState.ErrorCode = aErrorCode;
#if (FRAMEWORK40)
            SerializeObjectState += delegate(object exception,
                                             SafeSerializationEventArgs eventArgs)
            {
                eventArgs.AddSerializedState(FState);
            };
#endif
        }
Beispiel #4
0
 /// <summary>
 /// Creates a new FlexCelXlsAdapterException with an error message and an exception code.
 /// </summary>
 /// <param name="message">Error Message</param>
 /// <param name="aErrorCode">Error code of the exception.</param>
 public FlexCelXlsAdapterException(string message, XlsErr aErrorCode) : base(message)
 {
     InitState(aErrorCode);
 }
Beispiel #5
0
 public static void ThrowException(XlsErr ResName, params object[] args)
 {
     throw new FlexCelXlsAdapterException(GetString(ResName, args), ResName);
 }
Beispiel #6
0
 private static void InsertFirst(ref int First, int MaxRange, int MaxAll, int RangeCount, int aRowCount, XlsErr ErrorWhenTooMany)
 {
     if (First >= MaxRange)
     {
         First += RangeCount * aRowCount;
         if (First > MaxAll)
         {
             XlsMessages.ThrowException(ErrorWhenTooMany, First + 1, MaxAll + 1);
         }
     }
 }