System.Windows.Forms.CurrencyManager.EndCurrentEdit()

Here are the examples of the csharp api class System.Windows.Forms.CurrencyManager.EndCurrentEdit() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

20 Examples 7

1. Example

Project: MvvmFx
Source File: BoundTreeView.cs
private void ChangeParentToRoot(BoundTreeNode childnode)
        {
            if (childnode != null)
            {
                // ReSharper disable AssignNullToNotNullAttribute
                _parentIdentifierProperty.SetValue(_listManager.List[childnode.Position], null);
                // ReSharper restore AssignNullToNotNullAttribute
                _listManager.EndCurrentEdit();
            }
        }

2. Example

Project: MvvmFx
Source File: BoundTreeView.cs
private void ChangeParentToRoot(BoundTreeNode childnode)
        {
            if (childnode != null)
            {
                // ReSharper disable AssignNullToNotNullAttribute
                _parentIdentifierProperty.SetValue(_listManager.List[childnode.Position], null);
                // ReSharper restore AssignNullToNotNullAttribute
                _listManager.EndCurrentEdit();
            }
        }

3. Example

Project: MvvmFx
Source File: BoundTreeView.cs
private void ChangeParentToRoot(BoundTreeNode childnode)
        {
            if (childnode != null)
            {
                // ReSharper disable AssignNullToNotNullAttribute
                _parentIdentifierProperty.SetValue(_listManager.List[childnode.Position], null);
                // ReSharper restore AssignNullToNotNullAttribute
                _listManager.EndCurrentEdit();
            }
        }

4. Example

Project: MvvmFx
Source File: BoundTreeView.cs
private void ChangeParentToRoot(BoundTreeNode childnode)
        {
            if (childnode != null)
            {
                // ReSharper disable AssignNullToNotNullAttribute
                _parentIdentifierProperty.SetValue(_listManager.List[childnode.Position], null);
                // ReSharper restore AssignNullToNotNullAttribute
                _listManager.EndCurrentEdit();
            }
        }

5. Example

Project: MvvmFx
Source File: BoundTreeView.cs
private void ChangeParentNoAncestor(BoundTreeNode childnode, BoundTreeNode parentNode)
        {
            var parentId = _identifierProperty.GetValue(_listManager.List[parentNode.Position]);
            if (parentId != null)
            {
                _parentIdentifierProperty.SetValue(_listManager.List[childnode.Position], parentId);
                _listManager.EndCurrentEdit();
            }
        }

6. Example

Project: MvvmFx
Source File: BoundTreeView.cs
private void ChangeParentUpTheSameBranch(BoundTreeNode childnode, BoundTreeNode parentNode,
            BoundTreeNode replacementeParent, BoundTreeNode placeHolder)
        {
            var replacementeParentId = _identifierProperty.GetValue(_listManager.List[replacementeParent.Position]);
            if (replacementeParentId != null)
                _parentIdentifierProperty.SetValue(_listManager.List[placeHolder.Position], replacementeParentId);

            var parentId = _identifierProperty.GetValue(_listManager.List[parentNode.Position]);
            if (parentId != null)
            {
                _parentIdentifierProperty.SetValue(_listManager.List[childnode.Position], parentId);
                _listManager.EndCurrentEdit();
            }
        }

7. Example

Project: MvvmFx
Source File: BoundTreeView.cs
private void ChangeParentNoAncestor(BoundTreeNode childnode, BoundTreeNode parentNode)
        {
            var parentId = _identifierProperty.GetValue(_listManager.List[parentNode.Position]);
            if (parentId != null)
            {
                _parentIdentifierProperty.SetValue(_listManager.List[childnode.Position], parentId);
                _listManager.EndCurrentEdit();
            }
        }

8. Example

Project: MvvmFx
Source File: BoundTreeView.cs
private void ChangeParentUpTheSameBranch(BoundTreeNode childnode, BoundTreeNode parentNode,
            BoundTreeNode replacementeParent, BoundTreeNode placeHolder)
        {
            var replacementeParentId = _identifierProperty.GetValue(_listManager.List[replacementeParent.Position]);
            if (replacementeParentId != null)
                _parentIdentifierProperty.SetValue(_listManager.List[placeHolder.Position], replacementeParentId);

            var parentId = _identifierProperty.GetValue(_listManager.List[parentNode.Position]);
            if (parentId != null)
            {
                _parentIdentifierProperty.SetValue(_listManager.List[childnode.Position], parentId);
                _listManager.EndCurrentEdit();
            }
        }

9. Example

Project: MvvmFx
Source File: BoundTreeView.cs
private void ChangeParentNoAncestor(BoundTreeNode childnode, BoundTreeNode parentNode)
        {
            var parentId = _identifierProperty.GetValue(_listManager.List[parentNode.Position]);
            if (parentId != null)
            {
                _parentIdentifierProperty.SetValue(_listManager.List[childnode.Position], parentId);
                _listManager.EndCurrentEdit();
            }
        }

10. Example

Project: MvvmFx
Source File: BoundTreeView.cs
private void ChangeParentUpTheSameBranch(BoundTreeNode childnode, BoundTreeNode parentNode,
            BoundTreeNode replacementeParent, BoundTreeNode placeHolder)
        {
            var replacementeParentId = _identifierProperty.GetValue(_listManager.List[replacementeParent.Position]);
            if (replacementeParentId != null)
                _parentIdentifierProperty.SetValue(_listManager.List[placeHolder.Position], replacementeParentId);

            var parentId = _identifierProperty.GetValue(_listManager.List[parentNode.Position]);
            if (parentId != null)
            {
                _parentIdentifierProperty.SetValue(_listManager.List[childnode.Position], parentId);
                _listManager.EndCurrentEdit();
            }
        }

11. Example

Project: MvvmFx
Source File: BoundTreeView.cs
private void ChangeParentNoAncestor(BoundTreeNode childnode, BoundTreeNode parentNode)
        {
            var parentId = _identifierProperty.GetValue(_listManager.List[parentNode.Position]);
            if (parentId != null)
            {
                _parentIdentifierProperty.SetValue(_listManager.List[childnode.Position], parentId);
                _listManager.EndCurrentEdit();
            }
        }

12. Example

Project: MvvmFx
Source File: BoundTreeView.cs
private void ChangeParentUpTheSameBranch(BoundTreeNode childnode, BoundTreeNode parentNode,
            BoundTreeNode replacementeParent, BoundTreeNode placeHolder)
        {
            var replacementeParentId = _identifierProperty.GetValue(_listManager.List[replacementeParent.Position]);
            if (replacementeParentId != null)
                _parentIdentifierProperty.SetValue(_listManager.List[placeHolder.Position], replacementeParentId);

            var parentId = _identifierProperty.GetValue(_listManager.List[parentNode.Position]);
            if (parentId != null)
            {
                _parentIdentifierProperty.SetValue(_listManager.List[childnode.Position], parentId);
                _listManager.EndCurrentEdit();
            }
        }

13. Example

Project: MvvmFx
Source File: BoundListView.cs
protected override void OnAfterLabelEdit(LabelEditEventArgs e)
        {
            if (e.Label == null)
            {
                // If you press ESC while editing.
                e.CancelEdit = true;
                return;
            }

#if WINFORMS
            var index = e.Item;
#else
            var index = e.Item.Index;
#endif

            if (_listManager.List.Count > index)
            {
                var row = _listManager.List[index];
                // In a ListView you are only able to edit the first Column.
                var col = _listManager.GetItemProperties().Find(Columns[0].Text, false);
                try
                {
                    if (row != null && col != null)
                        col.SetValue(row, e.Label);
                    _listManager.EndCurrentEdit();
                    base.OnAfterLabelEdit(e);
                }
                catch (Exception ex)
                {
                    // If you try to enter strings in number-columns, too long strings or something
                    // else wich is not allowed by the DataSource.
                    MessageBox.Show(Resources.EditFailed + ": " + ex.Message, Resources.EditFailed, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    _listManager.CancelCurrentEdit();
                    e.CancelEdit = true;
                }
            }
        }

14. Example

Project: MvvmFx
Source File: BoundListView.cs
protected override void OnAfterLabelEdit(LabelEditEventArgs e)
        {
            if (e.Label == null)
            {
                // If you press ESC while editing.
                e.CancelEdit = true;
                return;
            }

#if WINFORMS
            var index = e.Item;
#else
            var index = e.Item.Index;
#endif

            if (_listManager.List.Count > index)
            {
                var row = _listManager.List[index];
                // In a ListView you are only able to edit the first Column.
                var col = _listManager.GetItemProperties().Find(Columns[0].Text, false);
                try
                {
                    if (row != null && col != null)
                        col.SetValue(row, e.Label);
                    _listManager.EndCurrentEdit();
                    base.OnAfterLabelEdit(e);
                }
                catch (Exception ex)
                {
                    // If you try to enter strings in number-columns, too long strings or something
                    // else wich is not allowed by the DataSource.
                    MessageBox.Show(Resources.EditFailed + ": " + ex.Message, Resources.EditFailed, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    _listManager.CancelCurrentEdit();
                    e.CancelEdit = true;
                }
            }
        }

15. Example

Project: MvvmFx
Source File: BoundListView.cs
protected override void OnAfterLabelEdit(LabelEditEventArgs e)
        {
            if (e.Label == null)
            {
                // If you press ESC while editing.
                e.CancelEdit = true;
                return;
            }

#if WINFORMS
            var index = e.Item;
#else
            var index = e.Item.Index;
#endif

            if (_listManager.List.Count > index)
            {
                var row = _listManager.List[index];
                // In a ListView you are only able to edit the first Column.
                var col = _listManager.GetItemProperties().Find(Columns[0].Text, false);
                try
                {
                    if (row != null && col != null)
                        col.SetValue(row, e.Label);
                    _listManager.EndCurrentEdit();
                    base.OnAfterLabelEdit(e);
                }
                catch (Exception ex)
                {
                    // If you try to enter strings in number-columns, too long strings or something
                    // else wich is not allowed by the DataSource.
                    MessageBox.Show(Resources.EditFailed + ": " + ex.Message, Resources.EditFailed, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    _listManager.CancelCurrentEdit();
                    e.CancelEdit = true;
                }
            }
        }

16. Example

Project: MvvmFx
Source File: BoundListView.cs
protected override void OnAfterLabelEdit(LabelEditEventArgs e)
        {
            if (e.Label == null)
            {
                // If you press ESC while editing.
                e.CancelEdit = true;
                return;
            }

#if WINFORMS
            var index = e.Item;
#else
            var index = e.Item.Index;
#endif

            if (_listManager.List.Count > index)
            {
                var row = _listManager.List[index];
                // In a ListView you are only able to edit the first Column.
                var col = _listManager.GetItemProperties().Find(Columns[0].Text, false);
                try
                {
                    if (row != null && col != null)
                        col.SetValue(row, e.Label);
                    _listManager.EndCurrentEdit();
                    base.OnAfterLabelEdit(e);
                }
                catch (Exception ex)
                {
                    // If you try to enter strings in number-columns, too long strings or something
                    // else wich is not allowed by the DataSource.
                    MessageBox.Show(Resources.EditFailed + ": " + ex.Message, Resources.EditFailed, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    _listManager.CancelCurrentEdit();
                    e.CancelEdit = true;
                }
            }
        }

17. Example

Project: MvvmFx
Source File: BoundTreeView.cs
protected override void OnAfterLabelEdit(NodeLabelEditEventArgs e)
        {
            if (e.Label == null)
            {
                // If you press ESC while editing.
                e.CancelEdit = true;
                return;
            }

            var node = e.Node as BoundTreeNode;
            if (node != null && PrepareValueConvertor() && _valueConverter.IsValid(e.Label))
            {
                try
                {
                    _displayProperty.SetValue(_listManager.List[node.Position],
                        _valueConverter.ConvertFromString(e.Label));
                    _listManager.EndCurrentEdit();
                    base.OnAfterLabelEdit(e);
                }
                catch (Exception ex)
                {
                    // If you try to enter strings in number-columns, too long strings or something
                    // else wich is not allowed by the DataSource.
                    MessageBox.Show(Resources.EditFailed + @": " + ex.Message, Resources.EditFailed,
                        MessageBoxButtons.OK, MessageBoxIcon.Error);
                    _listManager.CancelCurrentEdit();
                    e.CancelEdit = true;
                }
            }
        }

18. Example

Project: MvvmFx
Source File: BoundTreeView.cs
protected override void OnAfterLabelEdit(NodeLabelEditEventArgs e)
        {
            if (e.Label == null)
            {
                // If you press ESC while editing.
                e.CancelEdit = true;
                return;
            }

            var node = e.Node as BoundTreeNode;
            if (node != null && PrepareValueConvertor() && _valueConverter.IsValid(e.Label))
            {
                try
                {
                    _displayProperty.SetValue(_listManager.List[node.Position],
                        _valueConverter.ConvertFromString(e.Label));
                    _listManager.EndCurrentEdit();
                    base.OnAfterLabelEdit(e);
                }
                catch (Exception ex)
                {
                    // If you try to enter strings in number-columns, too long strings or something
                    // else wich is not allowed by the DataSource.
                    MessageBox.Show(Resources.EditFailed + @": " + ex.Message, Resources.EditFailed,
                        MessageBoxButtons.OK, MessageBoxIcon.Error);
                    _listManager.CancelCurrentEdit();
                    e.CancelEdit = true;
                }
            }
        }

19. Example

Project: MvvmFx
Source File: BoundTreeView.cs
protected override void OnAfterLabelEdit(NodeLabelEditEventArgs e)
        {
            if (e.Label == null)
            {
                // If you press ESC while editing.
                e.CancelEdit = true;
                return;
            }

            var node = e.Node as BoundTreeNode;
            if (node != null && PrepareValueConvertor() && _valueConverter.IsValid(e.Label))
            {
                try
                {
                    _displayProperty.SetValue(_listManager.List[node.Position],
                        _valueConverter.ConvertFromString(e.Label));
                    _listManager.EndCurrentEdit();
                    base.OnAfterLabelEdit(e);
                }
                catch (Exception ex)
                {
                    // If you try to enter strings in number-columns, too long strings or something
                    // else wich is not allowed by the DataSource.
                    MessageBox.Show(Resources.EditFailed + @": " + ex.Message, Resources.EditFailed,
                        MessageBoxButtons.OK, MessageBoxIcon.Error);
                    _listManager.CancelCurrentEdit();
                    e.CancelEdit = true;
                }
            }
        }

20. Example

Project: MvvmFx
Source File: BoundTreeView.cs
protected override void OnAfterLabelEdit(NodeLabelEditEventArgs e)
        {
            if (e.Label == null)
            {
                // If you press ESC while editing.
                e.CancelEdit = true;
                return;
            }

            var node = e.Node as BoundTreeNode;
            if (node != null && PrepareValueConvertor() && _valueConverter.IsValid(e.Label))
            {
                try
                {
                    _displayProperty.SetValue(_listManager.List[node.Position],
                        _valueConverter.ConvertFromString(e.Label));
                    _listManager.EndCurrentEdit();
                    base.OnAfterLabelEdit(e);
                }
                catch (Exception ex)
                {
                    // If you try to enter strings in number-columns, too long strings or something
                    // else wich is not allowed by the DataSource.
                    MessageBox.Show(Resources.EditFailed + @": " + ex.Message, Resources.EditFailed,
                        MessageBoxButtons.OK, MessageBoxIcon.Error);
                    _listManager.CancelCurrentEdit();
                    e.CancelEdit = true;
                }
            }
        }