Exemple #1
0
			/// <summary>
			/// Updates the compartments for the shapes associated to the given list of model elements
			/// </summary>
			/// <param name="elements">List of model elements</param>
			/// <param name="shapeType">The type of shape that needs updating</param>
			/// <param name="compartmentName">The name of the compartment to update</param>
			/// <param name="repaintOnly">If true, the method will only invalidate the shape for a repaint, without re-initializing the shape.</param>
			internal static void UpdateCompartments(global::System.Collections.IEnumerable elements, global::System.Type shapeType, string compartmentName, bool repaintOnly)
			{
				foreach (DslModeling::ModelElement element in elements)
				{
					DslModeling::LinkedElementCollection<DslDiagrams::PresentationElement> pels = DslDiagrams::PresentationViewsSubject.GetPresentation(element);
					foreach (DslDiagrams::PresentationElement pel in pels)
					{
						DslDiagrams::CompartmentShape compartmentShape = pel as DslDiagrams::CompartmentShape;
						if (compartmentShape != null && shapeType.IsAssignableFrom(compartmentShape.GetType()))
						{
							if (repaintOnly)
							{
								compartmentShape.Invalidate();
							}
							else
							{
								foreach(DslDiagrams::CompartmentMapping mapping in compartmentShape.GetCompartmentMappings())
								{
									if(mapping.CompartmentId==compartmentName)
									{
										mapping.InitializeCompartmentShape(compartmentShape);
										break;
									}
								}
							}
						}
					}
				}
			}
Exemple #2
0
        internal static global::System.Collections.IList GetElementsFromSimboloForSinonimoCompartment(DslModeling::ModelElement rootElement)
        {
            global::Maxsys.VisualLAL.Simbolo root = (global::Maxsys.VisualLAL.Simbolo)rootElement;
            // Segments 0 and 1
            DslModeling::LinkedElementCollection <global::Maxsys.VisualLAL.Sinonimo> result = root.Sinonimos;

            return(result);
        }
Exemple #3
0
        internal static global::System.Collections.IList GetElementsFromContainerForAssets(DslModeling::ModelElement rootElement)
        {
            global::JA.Risk.Container root = (global::JA.Risk.Container)rootElement;
            // Segments 0 and 1
            DslModeling::LinkedElementCollection <global::JA.Risk.Asset> result = root.Assets;

            return(result);
        }
Exemple #4
0
        internal static global::System.Collections.IList GetElementsFromOptionForProperties(DslModeling::ModelElement rootElement)
        {
            global::Ufba.Ev.Option root = (global::Ufba.Ev.Option)rootElement;
            // Segments 0 and 1
            DslModeling::LinkedElementCollection <global::Ufba.Ev.Property> result = root.Properties;

            return(result);
        }
Exemple #5
0
		/// <summary>
		/// Helper method to find shapes for either end of a connector by looking for shapes associated with either end of the relationship mapped to the connector.
		/// </summary>
		private DslDiagrams::NodeShape[] GetEndShapesForConnector(DslDiagrams::BinaryLinkShape connector)
		{
			DslModeling::ElementLink link = connector.ModelElement as DslModeling::ElementLink;
			DslDiagrams::NodeShape sourceShape = null, targetShape = null;
			if (link != null)
			{
				global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::ModelElement> linkedElements = link.LinkedElements;
				if (linkedElements.Count == 2)
				{
					DslDiagrams::Diagram currentDiagram = this.Diagram;
					DslModeling::LinkedElementCollection<DslDiagrams::PresentationElement> presentationElements = DslDiagrams::PresentationViewsSubject.GetPresentation(linkedElements[0]);
					foreach (DslDiagrams::PresentationElement presentationElement in presentationElements)
					{
						DslDiagrams::NodeShape shape = presentationElement as DslDiagrams::NodeShape;
						if (shape != null && shape.Diagram == currentDiagram)
						{
							sourceShape = shape;
							break;
						}
					}
					
					presentationElements = DslDiagrams::PresentationViewsSubject.GetPresentation(linkedElements[1]);
					foreach (DslDiagrams::PresentationElement presentationElement in presentationElements)
					{
						DslDiagrams::NodeShape shape = presentationElement as DslDiagrams::NodeShape;
						if (shape != null && shape.Diagram == currentDiagram)
						{
							targetShape = shape;
							break;
						}
					}
		
				}
			}
			
			return new DslDiagrams::NodeShape[] { sourceShape, targetShape };
		}
        internal static global::System.Collections.IList GetElementsFromEntityTypeForAttributesCompartment(DslModeling::ModelElement element)
        {
            global::ORMSolutions.ORMArchitect.EntityRelationshipModels.Barker.EntityType root = (global::ORMSolutions.ORMArchitect.EntityRelationshipModels.Barker.EntityType)element;
            // Segments 0 and 1
            DslModeling::LinkedElementCollection <global::ORMSolutions.ORMArchitect.EntityRelationshipModels.Barker.Attribute> result = root.AttributeCollection;

            return(result);
        }
        internal static global::System.Collections.IList GetElementsFromEntityTypeForProperties(DslModeling::ModelElement rootElement)
        {
            global::Microsoft.EntityFrameworkCore.Modeling.EntityType root = (global::Microsoft.EntityFrameworkCore.Modeling.EntityType)rootElement;
            // Segments 0 and 1
            DslModeling::LinkedElementCollection <global::Microsoft.EntityFrameworkCore.Modeling.Property> result = root.Properties;

            return(result);
        }
Exemple #8
0
        private static DslModeling::ModelElement GetParentForRelationship(DslModeling::ElementLink elementLink)
        {
            global::System.Collections.ObjectModel.ReadOnlyCollection <DslModeling::ModelElement> linkedElements = elementLink.LinkedElements;

            if (linkedElements.Count == 2)
            {
                DslDiagrams::ShapeElement sourceShape = linkedElements[0] as DslDiagrams::ShapeElement;
                DslDiagrams::ShapeElement targetShape = linkedElements[1] as DslDiagrams::ShapeElement;

                if (sourceShape == null)
                {
                    DslModeling::LinkedElementCollection <DslDiagrams::PresentationElement> presentationElements = DslDiagrams::PresentationViewsSubject.GetPresentation(linkedElements[0]);
                    foreach (DslDiagrams::PresentationElement presentationElement in presentationElements)
                    {
                        DslDiagrams::ShapeElement shape = presentationElement as DslDiagrams::ShapeElement;
                        if (shape != null)
                        {
                            sourceShape = shape;
                            break;
                        }
                    }
                }

                if (targetShape == null)
                {
                    DslModeling::LinkedElementCollection <DslDiagrams::PresentationElement> presentationElements = DslDiagrams::PresentationViewsSubject.GetPresentation(linkedElements[1]);
                    foreach (DslDiagrams::PresentationElement presentationElement in presentationElements)
                    {
                        DslDiagrams::ShapeElement shape = presentationElement as DslDiagrams::ShapeElement;
                        if (shape != null)
                        {
                            targetShape = shape;
                            break;
                        }
                    }
                }

                if (sourceShape == null || targetShape == null)
                {
                    global::System.Diagnostics.Debug.Fail("Unable to find source and/or target shape for view fixup.");
                    return(null);
                }

                DslDiagrams::ShapeElement sourceParent = sourceShape.ParentShape;
                DslDiagrams::ShapeElement targetParent = targetShape.ParentShape;

                while (sourceParent != targetParent && sourceParent != null)
                {
                    DslDiagrams::ShapeElement curParent = targetParent;
                    while (sourceParent != curParent && curParent != null)
                    {
                        curParent = curParent.ParentShape;
                    }

                    if (sourceParent == curParent)
                    {
                        break;
                    }
                    else
                    {
                        sourceParent = sourceParent.ParentShape;
                    }
                }

                while (sourceParent != null)
                {
                    // ensure that the parent can parent connectors (i.e., a diagram or a swimlane).
                    if (sourceParent is DslDiagrams::Diagram || sourceParent is DslDiagrams::SwimlaneShape)
                    {
                        break;
                    }
                    else
                    {
                        sourceParent = sourceParent.ParentShape;
                    }
                }

                global::System.Diagnostics.Debug.Assert(sourceParent != null && sourceParent.ModelElement != null, "Unable to find common parent for view fixup.");
                return(sourceParent.ModelElement);
            }

            return(null);
        }
Exemple #9
0
        internal static global::System.Collections.IList GetElementsFromTableForColumnsCompartment(DslModeling::ModelElement element)
        {
            global::ORMSolutions.ORMArchitect.RelationalModels.ConceptualDatabase.Table root = (global::ORMSolutions.ORMArchitect.RelationalModels.ConceptualDatabase.Table)element;
            // Segments 0 and 1
            DslModeling::LinkedElementCollection <global::ORMSolutions.ORMArchitect.RelationalModels.ConceptualDatabase.Column> result = root.ColumnCollection;

            return(result);
        }
        internal static global::System.Collections.IList GetElementsFromEntityForProperties(DslModeling::ModelElement rootElement)
        {
            global::EPAM.NHModelingLanguage.Entity root = (global::EPAM.NHModelingLanguage.Entity)rootElement;
            // Segments 0 and 1
            DslModeling::LinkedElementCollection <global::EPAM.NHModelingLanguage.Property> result = root.Properties;

            return(result);
        }
Exemple #11
0
        internal static global::System.Collections.IList GetElementsFromNestedClassForProperties(DslModeling::ModelElement element)
        {
            global::Castle.ActiveWriter.NestedClass root = (global::Castle.ActiveWriter.NestedClass)element;
            // Segments 0 and 1
            DslModeling::LinkedElementCollection <global::Castle.ActiveWriter.ModelProperty> result = root.Properties;

            return(result);
        }
Exemple #12
0
        internal static global::System.Collections.IList GetElementsFromModelClassForNavigationPropertiesCompartment(DslModeling::ModelElement element)
        {
            global::AgileFx.AgileModeler.ModelClass root = (global::AgileFx.AgileModeler.ModelClass)element;
            // Segments 0 and 1
            DslModeling::LinkedElementCollection <global::AgileFx.AgileModeler.NavigationProperty> result = root.NavigationProperties;

            return(result);
        }
Exemple #13
0
        internal static global::System.Collections.IList GetElementsFromEntityTypeForProperties(DslModeling::ModelElement element)
        {
            global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType root = (global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType)element;
            // Segments 0 and 1
            DslModeling::LinkedElementCollection <global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Property> result = root.Properties;

            return(result);
        }
Exemple #14
0
        internal static global::System.Collections.IList GetElementsFromOperacionForparametros(DslModeling::ModelElement rootElement)
        {
            global::UPM_IPS.MBRDCMDMI_ProyectoIPS.MBRDCMDMI.Operacion root = (global::UPM_IPS.MBRDCMDMI_ProyectoIPS.MBRDCMDMI.Operacion)rootElement;
            // Segments 0 and 1
            DslModeling::LinkedElementCollection <global::UPM_IPS.MBRDCMDMI_ProyectoIPS.MBRDCMDMI.Parametro> result = root.Parametro;

            return(result);
        }
Exemple #15
0
        internal static global::System.Collections.IList GetElementsFromClasePrincipalForoperaciones(DslModeling::ModelElement rootElement)
        {
            global::UPM_IPS.MBRDCMDMI_ProyectoIPS.MBRDCMDMI.ClasePrincipal root = (global::UPM_IPS.MBRDCMDMI_ProyectoIPS.MBRDCMDMI.ClasePrincipal)rootElement;
            // Segments 0 and 1
            DslModeling::LinkedElementCollection <global::UPM_IPS.MBRDCMDMI_ProyectoIPS.MBRDCMDMI.Operacion> result = root.Operacion;

            return(result);
        }
Exemple #16
0
        internal static global::System.Collections.IList GetElementsFromClaseForAtributos(DslModeling::ModelElement rootElement)
        {
            global::UPM_IPS.DRMRRBRRMProyectoIPS.Clase root = (global::UPM_IPS.DRMRRBRRMProyectoIPS.Clase)rootElement;
            // Segments 0 and 1
            DslModeling::LinkedElementCollection <global::UPM_IPS.DRMRRBRRMProyectoIPS.Atributo> result = root.Atributo;

            return(result);
        }