Exemplo n.º 1
0
        public void RemovePackage(IUmlPackage umlPackage)
        {
            short      i             = 0;
            Collection eaSubPackages = eaPackage.Packages;

            foreach (Package eaSubPackage in eaSubPackages)
            {
                if (eaSubPackage.PackageID == umlPackage.Id)
                {
                    eaSubPackages.Delete(i);
                }
                i++;
            }
            eaSubPackages.Refresh();
        }
Exemplo n.º 2
0
 /// <summary>
 /// Handles the selectionChanged event for the comboBoxBusinessChoreographyView.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void comboBoxBusinessChoreographyView_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     foreach (IUmlPackage umlPackage in eaUmlRepo.GetPackagesByStereotype("bChoreographyV"))
     {
         if (umlPackage.Name.Equals(comboBoxBusinessChoreographyView.SelectedItem))
         {
             currentChoreographyView = umlPackage;
             foreach (var package in umlPackage.GetPackagesByStereotype("bCollaborationV"))
             {
                 comboBoxBusinessCollaborationView.Items.Add(package.Name);
             }
         }
     }
     comboBoxBusinessCollaborationView.IsEnabled = true;
     checkFormState();
 }
        /// <summary>
        /// returns all packages owned by the package with the vgiven ID or below having one of the p
        /// </summary>
        /// <param name="parentPackageID"></param>
        /// <param name="includeParent"></param>
        /// <param name="stereotypes"></param>
        /// <returns></returns>
        public IEnumerable <IUmlPackage> GetSubPackagesByStereotype(IUmlPackage parentPackage, bool includeParent, params string[] stereotypes)
        {
            var foundPackages = new List <IUmlPackage>();
            //add parentPackage if it has the stereotype
            var packageTreeIDs = parentPackage.getPackageTreeIDs();
            //put each id between single quotes and put commas inbetween e.g. '123','456','789'
            var sqlPackageTreeIDs = string.Join(",", packageTreeIDs.Select(x => "'" + x + "'"));

            foreach (string stereotype in stereotypes)
            {
                //add parent package if needed
                if (includeParent &&
                    parentPackage.Stereotypes.Any(x => x == stereotype) &&
                    !foundPackages.Any(x => x.Id == parentPackage.Id))
                {
                    foundPackages.Add(parentPackage);
                }
                //search for sub elements
                string getPackageIDsByStereotypeSQL = formatSQL(@"select distinct p.Package_ID from t_object o
														inner join t_xref x on o.ea_guid = x.Client
                                                        inner join t_package p on p.ea_guid = o.ea_guid
														where x.Name = 'Stereotypes' 
														and o.Object_Type = 'Package'
														and x.Description like '%@STEREO;Name="                                                         + stereotype + ";%'" +
                                                                " and o.PDATA1 in (" + sqlPackageTreeIDs + ")");
                XmlDocument results = new XmlDocument();
                results.LoadXml(eaRepository.SQLQuery(getPackageIDsByStereotypeSQL));
                //get the package id's from the query results a
                foreach (XmlNode packageIDNode in results.SelectNodes("//Package_ID"))
                {
                    int packageID;
                    if (int.TryParse(packageIDNode.InnerText, out packageID))
                    {
                        //get the packages
                        var package = eaRepository.GetPackageByID(packageID);
                        if (package != null)
                        {
                            foundPackages.Add(new EaUmlPackage(eaRepository, package));
                        }
                    }
                }
            }
            return(foundPackages);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Handles the selectionChanged event for the comboBoxBusinessCollaborationView
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void comboBoxBusinessCollaborationView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            foreach (var umlPackage in currentChoreographyView.GetPackagesByStereotype("bCollaborationV"))
            {
                if (umlPackage.Name.Equals(comboBoxBusinessCollaborationView.SelectedItem))
                {
                    currentCollaborationView = umlPackage;
                }
            }
            checkFormState();

            targetXSDs.Items.Clear();
            foreach (var keyValuePair in retrieveMessageNames())
            {
                targetXSDs.Items.Add(new RetrievedMessage(keyValuePair.Key, "", ""));
            }
            if (targetXSDs.Items.IsEmpty)
            {
                MessageBox.Show("Your model either contains no messages or it does not comply to the UMM 2.0 Standard.\n" +
                                "Please note that each bTransaction and bCollaborationProtocol must contain one InitFlow containing 'Initial' in its name.\n" +
                                "(More information can be found at http://umm-dev.org) ", "Warning! Unable to proceed.");
                buttonGenerate.IsEnabled = false;
            }
        }
Exemplo n.º 5
0
 public UpccBdtLibrary(IUmlPackage umlPackage) : base(umlPackage)
 {
 }
		protected UpccLibrary(IUmlPackage umlPackage)
		{
			UmlPackage = umlPackage;
		}
Exemplo n.º 7
0
 public UpccBieLibrary(IUmlPackage umlPackage)
 {
     UmlPackage = umlPackage;
 }
Exemplo n.º 8
0
 public IUmlPackage UpdatePackage(IUmlPackage umlPackage, UmlPackageSpec spec)
 {
     ((EaUmlPackage)umlPackage).Update(spec);
     return(umlPackage);
 }
Exemplo n.º 9
0
 public UpccPrimLibrary(IUmlPackage umlPackage)
 {
     UmlPackage = umlPackage;
 }
Exemplo n.º 10
0
 public UpccCdtLibrary(IUmlPackage umlPackage)
 {
     UmlPackage = umlPackage;
 }
Exemplo n.º 11
0
 public UpccDocLibrary(IUmlPackage umlPackage)
 {
     UmlPackage = umlPackage;
 }
Exemplo n.º 12
0
 public UpccDocLibrary(IUmlPackage umlPackage) : base(umlPackage)
 {
 }
 public UpccEnumLibrary(IUmlPackage umlPackage) : base(umlPackage)
 {
 }
Exemplo n.º 14
0
 public UpccEnumLibrary(IUmlPackage umlPackage)
 {
     UmlPackage = umlPackage;
 }