Exemplo n.º 1
0
        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 + "]...");
                }
            }
        }
Exemplo n.º 2
0
        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 + "]...");
        }
Exemplo n.º 3
0
        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 + "]...");
                }
            }
        }
Exemplo n.º 4
0
        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() + "]...");
        }