internal void CheckHRESULT(RuleBase parent, WinCodecError error, Exception e, string param, params DataEntry[] de) { if (Marshal.GetHRForException(e) != (int)error) { string text = param == null?e.TargetSite.ToString(Resources._0_FailedWithIncorrectHRESULT) : e.TargetSite.ToString(Resources._0_FailedWithIncorrectHRESULT, param); Add(parent, text, de, new DataEntry(Resources.Actual, e), new DataEntry(Resources.Expected, error)); } }
public DataEntry(WinCodecError error) : this("HRESULT", error) { }
public DataEntry(WinCodecError error) : this("HRESULT", error) { }
internal void CheckHRESULT(RuleBase parent, WinCodecError error, Exception e, params DataEntry[] de) { CheckHRESULT(parent, error, e, null, de); }
void CheckGetBitmapSource(MainForm form, DataEntry[] de, Func<IWICBitmapSource> method, WinCodecError error) { IWICBitmapSource bs = null; try { bs = method(); } catch (Exception e) { form.CheckHRESULT(this, error, e, de); } finally { bs.ReleaseComObject(); } }
void CheckGetBitmapSource(MainForm form, DataEntry[] de, Func <IWICBitmapSource> method, WinCodecError error) { IWICBitmapSource bs = null; try { bs = method(); } catch (Exception e) { form.CheckHRESULT(this, error, e, de); } finally { bs.ReleaseComObject(); } }
internal void CheckHRESULT(RuleBase parent, WinCodecError error, Exception e, string param, params DataEntry[] de) { if (Marshal.GetHRForException(e) != (int)error) { string text = param == null ? e.TargetSite.ToString(Resources._0_FailedWithIncorrectHRESULT) : e.TargetSite.ToString(Resources._0_FailedWithIncorrectHRESULT, param); Add(parent, text, de, new DataEntry(Resources.Actual, e), new DataEntry(Resources.Expected, error)); } }
internal void CheckHRESULT(RuleBase parent, WinCodecError error, Exception e, params DataEntry[] de) { CheckHRESULT(parent, error, e, null, de); }