protected override void RunOverride(MainForm form, object tag) { bool info2Supported = false; IWICImagingFactory factory = (IWICImagingFactory) new WICImagingFactory(); IWICPixelFormatInfo2 info = null; try { info = factory.CreateComponentInfo(Parent.Clsid) as IWICPixelFormatInfo2; info2Supported = info != null; } finally { info.ReleaseComObject(); factory.ReleaseComObject(); } if (info2Supported) { ComponentInfoHelper.Check <IWICPixelFormatInfo2, object>(form, Parent.Clsid, Check, tag, this, false); } else { ComponentInfoHelper.Check <IWICPixelFormatInfo, object>(form, Parent.Clsid, Check, tag, this, false); } }
void Check(MainForm form, IWICPixelFormatInfo2 info, object tag) { if (info.GetNumericRepresentation() == WICPixelFormatNumericRepresentation.WICPixelFormatNumericRepresentationUnspecified) { form.Add(this, Resources.NoNumericRepresention); } Check(form, info as IWICPixelFormatInfo, tag); }