ImageGlass.ImageBox.GetImageSize C# (CSharp) Method

GetImageSize() private method

Gets the size of the image.
If an error occurs, for example due to the image being disposed, an empty size is returned
private GetImageSize ( ) : Size
return System.Drawing.Size
        private Size GetImageSize()
        {
            Size result;

            // HACK: This whole thing stinks. Hey MS, how about an IsDisposed property for images?

            if (Image != null)
            {
                try
                {
                    result = Image.Size;
                }
                catch
                {
                    result = Size.Empty;
                }
            }
            else
            {
                result = Size.Empty;
            }

            return result;
        }
ImageBox