Example #1
0
        /// <summary>
        /// Applies a text-edit via <c><see cref="_editor"/></c>.
        /// </summary>
        /// <param name="select"><c>true</c> to focus the <c>YataGrid</c></param>
        /// <seealso cref="YataGrid.editresultaccept()"><c>YataGrid.editresultaccept()</c></seealso>
        internal void editresultaccept(bool @select = false)
        {
            //logfile.Log("Propanel.editresultaccept()");

            bool sanitized = false;

            Cell cell = _grid[_r, _c];

            if (_editor.Text != cell.text)
            {
                sanitized = _grid.ChangeCellText(cell, _editor);                 // does a text-check
                _grid.Invalidator(YataGrid.INVALID_GRID | YataGrid.INVALID_FROZ);
            }
            else if (cell.loadchanged)
            {
                _grid.ClearLoadchanged(cell);
            }

            editresultcancel(@select);

            if (sanitized)
            {
                using (var ib = new Infobox(Infobox.Title_warni,
                                            "The text that was submitted has been altered.",
                                            null,
                                            InfoboxType.Warn))
                {
                    ib.ShowDialog(_grid._f);
                }
            }
        }