private void ContextMenu_SetLoginPassword(object sender, EventArgs e) { using (FormSetLoginPassword form = new FormSetLoginPassword()) { if (form.ShowDialog() == DialogResult.OK) { client.Security.SetLoginPasswordAsync(contextNode.Text, form.PasswordHash).ContinueWith((t) => { FormProgress.WaitForVisible(); FormProgress.Complete(); if (t.Status != TaskStatus.RanToCompletion) { Program.AsyncExceptionMessage(t, "An error occured while processing your request."); } }, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()); FormProgress.Start("Setting password for [" + contextNode.Text + "]..."); } } }
private void ContextMenu_DeleteLogin(object sender, EventArgs e) { if (MessageBox.Show("Are you sure you want to delete the login [" + contextNode.Text + "]?", "Delete Login?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) { return; } client.Security.DeleteLoginByNameAsync(contextNode.Text).ContinueWith((t) => { FormProgress.WaitForVisible(); FormProgress.Complete(); if (t.Status != TaskStatus.RanToCompletion) { Program.AsyncExceptionMessage(t, "An error occured while processing your request."); } treeManager.PopulateLogins(client); }, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()); FormProgress.Start("Deleting login [" + contextNode.Text + "]..."); }
private void ContextMenu_CreateLogin(object sender, EventArgs e) { using (FormCreateLogin form = new FormCreateLogin()) { if (form.ShowDialog() == DialogResult.OK) { client.Security.CreateLoginAsync(form.Username, form.PasswordHash).ContinueWith((t) => { FormProgress.WaitForVisible(); FormProgress.Complete(); if (t.Status != TaskStatus.RanToCompletion) { Program.AsyncExceptionMessage(t, "An error occured while processing your request."); } treeManager.PopulateLogins(client); }, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()); FormProgress.Start("Creating login [" + form.Username + "]..."); } } }
private void ContextMenu_RebuildIndex(object sender, EventArgs e) { if (MessageBox.Show("Are you sure you want to rebuild the index [" + contextNode.Text + "]?", "Rebuild Index?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) { return; } string SchemaName = treeManager.GetFullSchemaNameFromNode(contextNode); client.Schema.Indexes.RebuildAsync(SchemaName, contextNode.Value.ToString()).ContinueWith((t) => { FormProgress.WaitForVisible(); FormProgress.Complete(); if (t.Status != TaskStatus.RanToCompletion) { Program.AsyncExceptionMessage(t, "An error occured while processing your request."); } }, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()); FormProgress.Start("Rebuilding index [" + contextNode.Text.ToString() + "]..."); }