Ejemplo n.º 1
0
        public override SemanticClass CreateNewElement(SemanticModel_I model, Type type)
        {
            SemanticClass element;

            // if it is an attribute then we want to create an attribute class, that can hold more information about what types implement the attribute.
            if (XTypes.IsAttribute(type))
            {
                // already know it does not exist in the model as it is being called from a get or create statement (at initial version)
                SemanticAttributeClass attributeClass = XNew.New <SemanticAttributeClass>();

                element = attributeClass;
            }
            else
            {
                element = XNew.New <SemanticClass>();
            }

            element.RuntimeMapping = type.TypeHandle;

            return(element);
        }