Пример #1
0
        private void btnAddTask_Click(object sender, EventArgs e)
        {
            if (GetAvailableConnectionNames().Length == 0)
            {
                MessageService.ShowMessage("Add some participating connections first", "No connections");
                return;
            }
            NewTaskDialog dlg = new NewTaskDialog(GetAvailableConnectionNames());

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                TreeNode root = mTreeView.Nodes[0];
                CopyTaskNodeDecorator task = AddNewTask(
                    root,
                    dlg.SourceConnectionName,
                    dlg.SourceSchema,
                    dlg.SourceClass,
                    dlg.TargetConnectionName,
                    dlg.TargetSchema,
                    dlg.TargetClass,
                    dlg.TaskName,
                    dlg.CreateIfNotExist);

                if (dlg.CreateIfNotExist)
                {
                    task.PropertyMappings.OnAutoMap(this, EventArgs.Empty);
                }

                _tasks[task.DecoratedNode.Index] = task;
                root.Expand();

                btnSave.Enabled = (root.Nodes.Count > 0);
            }
        }
Пример #2
0
    protected void newTaskDialog(object sender, EventArgs e)
    {
        NewTaskDialog taskDialog = new NewTaskDialog();

        taskDialog.Show();
    }