Esempio n. 1
0
            /// <summary>
            /// Event handler called when decorator initialization is complete for ModuleShape.  Adds decorator mappings for this shape or connector.
            /// </summary>
            public static void OnDecoratorsInitialized(object sender, global::System.EventArgs e)
            {
                DslDiagrams::ShapeElement           shape = (DslDiagrams::ShapeElement)sender;
                DslDiagrams::AssociatedPropertyInfo propertyInfo;

                propertyInfo = new DslDiagrams::AssociatedPropertyInfo(global::Microsoft.Gadgeteer.Designer.Module.NameDomainPropertyId);
                DslDiagrams::ShapeElement.FindDecorator(shape.Decorators, "LabelDecorator").AssociateValueWith(shape.Store, propertyInfo);

                propertyInfo = new DslDiagrams::AssociatedPropertyInfo(global::Microsoft.Gadgeteer.Designer.Module.TypeDomainPropertyId);
                DslDiagrams::ShapeElement.FindDecorator(shape.Decorators, "TypeDecorator").AssociateValueWith(shape.Store, propertyInfo);
            }
Esempio n. 2
0
            /// <summary>
            /// Event handler called when decorator initialization is complete for ObjectShape.  Adds decorator mappings for this shape or connector.
            /// </summary>
            public static void OnDecoratorsInitialized(object sender, global::System.EventArgs e)
            {
                DslDiagrams::ShapeElement           shape = (DslDiagrams::ShapeElement)sender;
                DslDiagrams::AssociatedPropertyInfo propertyInfo;

                propertyInfo = new DslDiagrams::AssociatedPropertyInfo(global::AppDevUnited.TaskFlowDSLSample.NamedElement.NameDomainPropertyId);
                DslDiagrams::ShapeElement.FindDecorator(shape.Decorators, "Name").AssociateValueWith(shape.Store, propertyInfo);

                propertyInfo = new DslDiagrams::AssociatedPropertyInfo(global::AppDevUnited.TaskFlowDSLSample.ObjectInState.StateDomainPropertyId);
                DslDiagrams::ShapeElement.FindDecorator(shape.Decorators, "State").AssociateValueWith(shape.Store, propertyInfo);
            }
Esempio n. 3
0
            /// <summary>
            /// Event handler called when decorator initialization is complete for EndShape.  Adds decorator mappings for this shape or connector.
            /// </summary>
            public static void OnDecoratorsInitialized(object sender, global::System.EventArgs e)
            {
                DslDiagrams::ShapeElement           shape = (DslDiagrams::ShapeElement)sender;
                DslDiagrams::AssociatedPropertyInfo propertyInfo;

                propertyInfo = new DslDiagrams::AssociatedPropertyInfo(global::BotFrameworkDsl.End.NameDomainPropertyId);
                DslDiagrams::ShapeElement.FindDecorator(shape.Decorators, "NameDecorator").AssociateValueWith(shape.Store, propertyInfo);

                propertyInfo = new DslDiagrams::AssociatedPropertyInfo(global::BotFrameworkDsl.End.NameDomainPropertyId);
                DslDiagrams::ShapeElement.FindDecorator(shape.Decorators, "NameDecorator").AssociateValueWith(shape.Store, propertyInfo);
            }
            /// <summary>
            /// Event handler called when decorator initialization is complete for VentanaS.  Adds decorator mappings for this shape or connector.
            /// </summary>
            public static void OnDecoratorsInitialized(object sender, global::System.EventArgs e)
            {
                DslDiagrams::ShapeElement           shape = (DslDiagrams::ShapeElement)sender;
                DslDiagrams::AssociatedPropertyInfo propertyInfo;

                propertyInfo = new DslDiagrams::AssociatedPropertyInfo(global::UPM_IPS.DNRDPVSQGProyectoMDD.Ventana.nombreDomainPropertyId);
                DslDiagrams::ShapeElement.FindDecorator(shape.Decorators, "NombreVentanaS").AssociateValueWith(shape.Store, propertyInfo);

                propertyInfo = new DslDiagrams::AssociatedPropertyInfo(global::UPM_IPS.DNRDPVSQGProyectoMDD.VentanaSecundaria.modalDomainPropertyId);
                propertyInfo.FilteringValues.Add("True");
                DslDiagrams::ShapeElement.FindDecorator(shape.Decorators, "IconModal").AssociateVisibilityWith(shape.Store, propertyInfo);
            }
            /// <summary>
            /// Called by the base ConnectAction class to determine if the given shapes can be connected.
            /// </summary>
            /// <remarks>
            /// This implementation delegates calls to the ConnectionBuilder InheritanceBuilder.
            /// </remarks>
            public override bool CanCreateConnection(DslDiagrams::ShapeElement sourceShapeElement, DslDiagrams::ShapeElement targetShapeElement, ref string connectionWarning)
            {
                bool canConnect = true;

                if (sourceShapeElement == null)
                {
                    throw new global::System.ArgumentNullException("sourceShapeElement");
                }
                sourceShapeElement = RemovePassThroughShapes(sourceShapeElement);
                DslModeling::ModelElement sourceElement = sourceShapeElement.ModelElement;

                if (sourceElement == null)
                {
                    sourceElement = sourceShapeElement;
                }

                DslModeling::ModelElement targetElement = null;

                if (targetShapeElement != null)
                {
                    targetShapeElement = RemovePassThroughShapes(targetShapeElement);
                    targetElement      = targetShapeElement.ModelElement;
                    if (targetElement == null)
                    {
                        targetElement = targetShapeElement;
                    }

                    // The InheritanceTool connection tool specifies that source and target should be reversed.
                    // base.CanCreateConnection must be called to check whether existing Locks prevent this link from getting created.
                    canConnect = base.CanCreateConnection(targetShapeElement, sourceShapeElement, ref connectionWarning);
                }

                if (canConnect)
                {
                    if (targetShapeElement == null)
                    {
                        // The InheritanceTool connection tool specifies that source and target should be reversed.
                        return(InheritanceBuilder.CanAcceptTarget(sourceElement));
                    }
                    else
                    {
                        // The InheritanceTool connection tool specifies that source and target should be reversed.
                        return(InheritanceBuilder.CanAcceptSourceAndTarget(targetElement, sourceElement));
                    }
                }
                else
                {
                    //return false
                    return(canConnect);
                }
            }
Esempio n. 6
0
            /// <summary>
            /// Event handler called when decorator initialization is complete for RelationshipShape.  Adds decorator mappings for this shape or connector.
            /// </summary>
            public static void OnDecoratorsInitialized(object sender, global::System.EventArgs e)
            {
                DslDiagrams::ShapeElement           shape = (DslDiagrams::ShapeElement)sender;
                DslDiagrams::AssociatedPropertyInfo propertyInfo;

                propertyInfo = new DslDiagrams::AssociatedPropertyInfo(global::Bb.ApplicationCooperationViewPoint.Relationship.NameDomainPropertyId);
                DslDiagrams::ShapeElement.FindDecorator(shape.Decorators, "NameDecorator").AssociateValueWith(shape.Store, propertyInfo);

                propertyInfo = new DslDiagrams::AssociatedPropertyInfo(global::Bb.ApplicationCooperationViewPoint.Relationship.NameDomainPropertyId);
                DslDiagrams::ShapeElement.FindDecorator(shape.Decorators, "NameDecorator").AssociateValueWith(shape.Store, propertyInfo);

                propertyInfo = new DslDiagrams::AssociatedPropertyInfo(global::Bb.ApplicationCooperationViewPoint.Relationship.LabelDomainPropertyId);
                DslDiagrams::ShapeElement.FindDecorator(shape.Decorators, "LabelDecorator").AssociateValueWith(shape.Store, propertyInfo);
            }
Esempio n. 7
0
            private static DslDiagrams::ShapeElement RemovePassThroughShapes(DslDiagrams::ShapeElement shape)
            {
                if (shape is DslDiagrams::Compartment)
                {
                    return(shape.ParentShape);
                }
                DslDiagrams::SwimlaneShape swimlane = shape as DslDiagrams::SwimlaneShape;

                if (swimlane != null && swimlane.ForwardDragDropToParent)
                {
                    return(shape.ParentShape);
                }
                return(shape);
            }
Esempio n. 8
0
            /// <summary>
            /// Event handler called when decorator initialization is complete for FeatureShape.  Adds decorator mappings for this shape or connector.
            /// </summary>
            public static void OnDecoratorsInitialized(object sender, global::System.EventArgs e)
            {
                DslDiagrams::ShapeElement           shape = (DslDiagrams::ShapeElement)sender;
                DslDiagrams::AssociatedPropertyInfo propertyInfo;

                propertyInfo = new DslDiagrams::AssociatedPropertyInfo(global::Ufba.vShome.Feature.FeatureTypeDomainPropertyId);
                DslDiagrams::ShapeElement.FindDecorator(shape.Decorators, "FeatureType").AssociateValueWith(shape.Store, propertyInfo);

                propertyInfo = new DslDiagrams::AssociatedPropertyInfo(global::Ufba.vShome.Feature.FeatureNameDomainPropertyId);
                DslDiagrams::ShapeElement.FindDecorator(shape.Decorators, "Name").AssociateValueWith(shape.Store, propertyInfo);

                propertyInfo = new DslDiagrams::AssociatedPropertyInfo(global::Ufba.vShome.Feature.SerialDomainPropertyId);
                DslDiagrams::ShapeElement.FindDecorator(shape.Decorators, "Serial").AssociateValueWith(shape.Store, propertyInfo);
            }
Esempio n. 9
0
		/// <summary>
		/// Called during view fixup to configure the given child element, after it has been created.
		/// </summary>
		/// <remarks>
		/// Custom code for choosing the shapes attached to either end of a connector is called from here.
		/// </remarks>
		protected override void OnChildConfiguring(DslDiagrams::ShapeElement child, bool createdDuringViewFixup)
		{
			DslDiagrams::NodeShape sourceShape;
			DslDiagrams::NodeShape targetShape;
			DslDiagrams::BinaryLinkShape connector = child as DslDiagrams::BinaryLinkShape;
			if(connector == null)
			{
				base.OnChildConfiguring(child, createdDuringViewFixup);
				return;
			}
			this.GetSourceAndTargetForConnector(connector, out sourceShape, out targetShape);
			
			global::System.Diagnostics.Debug.Assert(sourceShape != null && targetShape != null, "Unable to find source and target shapes for connector.");
			connector.Connect(sourceShape, targetShape);
		}
Esempio n. 10
0
            /// <summary>
            /// Called by the base ConnectAction class to determine if the given shapes can be connected.
            /// </summary>
            /// <remarks>
            /// This implementation delegates calls to the ConnectionBuilder EntidadReferencesRelacionedBuilder.
            /// </remarks>
            public override bool CanCreateConnection(DslDiagrams::ShapeElement sourceShapeElement, DslDiagrams::ShapeElement targetShapeElement, ref string connectionWarning)
            {
                bool canConnect = true;

                if (sourceShapeElement == null)
                {
                    throw new global::System.ArgumentNullException("sourceShapeElement");
                }
                sourceShapeElement = RemovePassThroughShapes(sourceShapeElement);
                DslModeling::ModelElement sourceElement = sourceShapeElement.ModelElement;

                if (sourceElement == null)
                {
                    sourceElement = sourceShapeElement;
                }

                DslModeling::ModelElement targetElement = null;

                if (targetShapeElement != null)
                {
                    targetShapeElement = RemovePassThroughShapes(targetShapeElement);
                    targetElement      = targetShapeElement.ModelElement;
                    if (targetElement == null)
                    {
                        targetElement = targetShapeElement;
                    }
                }

                // base.CanCreateConnection must be called to check whether existing Locks prevent this link from getting created.
                canConnect = base.CanCreateConnection(sourceShapeElement, targetShapeElement, ref connectionWarning);
                if (canConnect)
                {
                    if (targetShapeElement == null)
                    {
                        return(EntidadReferencesRelacionedBuilder.CanAcceptSource(sourceElement));
                    }
                    else
                    {
                        return(EntidadReferencesRelacionedBuilder.CanAcceptSourceAndTarget(sourceElement, targetElement));
                    }
                }
                else
                {
                    //return false
                    return(canConnect);
                }
            }
Esempio n. 11
0
        /// <summary>
        /// Gets the cursor corresponding to the given mouse position.
        /// </summary>
        /// <remarks>
        /// Changes the cursor to Cursors.No before the first mouse click if the source shape is not valid.
        /// </remarks>
        public override global::System.Windows.Forms.Cursor GetCursor(global::System.Windows.Forms.Cursor currentCursor, DslDiagrams::DiagramClientView diagramClientView, DslDiagrams::PointD mousePosition)
        {
            if (this.MouseDownHitShape == null && currentCursor != global::System.Windows.Forms.Cursors.No)
            {
                DslDiagrams::DiagramHitTestInfo hitTestInfo = new DslDiagrams::DiagramHitTestInfo(diagramClientView);
                this.Diagram.DoHitTest(mousePosition, hitTestInfo);
                DslDiagrams::ShapeElement shape = hitTestInfo.HitDiagramItem.Shape;

                DslDiagrams::ConnectionType connectionType = GetConnectionTypes(shape, null)[0];
                string warningString = string.Empty;
                if (!connectionType.CanCreateConnection(shape, null, ref warningString))
                {
                    return(global::System.Windows.Forms.Cursors.No);
                }
            }
            return(base.GetCursor(currentCursor, diagramClientView, mousePosition));
        }
Esempio n. 12
0
            /// <summary>
            /// Event handler called when decorator initialization is complete for CapacitorShape.  Adds decorator mappings for this shape or connector.
            /// </summary>
            public static void OnDecoratorsInitialized(object sender, global::System.EventArgs e)
            {
                ComponentShapeDecoratorMap.OnDecoratorsInitialized(sender, e);

                DslDiagrams::ShapeElement           shape = (DslDiagrams::ShapeElement)sender;
                DslDiagrams::AssociatedPropertyInfo propertyInfo;

                propertyInfo = new DslDiagrams::AssociatedPropertyInfo(global::Microsoft.Example.Circuits.NamedElement.NameDomainPropertyId);
                DslDiagrams::ShapeElement.FindDecorator(shape.Decorators, "NameDecorator").AssociateValueWith(shape.Store, propertyInfo);

                propertyInfo = new DslDiagrams::AssociatedPropertyInfo(global::Microsoft.Example.Circuits.Capacitor.IsPolarDomainPropertyId);
                propertyInfo.FilteringValues.Add("False");
                DslDiagrams::ShapeElement.FindDecorator(shape.Decorators, "NonPolarImage").AssociateVisibilityWith(shape.Store, propertyInfo);

                propertyInfo = new DslDiagrams::AssociatedPropertyInfo(global::Microsoft.Example.Circuits.Capacitor.IsPolarDomainPropertyId);
                propertyInfo.FilteringValues.Add("True");
                DslDiagrams::ShapeElement.FindDecorator(shape.Decorators, "PolarImage").AssociateVisibilityWith(shape.Store, propertyInfo);
            }
            /// <summary>
            /// Event handler called when decorator initialization is complete for ItemShape.  Adds decorator mappings for this shape or connector.
            /// </summary>
            public static void OnDecoratorsInitialized(object sender, global::System.EventArgs e)
            {
                DslDiagrams::ShapeElement           shape = (DslDiagrams::ShapeElement)sender;
                DslDiagrams::AssociatedPropertyInfo propertyInfo;

                propertyInfo = new DslDiagrams::AssociatedPropertyInfo(global::UPM_IPS.DNRDPVSQGProyectoMDD.Item.tipoDomainPropertyId);
                propertyInfo.FilteringValues.Add("Instagram");
                DslDiagrams::ShapeElement.FindDecorator(shape.Decorators, "InstagramIcon").AssociateVisibilityWith(shape.Store, propertyInfo);

                propertyInfo = new DslDiagrams::AssociatedPropertyInfo(global::UPM_IPS.DNRDPVSQGProyectoMDD.Item.tipoDomainPropertyId);
                propertyInfo.FilteringValues.Add("Facebook");
                DslDiagrams::ShapeElement.FindDecorator(shape.Decorators, "FacebookIcon").AssociateVisibilityWith(shape.Store, propertyInfo);

                propertyInfo = new DslDiagrams::AssociatedPropertyInfo(global::UPM_IPS.DNRDPVSQGProyectoMDD.Item.tipoDomainPropertyId);
                propertyInfo.FilteringValues.Add("Twitter");
                DslDiagrams::ShapeElement.FindDecorator(shape.Decorators, "TwitterIcon").AssociateVisibilityWith(shape.Store, propertyInfo);

                propertyInfo = new DslDiagrams::AssociatedPropertyInfo(global::UPM_IPS.DNRDPVSQGProyectoMDD.Item.tituloDomainPropertyId);
                DslDiagrams::ShapeElement.FindDecorator(shape.Decorators, "NombreItem").AssociateValueWith(shape.Store, propertyInfo);

                propertyInfo = new DslDiagrams::AssociatedPropertyInfo(global::UPM_IPS.DNRDPVSQGProyectoMDD.Item.tipoDomainPropertyId);
                propertyInfo.FilteringValues.Add("PorDefecto");
                DslDiagrams::ShapeElement.FindDecorator(shape.Decorators, "DefaultIcon").AssociateVisibilityWith(shape.Store, propertyInfo);
            }
Esempio n. 14
0
        /// <summary>
        /// Returns the ProductionWorkflowConnectorConnectionType associated with this action.
        /// </summary>
        protected override DslDiagrams::ConnectionType[] GetConnectionTypes(DslDiagrams::ShapeElement sourceShapeElement, DslDiagrams::ShapeElement targetShapeElement)
        {
            if (this.connectionTypes == null)
            {
                this.connectionTypes = new DslDiagrams::ConnectionType[] { new ProductionWorkflowConnectorConnectionType() };
            }

            return(this.connectionTypes);
        }
Esempio n. 15
0
        /// <summary>
        /// Returns the Broker_To_Application_ConnectorConnectionType associated with this action.
        /// </summary>
        protected override DslDiagrams::ConnectionType[] GetConnectionTypes(DslDiagrams::ShapeElement sourceShapeElement, DslDiagrams::ShapeElement targetShapeElement)
        {
            if (this.connectionTypes == null)
            {
                this.connectionTypes = new DslDiagrams::ConnectionType[] { new Broker_To_Application_ConnectorConnectionType() };
            }

            return(this.connectionTypes);
        }
Esempio n. 16
0
        /// <summary>
        /// Returns the EntidadRelacionConnectionType associated with this action.
        /// </summary>
        protected override DslDiagrams::ConnectionType[] GetConnectionTypes(DslDiagrams::ShapeElement sourceShapeElement, DslDiagrams::ShapeElement targetShapeElement)
        {
            if (this.connectionTypes == null)
            {
                this.connectionTypes = new DslDiagrams::ConnectionType[] { new EntidadRelacionConnectionType() };
            }

            return(this.connectionTypes);
        }
            /// <summary>
            /// Called by the base ConnectAction class to create the underlying relationship.
            /// </summary>
            /// <remarks>
            /// This implementation delegates calls to the ConnectionBuilder SocketUseReferencesSocketBuilder.
            /// </remarks>
            public override void CreateConnection(DslDiagrams::ShapeElement sourceShapeElement, DslDiagrams::ShapeElement targetShapeElement, DslDiagrams::PaintFeedbackArgs paintFeedbackArgs)
            {
                if (sourceShapeElement == null)
                {
                    throw new global::System.ArgumentNullException("sourceShapeElement");
                }
                if (targetShapeElement == null)
                {
                    throw new global::System.ArgumentNullException("targetShapeElement");
                }

                sourceShapeElement = RemovePassThroughShapes(sourceShapeElement);
                targetShapeElement = RemovePassThroughShapes(targetShapeElement);

                DslModeling::ModelElement sourceElement = sourceShapeElement.ModelElement;

                if (sourceElement == null)
                {
                    sourceElement = sourceShapeElement;
                }
                DslModeling::ModelElement targetElement = targetShapeElement.ModelElement;

                if (targetElement == null)
                {
                    targetElement = targetShapeElement;
                }
                // You will need to implement a method with the following signature:
                // public static void Connect(DslModeling::ModelElement sourceElement, DslModeling::ModelElement targetElement)
                // {
                // }
                // in a partial class of SocketUseReferencesSocketBuilder.
                SocketUseReferencesSocketBuilder.Connect(sourceElement, targetElement);
            }
Esempio n. 18
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);
        }
            /// <summary>
            /// Called by the base ConnectAction class to determine if the given shapes can be connected.
            /// </summary>
            /// <remarks>
            /// This implementation delegates calls to the ConnectionBuilder SocketUseReferencesSocketBuilder.
            /// </remarks>
            public override bool CanCreateConnection(DslDiagrams::ShapeElement sourceShapeElement, DslDiagrams::ShapeElement targetShapeElement, ref string connectionWarning)
            {
                bool canConnect = true;

                if (sourceShapeElement == null)
                {
                    throw new global::System.ArgumentNullException("sourceShapeElement");
                }
                sourceShapeElement = RemovePassThroughShapes(sourceShapeElement);
                DslModeling::ModelElement sourceElement = sourceShapeElement.ModelElement;

                if (sourceElement == null)
                {
                    sourceElement = sourceShapeElement;
                }

                DslModeling::ModelElement targetElement = null;

                if (targetShapeElement != null)
                {
                    targetShapeElement = RemovePassThroughShapes(targetShapeElement);
                    targetElement      = targetShapeElement.ModelElement;
                    if (targetElement == null)
                    {
                        targetElement = targetShapeElement;
                    }
                }

                // base.CanCreateConnection must be called to check whether existing Locks prevent this link from getting created.
                canConnect = base.CanCreateConnection(sourceShapeElement, targetShapeElement, ref connectionWarning);
                if (canConnect)
                {
                    if (targetShapeElement == null)
                    {
                        // You will need to implement a method with the following signature:
                        // public static bool CanAcceptSource(DslModeling::ModelElement sourceElement)
                        // {
                        // }
                        // in a partial class of SocketUseReferencesSocketBuilder.
                        return(SocketUseReferencesSocketBuilder.CanAcceptSource(sourceElement));
                    }
                    else
                    {
                        // You will need to implement a method with the following signature:
                        // public static bool CanAcceptSourceAndTarget(DslModeling::ModelElement sourceElement, DslModeling::ModelElement targetElement)
                        // {
                        // }
                        // in a partial class of SocketUseReferencesSocketBuilder.
                        return(SocketUseReferencesSocketBuilder.CanAcceptSourceAndTarget(sourceElement, targetElement));
                    }
                }
                else
                {
                    //return false
                    return(canConnect);
                }
            }
            /// <summary>
            /// Called by the base ConnectAction class to create the underlying relationship.
            /// </summary>
            /// <remarks>
            /// This implementation delegates calls to the ConnectionBuilder InheritanceBuilder.
            /// </remarks>
            public override void CreateConnection(DslDiagrams::ShapeElement sourceShapeElement, DslDiagrams::ShapeElement targetShapeElement, DslDiagrams::PaintFeedbackArgs paintFeedbackArgs)
            {
                if (sourceShapeElement == null)
                {
                    throw new global::System.ArgumentNullException("sourceShapeElement");
                }
                if (targetShapeElement == null)
                {
                    throw new global::System.ArgumentNullException("targetShapeElement");
                }

                sourceShapeElement = RemovePassThroughShapes(sourceShapeElement);
                targetShapeElement = RemovePassThroughShapes(targetShapeElement);

                DslModeling::ModelElement sourceElement = sourceShapeElement.ModelElement;

                if (sourceElement == null)
                {
                    sourceElement = sourceShapeElement;
                }
                DslModeling::ModelElement targetElement = targetShapeElement.ModelElement;

                if (targetElement == null)
                {
                    targetElement = targetShapeElement;
                }
                // The InheritanceTool connection tool specifies that source and target should be reversed.
                InheritanceBuilder.Connect(targetElement, sourceElement);
            }
Esempio n. 21
0
            /// <summary>
            /// Called by the base ConnectAction class to determine if the given shapes can be connected.
            /// </summary>
            /// <remarks>
            /// This implementation delegates calls to the ConnectionBuilder OutPortSendsToApplicationBuilder.
            /// </remarks>
            public override bool CanCreateConnection(DslDiagrams::ShapeElement sourceShapeElement, DslDiagrams::ShapeElement targetShapeElement, ref string connectionWarning)
            {
                if (sourceShapeElement == null)
                {
                    throw new global::System.ArgumentNullException("sourceShapeElement");
                }

                sourceShapeElement = RemovePassThroughShapes(sourceShapeElement);

                DslModeling::ModelElement sourceElement = sourceShapeElement.ModelElement;

                if (sourceElement == null)
                {
                    sourceElement = sourceShapeElement;
                }

                if (targetShapeElement == null)
                {
                    return(OutPortSendsToApplicationBuilder.CanAcceptSource(sourceElement));
                }
                else
                {
                    targetShapeElement = RemovePassThroughShapes(targetShapeElement);
                    DslModeling::ModelElement targetElement = targetShapeElement.ModelElement;
                    if (targetElement == null)
                    {
                        targetElement = targetShapeElement;
                    }

                    return(OutPortSendsToApplicationBuilder.CanAcceptSourceAndTarget(sourceElement, targetElement));
                }
            }
        /// <summary>
        /// Returns the InheritanceToolConnectionType associated with this action.
        /// </summary>
        protected override DslDiagrams::ConnectionType[] GetConnectionTypes(DslDiagrams::ShapeElement sourceShapeElement, DslDiagrams::ShapeElement targetShapeElement)
        {
            if (this.connectionTypes == null)
            {
                this.connectionTypes = new DslDiagrams::ConnectionType[] { new InheritanceToolConnectionType() };
            }

            return(this.connectionTypes);
        }
Esempio n. 23
0
 /// <summary>
 /// Called by the base ConnectAction class to ask whether the given source and target are valid.
 /// </summary>
 /// <remarks>
 /// Always return true here, to give CanCreateConnection a chance to decide.
 /// </remarks>
 public override bool IsValidSourceAndTarget(DslDiagrams::ShapeElement sourceShapeElement, DslDiagrams::ShapeElement targetShapeElement)
 {
     return(true);
 }
Esempio n. 24
0
            /// <summary>
            /// Called by the base ConnectAction class to create the underlying relationship.
            /// </summary>
            /// <remarks>
            /// This implementation delegates calls to the ConnectionBuilder EntidadReferencesRelacionedBuilder.
            /// </remarks>
            public override void CreateConnection(DslDiagrams::ShapeElement sourceShapeElement, DslDiagrams::ShapeElement targetShapeElement, DslDiagrams::PaintFeedbackArgs paintFeedbackArgs)
            {
                if (sourceShapeElement == null)
                {
                    throw new global::System.ArgumentNullException("sourceShapeElement");
                }
                if (targetShapeElement == null)
                {
                    throw new global::System.ArgumentNullException("targetShapeElement");
                }

                sourceShapeElement = RemovePassThroughShapes(sourceShapeElement);
                targetShapeElement = RemovePassThroughShapes(targetShapeElement);

                DslModeling::ModelElement sourceElement = sourceShapeElement.ModelElement;

                if (sourceElement == null)
                {
                    sourceElement = sourceShapeElement;
                }
                DslModeling::ModelElement targetElement = targetShapeElement.ModelElement;

                if (targetElement == null)
                {
                    targetElement = targetShapeElement;
                }
                EntidadReferencesRelacionedBuilder.Connect(sourceElement, targetElement);
            }
        /// <summary>
        /// Returns the TabDataGridReferenceConnectionType associated with this action.
        /// </summary>
        protected override DslDiagrams::ConnectionType[] GetConnectionTypes(DslDiagrams::ShapeElement sourceShapeElement, DslDiagrams::ShapeElement targetShapeElement)
        {
            if (this.connectionTypes == null)
            {
                this.connectionTypes = new DslDiagrams::ConnectionType[] { new TabDataGridReferenceConnectionType() };
            }

            return(this.connectionTypes);
        }