src/Misc/EFTools/DesignXmlCore/Base/Shell/TreeGridDesignerBranch.cs
/// <summary>
///     Called when the user commits an in-place edit
/// </summary>
/// <param name="row">Index into this branch</param>
/// <param name="column">Column index</param>
/// <param name="newText">New value entered by the user</param>
/// <returns></returns>
Called when the user commits an in-place edit
Called when the user commits an in - place edit
protected virtual LabelEditResult CommitLabelEdit(int row, int column, string newText)
        {
            var result = LabelEditResult.AcceptEdit;
            var eltCount = ElementCount;
            if (row != _insertingIndex
                && (row < eltCount || (row == eltCount && eltCount == 0)))
            {
                var columnDesc = _columns[column];
                Debug.Assert(columnDesc.Converter != null, "Column " + columnDesc.GetType().FullName + " has null Converter");
                if (columnDesc.Converter != null)
                {
                    var convertedObject = columnDesc.Converter.ConvertFrom(newText);
                    Debug.Assert(
                        convertedObject != null, "Column " + columnDesc.GetType().FullName + " could not convert newText " + newText);
                    object component = null;
                    if (row == eltCount
                        && eltCount == 0)
                    {
                        component = GetCreatorElement();
                    }
                    else
                    {
                        component = GetElement(row);
                    }
                    Debug.Assert(component != null, "Why couldn't we find the component for this row in the mapping details view?");
                    columnDesc.SetValue(component, convertedObject);
                }
            }
            else
            {
                try
                {
                    InCreatorNodeCommit = true;
                    result = OnCreatorNodeEditCommitted(
                        _insertingCreatorIndex == -1 ? row - eltCount : _insertingCreatorIndex, newText, _insertingIndex);
                }
                finally
                {
                    InCreatorNodeCommit = false;
                }
            }
            return result;
        }
protected virtual LabelEditResult CommitLabelEdit ( int row , int column , string newText ) { var result = LabelEditResult . AcceptEdit ; var eltCount = ElementCount ; if ( row != _insertingIndex && ( row < eltCount || ( row == eltCount && eltCount == 0 ) ) ) { var columnDesc = _columns [ column ] ; Debug . Assert ( columnDesc . Converter != null , " " + columnDesc . GetType ( ) . FullName + " " ) ; if ( columnDesc . Converter != null ) { var convertedObject = columnDesc . Converter . ConvertFrom ( newText ) ; Debug . Assert ( convertedObject != null , " " + columnDesc . GetType ( ) . FullName + " " + newText ) ; object component = null ; if ( row == eltCount && eltCount == 0 ) { component = GetCreatorElement ( ) ; } else { component = GetElement ( row ) ; } Debug . Assert ( component != null , " " ) ; columnDesc . SetValue ( component , convertedObject ) ; } } else { try { InCreatorNodeCommit = true ; result = OnCreatorNodeEditCommitted ( _insertingCreatorIndex == - 1 ? row - eltCount : _insertingCreatorIndex , newText , _insertingIndex ) ; } finally { InCreatorNodeCommit = false ; } } return result ; }
Called when the user commits an in-place edit
Called when the user commits an in - place edit
// convertedObject can just the original string in case of a // edit from the keyboard (which has no context) // if we are setting a column value for one that doesn't have a component already, we have to at least  // pass in an 'dummy' component so SetValue knows what type it is.
None
row
int
Index into this branch
Index into this branch
column
int
None
newText
string
New value entered by the user
New value entered by the user