CloudNotes.DesktopClient.FrmMain.ResortNodes(System.Windows.Forms.TreeNode)

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

2 Examples 7

1. Example

Project: CloudNotes
Source File: FrmMain.cs
private async Task DoMarkDeleteAsync()
        {
            await SafeExecutionContext.ExecuteAsync(
                this,
                async () =>
                {
                    var treeNode = this.tvNotes.SelectedNode;
                    if (treeNode != null)
                    {
                        var item = GetItem(treeNode);
                        var note = item.Data;
                        using (var dataAccessProxy = this.CreateDataAccessProxy())
                        {
                            await dataAccessProxy.MarkDeleteAsync(note.ID);
                        }
                        treeNode.Remove();

                        this.tvNotes.AddItem(this.trashNode.Nodes, item);

                        note.DeletedFlag = (int) DeleteFlag.MarkDeleted;

                        this.ResortNodes(this.trashNode);
                        
                        this.mnuEmptyTrash.Enabled = true;
                        this.cmnuEmptyTrash.Enabled = true;
                    }
                },
                () =>
                {
                    this.slblStatus.Text = Resources.Deleting;
                    this.sp.Visible = true;
                },
                () => this.sp.Visible = false);
        }

2. Example

Project: CloudNotes
Source File: FrmMain.cs
private async Task DoRestoreAsync()
        {
            await SafeExecutionContext.ExecuteAsync(
                this,
                async () =>
                {
                    var treeNode = this.tvNotes.SelectedNode;
                    if (treeNode != null)
                    {
                        var item = GetItem(treeNode);
                        var note = item.Data;
                        using (var dataAccessProxy = this.CreateDataAccessProxy())
                        {
                            await dataAccessProxy.RestoreAsync(note.ID);
                        }
                        await this.CorrectNodeSelectionAsync(treeNode);
                        treeNode.Remove();
                        this.tvNotes.AddItem(this.notesNode.Nodes, item);
                        note.DeletedFlag = DeleteFlag.None;

                        this.ResortNodes(this.notesNode);
                        if (this.trashNode.Nodes.Count == 0)
                        {
                            this.mnuEmptyTrash.Enabled = false;
                            this.cmnuEmptyTrash.Enabled = false;
                        }
                    }
                },
                () =>
                {
                    this.slblStatus.Text = Resources.Restoring;
                    this.sp.Visible = true;
                },
                () => this.sp.Visible = false);
        }