public CollaborationEdit(UMLCollaboration collaboration) { InitializeComponent(); Collaboration = collaboration; LoadCollaboration(); int selectIndex = -1; typeCombobox.Items.Add(new ComboboxItem("External input", "EI")); if ("EI" == collaboration.Type) { selectIndex = 0; } typeCombobox.Items.Add(new ComboboxItem("External output", "EO")); if ("EO" == collaboration.Type) { selectIndex = 1; } typeCombobox.Items.Add(new ComboboxItem("External inquery", "EQ")); if ("EQ" == collaboration.Type) { selectIndex = 2; } typeCombobox.SelectedIndex = selectIndex; tabCollection.TabPages.RemoveAt(1); _load = true; }
public CollaborationEdit(UMLCollaboration collaboration) { InitializeComponent(); Collaboration = collaboration; LoadCollaboration(); int selectIndex = -1; typeCombobox.Items.Add(new ComboboxItem("External input", "EI")); if ("EI" == collaboration.Type) selectIndex = 0; typeCombobox.Items.Add(new ComboboxItem("External output", "EO")); if ("EO" == collaboration.Type) selectIndex = 1; typeCombobox.Items.Add(new ComboboxItem("External inquery", "EQ")); if ("EQ" == collaboration.Type) selectIndex = 2; typeCombobox.SelectedIndex = selectIndex; tabCollection.TabPages.RemoveAt(1); _load = true; }
public void CreateCollaboration() { UMLProject project = null; project = UMLProject.GetInstance(); List<IUMLElement> elements = project.GetOwnedElements(); if (elements.Count > 0) { UMLUseCase uc = new UMLUseCase(); uc.Owner = elements[0]; uc.Name = "UC Test Collaboration"; uc.Save(); UMLCollaboration coll = new UMLCollaboration(); coll.Owner = uc; coll.Name = "Collaboration EI"; coll.Type = UMLActionType.EI; coll.GenerateAction = true; coll.SendMessage = true; coll.Save(); Assert.AreNotEqual(null, coll); Assert.AreNotEqual(String.Empty, coll.Guid); Assert.AreNotEqual(null, coll.Guid); Assert.AreEqual("Collaboration EI", coll.Name); Assert.AreNotEqual(String.Empty, coll.Name); Assert.AreNotEqual(null, coll.Name); Assert.AreNotEqual(String.Empty, coll.PathName); Assert.AreNotEqual(null, coll.PathName); Assert.AreEqual(UMLActionType.EI, coll.Type); Assert.AreEqual(true, coll.GenerateAction); Assert.AreEqual(true, coll.SendMessage); UMLCollaboration coll2 = new UMLCollaboration(); coll2.Owner = uc; coll2.Name = "Collaboration EO"; coll2.Type = UMLActionType.EO; coll2.GenerateAction = true; coll2.SendMessage = false; coll2.Save(); Assert.AreNotEqual(null, coll2); Assert.AreNotEqual(String.Empty, coll2.Guid); Assert.AreNotEqual(null, coll2.Guid); Assert.AreEqual("Collaboration EO", coll2.Name); Assert.AreNotEqual(String.Empty, coll2.Name); Assert.AreNotEqual(null, coll2.Name); Assert.AreNotEqual(String.Empty, coll2.PathName); Assert.AreNotEqual(null, coll2.PathName); Assert.AreEqual(UMLActionType.EO, coll2.Type); Assert.AreEqual(true, coll2.GenerateAction); Assert.AreEqual(false, coll2.SendMessage); UMLCollaboration coll3 = new UMLCollaboration(); coll3.Owner = uc; coll3.Name = "Collaboration EQ"; coll3.Type = UMLActionType.EQ; coll3.Save(); Assert.AreNotEqual(null, coll3); Assert.AreNotEqual(String.Empty, coll3.Guid); Assert.AreNotEqual(null, coll3.Guid); Assert.AreEqual("Collaboration EQ", coll3.Name); Assert.AreNotEqual(String.Empty, coll3.Name); Assert.AreNotEqual(null, coll3.Name); Assert.AreNotEqual(String.Empty, coll3.PathName); Assert.AreNotEqual(null, coll3.PathName); Assert.AreEqual(UMLActionType.EQ, coll3.Type); Assert.AreEqual(false, coll3.GenerateAction); Assert.AreEqual(false, coll3.SendMessage); } }
public void CreateCollaboration() { UMLProject project = null; project = UMLProject.GetInstance(); List <IUMLElement> elements = project.GetOwnedElements(); if (elements.Count > 0) { UMLUseCase uc = new UMLUseCase(); uc.Owner = elements[0]; uc.Name = "UC Test Collaboration"; uc.Save(); UMLCollaboration coll = new UMLCollaboration(); coll.Owner = uc; coll.Name = "Collaboration EI"; coll.Type = UMLActionType.EI; coll.GenerateAction = true; coll.SendMessage = true; coll.Save(); Assert.AreNotEqual(null, coll); Assert.AreNotEqual(String.Empty, coll.Guid); Assert.AreNotEqual(null, coll.Guid); Assert.AreEqual("Collaboration EI", coll.Name); Assert.AreNotEqual(String.Empty, coll.Name); Assert.AreNotEqual(null, coll.Name); Assert.AreNotEqual(String.Empty, coll.PathName); Assert.AreNotEqual(null, coll.PathName); Assert.AreEqual(UMLActionType.EI, coll.Type); Assert.AreEqual(true, coll.GenerateAction); Assert.AreEqual(true, coll.SendMessage); UMLCollaboration coll2 = new UMLCollaboration(); coll2.Owner = uc; coll2.Name = "Collaboration EO"; coll2.Type = UMLActionType.EO; coll2.GenerateAction = true; coll2.SendMessage = false; coll2.Save(); Assert.AreNotEqual(null, coll2); Assert.AreNotEqual(String.Empty, coll2.Guid); Assert.AreNotEqual(null, coll2.Guid); Assert.AreEqual("Collaboration EO", coll2.Name); Assert.AreNotEqual(String.Empty, coll2.Name); Assert.AreNotEqual(null, coll2.Name); Assert.AreNotEqual(String.Empty, coll2.PathName); Assert.AreNotEqual(null, coll2.PathName); Assert.AreEqual(UMLActionType.EO, coll2.Type); Assert.AreEqual(true, coll2.GenerateAction); Assert.AreEqual(false, coll2.SendMessage); UMLCollaboration coll3 = new UMLCollaboration(); coll3.Owner = uc; coll3.Name = "Collaboration EQ"; coll3.Type = UMLActionType.EQ; coll3.Save(); Assert.AreNotEqual(null, coll3); Assert.AreNotEqual(String.Empty, coll3.Guid); Assert.AreNotEqual(null, coll3.Guid); Assert.AreEqual("Collaboration EQ", coll3.Name); Assert.AreNotEqual(String.Empty, coll3.Name); Assert.AreNotEqual(null, coll3.Name); Assert.AreNotEqual(String.Empty, coll3.PathName); Assert.AreNotEqual(null, coll3.PathName); Assert.AreEqual(UMLActionType.EQ, coll3.Type); Assert.AreEqual(false, coll3.GenerateAction); Assert.AreEqual(false, coll3.SendMessage); } }
private void newCollaborationToolStripMenuItem_Click(object sender, EventArgs e) { UMLCollaboration collaboraion = new UMLCollaboration(); NewFormEdit(collaboraion); }
private void newCollaborationToolStripMenuItem_Click(object sender, EventArgs e) { UMLCollaboration collaboraion = new UMLCollaboration(); NewFormEdit(collaboraion); }
/// <summary> /// Adds a new collaboration /// </summary> /// <param name="collaboration"></param> /// <returns></returns> private UMLCollaboration AddCollaboration(UMLCollaboration collaboration) { foreach (UMLCollaboration c in Collaborations) { if (collaboration.Name == c.Name && collaboration.Owner == c.Owner) { c.Files = collaboration.Files; return c; } } Collaborations.Add(collaboration); return collaboration; }
/// <summary> /// Loads the use cases and collaborations /// </summary> public void LoadUseCasesCollaborationsExcel() { DataTable dtResult = new DataTable(); dtResult = GetDataTable(_fileName, COLLABORATION_SHEET, "Name <> ''"); UMLPackage pack = new UMLPackage(); pack.Name = "UseCaseImport"; pack.Owner = _scenariosModel; Packages.Add(pack); foreach (DataRow dr in dtResult.Rows) { UMLUseCase useCase = new UMLUseCase(); useCase.Name = dr["UseCase"].ToString().Trim(); useCase.Owner = pack; useCase = AddUseCase(useCase); UMLCollaboration collaboration = new UMLCollaboration(); collaboration.Name = dr["Name"].ToString().Trim(); collaboration.Type = dr["Type"].ToString(); if (dr["SendMessage"].ToString() == "X") { collaboration.SendMessage = true; } if (dr["GenerateAction"].ToString() == "X") { collaboration.GenerateAction = true; } string[] filesName = dr["FilesList"].ToString().Split(','); foreach (string fName in filesName) { UMLFile file = new UMLFile(); file.Name = fName.Trim(); file = AddFile(file); collaboration.Files.Add(file); } collaboration.Owner = useCase; collaboration = AddCollaboration(collaboration); useCase.Collaborations.Add(collaboration); } }