Exemplo n.º 1
0
        /// <summary>
        /// Create a shape of the given link shape type.
        /// </summary>
        /// <param name="shapeTypeId">Shape type id.</param>
        /// <param name="modelElement">Model element.</param>
        /// <param name="assignments">Properties for the shape.</param>
        /// <returns>Shape if one could be created. Null otherwise.</returns>
        public override DslModeling::ModelElement CreateShapeForElementLink(System.Guid shapeTypeId, DslModeling::ModelElement modelElement, params DslModeling::PropertyAssignment[] assignments)
        {
            DslEditorDiagrams::LinkShape nodeShape = null;

            if (createRSShapeMap == null)
            {
                createRSShapeMap = new global::System.Collections.Generic.Dictionary <global::System.Guid, int>(1);
                createRSShapeMap.Add(global::Tum.StateMachineDSL.TransitionShape.DomainClassId, 0);
            }
            int index;

            if (!createRSShapeMap.TryGetValue(shapeTypeId, out index))
            {
                throw new global::System.ArgumentException("Unrecognized shape type " + shapeTypeId.ToString());
            }
            switch (index)
            {
            case 0: nodeShape = new global::Tum.StateMachineDSL.TransitionShape(modelElement.Store, assignments); break;
            }

            if (nodeShape == null)
            {
                throw new System.InvalidOperationException("Couldn't create shape of type " + shapeTypeId.ToString() + " for element link " + modelElement.ToString());
            }

            nodeShape.Element = modelElement;

            return(nodeShape);
        }
        /// <summary>
        /// Create a shape of the given link shape type.
        /// </summary>
        /// <param name="shapeTypeId">Shape type id.</param>
        /// <param name="modelElement">Model element.</param>
		/// <param name="assignments">Properties for the shape.</param>
        /// <returns>Shape if one could be created. Null otherwise.</returns>
        public override DslModeling::ModelElement CreateShapeForElementLink(System.Guid shapeTypeId, DslModeling::ModelElement modelElement, params DslModeling::PropertyAssignment[] assignments)
		{
			
			DslEditorDiagrams::LinkShape nodeShape = null;	
		
			if( createRSShapeMap == null )
			{
				createRSShapeMap = new global::System.Collections.Generic.Dictionary<global::System.Guid, int>(1);
				createRSShapeMap.Add(global::Tum.StateMachineDSL.TransitionShape.DomainClassId, 0);
			}
			int index;
			if (!createRSShapeMap.TryGetValue(shapeTypeId, out index))
				throw new global::System.ArgumentException("Unrecognized shape type " + shapeTypeId.ToString());
			switch (index)
			{
				case 0: nodeShape = new global::Tum.StateMachineDSL.TransitionShape(modelElement.Store, assignments); break;
				
			}

			if( nodeShape == null )
				throw new System.InvalidOperationException("Couldn't create shape of type " + shapeTypeId.ToString() + " for element link " + modelElement.ToString());
			
			nodeShape.Element = modelElement;
								
			return nodeShape;
		
        }