Beispiel #1
0
 /// <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);
 }
Beispiel #2
0
        /// <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);
            }
        }