ImageMagick.MagickExceptionHelper.IsError C# (CSharp) Метод

IsError() публичный статический Метод

public static IsError ( MagickException exception ) : bool
exception MagickException
Результат bool
    public static bool IsError(MagickException exception)
    {
      if (exception == null)
        return false;

      return exception is MagickErrorException;
    }
  }

Usage Example

Пример #1
0
            public IntPtr Smush(IMagickImage image, int offset, bool stack)
            {
                IntPtr exception = IntPtr.Zero;
                IntPtr result;

                #if PLATFORM_AnyCPU
                if (NativeLibrary.Is64Bit)
                #endif
                #if PLATFORM_x64 || PLATFORM_AnyCPU
                result = NativeMethods.X64.MagickImageCollection_Smush(image.GetInstance(), (IntPtr)offset, stack, out exception);
                #endif
                #if PLATFORM_AnyCPU
                else
                #endif
                #if PLATFORM_x86 || PLATFORM_AnyCPU
                result = NativeMethods.X86.MagickImageCollection_Smush(image.GetInstance(), (IntPtr)offset, stack, out exception);
                #endif
                MagickException magickException = MagickExceptionHelper.Create(exception);
                if (MagickExceptionHelper.IsError(magickException))
                {
                    if (result != IntPtr.Zero)
                    {
                        Dispose(result);
                    }
                    throw magickException;
                }
                RaiseWarning(magickException);
                return(result);
            }
All Usage Examples Of ImageMagick.MagickExceptionHelper::IsError