Exemplo n.º 1
0
        /// <summary>
        /// Gets the dependencies for a specific model elements.
        /// </summary>
        /// <param name="modelElements">List of model elements to get the dependencies for.</param>
        /// <param name="excludedDomainModels">Exclude dependencies that belong to a domain model that is provied in this list.</param>
        /// <param name="categories">List of categories to include in the search.</param>
        /// <returns>List of dependencies.</returns>
        public virtual DependenciesData GetDependencies(System.Collections.Generic.List <DslModeling::ModelElement> modelElements, System.Collections.Generic.List <DslModeling::ModelElement> excludedDomainModels, params DependencyItemCategory[] categories)
        {
            DependenciesData dependenciesData = new DependenciesData();

            foreach (DslModeling::ModelElement modelElement in modelElements)
            {
                if (modelElement is global::Tum.PDE.LanguageDSL.ExternModelContext)
                {
                    ExternModelContextDependencyItemsProvider.Instance.GetDependencies(dependenciesData, modelElement, excludedDomainModels, categories);
                }
                else if (modelElement is global::Tum.PDE.LanguageDSL.DomainRole)
                {
                    DomainRoleDependencyItemsProvider.Instance.GetDependencies(dependenciesData, modelElement, excludedDomainModels, categories);
                }
                else if (modelElement is global::Tum.PDE.LanguageDSL.DomainProperty)
                {
                    DomainPropertyDependencyItemsProvider.Instance.GetDependencies(dependenciesData, modelElement, excludedDomainModels, categories);
                }
                else if (modelElement is global::Tum.PDE.LanguageDSL.PropertyGridEditor)
                {
                    PropertyGridEditorDependencyItemsProvider.Instance.GetDependencies(dependenciesData, modelElement, excludedDomainModels, categories);
                }
            }

            return(dependenciesData);
        }
		/// <summary>
        /// Gets the dependencies for a specific model elements.
        /// </summary>
        /// <param name="modelElements">List of model elements to get the dependencies for.</param>
        /// <param name="excludedDomainModels">Exclude dependencies that belong to a domain model that is provied in this list.</param>
        /// <param name="categories">List of categories to include in the search.</param>
        /// <returns>List of dependencies.</returns>
        public virtual DependenciesData GetDependencies(System.Collections.Generic.List<DslModeling::ModelElement> modelElements, System.Collections.Generic.List<DslModeling::ModelElement> excludedDomainModels, params DependencyItemCategory[] categories)
		{
			DependenciesData dependenciesData = new DependenciesData();

			foreach(DslModeling::ModelElement modelElement in modelElements)
			{
				if(modelElement is global::Tum.PDE.LanguageDSL.ExternModelContext)
				{
					ExternModelContextDependencyItemsProvider.Instance.GetDependencies(dependenciesData, modelElement, excludedDomainModels, categories);
				}
				else if(modelElement is global::Tum.PDE.LanguageDSL.DomainRole)
				{
					DomainRoleDependencyItemsProvider.Instance.GetDependencies(dependenciesData, modelElement, excludedDomainModels, categories);
				}
				else if(modelElement is global::Tum.PDE.LanguageDSL.DomainProperty)
				{
					DomainPropertyDependencyItemsProvider.Instance.GetDependencies(dependenciesData, modelElement, excludedDomainModels, categories);
				}
				else if(modelElement is global::Tum.PDE.LanguageDSL.PropertyGridEditor)
				{
					PropertyGridEditorDependencyItemsProvider.Instance.GetDependencies(dependenciesData, modelElement, excludedDomainModels, categories);
				}
			}
			
			return dependenciesData;
		}
Exemplo n.º 3
0
        /// <summary>
        /// Gets the dependencies for a specific model elements.
        /// </summary>
        /// <param name="dependenciesData">Dependencies data to add new dependency and origin items to.</param>
        /// <param name="modelElement">Model element to get the dependencies for.</param>
        /// <param name="excludedDomainModels">Exclude dependencies that belong to a domain model that is provied in this list.</param>
        /// <param name="categories">List of categories to include in the search.</param>
        public virtual void GetDependencies(DependenciesData dependenciesData, DslModeling::ModelElement modelElement, System.Collections.Generic.List <DslModeling::ModelElement> excludedDomainModels, params DependencyItemCategory[] categories)
        {
            #region Check Parameter
            if (dependenciesData == null)
            {
                throw new System.ArgumentNullException("dependenciesData");
            }
            if (modelElement == null)
            {
                throw new System.ArgumentNullException("modelElement");
            }
            if (excludedDomainModels == null)
            {
                throw new System.ArgumentNullException("excludedDomainModels");
            }
            if (categories == null)
            {
                throw new System.ArgumentNullException("categories");
            }
            #endregion

            #region DomainTypeReferencesPropertyGridEditor
            // get all instances of DomainTypeReferencesPropertyGridEditor
            System.Collections.ObjectModel.ReadOnlyCollection <global::Tum.PDE.LanguageDSL.DomainTypeReferencesPropertyGridEditor> DomainTypeReferencesPropertyGridEditorLinks = DslModeling::DomainRoleInfo.GetElementLinks <global::Tum.PDE.LanguageDSL.DomainTypeReferencesPropertyGridEditor>(modelElement, global::Tum.PDE.LanguageDSL.DomainTypeReferencesPropertyGridEditor.DomainTypeDomainRoleId);
            if (DomainTypeReferencesPropertyGridEditorLinks.Count > 0)
            {
                foreach (global::Tum.PDE.LanguageDSL.DomainTypeReferencesPropertyGridEditor link in DomainTypeReferencesPropertyGridEditorLinks)
                {
                    bool bExclude = false;
                    if (excludedDomainModels.Count > 0)
                    {
                        DslModeling::ModelElement domainModel = LanguageDSLElementParentProvider.Instance.GetEmbeddingDomainModel(link.PropertyGridEditor);
                        if (excludedDomainModels.Contains(domainModel))
                        {
                            bExclude = true;
                        }
                    }
                    if (!bExclude)
                    {
                        foreach (DependencyItemCategory category in categories)
                        {
                            if (category == DependencyItemCategory.Referencing)
                            {
                                DependencyItem item = new DependencyItem(link, category,
                                                                         link.DomainType, link.PropertyGridEditor);
                                dependenciesData.ActiveDependencies.Add(item);
                            }
                        }
                    }
                }
            }
            #endregion
        }
Exemplo n.º 4
0
        public bool CanUnloadImportedLibrary()
        {
            DependenciesData data = GetDependencies();

            if (data.ActiveDependencies.Count > 0)
            {
                return(false);
            }

            // continue with imported imports
            foreach (MetaModelLibraryBase l in this.ImportingImports)
            {
                if (!l.CanUnloadImportedLibrary())
                {
                    return(false);
                }
            }

            return(true);
        }
Exemplo n.º 5
0
 /// <summary>
 /// Gets the dependencies for a specific model elements.
 /// </summary>
 /// <param name="dependenciesData">Dependencies data to add new dependency and origin items to.</param>
 /// <param name="modelElement">Model element to get the dependencies for.</param>
 /// <param name="excludedDomainModels">Exclude dependencies that belong to a domain model that is provied in this list.</param>
 /// <param name="categories">List of categories to include in the search.</param>
 public virtual void GetDependencies(DependenciesData dependenciesData, DslModeling::ModelElement modelElement, System.Collections.Generic.List <DslModeling::ModelElement> excludedDomainModels, params DependencyItemCategory[] categories)
 {
     #region Check Parameter
     if (dependenciesData == null)
     {
         throw new System.ArgumentNullException("dependenciesData");
     }
     if (modelElement == null)
     {
         throw new System.ArgumentNullException("modelElement");
     }
     if (excludedDomainModels == null)
     {
         throw new System.ArgumentNullException("excludedDomainModels");
     }
     if (categories == null)
     {
         throw new System.ArgumentNullException("categories");
     }
     #endregion
 }
		/// <summary>
        /// Gets the dependencies for a specific model elements.
        /// </summary>
		/// <param name="dependenciesData">Dependencies data to add new dependency and origin items to.</param>
        /// <param name="modelElement">Model element to get the dependencies for.</param>
        /// <param name="excludedDomainModels">Exclude dependencies that belong to a domain model that is provied in this list.</param>
        /// <param name="categories">List of categories to include in the search.</param>
        public virtual void GetDependencies(DependenciesData dependenciesData, DslModeling::ModelElement modelElement, System.Collections.Generic.List<DslModeling::ModelElement> excludedDomainModels, params DependencyItemCategory[] categories)
		{		
			#region Check Parameter
			if( dependenciesData == null )
				throw new System.ArgumentNullException("dependenciesData");
			if( modelElement == null )
				throw new System.ArgumentNullException("modelElement");
			if( excludedDomainModels == null )
				throw new System.ArgumentNullException("excludedDomainModels");
			if( categories == null )
				throw new System.ArgumentNullException("categories");				
			#endregion
			
		}
		/// <summary>
        /// Gets the dependencies for a specific model elements.
        /// </summary>
		/// <param name="dependenciesData">Dependencies data to add new dependency and origin items to.</param>
        /// <param name="modelElement">Model element to get the dependencies for.</param>
        /// <param name="excludedDomainModels">Exclude dependencies that belong to a domain model that is provied in this list.</param>
        /// <param name="categories">List of categories to include in the search.</param>
        public virtual void GetDependencies(DependenciesData dependenciesData, DslModeling::ModelElement modelElement, System.Collections.Generic.List<DslModeling::ModelElement> excludedDomainModels, params DependencyItemCategory[] categories)
		{		
			#region Check Parameter
			if( dependenciesData == null )
				throw new System.ArgumentNullException("dependenciesData");
			if( modelElement == null )
				throw new System.ArgumentNullException("modelElement");
			if( excludedDomainModels == null )
				throw new System.ArgumentNullException("excludedDomainModels");
			if( categories == null )
				throw new System.ArgumentNullException("categories");				
			#endregion
			
			#region DomainTypeReferencesPropertyGridEditor
		    // get all instances of DomainTypeReferencesPropertyGridEditor				
		    System.Collections.ObjectModel.ReadOnlyCollection<global::Tum.PDE.LanguageDSL.DomainTypeReferencesPropertyGridEditor> DomainTypeReferencesPropertyGridEditorLinks = DslModeling::DomainRoleInfo.GetElementLinks<global::Tum.PDE.LanguageDSL.DomainTypeReferencesPropertyGridEditor>(modelElement, global::Tum.PDE.LanguageDSL.DomainTypeReferencesPropertyGridEditor.DomainTypeDomainRoleId);
		    if( DomainTypeReferencesPropertyGridEditorLinks.Count > 0 )
		    {
		    	foreach(global::Tum.PDE.LanguageDSL.DomainTypeReferencesPropertyGridEditor link in DomainTypeReferencesPropertyGridEditorLinks)
		    	{
		    		bool bExclude = false;
		    		if( excludedDomainModels.Count > 0 )
		    		{	
		    			DslModeling::ModelElement domainModel = LanguageDSLElementParentProvider.Instance.GetEmbeddingDomainModel(link.PropertyGridEditor);
		    			if( excludedDomainModels.Contains(domainModel) )
		    				bExclude = true;
		    		}				
					if( !bExclude )
					{
						foreach(DependencyItemCategory category in categories)
						{
							if( category == DependencyItemCategory.Referencing )
							{
								DependencyItem item = new DependencyItem(link, category,
									link.DomainType, link.PropertyGridEditor);
								dependenciesData.ActiveDependencies.Add(item);
							}								
						}
					}
		    	}
		    }			
			#endregion
		}