protected void setupExceptionWithType(ImageHelperErrorType type) { switch (type) { case ImageHelperErrorType.WatcherCreate: ErrorCode = 10; ErrorMessage = "Could not watch for MediaPortal screenshots."; break; case ImageHelperErrorType.WatcherEnable: ErrorCode = 11; ErrorMessage = "Error starting to watch for MediaPortal screenshots."; break; case ImageHelperErrorType.DirectoryCreate: ErrorCode = 20; ErrorMessage = "Could not create screenshot directory."; break; case ImageHelperErrorType.Timeout: ErrorCode = 30; ErrorMessage = "Timeout while waiting for MediaPortal to take the screenshot."; break; case ImageHelperErrorType.ScreenshotRead: ErrorCode = 40; ErrorMessage = "Could not read MediaPortal screenshot"; break; default: ErrorCode = 0; ErrorMessage = "An unexpected error occured."; break; } }
public ImageHelperError(ImageHelperErrorType type) { setupExceptionWithType(type); }