Exemplo n.º 1
0
        private void findBtn_Click(object sender, EventArgs e)
        {
            using (SelectDialog form = new SelectDialog())
            {
                form.FrontendApplication = FrontendApplication;

                if (form.ShowDialog() == DialogResult.OK)
                {
                    dialogTbx.Text = form.SelectedDialog.Name;
                    dialogTbx.Tag  = form.SelectedDialog;
                }
            }
        }
        private void dialogFindBtn_Click(object sender, EventArgs e)
        {
            using (SelectDialog form = new SelectDialog())
            {
                form.FrontendApplication = FrontendApplication;

                if (form.ShowDialog() == DialogResult.OK)
                {
                    if (form.SelectedDialog.InterfaceView == null)
                    {
                        MessageBox.Show("The selected dialog is not valid since it has no interface view defined.");
                        return;
                    }

                    dialogTbx.Text     = form.SelectedDialog.Name;
                    HyperDialog.Dialog = form.SelectedDialog;
                }
            }
        }
Exemplo n.º 3
0
        private void addDialogBtn_Click(object sender, EventArgs e)
        {
            SelectDialog form = new SelectDialog();

            form.FrontendApplication = FrontendApplication;
            form.BackendApplication  = BackendApplication;

            if (form.ShowDialog() == DialogResult.OK)
            {
                //if (Workflow.Module.Id != form.SelectedDialog.Module.Id)
                //{
                //        MessageBox.Show("You can only add Dialogs from the same Module as the Workflow.", "MetaManager");
                //        return;
                //}

                foreach (WorkflowDialog wfDialog in Workflow.Dialogs)
                {
                    if (wfDialog.Dialog.Id == form.SelectedDialog.Id)
                    {
                        MessageBox.Show("The selected Dialog is already present in the Workflow.", "MetaManager");
                        return;
                    }
                }

                Cdc.MetaManager.DataAccess.Domain.Dialog dialog = MetaManagerServices.GetDialogService().GetDialogWithViewTree(form.SelectedDialog.Id);

                WorkflowDialog workflowDialog = new WorkflowDialog();
                workflowDialog.Dialog   = dialog;
                workflowDialog.Workflow = Workflow;
                Workflow.Dialogs.Add(workflowDialog);

                Type activityType = WorkflowTypeFactory.CreateActivities(Workflow, this.BackendApplication, new Dialog[] { dialog }, new ServiceMethod[0], new DataAccess.Domain.Workflow[0]).Last();

                TypeProvider typeProvider = workflowControl.GetService(typeof(ITypeProvider)) as TypeProvider;
                typeProvider.AddAssembly(activityType.Assembly);
                workflowControl.ToolBox.AddToolBoxItem(new SelfHostToolboxItem(activityType));
            }
        }