Esempio n. 1
0
        protected override void ConvertUnknownAttributes(ATypePredefinition myTypePredefinition)
        {
            if (myTypePredefinition.UnknownAttributes == null)
            {
                return;
            }

            var toBeConverted = myTypePredefinition.UnknownAttributes.ToArray();

            foreach (var unknown in toBeConverted)
            {
                if (_baseTypeManager.IsBaseType(unknown.AttributeType))
                {
                    var prop = ConvertUnknownToProperty(unknown);

                    (myTypePredefinition as EdgeTypePredefinition).AddProperty(prop);
                }
                else
                {
                    throw new PropertyHasWrongTypeException(myTypePredefinition.TypeName, unknown.AttributeName, unknown.Multiplicity, "a base type");
                }
            }

            myTypePredefinition.ResetUnknown();
        }
Esempio n. 2
0
        protected override void ConvertUnknownAttributes(ATypePredefinition myTypePredefinitions)
        {
            if (myTypePredefinitions.UnknownAttributes == null)
            {
                return;
            }

            var toBeConverted = myTypePredefinitions.UnknownAttributes.ToArray();

            foreach (var unknown in toBeConverted)
            {
                if (BinaryPropertyPredefinition.TypeName.Equals(unknown.AttributeType))
                {
                    var prop = ConvertUnknownToBinaryProperty(unknown);

                    (myTypePredefinitions as VertexTypePredefinition).AddBinaryProperty(prop);
                }
                else if (_baseTypeManager.IsBaseType(unknown.AttributeType))
                {
                    var prop = ConvertUnknownToProperty(unknown);

                    (myTypePredefinitions as VertexTypePredefinition).AddProperty(prop);
                }
                else if (unknown.AttributeType.Contains(IncomingEdgePredefinition.TypeSeparator))
                {
                    var prop = ConvertUnknownToIncomingEdge(unknown);
                    (myTypePredefinitions as VertexTypePredefinition).AddIncomingEdge(prop);
                }
                else
                {
                    var prop = ConvertUnknownToOutgoingEdge(unknown);
                    (myTypePredefinitions as VertexTypePredefinition).AddOutgoingEdge(prop);
                }
            }

            myTypePredefinitions.ResetUnknown();
        }