Beispiel #1
0
        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));
            }
        }
Beispiel #2
0
 public DataEntry(WinCodecError error)
     : this("HRESULT", error)
 {
 }
Beispiel #3
0
 public DataEntry(WinCodecError error)
     : this("HRESULT", error)
 {
 }
Beispiel #4
0
 internal void CheckHRESULT(RuleBase parent, WinCodecError error, Exception e, params DataEntry[] de)
 {
     CheckHRESULT(parent, error, e, null, de);
 }
Beispiel #5
0
 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();
            }
        }
Beispiel #7
0
        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));
            }
        }
Beispiel #8
0
 internal void CheckHRESULT(RuleBase parent, WinCodecError error, Exception e, params DataEntry[] de)
 {
     CheckHRESULT(parent, error, e, null, de);
 }