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)); }
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); } }
private void InitState(XlsErr aErrorCode) { FState.ErrorCode = aErrorCode; #if (FRAMEWORK40) SerializeObjectState += delegate(object exception, SafeSerializationEventArgs eventArgs) { eventArgs.AddSerializedState(FState); }; #endif }
/// <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); }
public static void ThrowException(XlsErr ResName, params object[] args) { throw new FlexCelXlsAdapterException(GetString(ResName, args), ResName); }
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); } } }