Description of EnumerationLiteral.
Inheritance: AttributeWrapper, TSF.UmlToolingFramework.UML.Classes.Kernel.EnumerationLiteral
コード例 #1
0
 /// creates a new EAAttribute based on the given EA.Attribute
 internal AttributeWrapper createEAAttributeWrapper(global::EA.Attribute attributeToWrap)
 {
     if (EnumerationLiteral.isLiteralValue(this.model as Model, attributeToWrap))
     {
         return(new EnumerationLiteral(this.model as Model, attributeToWrap));
     }
     else
     {
         return(new Attribute(this.model as Model, attributeToWrap));
     }
 }
        /// <summary>
        /// gets the SchemaLiteral that corresponds with the given literal value
        /// </summary>
        /// <param name="literal">the literal to match</param>
        /// <returns>the corresponding SchemaLiteral</returns>
        EASchemaLiteral getMatchingSchemaLiteral(UTF_EA.EnumerationLiteral literal)
        {
            EASchemaLiteral result             = null;
            var             sourceAttributeTag = literal.getTaggedValue(this.owner.settings.sourceAttributeTagName);

            if (sourceAttributeTag != null)
            {
                string tagReference = sourceAttributeTag.eaStringValue;

                foreach (EASchemaLiteral schemaLiteral in this.schemaLiterals)
                {
                    //we have the same attribute if the given attribute has a tagged value
                    //called sourceAttribute that refences the source attribute of the schema Property
                    if (((UTF_EA.EnumerationLiteral)schemaLiteral.sourceLiteral).guid == tagReference)
                    {
                        result = schemaLiteral;
                        break;
                    }
                }
            }
            return(result);
        }