implement Image.SetPropertyItem() method v2

This is thought to be fixing https://bugzilla.novell.com/show_bug.cgi?id=406307.
On Mon, Jun 30, 2014 at 1:46 PM, Ungureanu Marius <notifications@github.com>
wrote:

> In mcs/class/System.Drawing/System.Drawing/Image.cs:
>
> > @@ -532,16 +533,31 @@ public int SelectActiveFrame(
> FrameDimension dimension, int frameIndex)
> >
> >  	public void SetPropertyItem(PropertyItem propitem)
> >  	{
> > -		throw new NotImplementedException ();
> > -/*
> > -		GdipPropertyItem pi = new GdipPropertyItem ();
> > -		GdipPropertyItem.MarshalTo (pi, propitem);
> > -		unsafe {
> > -			Status status = GDIPlus.GdipSetPropertyItem (nativeObject, &pi);
> > +		if(propitem == null)
> > +			throw new ArgumentNullException ("propitem");
> > +
> > +		int nItemSize =  Marshal.SizeOf (propitem.Value[0]);
> > +		int size = nItemSize * propitem.Value.Length;
> > +		IntPtr dest = Marshal.AllocHGlobal (size);
> > +		try {
> > +
>
> No newline here please. :D
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/mono/mono/pull/1136/files#r14345879>.
>

v3 with formatting fixes is attached.