Пример #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>(3);
                createRSShapeMap.Add(global::Tum.VModellXT.Dynamik.AblaufbausteinpunktRAblaufbausteinspezShape.DomainClassId, 0);
                createRSShapeMap.Add(global::Tum.VModellXT.Dynamik.AblaufbausteinRAblaufbausteinspezShape.DomainClassId, 1);
                createRSShapeMap.Add(global::Tum.VModellXT.Dynamik.UebergangShape.DomainClassId, 2);
            }
            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.VModellXT.Dynamik.AblaufbausteinpunktRAblaufbausteinspezShape(modelElement.Store, assignments); break;

            case 1: nodeShape = new global::Tum.VModellXT.Dynamik.AblaufbausteinRAblaufbausteinspezShape(modelElement.Store, assignments); break;

            case 2: nodeShape = new global::Tum.VModellXT.Dynamik.UebergangShape(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>(3);
				createRSShapeMap.Add(global::Tum.VModellXT.Dynamik.AblaufbausteinpunktRAblaufbausteinspezShape.DomainClassId, 0);
				createRSShapeMap.Add(global::Tum.VModellXT.Dynamik.AblaufbausteinRAblaufbausteinspezShape.DomainClassId, 1);
				createRSShapeMap.Add(global::Tum.VModellXT.Dynamik.UebergangShape.DomainClassId, 2);
			}
			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.VModellXT.Dynamik.AblaufbausteinpunktRAblaufbausteinspezShape(modelElement.Store, assignments); break;
				case 1: nodeShape = new global::Tum.VModellXT.Dynamik.AblaufbausteinRAblaufbausteinspezShape(modelElement.Store, assignments); break;
				case 2: nodeShape = new global::Tum.VModellXT.Dynamik.UebergangShape(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;
		
        }