예제 #1
0
        private void Click_CreateCollection(object sender, EventArgs e)
        {
            var selectedNode = _tvScheme.SelectedNode;

            if (selectedNode == null)
            {
                return;
            }

            SimpleInputBox dialog = new SimpleInputBox();

            dialog.Title         = "Create new collection";
            dialog.Description   = "Input new collection name.";
            dialog.StartPosition = FormStartPosition.CenterParent;
            dialog.ShowDialog();

            if (dialog.IsOk)
            {
                string schemeName = selectedNode.Text;
                FormMain.SetStatus($"Creating '{dialog.InputText}' collection.");
                Global.API.CreateCollection(Global.UrlAPI, schemeName, dialog.InputText, (result) =>
                {
                    if (result.ResultCode != RoseResult.Ok)
                    {
                        MessageBox.Show(result.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }


                    Click_Refresh(_tvScheme, null);
                    FormMain.SetStatus("Ready");
                });
            }
        }
예제 #2
0
        private void Click_CreateScheme(object sender, EventArgs e)
        {
            SimpleInputBox dialog = new SimpleInputBox();

            dialog.Title         = "Create new scheme";
            dialog.Description   = "Input new scheme name.";
            dialog.StartPosition = FormStartPosition.CenterParent;
            dialog.ShowDialog();

            if (dialog.IsOk)
            {
                FormMain.SetStatus($"Creating '{dialog.InputText}' scheme.");
                Global.API.CreateScheme(Global.UrlAPI, dialog.InputText, (result) =>
                {
                    if (result.ResultCode != RoseResult.Ok)
                    {
                        MessageBox.Show(result.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }


                    Click_Refresh(_tvScheme, null);
                    FormMain.SetStatus("Ready");
                });
            }
        }