public void TestUniCode()
 {
     if (!isUni)
     {
         return;
     }
     NativeListControl list = new NativeListControl(testDlg.IdentifyFromDialogId(1037));
     list.EmulateEdit(0, "𩸽");
     Assert.AreEqual("𩸽", list.GetItemText(0, 0));
 }
 public void TestGetItemTextOver256()
 {
     NativeListControl list = new NativeListControl(testDlg.IdentifyFromDialogId(1037));
     StringBuilder overText = new StringBuilder();
     for (int i = 0; i < 259; i++)//ツリーの文字数最大がデフォルトで259。
     {
         overText.Append((i % 10).ToString());
     }
     list.EmulateEdit(0, overText.ToString());
     Assert.AreEqual(overText.ToString(), list.GetItemText(0, 0));
 }
        public void TestEdit()
        {
            NativeListControl list = new NativeListControl(testDlg.IdentifyFromDialogId(1037));
            list.EmulateEdit(list.ItemCount - 1, "xxx");
            Assert.AreEqual("xxx", list.GetItemText(list.ItemCount - 1, 0));

            //非同期でも同様の効果があることを確認。
            Async a = new Async();
            list.EmulateEdit(list.ItemCount - 1, "yyy", a);
            while (!a.IsCompleted)
            {
                Thread.Sleep(10);
            }
            Assert.AreEqual("yyy", list.GetItemText(list.ItemCount - 1, 0));
        }
        public void TestCancelEdit()
        {
            NativeListControl list = new NativeListControl(testDlg.IdentifyFromDialogId(1037));

            //編集状態にする。
            list.SetFocus();
            int LVM_EDITLABEL = isUni ? LVM_EDITLABELW : LVM_EDITLABELA;
            list.SetFocus();
            list.SendMessage(LVM_EDITLABEL, new IntPtr(0), IntPtr.Zero);
            new WindowControl(list.App, list.SendMessage(LVM_GETEDITCONTROL, IntPtr.Zero, IntPtr.Zero)).SetWindowText("test");

            //キャンセル。
            list.EmulateCancelEdit();
            Assert.AreEqual("0-0", list.GetItemText(0, 0));
        }
 public void TestItemText()
 {
     NativeListControl list = new NativeListControl(testDlg.IdentifyFromDialogId(1037));
     Assert.AreEqual("10-1", list.GetItemText(10, 1));
 }