private VideoUrlParseResult(VideoUrlParseResultType resultType, string url, VideoParseException exception) { ResultType = resultType; Url = url; Exception = exception ?? GetException(resultType, url); }
public static VideoParseException GetException(VideoUrlParseResultType resultType, string url) { switch (resultType) { case VideoUrlParseResultType.NoMatcher: return(new VideoParseException(string.Format("No matcher defined (url {0})", url))); case VideoUrlParseResultType.LoadError: return(new VideoParseException(string.Format("Unable to load metadata (url {0})", url))); case VideoUrlParseResultType.Duplicate: return(new VideoParseException(string.Format("Duplicate entry (url {0})", url))); case VideoUrlParseResultType.OtherError: return(new VideoParseException(string.Format("Unable to process PV link (url {0})", url))); default: return(null); } }
public static VideoParseException GetException(VideoUrlParseResultType resultType, string url) { switch (resultType) { case VideoUrlParseResultType.NoMatcher: return new VideoParseException(string.Format("No matcher defined (url {0})", url)); case VideoUrlParseResultType.LoadError: return new VideoParseException(string.Format("Unable to load metadata (url {0})", url)); case VideoUrlParseResultType.Duplicate: return new VideoParseException(string.Format("Duplicate entry (url {0})", url)); case VideoUrlParseResultType.OtherError: return new VideoParseException(string.Format("Unable to process PV link (url {0})", url)); default: return null; } }
public static VideoUrlParseResult CreateError(string url, VideoUrlParseResultType resultType, string message) { return(CreateError(url, resultType, new VideoParseException(message))); }
public static VideoUrlParseResult CreateError(string url, VideoUrlParseResultType resultType, VideoParseException exception = null) { return(new VideoUrlParseResult(resultType, url, exception)); }
public static VideoParseException GetException(VideoUrlParseResultType resultType, string url) => resultType switch {
public static VideoUrlParseResult CreateError(string url, VideoUrlParseResultType resultType, string message) { return CreateError(url, resultType, new VideoParseException(message)); }
public static VideoUrlParseResult CreateError(string url, VideoUrlParseResultType resultType, VideoParseException exception = null) { return new VideoUrlParseResult(resultType, url, exception); }