예제 #1
0
        private void btnSelectUseCase_Click(object sender, EventArgs e)
        {
            frmChooser frm = new frmChooser(
                this.model,
                this.localizer,
                this.localizer.GetValue("Globals", "UseCase"));

            frm.ShowActors              = false;
            frm.ShowUseCases            = true;
            frm.PackageSelectionIsValid = false;
            frm.UseCaseSelectionIsValid = true;
            frm.ActorSelectionIsValid   = false;
            frm.Initialize();

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                this.selected             = (UseCase)frm.SelectedElement;
                this.lblUpperUseCase.Text = caller.Name;
                this.lblLowerUseCase.Text = selected.Name;
                this.btnOK.Enabled        = true;
                this.btnSwap.Enabled      = true;
            }

            frm.Dispose();
        }
예제 #2
0
        private void btnAddMappedUC_Click(object sender, EventArgs e)
        {
            frmChooser frm = new frmChooser(
                this.model,
                this.localizer,
                this.localizer.GetValue("Globals", "UseCase"));

            frm.ShowActors              = false;
            frm.ShowUseCases            = true;
            frm.PackageSelectionIsValid = false;
            frm.UseCaseSelectionIsValid = true;
            frm.ActorSelectionIsValid   = false;
            frm.Initialize();

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                UseCase useCase = (UseCase)frm.SelectedElement;
                if (this.requirement.MappedUseCases.FindByUniqueID(useCase.UniqueID) != null)
                {
                    // [Element already present!]
                    MessageBox.Show(this, this.localizer.GetValue("UserMessages", "elementAlreadyPresent"));
                    return;
                }
                this.requirement.AddMappedUseCase(useCase);

                ListViewItem lvi = new ListViewItem();
                lvi.Text = useCase.Name;
                this.lvMappedOntoUCs.Items.Add(lvi);
                this.modified = true;
            }

            frm.Dispose();
        }
예제 #3
0
        private void btnAddActor_Click(object sender, System.EventArgs e)
        {
            UseCase useCase = (UseCase)this.currentElement;

            frmChooser frm = new frmChooser(
                parent.Model,
                this.localizer,
                this.localizer.GetValue("Globals", "Actor"));
            frm.ShowActors = true;
            frm.ShowUseCases = false;
            frm.PackageSelectionIsValid = false;
            frm.UseCaseSelectionIsValid = false;
            frm.ActorSelectionIsValid = true;
            frm.Initialize();

            if(frm.ShowDialog(this) == DialogResult.OK)
            {
                Actor actor = (Actor)frm.SelectedElement;
                if(useCase.ActiveActors.FindByUniqueID(actor.UniqueID) != null)
                {
                    // [Element already present!]
                    MessageBox.Show(this, this.localizer.GetValue("UserMessages", "elementAlreadyPresent"));
                    return;
                }
                useCase.AddActiveActor(actor);
                this.UpdateView();
                tabUseCase.SelectedTab = pgUCGeneral;
                parent.SetModified(true);
            }

            frm.Dispose();
        }
        private void btnAddMappedUC_Click(object sender, EventArgs e)
        {
            frmChooser frm = new frmChooser(
                this.model,
                this.localizer,
                this.localizer.GetValue("Globals", "UseCase"));
            frm.ShowActors = false;
            frm.ShowUseCases = true;
            frm.PackageSelectionIsValid = false;
            frm.UseCaseSelectionIsValid = true;
            frm.ActorSelectionIsValid = false;
            frm.Initialize();

            if(frm.ShowDialog(this) == DialogResult.OK)
            {
                UseCase useCase = (UseCase)frm.SelectedElement;
                if(this.requirement.MappedUseCases.FindByUniqueID(useCase.UniqueID) != null)
                {
                    // [Element already present!]
                    MessageBox.Show(this, this.localizer.GetValue("UserMessages", "elementAlreadyPresent"));
                    return;
                }
                this.requirement.AddMappedUseCase(useCase);

                ListViewItem lvi = new ListViewItem();
                lvi.Text = useCase.Name;
                this.lvMappedOntoUCs.Items.Add(lvi);
                this.modified = true;
            }

            frm.Dispose();
        }
예제 #5
0
        private void btnSelectUseCase_Click(object sender, EventArgs e)
        {
            frmChooser frm = new frmChooser(
                this.model,
                this.localizer,
                this.localizer.GetValue("Globals", "UseCase"));
            frm.ShowActors = false;
            frm.ShowUseCases = true;
            frm.PackageSelectionIsValid = false;
            frm.UseCaseSelectionIsValid = true;
            frm.ActorSelectionIsValid = false;
            frm.Initialize();

            if(frm.ShowDialog(this) == DialogResult.OK)
            {
                this.selected = (UseCase)frm.SelectedElement;
                this.lblUpperUseCase.Text = caller.Name;
                this.lblLowerUseCase.Text = selected.Name;
                this.btnOK.Enabled = true;
                this.btnSwap.Enabled = true;
            }

            frm.Dispose();
        }