/// <summary> /// <para> /// Disposes of the resources (other than memory) used by the /// <see cref='System.Web.UI.Design.MobileControls.ListDesigner'/>. /// </para> /// </summary> /// <remarks> /// <para> /// Call <see langword='Dispose'/> when /// you are finished using the <see cref='System.Web.UI.Design.MobileControls.ListDesigner'/>. The <see langword='Dispose'/> method leaves the <see cref='System.Web.UI.Design.WebControls.DataListDesigner'/> in an unusable state. After /// calling <see langword='Dispose'/>, you must release all /// references to the <see cref='System.Web.UI.Design.MobileControls.ListDesigner'/> so the memory it was occupying /// can be reclaimed by garbage collection. /// </para> /// <note type="note"> /// Always call <see langword='Dispose'/> before you release your last reference to /// the <see cref='System.Web.UI.Design.MobileControls.ListDesigner'/>. Otherwise, the resources /// the <see cref='System.Web.UI.Design.MobileControls.ListDesigner'/> is using will not be freed /// until garbage collection calls the <see cref='System.Web.UI.Design.MobileControls.ListDesigner'/> object's /// destructor. /// </note> /// </remarks> /// <seealso cref='System.ComponentModel.Design.IDesigner'/> protected override void Dispose(bool disposing) { if (disposing && _tempBmpFile != null) { _tempBmpFile.Dispose(); _cachedWbmpUri = null; _tempBmpFile = null; } base.Dispose(disposing); }
private String GetConvertedImageURI(String imageUriString) { Uri baseUri = new Uri(BaseUrl); Uri imageUri = new Uri(baseUri, imageUriString); String extension = Path.GetExtension(imageUriString); if (extension.Equals(".wbmp")) { if (_tempBmpFile != null) { if (_cachedWbmpUri != null && _cachedWbmpUri.Equals(imageUri)) { return(_tempBmpFile.Url); } else { _tempBmpFile.Dispose(); _tempBmpFile = null; _cachedWbmpUri = null; } } Byte[] buffer = FileReader.Read(imageUri); if (buffer == null) { // Could not read image from URI, return original URI to // Trident and let it render as a broken image. goto ConversionError; } Bitmap bitmap = WbmpConverter.Convert(buffer); if (bitmap == null) { // .wbmp appears to be corrupt, return original URI to // Trident and let it render as a broken image. goto ConversionError; } _tempBmpFile = new TemporaryBitmapFile(bitmap); imageUriString = _tempBmpFile.Url; _cachedWbmpUri = imageUri; } ConversionError: return(imageUriString); }