You've already forked linux-packaging-mono
Imported Upstream version 5.0.0.42
Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
This commit is contained in:
parent
1190d13a04
commit
6bdd276d05
@@ -68,6 +68,10 @@ namespace System.Resources {
|
||||
if (parts.Length == 1)
|
||||
throw new ArgumentException ("value");
|
||||
|
||||
string filename = parts [0];
|
||||
if (Path.DirectorySeparatorChar == '/')
|
||||
filename = filename.Replace ("\\", "/");
|
||||
|
||||
Type type = Type.GetType (parts [1]);
|
||||
if (type == typeof(string)) {
|
||||
Encoding encoding;
|
||||
@@ -77,12 +81,12 @@ namespace System.Resources {
|
||||
encoding = Encoding.Default;
|
||||
}
|
||||
|
||||
using (TextReader reader = new StreamReader(parts [0], encoding)) {
|
||||
using (TextReader reader = new StreamReader(filename, encoding)) {
|
||||
return reader.ReadToEnd();
|
||||
}
|
||||
}
|
||||
|
||||
using (FileStream file = new FileStream (parts [0], FileMode.Open, FileAccess.Read, FileShare.Read)) {
|
||||
using (FileStream file = new FileStream (filename, FileMode.Open, FileAccess.Read, FileShare.Read)) {
|
||||
buffer = new byte [file.Length];
|
||||
file.Read(buffer, 0, (int) file.Length);
|
||||
}
|
||||
@@ -90,7 +94,7 @@ namespace System.Resources {
|
||||
if (type == typeof(System.Byte[]))
|
||||
return buffer;
|
||||
|
||||
if (type == typeof (Bitmap) && Path.GetExtension (parts [0]) == ".ico") {
|
||||
if (type == typeof (Bitmap) && Path.GetExtension (filename) == ".ico") {
|
||||
MemoryStream ms = new MemoryStream (buffer);
|
||||
return new Icon (ms).ToBitmap ();
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@
|
||||
../../build/common/MonoTODOAttribute.cs
|
||||
Assembly/AssemblyInfo.cs
|
||||
Assembly/Locale.cs
|
||||
../System/System/MonoToolsLocator.cs
|
||||
System.Resources/AssemblyNamesTypeResolutionService.cs
|
||||
System.Resources/ByteArrayFromResXHandler.cs
|
||||
System.Resources/ResXNullRef.cs
|
||||
|
@@ -560,35 +560,7 @@ namespace System.Windows.Forms
|
||||
if (Assembly.GetEntryAssembly () == null)
|
||||
throw new NotSupportedException ("The method 'Restart' is not supported by this application type.");
|
||||
|
||||
string mono_path = null;
|
||||
|
||||
//Get mono path
|
||||
PropertyInfo gac = typeof (Environment).GetProperty ("GacPath", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
MethodInfo get_gac = null;
|
||||
if (gac != null)
|
||||
get_gac = gac.GetGetMethod (true);
|
||||
|
||||
if (get_gac != null) {
|
||||
string gac_path = Path.GetDirectoryName ((string)get_gac.Invoke (null, null));
|
||||
string mono_prefix = Path.GetDirectoryName (Path.GetDirectoryName (gac_path));
|
||||
|
||||
if (XplatUI.RunningOnUnix) {
|
||||
mono_path = Path.Combine (mono_prefix, "bin/mono");
|
||||
if (!File.Exists (mono_path))
|
||||
mono_path = "mono";
|
||||
} else {
|
||||
mono_path = Path.Combine (mono_prefix, "bin\\mono.bat");
|
||||
|
||||
if (!File.Exists (mono_path))
|
||||
mono_path = Path.Combine (mono_prefix, "bin\\mono.exe");
|
||||
|
||||
if (!File.Exists (mono_path))
|
||||
mono_path = Path.Combine (mono_prefix, "mono\\mono\\mini\\mono.exe");
|
||||
|
||||
if (!File.Exists (mono_path))
|
||||
throw new FileNotFoundException (string.Format ("Windows mono path not found: '{0}'", mono_path));
|
||||
}
|
||||
}
|
||||
string mono_path = MonoToolsLocator.Mono;
|
||||
|
||||
//Get command line arguments
|
||||
StringBuilder argsBuilder = new StringBuilder ();
|
||||
|
@@ -2222,7 +2222,7 @@ namespace System.Windows.Forms
|
||||
|
||||
protected virtual bool ShouldSerializeLinkHoverColor ()
|
||||
{
|
||||
return grid_style.LinkHoverColor != grid_style.LinkHoverColor;
|
||||
return grid_style.LinkHoverColor != default_style.LinkHoverColor;
|
||||
}
|
||||
|
||||
protected virtual bool ShouldSerializeParentRowsBackColor ()
|
||||
|
@@ -596,7 +596,7 @@ namespace System.Windows.Forms {
|
||||
|
||||
if (this.title_style == TitleStyle.Normal) {
|
||||
pt.Y += caption_height;
|
||||
} else if (this.title_style == TitleStyle.Normal) {
|
||||
} else if (this.title_style == TitleStyle.Tool) {
|
||||
pt.Y += tool_caption_height;
|
||||
}
|
||||
|
||||
|
@@ -1 +1 @@
|
||||
1087563b16ad124ceb91234588b7e4bfdf55388a
|
||||
a6b37d7c2a812d0531b3ca17e66d67fbc6342b4b
|
@@ -2138,7 +2138,7 @@ namespace System.Windows.Forms
|
||||
static bool AreEqual (VisualStyleElement value1, VisualStyleElement value2)
|
||||
{
|
||||
return
|
||||
value1.ClassName == value1.ClassName &&
|
||||
value1.ClassName == value2.ClassName &&
|
||||
value1.Part == value2.Part &&
|
||||
value1.State == value2.State;
|
||||
}
|
||||
|
@@ -1 +1 @@
|
||||
a8f92d12389c7295755fe15cb5e75d14da12c64b
|
||||
90fe714b33d6e36c80b597f874c38c872448622d
|
@@ -1,3 +1,4 @@
|
||||
../../test-helpers/NunitHelpers.cs
|
||||
../../../build/common/Consts.cs
|
||||
System.Windows.Forms/ApplicationTest.cs
|
||||
System.Windows.Forms/AutoCompleteStringCollectionTest.cs
|
||||
|
@@ -47,7 +47,7 @@ namespace MonoTests.System.Resources {
|
||||
|
||||
Assert.IsNotNull (returnedNode, "#A1");
|
||||
object val = returnedNode.GetValue (new ReturnSerializableSubClassITRS ());
|
||||
Assert.IsNotInstanceOfType (typeof (serializableSubClass), val, "#A2");
|
||||
AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), val, "#A2");
|
||||
Assert.IsInstanceOfType (typeof (serializable), val, "#A3");
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace MonoTests.System.Resources {
|
||||
node = GetNodeFileRefToSerializable ("ser.bbb",true);
|
||||
|
||||
object val = node.GetValue (new ReturnSerializableSubClassITRS ());
|
||||
Assert.IsNotInstanceOfType (typeof (serializableSubClass), val, "#A1");
|
||||
AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), val, "#A1");
|
||||
Assert.IsInstanceOfType (typeof (serializable), val, "#A2");
|
||||
}
|
||||
|
||||
|
@@ -90,7 +90,7 @@ namespace MonoTests.System.Resources {
|
||||
// get value passing no params
|
||||
object val = returnedNode.GetValue ((ITypeResolutionService) null);
|
||||
Assert.IsInstanceOfType (typeof (serializable), val, "#A2");
|
||||
Assert.IsNotInstanceOfType (typeof (serializableSubClass), val, "#A3");
|
||||
AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), val, "#A3");
|
||||
|
||||
//get value type passing different params
|
||||
string newType = returnedNode.GetValueTypeName (new ReturnSerializableSubClassITRS ());
|
||||
|
@@ -50,10 +50,10 @@ namespace MonoTests.System.Resources {
|
||||
|
||||
object defaultVal = returnedNode.GetValue ((ITypeResolutionService) null);
|
||||
Assert.IsInstanceOfType (typeof (serializable), defaultVal, "#A2");
|
||||
Assert.IsNotInstanceOfType (typeof (serializableSubClass), defaultVal, "#A3");
|
||||
AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), defaultVal, "#A3");
|
||||
|
||||
object newVal = returnedNode.GetValue (new ReturnSerializableSubClassITRS ());
|
||||
Assert.IsNotInstanceOfType (typeof (serializableSubClass), newVal, "#A4");
|
||||
AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), newVal, "#A4");
|
||||
Assert.IsInstanceOfType (typeof (serializable), newVal, "#A5");
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace MonoTests.System.Resources {
|
||||
|
||||
// get value passing null params
|
||||
object val = returnedNode.GetValue ((ITypeResolutionService) null);
|
||||
// Assert.IsNotInstanceOfType (typeof (serializable), val, "#A5"); this would fail as subclasses are id-ed as instances of parents
|
||||
// AssertHelper.IsNotInstanceOfType (typeof (serializable), val, "#A5"); this would fail as subclasses are id-ed as instances of parents
|
||||
Assert.IsInstanceOfType (typeof (serializableSubClass), val, "#A4");
|
||||
}
|
||||
|
||||
|
@@ -314,7 +314,7 @@ namespace MonoTests.System.Resources {
|
||||
|
||||
object o = node.GetValue ((AssemblyName []) null);
|
||||
|
||||
Assert.IsNotInstanceOfType (typeof (serializableSubClass), o, "#A2");
|
||||
AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), o, "#A2");
|
||||
Assert.IsInstanceOfType (typeof (serializable), o, "#A3");
|
||||
rr.Close ();
|
||||
}
|
||||
|
@@ -252,7 +252,7 @@ namespace MonoTests.System.Resources {
|
||||
Assert.IsNotNull (finalNode, "#A3");
|
||||
|
||||
object finalVal = finalNode.GetValue ((ITypeResolutionService) null);
|
||||
Assert.IsNotInstanceOfType (typeof (serializableSubClass), finalVal, "#A4");
|
||||
AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), finalVal, "#A4");
|
||||
Assert.IsInstanceOfType (typeof (serializable), finalVal, "#A5");
|
||||
}
|
||||
|
||||
|
@@ -229,6 +229,26 @@ namespace MonoTests.System.Resources
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ConvertFrom_Type_String_FilePathWithBackslashes ()
|
||||
{
|
||||
if (Path.DirectorySeparatorChar == '\\')
|
||||
// non-windows test
|
||||
return;
|
||||
|
||||
string fileContents = "foobar";
|
||||
string fileName = "foo.txt";
|
||||
string filePath = Path.Combine (_tempDirectory, fileName);
|
||||
File.WriteAllText (filePath, fileContents);
|
||||
|
||||
filePath = _tempDirectory + "\\.\\" + fileName;
|
||||
|
||||
string fileRef = filePath + ";" + typeof (string).AssemblyQualifiedName;
|
||||
string result = _converter.ConvertFrom (fileRef) as string;
|
||||
Assert.IsNotNull (result, "#A1");
|
||||
Assert.AreEqual (result, fileContents, "#A2");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ConvertFrom_Type_StreamReader ()
|
||||
{
|
||||
|
@@ -91,6 +91,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Ignore ("causes an infinite restart loop since we're not in a separate AppDomain with nunit-lite")]
|
||||
[ExpectedException (typeof (NotSupportedException))]
|
||||
public void RestartNotSupportedExceptionTest ()
|
||||
{
|
||||
|
@@ -65,7 +65,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
o = c.Anchor;
|
||||
c.Anchor = AnchorStyles.Right;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A6");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.AutoScrollOffset;
|
||||
c.AutoScrollOffset = new Point (40, 40);
|
||||
Assert.IsFalse (c.IsHandleCreated, "A7");
|
||||
@@ -174,7 +174,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.IsFalse (c.IsHandleCreated, "A42");
|
||||
o = c.IsDisposed;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A43");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.IsMirrored;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A44");
|
||||
#endif
|
||||
@@ -245,7 +245,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.IsFalse (c.IsHandleCreated, "A66");
|
||||
o = c.TopLevelControl;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A67");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.UseWaitCursor;
|
||||
c.UseWaitCursor = true;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A68");
|
||||
@@ -270,7 +270,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
ProtectedPropertyControl c = new ProtectedPropertyControl ();
|
||||
|
||||
object o;
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.PublicCanRaiseEvents;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A1");
|
||||
#endif
|
||||
@@ -301,7 +301,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
o = c.PublicResizeRedraw;
|
||||
c.PublicResizeRedraw = !c.PublicResizeRedraw;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A13");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.PublicScaleChildren;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A14");
|
||||
#endif
|
||||
@@ -448,7 +448,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
|
||||
private class ProtectedPropertyControl : Control
|
||||
{
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public bool PublicCanRaiseEvents { get { return base.CanRaiseEvents; } }
|
||||
#endif
|
||||
public CreateParams PublicCreateParams { get { return base.CreateParams; } }
|
||||
@@ -463,7 +463,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
public int PublicFontHeight { get { return base.FontHeight; } set { base.FontHeight = value; } }
|
||||
public bool PublicRenderRightToLeft { get { return base.RenderRightToLeft; } }
|
||||
public bool PublicResizeRedraw { get { return base.ResizeRedraw; } set { base.ResizeRedraw = value; } }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public bool PublicScaleChildren { get { return base.ScaleChildren; } }
|
||||
#endif
|
||||
public bool PublicShowFocusCues { get { return base.ShowFocusCues; } }
|
||||
@@ -495,7 +495,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
c = new ProtectedMethodsControl ();
|
||||
c.PublicGetAccessibilityObjectById (0);
|
||||
Assert.IsFalse (c.IsHandleCreated, "A6");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
c.PublicGetAutoSizeMode ();
|
||||
Assert.IsFalse (c.IsHandleCreated, "A7");
|
||||
c.PublicGetScaledBounds (new Rectangle (0, 0, 100, 100), new SizeF (1.5f, 1.5f), BoundsSpecified.All);
|
||||
@@ -549,7 +549,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.IsFalse (c.IsHandleCreated, "A29");
|
||||
c.PublicRtlTranslateLeftRight (LeftRightAlignment.Left);
|
||||
Assert.IsFalse (c.IsHandleCreated, "A30");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
c.PublicScaleControl (new SizeF (1.5f, 1.5f), BoundsSpecified.All);
|
||||
Assert.IsFalse (c.IsHandleCreated, "A31");
|
||||
#endif
|
||||
@@ -557,7 +557,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.IsFalse (c.IsHandleCreated, "A32");
|
||||
c.PublicSelect ();
|
||||
Assert.IsFalse (c.IsHandleCreated, "A33");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
c.PublicSetAutoSizeMode (AutoSizeMode.GrowAndShrink);
|
||||
Assert.IsFalse (c.IsHandleCreated, "A34");
|
||||
#endif
|
||||
@@ -594,7 +594,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
public void PublicCreateHandle () { base.CreateHandle (); }
|
||||
public void PublicDestroyHandle () { base.DestroyHandle (); }
|
||||
public AccessibleObject PublicGetAccessibilityObjectById (int objectId) { return base.GetAccessibilityObjectById (objectId); }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public AutoSizeMode PublicGetAutoSizeMode () { return base.GetAutoSizeMode (); }
|
||||
public Rectangle PublicGetScaledBounds (Rectangle bounds, SizeF factor, BoundsSpecified specified) { return base.GetScaledBounds (bounds, factor, specified); }
|
||||
#endif
|
||||
@@ -620,12 +620,12 @@ namespace MonoTests.System.Windows.Forms
|
||||
public ContentAlignment PublicRtlTranslateContent (ContentAlignment align) { return base.RtlTranslateContent (align); }
|
||||
public HorizontalAlignment PublicRtlTranslateHorizontal (HorizontalAlignment align) { return base.RtlTranslateHorizontal (align); }
|
||||
public LeftRightAlignment PublicRtlTranslateLeftRight (LeftRightAlignment align) { return base.RtlTranslateLeftRight (align); }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public void PublicScaleControl (SizeF factor, BoundsSpecified specified) { base.ScaleControl (factor, specified); }
|
||||
#endif
|
||||
public void PublicScaleCore (float dx, float dy) { base.ScaleCore (dx, dy); }
|
||||
public void PublicSelect () { base.Select (); }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public void PublicSetAutoSizeMode (AutoSizeMode mode) { base.SetAutoSizeMode (mode); }
|
||||
#endif
|
||||
public void PublicSetBoundsCore (int x, int y, int width, int height, BoundsSpecified specified) { base.SetBoundsCore (x, y, width, height, specified); }
|
||||
|
@@ -89,7 +89,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
o = c.Anchor;
|
||||
c.Anchor = AnchorStyles.Right;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A6");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.AutoScrollOffset;
|
||||
c.AutoScrollOffset = new Point (40, 40);
|
||||
Assert.IsFalse (c.IsHandleCreated, "A7");
|
||||
@@ -133,7 +133,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
c.AutoScrollMinSize = new Size (c.AutoScrollMinSize.Width + 1, c.AutoScrollMinSize.Height + 1);
|
||||
Assert.IsFalse (c.IsHandleCreated, "FA9");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.AutoScrollOffset;
|
||||
c.AutoScrollOffset = new Point (c.AutoScrollOffset.X + 1, c.AutoScrollOffset.Y + 1);
|
||||
Assert.IsFalse (c.IsHandleCreated, "FA10");
|
||||
@@ -146,7 +146,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
o = c.AutoSize;
|
||||
c.AutoSize = !c.AutoSize;
|
||||
Assert.IsFalse (c.IsHandleCreated, "FA12");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.AutoSizeMode;
|
||||
c.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
Assert.IsFalse (c.IsHandleCreated, "FA13");
|
||||
@@ -311,7 +311,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
c.HelpButton = !c.HelpButton;
|
||||
Assert.IsFalse (c.IsHandleCreated, "FH1");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.HorizontalScroll;
|
||||
Assert.IsFalse (c.IsHandleCreated, "FH2");
|
||||
#endif
|
||||
@@ -324,7 +324,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.IsFalse (c.IsHandleCreated, "A42");
|
||||
o = c.IsDisposed;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A43");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.IsMirrored;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A44");
|
||||
#endif
|
||||
@@ -457,7 +457,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
o = c.ParentForm;
|
||||
Assert.IsFalse (c.IsHandleCreated, "FP1");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.RestoreBounds;
|
||||
Assert.IsFalse (c.IsHandleCreated, "FR1");
|
||||
#endif
|
||||
@@ -483,7 +483,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.IsFalse (c.IsHandleCreated, "A66");
|
||||
o = c.TopLevelControl;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A67");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.UseWaitCursor;
|
||||
c.UseWaitCursor = true;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A68");
|
||||
@@ -544,7 +544,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
c.TransparencyKey = Color.BurlyWood;
|
||||
Assert.IsFalse (c.IsHandleCreated, "FT4");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.VerticalScroll;
|
||||
Assert.IsFalse (c.IsHandleCreated, "FV1");
|
||||
#endif
|
||||
@@ -565,7 +565,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
ProtectedPropertyForm c = new ProtectedPropertyForm ();
|
||||
|
||||
object o;
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.PublicCanRaiseEvents;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A1");
|
||||
#endif
|
||||
@@ -596,7 +596,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
o = c.PublicResizeRedraw;
|
||||
c.PublicResizeRedraw = !c.PublicResizeRedraw;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A13");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
o = c.PublicScaleChildren;
|
||||
Assert.IsFalse (c.IsHandleCreated, "A14");
|
||||
#endif
|
||||
@@ -789,7 +789,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
c.LayoutMdi (MdiLayout.Cascade);
|
||||
Assert.IsFalse (c.IsHandleCreated, "F5");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
c.PerformAutoScale ();
|
||||
Assert.IsFalse (c.IsHandleCreated, "F6");
|
||||
#endif
|
||||
@@ -827,7 +827,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
c.Validate ();
|
||||
Assert.IsFalse (c.IsHandleCreated, "F15");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
c.ValidateChildren ();
|
||||
Assert.IsFalse (c.IsHandleCreated, "F16");
|
||||
#endif
|
||||
@@ -865,7 +865,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
public class ProtectedPropertyForm : Form
|
||||
{
|
||||
public SizeF PublicAutoScaleFactor { get { return base.AutoScaleFactor; } }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public bool PublicCanRaiseEvents { get { return base.CanRaiseEvents; } }
|
||||
#endif
|
||||
public CreateParams PublicCreateParams { get { return base.CreateParams; } }
|
||||
@@ -884,7 +884,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
public Rectangle PublicMaximizedBounds { get {return base.MaximizedBounds; } set { base.MaximizedBounds = value; }}
|
||||
public bool PublicRenderRightToLeft { get { return base.RenderRightToLeft; } }
|
||||
public bool PublicResizeRedraw { get { return base.ResizeRedraw; } set { base.ResizeRedraw = value; } }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public bool PublicScaleChildren { get { return base.ScaleChildren; } }
|
||||
#endif
|
||||
public bool PublicShowFocusCues { get { return base.ShowFocusCues; } }
|
||||
@@ -925,7 +925,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
c = new ProtectedMethodsForm ();
|
||||
c.PublicGetAccessibilityObjectById (0);
|
||||
Assert.IsFalse (c.IsHandleCreated, "A6");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
c.PublicGetAutoSizeMode ();
|
||||
Assert.IsFalse (c.IsHandleCreated, "A7");
|
||||
c.PublicGetScaledBounds (new Rectangle (0, 0, 100, 100), new SizeF (1.5f, 1.5f), BoundsSpecified.All);
|
||||
@@ -983,7 +983,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.IsFalse (c.IsHandleCreated, "A29");
|
||||
c.PublicRtlTranslateLeftRight (LeftRightAlignment.Left);
|
||||
Assert.IsFalse (c.IsHandleCreated, "A30");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
c.PublicScaleControl (new SizeF (1.5f, 1.5f), BoundsSpecified.All);
|
||||
Assert.IsFalse (c.IsHandleCreated, "A31");
|
||||
#endif
|
||||
@@ -994,7 +994,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
c.Dispose ();
|
||||
|
||||
c = new ProtectedMethodsForm ();
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
c.PublicSetAutoSizeMode (AutoSizeMode.GrowAndShrink);
|
||||
Assert.IsFalse (c.IsHandleCreated, "A34");
|
||||
#endif
|
||||
@@ -1081,7 +1081,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
c.PublicProcessTabKey (true);
|
||||
Assert.IsFalse (c.IsHandleCreated, "F14");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
c.Controls.Add (new Control ());
|
||||
c.PublicScrollToControl (c.Controls [0]);
|
||||
Assert.IsFalse (c.IsHandleCreated, "F15");
|
||||
@@ -1119,7 +1119,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
public void PublicCreateHandle () { base.CreateHandle (); }
|
||||
public void PublicDestroyHandle () { base.DestroyHandle (); }
|
||||
public AccessibleObject PublicGetAccessibilityObjectById (int objectId) { return base.GetAccessibilityObjectById (objectId); }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public AutoSizeMode PublicGetAutoSizeMode () { return base.GetAutoSizeMode (); }
|
||||
public Rectangle PublicGetScaledBounds (Rectangle bounds, SizeF factor, BoundsSpecified specified) { return base.GetScaledBounds (bounds, factor, specified); }
|
||||
#endif
|
||||
@@ -1155,17 +1155,17 @@ namespace MonoTests.System.Windows.Forms
|
||||
public ContentAlignment PublicRtlTranslateContent (ContentAlignment align) { return base.RtlTranslateContent (align); }
|
||||
public HorizontalAlignment PublicRtlTranslateHorizontal (HorizontalAlignment align) { return base.RtlTranslateHorizontal (align); }
|
||||
public LeftRightAlignment PublicRtlTranslateLeftRight (LeftRightAlignment align) { return base.RtlTranslateLeftRight (align); }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public void PublicScaleControl (SizeF factor, BoundsSpecified specified) { base.ScaleControl (factor, specified); }
|
||||
#endif
|
||||
public void PublicScaleCore (float dx, float dy) { base.ScaleCore (dx, dy); }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public void PublicScrollToControl (Control activeControl) { base.ScrollToControl (activeControl); }
|
||||
#endif
|
||||
public void PublicSelect () { base.Select (); }
|
||||
public void PublicSelect (bool directed, bool forward) { base.Select (directed, forward); }
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public void PublicSetAutoSizeMode (AutoSizeMode mode) { base.SetAutoSizeMode (mode); }
|
||||
#endif
|
||||
public void PublicSetBoundsCore (int x, int y, int width, int height, BoundsSpecified specified) { base.SetBoundsCore (x, y, width, height, specified); }
|
||||
|
@@ -1958,5 +1958,56 @@ namespace MonoTests.System.Windows.Forms
|
||||
return base.IsInputChar (charCode);
|
||||
}
|
||||
}
|
||||
|
||||
[Test] // Should not throw IndexOutOfBoundsException
|
||||
public void ReaddingItem ()
|
||||
{
|
||||
Form form = new Form ();
|
||||
form.ShowInTaskbar = false;
|
||||
ListView lvw1 = new ListView ();
|
||||
ListView lvw2 = new ListView ();
|
||||
lvw1.View = View.Details;
|
||||
lvw2.View = View.Details;
|
||||
lvw1.Columns.Add (new ColumnHeader ("1"));
|
||||
lvw2.Columns.Add (new ColumnHeader ("2"));
|
||||
form.Controls.Add (lvw1);
|
||||
form.Controls.Add (lvw2);
|
||||
form.Show ();
|
||||
|
||||
for (int i = 0; i < 50; i++)
|
||||
lvw1.Items.Add ("A");
|
||||
lvw2.Items.Add ("B1");
|
||||
|
||||
ListViewItem item = lvw1.Items [lvw1.Items.Count - 1];
|
||||
item.Selected = true;
|
||||
item.Remove ();
|
||||
lvw2.Items.Add (item);
|
||||
item.Selected = true;
|
||||
|
||||
Assert.AreEqual (lvw1.Items.Count, 49, "#1");
|
||||
Assert.AreEqual (lvw2.Items.Count, 2, "#2");
|
||||
Assert.AreEqual (lvw2.Items [1].Selected, true, "#3");
|
||||
|
||||
form.Dispose ();
|
||||
}
|
||||
|
||||
[Test] // Should not throw ArgumentOutOfRangeException
|
||||
public void DeleteNotFocusedItem ()
|
||||
{
|
||||
Form form = new Form ();
|
||||
form.ShowInTaskbar = false;
|
||||
ListView lvw = new ListView ();
|
||||
form.Controls.Add (lvw);
|
||||
form.Show ();
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
lvw.Items.Add ("A");
|
||||
|
||||
lvw.Items [lvw.Items.Count - 1].Focused = true;
|
||||
lvw.Items [0].Remove ();
|
||||
lvw.Items [0].Remove ();
|
||||
|
||||
form.Dispose ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -109,7 +109,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
o = child1.Anchor;
|
||||
child1.Anchor = AnchorStyles.Right;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "A6");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
o = child1.AutoScrollOffset;
|
||||
child1.AutoScrollOffset = new Point (40, 40);
|
||||
@@ -164,7 +164,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
child1.AutoScrollMinSize = new Size (child1.AutoScrollMinSize.Width + 1, child1.AutoScrollMinSize.Height + 1);
|
||||
Assert.IsFalse (child1.IsHandleCreated, "FA9");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
o = child1.AutoScrollOffset;
|
||||
child1.AutoScrollOffset = new Point (child1.AutoScrollOffset.X + 1, child1.AutoScrollOffset.Y + 1);
|
||||
@@ -180,7 +180,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
o = child1.AutoSize;
|
||||
child1.AutoSize = !child1.AutoSize;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "FA12");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
o = child1.AutoSizeMode;
|
||||
child1.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
@@ -410,7 +410,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
child1.HelpButton = !child1.HelpButton;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "FH1");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
o = child1.HorizontalScroll;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "FH2");
|
||||
@@ -431,7 +431,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
SetUp ();
|
||||
o = child1.IsDisposed;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "A43");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
o = child1.IsMirrored;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "A44");
|
||||
@@ -614,7 +614,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
o = child1.ParentForm;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "FP1");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
o = child1.RestoreBounds;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "FR1");
|
||||
@@ -654,7 +654,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
SetUp ();
|
||||
o = child1.TopLevelControl;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "A67");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
o = child1.UseWaitCursor;
|
||||
child1.UseWaitCursor = true;
|
||||
@@ -732,7 +732,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
child1.TransparencyKey = Color.BurlyWood;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "FT4");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
o = child1.VerticalScroll;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "FV1");
|
||||
@@ -752,7 +752,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
// Not a surprise, but none of these cause handle creation.
|
||||
// Included just to absolutely certain.
|
||||
object o;
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
o = child1.PublicCanRaiseEvents;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "A1");
|
||||
@@ -803,7 +803,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
o = child1.PublicResizeRedraw;
|
||||
child1.PublicResizeRedraw = !child1.PublicResizeRedraw;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "A13");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
o = child1.PublicScaleChildren;
|
||||
Assert.IsFalse (child1.IsHandleCreated, "A14");
|
||||
@@ -1033,7 +1033,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
child1.LayoutMdi (MdiLayout.Cascade);
|
||||
Assert.IsFalse (child1.IsHandleCreated, "F5");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
child1.PerformAutoScale ();
|
||||
Assert.IsFalse (child1.IsHandleCreated, "F6");
|
||||
@@ -1086,7 +1086,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
child1.Validate ();
|
||||
Assert.IsFalse (child1.IsHandleCreated, "F15");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
child1.ValidateChildren ();
|
||||
Assert.IsFalse (child1.IsHandleCreated, "F16");
|
||||
@@ -1144,7 +1144,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
SetUp ();
|
||||
child1.PublicGetAccessibilityObjectById (0);
|
||||
Assert.IsFalse (child1.IsHandleCreated, "A6");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
child1.PublicGetAutoSizeMode ();
|
||||
Assert.IsFalse (child1.IsHandleCreated, "A7");
|
||||
@@ -1240,7 +1240,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
SetUp ();
|
||||
child1.PublicRtlTranslateLeftRight (LeftRightAlignment.Left);
|
||||
Assert.IsFalse (child1.IsHandleCreated, "A30");
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
child1.PublicScaleControl (new SizeF (1.5f, 1.5f), BoundsSpecified.All);
|
||||
Assert.IsFalse (child1.IsHandleCreated, "A31");
|
||||
@@ -1253,7 +1253,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
child1.PublicSelect ();
|
||||
Assert.IsTrue (child1.IsHandleCreated, "A33");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
child1.PublicSetAutoSizeMode (AutoSizeMode.GrowAndShrink);
|
||||
Assert.IsFalse (child1.IsHandleCreated, "A34");
|
||||
@@ -1363,7 +1363,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
child1.PublicProcessTabKey (true);
|
||||
Assert.IsFalse (child1.IsHandleCreated, "F14");
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
SetUp ();
|
||||
child1.Controls.Add (new Control ());
|
||||
child1.PublicScrollToControl (child1.Controls [0]);
|
||||
@@ -1391,7 +1391,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
{
|
||||
// Properties
|
||||
public SizeF PublicAutoScaleFactor { get { return base.AutoScaleFactor; } }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public bool PublicCanRaiseEvents { get { return base.CanRaiseEvents; } }
|
||||
#endif
|
||||
public CreateParams PublicCreateParams { get { return base.CreateParams; } }
|
||||
@@ -1410,7 +1410,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
public Rectangle PublicMaximizedBounds { get {return base.MaximizedBounds; } set { base.MaximizedBounds = value; }}
|
||||
public bool PublicRenderRightToLeft { get { return base.RenderRightToLeft; } }
|
||||
public bool PublicResizeRedraw { get { return base.ResizeRedraw; } set { base.ResizeRedraw = value; } }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public bool PublicScaleChildren { get { return base.ScaleChildren; } }
|
||||
#endif
|
||||
public bool PublicShowFocusCues { get { return base.ShowFocusCues; } }
|
||||
@@ -1430,7 +1430,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
public void PublicCreateHandle () { base.CreateHandle (); }
|
||||
public void PublicDestroyHandle () { base.DestroyHandle (); }
|
||||
public AccessibleObject PublicGetAccessibilityObjectById (int objectId) { return base.GetAccessibilityObjectById (objectId); }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public AutoSizeMode PublicGetAutoSizeMode () { return base.GetAutoSizeMode (); }
|
||||
public Rectangle PublicGetScaledBounds (Rectangle bounds, SizeF factor, BoundsSpecified specified) { return base.GetScaledBounds (bounds, factor, specified); }
|
||||
#endif
|
||||
@@ -1466,17 +1466,17 @@ namespace MonoTests.System.Windows.Forms
|
||||
public ContentAlignment PublicRtlTranslateContent (ContentAlignment align) { return base.RtlTranslateContent (align); }
|
||||
public HorizontalAlignment PublicRtlTranslateHorizontal (HorizontalAlignment align) { return base.RtlTranslateHorizontal (align); }
|
||||
public LeftRightAlignment PublicRtlTranslateLeftRight (LeftRightAlignment align) { return base.RtlTranslateLeftRight (align); }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public void PublicScaleControl (SizeF factor, BoundsSpecified specified) { base.ScaleControl (factor, specified); }
|
||||
#endif
|
||||
public void PublicScaleCore (float dx, float dy) { base.ScaleCore (dx, dy); }
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public void PublicScrollToControl (Control activeControl) { base.ScrollToControl (activeControl); }
|
||||
#endif
|
||||
public void PublicSelect () { base.Select (); }
|
||||
public void PublicSelect (bool directed, bool forward) { base.Select (directed, forward); }
|
||||
|
||||
#if !__MonoCS__
|
||||
#if !MONO
|
||||
public void PublicSetAutoSizeMode (AutoSizeMode mode) { base.SetAutoSizeMode (mode); }
|
||||
#endif
|
||||
public void PublicSetBoundsCore (int x, int y, int width, int height, BoundsSpecified specified) { base.SetBoundsCore (x, y, width, height, specified); }
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user