Imported Upstream version 5.2.0.175

Former-commit-id: bb0468d0f257ff100aa895eb5fe583fb5dfbf900
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-06-07 13:16:24 +00:00
parent 4bdbaf4a88
commit 966bba02bb
8776 changed files with 346420 additions and 149650 deletions

View File

@@ -10,10 +10,12 @@ LIB_MCS_FLAGS = /unsafe \
-resource:Assembly/Error.ico,Error.ico -resource:Assembly/Warning.ico,Warning.ico \
-resource:Assembly/Question.ico,Question.ico -resource:Assembly/Shield.ico,Shield.ico
ifneq (winaot, $(PROFILE))
LIB_MCS_FLAGS += -d:FEATURE_TYPECONVERTER,SUPPORTS_WINDOWS_COLORS
else
ifeq (winaot, $(PROFILE))
LIB_MCS_FLAGS += /keyfile:../msfinal.pub
else ifeq (orbis, $(PROFILE))
LIB_MCS_FLAGS += /keyfile:../msfinal.pub
else
LIB_MCS_FLAGS += -d:FEATURE_TYPECONVERTER,SUPPORTS_WINDOWS_COLORS
endif
TEST_LIB_REFS = System.Drawing System.Runtime.Serialization.Formatters.Soap System.Xml

View File

@@ -33,11 +33,9 @@
//
using System.Collections;
using System.Security.Permissions;
namespace System.Drawing.Design
{
[PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
public sealed class CategoryNameCollection : ReadOnlyCollectionBase
{

View File

@@ -30,12 +30,9 @@
//
using System.ComponentModel;
using System.Security.Permissions;
namespace System.Drawing.Design
{
[PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
[PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)]
public class PaintValueEventArgs : EventArgs
{
private ITypeDescriptorContext context;

View File

@@ -32,12 +32,8 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Security.Permissions;
namespace System.Drawing.Design
{
[PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
[PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)]
public class PropertyValueUIItem
{

View File

@@ -31,12 +31,9 @@
//
using System.ComponentModel;
using System.Security.Permissions;
namespace System.Drawing.Design
{
[PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
[PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)]
public class ToolboxComponentsCreatedEventArgs : EventArgs
{
private IComponent[] components;

View File

@@ -30,13 +30,10 @@
//
using System.ComponentModel;
using System.Security.Permissions;
using System.Collections;
namespace System.Drawing.Design
{
[PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
[PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)]
public class UITypeEditor {
static UITypeEditor ()

View File

@@ -221,27 +221,27 @@ namespace System.Drawing.Drawing2D
//
// AddArc
//
public void AddArc (Rectangle rect, float start_angle, float sweep_angle)
public void AddArc (Rectangle rect, float startAngle, float sweepAngle)
{
Status status = GDIPlus.GdipAddPathArcI (nativePath, rect.X, rect.Y, rect.Width, rect.Height, start_angle, sweep_angle);
Status status = GDIPlus.GdipAddPathArcI (nativePath, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
GDIPlus.CheckStatus (status);
}
public void AddArc (RectangleF rect, float start_angle, float sweep_angle)
public void AddArc (RectangleF rect, float startAngle, float sweepAngle)
{
Status status = GDIPlus.GdipAddPathArc (nativePath, rect.X, rect.Y, rect.Width, rect.Height, start_angle, sweep_angle);
Status status = GDIPlus.GdipAddPathArc (nativePath, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
GDIPlus.CheckStatus (status);
}
public void AddArc (int x, int y, int width, int height, float start_angle, float sweep_angle)
public void AddArc (int x, int y, int width, int height, float startAngle, float sweepAngle)
{
Status status = GDIPlus.GdipAddPathArcI (nativePath, x, y, width, height, start_angle, sweep_angle);
Status status = GDIPlus.GdipAddPathArcI (nativePath, x, y, width, height, startAngle, sweepAngle);
GDIPlus.CheckStatus (status);
}
public void AddArc (float x, float y, float width, float height, float start_angle, float sweep_angle)
public void AddArc (float x, float y, float width, float height, float startAngle, float sweepAngle)
{
Status status = GDIPlus.GdipAddPathArc (nativePath, x, y, width, height, start_angle, sweep_angle);
Status status = GDIPlus.GdipAddPathArc (nativePath, x, y, width, height, startAngle, sweepAngle);
GDIPlus.CheckStatus (status);
}
@@ -279,28 +279,28 @@ namespace System.Drawing.Drawing2D
//
// AddBeziers
//
public void AddBeziers (params Point [] pts)
public void AddBeziers (params Point [] points)
{
if (pts == null)
throw new ArgumentNullException ("pts");
Status status = GDIPlus.GdipAddPathBeziersI (nativePath, pts, pts.Length);
if (points == null)
throw new ArgumentNullException ("points");
Status status = GDIPlus.GdipAddPathBeziersI (nativePath, points, points.Length);
GDIPlus.CheckStatus (status);
}
public void AddBeziers (PointF [] pts)
public void AddBeziers (PointF [] points)
{
if (pts == null)
throw new ArgumentNullException ("pts");
Status status = GDIPlus.GdipAddPathBeziers (nativePath, pts, pts.Length);
if (points == null)
throw new ArgumentNullException ("points");
Status status = GDIPlus.GdipAddPathBeziers (nativePath, points, points.Length);
GDIPlus.CheckStatus (status);
}
//
// AddEllipse
//
public void AddEllipse (RectangleF r)
public void AddEllipse (RectangleF rect)
{
Status status = GDIPlus.GdipAddPathEllipse (nativePath, r.X, r.Y, r.Width, r.Height);
Status status = GDIPlus.GdipAddPathEllipse (nativePath, rect.X, rect.Y, rect.Width, rect.Height);
GDIPlus.CheckStatus (status);
}
@@ -310,9 +310,9 @@ namespace System.Drawing.Drawing2D
GDIPlus.CheckStatus (status);
}
public void AddEllipse (Rectangle r)
public void AddEllipse (Rectangle rect)
{
Status status = GDIPlus.GdipAddPathEllipseI (nativePath, r.X, r.Y, r.Width, r.Height);
Status status = GDIPlus.GdipAddPathEllipseI (nativePath, rect.X, rect.Y, rect.Width, rect.Height);
GDIPlus.CheckStatus (status);
}
@@ -326,16 +326,16 @@ namespace System.Drawing.Drawing2D
//
// AddLine
//
public void AddLine (Point a, Point b)
public void AddLine (Point pt1, Point pt2)
{
Status status = GDIPlus.GdipAddPathLineI (nativePath, a.X, a.Y, b.X, b.Y);
Status status = GDIPlus.GdipAddPathLineI (nativePath, pt1.X, pt1.Y, pt2.X, pt2.Y);
GDIPlus.CheckStatus (status);
}
public void AddLine (PointF a, PointF b)
public void AddLine (PointF pt1, PointF pt2)
{
Status status = GDIPlus.GdipAddPathLine (nativePath, a.X, a.Y, b.X,
b.Y);
Status status = GDIPlus.GdipAddPathLine (nativePath, pt1.X, pt1.Y, pt2.X,
pt2.Y);
GDIPlus.CheckStatus (status);
}

View File

@@ -45,14 +45,14 @@ namespace System.Drawing.Drawing2D
{
}
public HatchBrush (HatchStyle hatchStyle, Color foreColor)
: this (hatchStyle, foreColor, Color.Black)
public HatchBrush (HatchStyle hatchstyle, Color foreColor)
: this (hatchstyle, foreColor, Color.Black)
{
}
public HatchBrush(HatchStyle hatchStyle, Color foreColor, Color backColor)
public HatchBrush(HatchStyle hatchstyle, Color foreColor, Color backColor)
{
Status status = GDIPlus.GdipCreateHatchBrush (hatchStyle, foreColor.ToArgb (), backColor.ToArgb (), out nativeObject);
Status status = GDIPlus.GdipCreateHatchBrush (hatchstyle, foreColor.ToArgb (), backColor.ToArgb (), out nativeObject);
GDIPlus.CheckStatus (status);
}

View File

@@ -77,33 +77,33 @@ namespace System.Drawing.Imaging
}
[CLSCompliant(false)]
public ColorMatrix (float[][] matrix)
public ColorMatrix (float[][] newColorMatrix)
{
color00 = matrix [0][0];
color01 = matrix [0][1];
color02 = matrix [0][2];
color03 = matrix [0][3];
color04 = matrix [0][4];
color10 = matrix [1][0];
color11 = matrix [1][1];
color12 = matrix [1][2];
color13 = matrix [1][3];
color14 = matrix [1][4];
color20 = matrix [2][0];
color21 = matrix [2][1];
color22 = matrix [2][2];
color23 = matrix [2][3];
color24 = matrix [2][4];
color30 = matrix [3][0];
color31 = matrix [3][1];
color32 = matrix [3][2];
color33 = matrix [3][3];
color34 = matrix [3][4];
color40 = matrix [4][0];
color41 = matrix [4][1];
color42 = matrix [4][2];
color43 = matrix [4][3];
color44 = matrix [4][4];
color00 = newColorMatrix [0][0];
color01 = newColorMatrix [0][1];
color02 = newColorMatrix [0][2];
color03 = newColorMatrix [0][3];
color04 = newColorMatrix [0][4];
color10 = newColorMatrix [1][0];
color11 = newColorMatrix [1][1];
color12 = newColorMatrix [1][2];
color13 = newColorMatrix [1][3];
color14 = newColorMatrix [1][4];
color20 = newColorMatrix [2][0];
color21 = newColorMatrix [2][1];
color22 = newColorMatrix [2][2];
color23 = newColorMatrix [2][3];
color24 = newColorMatrix [2][4];
color30 = newColorMatrix [3][0];
color31 = newColorMatrix [3][1];
color32 = newColorMatrix [3][2];
color33 = newColorMatrix [3][3];
color34 = newColorMatrix [3][4];
color40 = newColorMatrix [4][0];
color41 = newColorMatrix [4][1];
color42 = newColorMatrix [4][2];
color43 = newColorMatrix [4][3];
color44 = newColorMatrix [4][4];
}
// properties

View File

@@ -198,21 +198,21 @@ namespace System.Drawing.Imaging {
}
}
public EncoderParameter (Encoder encoder, int numberOfValues, int type, int value)
public EncoderParameter (Encoder encoder, int NumberOfValues, int Type, int Value)
{
this.encoder = encoder;
this.valuePtr = (IntPtr) value;
this.valuesCount = numberOfValues;
this.type = (EncoderParameterValueType) type;
this.valuePtr = (IntPtr) Value;
this.valuesCount = NumberOfValues;
this.type = (EncoderParameterValueType) Type;
}
public EncoderParameter (Encoder encoder, int numerator1, int denominator1, int numerator2, int denominator2)
public EncoderParameter (Encoder encoder, int numerator1, int demoninator1, int numerator2, int demoninator2)
{
this.encoder = encoder;
this.valuesCount = 1;
this.type = EncoderParameterValueType.ValueTypeRationalRange;
this.valuePtr = Marshal.AllocHGlobal (4 * 4);
int [] valuearray = { numerator1, denominator1, numerator2, denominator2 };
int [] valuearray = { numerator1, demoninator1, numerator2, demoninator2 };
Marshal.Copy (valuearray, 0, this.valuePtr, 4);
}

View File

@@ -160,22 +160,22 @@ namespace System.Drawing.Imaging {
SetColorKey (colorLow, colorHigh, ColorAdjustType.Default);
}
public void SetColorMatrix (ColorMatrix colorMatrix)
public void SetColorMatrix (ColorMatrix newColorMatrix)
{
SetColorMatrix (colorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Default);
SetColorMatrix (newColorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Default);
}
public void SetColorMatrix (ColorMatrix colorMatrix, ColorMatrixFlag colorMatrixFlag)
public void SetColorMatrix (ColorMatrix newColorMatrix, ColorMatrixFlag flags)
{
SetColorMatrix (colorMatrix, colorMatrixFlag, ColorAdjustType.Default);
SetColorMatrix (newColorMatrix, flags, ColorAdjustType.Default);
}
public void SetColorMatrix (ColorMatrix colorMatrix, ColorMatrixFlag colorMatrixFlag, ColorAdjustType colorAdjustType)
public void SetColorMatrix (ColorMatrix newColorMatrix, ColorMatrixFlag mode, ColorAdjustType type)
{
IntPtr cm = ColorMatrix.Alloc (colorMatrix);
IntPtr cm = ColorMatrix.Alloc (newColorMatrix);
try {
Status status = GDIPlus.GdipSetImageAttributesColorMatrix (nativeImageAttr,
colorAdjustType, true, cm, IntPtr.Zero, colorMatrixFlag);
type, true, cm, IntPtr.Zero, mode);
GDIPlus.CheckStatus (status);
}
finally {
@@ -294,9 +294,9 @@ namespace System.Drawing.Imaging {
SetGamma (gamma, ColorAdjustType.Default);
}
public void SetGamma (float gamma, ColorAdjustType coloradjust)
public void SetGamma (float gamma, ColorAdjustType type)
{
Status status = GDIPlus.GdipSetImageAttributesGamma (nativeImageAttr, coloradjust, true, gamma);
Status status = GDIPlus.GdipSetImageAttributesGamma (nativeImageAttr, type, true, gamma);
GDIPlus.CheckStatus (status);
}

View File

@@ -220,10 +220,10 @@ namespace System.Drawing.Imaging {
}
public Metafile (IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit, EmfType type,
string description)
string desc)
{
Status status = GDIPlus.GdipRecordMetafileI (referenceHdc, type, ref frameRect, frameUnit,
description, out nativeObject);
desc, out nativeObject);
GDIPlus.CheckStatus (status);
}
@@ -261,8 +261,8 @@ namespace System.Drawing.Imaging {
}
public Metafile (string fileName, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit,
string description) : this (fileName, referenceHdc, frameRect, frameUnit, EmfType.EmfPlusDual,
description)
string desc) : this (fileName, referenceHdc, frameRect, frameUnit, EmfType.EmfPlusDual,
desc)
{
}
@@ -405,11 +405,11 @@ namespace System.Drawing.Imaging {
}
[MonoLimitation ("Metafiles aren't only partially supported by libgdiplus.")]
public static MetafileHeader GetMetafileHeader (IntPtr henhmetafile, WmfPlaceableFileHeader wmfHeader)
public static MetafileHeader GetMetafileHeader (IntPtr hmetafile, WmfPlaceableFileHeader wmfHeader)
{
IntPtr header = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (MetafileHeader)));
try {
Status status = GDIPlus.GdipGetMetafileHeaderFromEmf (henhmetafile, header);
Status status = GDIPlus.GdipGetMetafileHeaderFromEmf (hmetafile, header);
GDIPlus.CheckStatus (status);
return new MetafileHeader (header);
}

View File

@@ -31,7 +31,6 @@
//
using System.Runtime.Serialization;
using System.Security.Permissions;
namespace System.Drawing.Printing {
@@ -50,7 +49,6 @@ namespace System.Drawing.Printing {
{
}
[SecurityPermission (SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData (SerializationInfo info, StreamingContext context)
{
if (info == null)
@@ -58,7 +56,7 @@ namespace System.Drawing.Printing {
base.GetObjectData (info, context);
}
private static string GetMessage(PrinterSettings settings)
{
if (settings.PrinterName == null || settings.PrinterName == String.Empty)

View File

@@ -30,7 +30,6 @@
//
using System.IO;
using System.Security.Permissions;
using System.Runtime.InteropServices;
namespace System.Drawing.Text {
@@ -62,7 +61,6 @@ namespace System.Drawing.Text {
GDIPlus.CheckStatus (status);
}
[SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public void AddMemoryFont (IntPtr memory, int length)
{
// note: MS throw FileNotFoundException if something is bad with the data (except for a null pointer)

View File

@@ -37,10 +37,10 @@
using System.IO;
using System.Drawing.Imaging;
using System.Reflection;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
using System.ComponentModel;
using System.Security.Permissions;
namespace System.Drawing
{
@@ -133,7 +133,11 @@ namespace System.Drawing
if (resource == null)
throw new ArgumentException ("resource");
Stream s = type.Assembly.GetManifestResourceStream (type, resource);
// For compatibility with the .NET Framework
if (type == null)
throw new NullReferenceException();
Stream s = type.GetTypeInfo ().Assembly.GetManifestResourceStream (type, resource);
if (s == null) {
string msg = Locale.GetText ("Resource '{0}' was not found.", resource);
throw new FileNotFoundException (msg);
@@ -228,14 +232,12 @@ namespace System.Drawing
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
[SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
public IntPtr GetHbitmap ()
{
return GetHbitmap(Color.Gray);
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
[SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
public IntPtr GetHbitmap (Color background)
{
IntPtr HandleBmp;
@@ -247,7 +249,6 @@ namespace System.Drawing
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
[SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
public IntPtr GetHicon ()
{
IntPtr HandleIcon;

View File

@@ -30,7 +30,6 @@
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Security.Permissions;
namespace System.Drawing
{
@@ -106,7 +105,6 @@ namespace System.Drawing
}
[MonoTODO ("The targetDC parameter has no equivalent in libgdiplus.")]
[SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public void Render (IntPtr targetDC)
{
throw new NotImplementedException ();

View File

@@ -30,7 +30,6 @@
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Security.Permissions;
namespace System.Drawing
{
@@ -54,7 +53,6 @@ namespace System.Drawing
}
[MonoTODO ("The targetDC parameter has no equivalent in libgdiplus.")]
[SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public BufferedGraphics Allocate (IntPtr targetDC, Rectangle targetRectangle)
{
throw new NotImplementedException ();

File diff suppressed because it is too large Load Diff

View File

@@ -31,9 +31,9 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Reflection;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using System.ComponentModel;
namespace System.Drawing
@@ -428,10 +428,7 @@ namespace System.Drawing
[Browsable(false)]
public bool IsSystemFont {
get {
if (systemFontName == null)
return false;
return StringComparer.InvariantCulture.Compare (systemFontName, string.Empty) != 0;
return !string.IsNullOrEmpty (systemFontName);
}
}
@@ -591,7 +588,6 @@ namespace System.Drawing
}
}
[SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public void ToLogFont (object logFont)
{
if (GDIPlus.RunningOnUnix ()) {
@@ -616,7 +612,6 @@ namespace System.Drawing
}
}
[SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public void ToLogFont (object logFont, Graphics graphics)
{
if (graphics == null)
@@ -627,7 +622,7 @@ namespace System.Drawing
}
Type st = logFont.GetType ();
if (!st.IsLayoutSequential)
if (!st.GetTypeInfo ().IsLayoutSequential)
throw new ArgumentException ("logFont", Locale.GetText ("Layout must be sequential."));
// note: there is no exception if 'logFont' isn't big enough

View File

@@ -35,7 +35,6 @@ using System.Drawing.Imaging;
using System.Drawing.Text;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using System.Text;
namespace System.Drawing
@@ -56,7 +55,7 @@ namespace System.Drawing
IntPtr data,
PlayRecordCallback callbackData);
public delegate bool DrawImageAbort (IntPtr callbackData);
public delegate bool DrawImageAbort (IntPtr callbackdata);
internal Graphics (IntPtr nativeGraphics)
{
@@ -1692,7 +1691,6 @@ namespace System.Drawing
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
[SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
public static Graphics FromHdcInternal (IntPtr hdc)
{
GDIPlus.Display = hdc;
@@ -1744,7 +1742,6 @@ namespace System.Drawing
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
[SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
public static Graphics FromHwndInternal (IntPtr hwnd)
{
return FromHwnd (hwnd);
@@ -2015,13 +2012,11 @@ namespace System.Drawing
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
[SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public void ReleaseHdc (IntPtr hdc)
{
ReleaseHdcInternal (hdc);
}
[SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
public void ReleaseHdc ()
{
ReleaseHdcInternal (deviceContextHdc);
@@ -2029,7 +2024,6 @@ namespace System.Drawing
[MonoLimitation ("Can only be used when hdc was provided by Graphics.GetHdc() method")]
[EditorBrowsable (EditorBrowsableState.Never)]
[SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
public void ReleaseHdcInternal (IntPtr hdc)
{
Status status = Status.InvalidParameter;

Some files were not shown because too many files have changed in this diff Show More