FindNearestItem() public method

public FindNearestItem ( SearchDirectionHint dir, Point point ) : System.Windows.Forms.ListViewItem
dir SearchDirectionHint
point System.Drawing.Point
return System.Windows.Forms.ListViewItem
コード例 #1
0
ファイル: ListViewTest.cs プロジェクト: Profit0004/mono
		public void FindNearestItem_Exceptions ()
		{
			ListView lvw = new ListView ();
			lvw.Items.Add ("A");
			lvw.Items.Add ("B");

			lvw.View = View.Details;
			try {
				lvw.FindNearestItem (SearchDirectionHint.Down, 0, 0);
				Assert.Fail ("#A1");
			} catch (InvalidOperationException) {
			}

			lvw.View = View.List;
			try {
				lvw.FindNearestItem (SearchDirectionHint.Down, 0, 0);
				Assert.Fail ("#A2");
			} catch (InvalidOperationException) {
			}

			lvw.View = View.Tile;
			try {
				lvw.FindNearestItem (SearchDirectionHint.Down, 0, 0);
				Assert.Fail ("#A3");
			} catch (InvalidOperationException) {
			}

			lvw.View = View.LargeIcon;
			try {
				lvw.FindNearestItem ((SearchDirectionHint)666, 0, 0);
			} catch (ArgumentOutOfRangeException) {
			}
		}