[Mono-dev] Implementation of SetPropertyItem

Alan alan.mcgovern at gmail.com
Wed Nov 24 10:42:51 EST 2010


Simplest thing to do is run a "git blame" on the file and see when the
lines were changed last. The code was commented out in rev  83c90e2.
The commit message is:

    Image.cs: throw NotImplementedException in SetPropertyItem instead
of executing broken code. See #406307 for test case.

So check out http://bugzilla.novell.com for that bug number and you'll
see why the code is disabled.

Alan.

On Tue, Nov 23, 2010 at 6:41 PM, Patrick Kowalzick
<patrick.kowalzick at web.de> wrote:
> Dear List,
>
> I found that System.Drawing.Image::SetPropertyItem throws a
> NotImplementedException.
>
> The code from
> <https://github.com/mono/mono/blob/master/mcs/class/System.Drawing/System.Drawing/Image.cs>
> looks like
>
> public void SetPropertyItem(PropertyItem propitem)
> {
>   throw new NotImplementedException ();
>   /*
>     GdipPropertyItem pi = new GdipPropertyItem ();
>     GdipPropertyItem.MarshalTo (pi, propitem);
>     unsafe {
>       Status status = GDIPlus.GdipSetPropertyItem (nativeObject, &pi);
>       GDIPlus.CheckStatus (status);
>     }
>   */
> }
>
> On a first glance the code inside the comment doesn't look that bad, and
> I do not understand why it is commented out.
>
> The Implementation of GdipSetPropertyItem in libgdiplus could work as well:
> [https://github.com/mono/libgdiplus/blob/master/src/image.c]
>
>
> I have two questions concerning this issue:
>
> 1.) How do I find out, why the code is disabled?
>
> 2.) If the libgdiplus code is incorrect, couldn't the SetPropertyItem
> check for Windows, then using the commented code? Something like:
>
> public void SetPropertyItem(PropertyItem propitem)
> {
>   if (!IsWindows())
>     throw new NotImplementedException ();
>   else
>   {
>     GdipPropertyItem pi = new GdipPropertyItem ();
>     GdipPropertyItem.MarshalTo (pi, propitem);
>     unsafe {
>       Status status = GDIPlus.GdipSetPropertyItem (nativeObject, &pi);
>       GDIPlus.CheckStatus (status);
>     }
>   }
> }
>
>
> Thanks and kind regards,
> Patrick
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>


More information about the Mono-devel-list mailing list