* TreeViewHitTestInfo.cs: implement.
authorJackson Harper <jackson@novell.com>
Mon, 5 Mar 2007 21:35:01 +0000 (21:35 -0000)
committerJackson Harper <jackson@novell.com>
Mon, 5 Mar 2007 21:35:01 +0000 (21:35 -0000)
svn path=/trunk/mcs/; revision=73763

mcs/class/Managed.Windows.Forms/System.Windows.Forms.dll.sources
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeViewHitTestInfo.cs [new file with mode: 0644]
mcs/class/Managed.Windows.Forms/System.Windows.Forms_test.dll.sources
mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TreeViewHitTestInfoTest.cs [new file with mode: 0644]

index 9e5750a3b62e0d421ca4ffd9fe0678c08c3f1146..a05da9fd642cc3999a09bffd8e2d1259c54c7821 100644 (file)
@@ -716,6 +716,7 @@ System.Windows.Forms/TreeViewCancelEventHandler.cs
 System.Windows.Forms/TreeViewDrawMode.cs
 System.Windows.Forms/TreeViewEventArgs.cs
 System.Windows.Forms/TreeViewEventHandler.cs
+System.Windows.Forms/TreeViewHitTestInfo.cs
 System.Windows.Forms/TreeViewHitTestLocations.cs
 System.Windows.Forms/TreeViewImageIndexConverter.cs
 System.Windows.Forms/TypeValidationEventArgs.cs
index b5c1dddf3dbfd28e3afe2e3bfe5a75fd3073b56d..0d4dc08ee2155dfd5791dddbbd9a3fc78248e75b 100644 (file)
@@ -1,3 +1,7 @@
+2007-03-05  Jackson Harper  <jackson@ximian.com>
+
+       * TreeViewHitTestInfo.cs: implement.
+
 2007-03-05  Jackson Harper  <jackson@ximian.com>
 
        * InternalWindowManager.cs: class status fix.
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeViewHitTestInfo.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeViewHitTestInfo.cs
new file mode 100644 (file)
index 0000000..68665a4
--- /dev/null
@@ -0,0 +1,56 @@
+//
+// TreeViewHitTestLocations.cs
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2007 Novell, Inc.
+//
+// Authors:
+//     Jackson Harper (jackson@ximian.com)
+//
+
+
+#if NET_2_0
+
+namespace System.Windows.Forms {
+
+       public class TreeViewHitTestInfo {
+
+               private TreeNode node;
+               private TreeViewHitTestLocations location;
+
+               public TreeViewHitTestInfo (TreeNode node, TreeViewHitTestLocations location)
+               {
+                       this.node = node;
+                       this.location = location;
+               }
+
+               public TreeNode Node {
+                       get { return node; }
+               }
+
+               public TreeViewHitTestLocations Location {
+                       get { return location; }
+               }
+       }
+}
+
+#endif
+
index 6a2f18194fbfd1520e521f1f64b5972383268916..a3a8231e789a03a3702ec9259801ff39acfc4042 100644 (file)
@@ -113,6 +113,7 @@ System.Windows.Forms/ToolTipTest.cs
 System.Windows.Forms/TrackBarTest.cs
 System.Windows.Forms/TreeNodeCollectionTest.cs
 System.Windows.Forms/TreeNodeTest.cs
+System.Windows.Forms/TreeViewHitTestInfoTest.cs
 System.Windows.Forms/TreeViewTest.cs
 System.Windows.Forms/UpDownTest.cs
 System.Windows.Forms/UserControlTest.cs
diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TreeViewHitTestInfoTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TreeViewHitTestInfoTest.cs
new file mode 100644 (file)
index 0000000..52d4728
--- /dev/null
@@ -0,0 +1,54 @@
+//
+// Copyright (c) 2007 Novell, Inc.
+//
+// Authors:
+//     Jackson Harper (jackson@ximian.com)
+//
+
+using System;
+using System.Windows.Forms;
+using System.Drawing;
+using System.Threading;
+using System.ComponentModel;
+using System.Runtime.Remoting;
+
+using NUnit.Framework;
+
+#if NET_2_0
+namespace MonoTests.System.Windows.Forms {
+
+       [TestFixture]
+       public class TreeViewHitTestInfoTest {
+
+               [Test]
+               public void TestCtor ()
+               {
+                       TreeViewHitTestInfo t = new TreeViewHitTestInfo (null, TreeViewHitTestLocations.None);
+
+                       Assert.AreEqual (t.Node, null, "null-1");
+                       Assert.AreEqual (t.Location, TreeViewHitTestLocations.None, "null-2");
+
+                       t = new TreeViewHitTestInfo (null, TreeViewHitTestLocations.Image);
+
+                       Assert.AreEqual (t.Node, null, "loc-1");
+                       Assert.AreEqual (t.Location, TreeViewHitTestLocations.Image, "loc-2");
+
+                       TreeNode tn = new TreeNode ("test");
+                       t = new TreeViewHitTestInfo (tn, TreeViewHitTestLocations.PlusMinus);
+
+                       Assert.AreEqual (t.Node, tn, "node-1");
+                       Assert.AreEqual (t.Location, TreeViewHitTestLocations.PlusMinus);
+               }
+
+               [Test]
+               public void TestBadLocation ()
+               {
+                       TreeViewHitTestInfo t = new TreeViewHitTestInfo (null, (TreeViewHitTestLocations) (-1));
+
+                       Assert.AreEqual (t.Node, null, "bad-loc-1");
+                       Assert.AreEqual ((int) t.Location, -1, "bad-loc-2");
+               }
+       }
+
+}
+#endif