示例#1
0
        public void UpdateTable_DefaultValue()
        {
            var sut = new TablePropertyForm();

            sut.TableProperties = new HtmlTableProperty(true);
            Assert.IsFalse(sut.UpdateTable);
        }
示例#2
0
        public void InsertTable()
        {
            var        helper = noteGlue.Editor.TableEditor;
            IHTMLTable table  = helper.GetSelectedTable();

            if (table != null) //modify selected table
            {
                using (var dialog = new TablePropertyForm())
                {
                    dialog.UpdateTable     = true;
                    dialog.TableProperties = helper.GetTableProperties(table);
                    if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        helper.TableModify(table, dialog.TableProperties);
                    }
                }
            }
            else //insert new table
            {
                using (var dialog = new TablePropertyForm())
                {
                    if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        helper.TableInsert(dialog.TableProperties);
                    }
                }
            }
        }
示例#3
0
        public void UpdateTable()
        {
            var sut = new TablePropertyForm();

            sut.TableProperties = new HtmlTableProperty(true);
            sut.UpdateTable     = true;
            Assert.IsTrue(sut.UpdateTable);
        }
示例#4
0
        public void TablePropertyForm()
        {
            var sut = new TablePropertyForm();

            sut.TableProperties = new HtmlTableProperty(true);
            sut.Show();
            sut.Close();
            Assert.IsTrue(string.IsNullOrEmpty(sut.TableProperties.CaptionText));
        }
        /// <summary>
        /// Method to present to the user the table properties dialog
        /// Uses all the default properties for the table based on an insert operation
        /// </summary>
        private void ProcessTablePrompt(mshtmlTable table)
        {
            using (TablePropertyForm dialog = new TablePropertyForm())
            {
                // define the base set of table properties
                HtmlTableProperty tableProperties = GetTableProperties(table);

                // set the dialog properties
                dialog.TableProperties = tableProperties;
                DefineDialogProperties(dialog);
                // based on the user interaction perform the neccessary action
                if (dialog.ShowDialog(this.ParentForm) == DialogResult.OK)
                {
                    tableProperties = dialog.TableProperties;
                    if (table == null) TableInsert(tableProperties);
                    else ProcessTable(table, tableProperties);
                }
            }
        }