Example #1
0
        public void ColumnMoveRight()
        {
            string cellValue  = "empty";
            string cellValue2 = "empty";

            System.Threading.Thread t = new System.Threading.Thread(() =>
            {
                var editor  = new NoteEditor();
                var form    = CreateForm();
                form.Shown += (sender, args) =>
                {
                    //insert table
                    var sut = new HtmlTableHelper(editor);
                    sut.TableInsert(new HtmlTableProperty(true));
                    //fill table
                    FillTable((editor.Document.GetElementsByTagName("table")[0].DomElement) as IHTMLTable);
                    //move inside table
                    var body         = editor.Document.Body.DomElement as IHTMLBodyElement;
                    IHTMLTxtRange r2 = body.createTextRange() as IHTMLTxtRange;
                    r2.findText("r0c0");
                    r2.select();
                    //modify table
                    sut.ColumnMoveRight();

                    form.Close();
                };

                form.Controls.Add(editor);

                form.ShowDialog();

                cellValue  = GetCellValue(GetTable(editor), 1, 0);
                cellValue2 = GetCellValue(GetTable(editor), 1, 1);
            });
            t.SetApartmentState(System.Threading.ApartmentState.STA);
            t.Start();
            t.Join();

            Assert.AreEqual("r1c1", cellValue);
            Assert.AreEqual("r1c0", cellValue2);
        }
Example #2
0
        public void ColumnMoveRight()
        {
            string cellValue = "empty";
            string cellValue2 = "empty";

            System.Threading.Thread t = new System.Threading.Thread(() =>
            {
                var editor = new NoteEditor();
                var form = CreateForm();
                form.Shown += (sender, args) =>
                {
                    //insert table
                    var sut = new HtmlTableHelper(editor);
                    sut.TableInsert(new HtmlTableProperty(true));
                    //fill table
                    FillTable((editor.Document.GetElementsByTagName("table")[0].DomElement) as IHTMLTable);
                    //move inside table
                    var body = editor.Document.Body.DomElement as IHTMLBodyElement;
                    IHTMLTxtRange r2 = body.createTextRange() as IHTMLTxtRange;
                    r2.findText("r0c0");
                    r2.select();
                    //modify table
                    sut.ColumnMoveRight();

                    form.Close();
                };

                form.Controls.Add(editor);

                form.ShowDialog();

                cellValue = GetCellValue(GetTable(editor), 1, 0);
                cellValue2 = GetCellValue(GetTable(editor), 1, 1);
            });
            t.SetApartmentState(System.Threading.ApartmentState.STA);
            t.Start();
            t.Join();

            Assert.AreEqual("r1c1", cellValue);
            Assert.AreEqual("r1c0", cellValue2);
        }