internal ServiceUnknownAttributePredefinition(UnknownAttributePredefinition myPredef)
     : base(myPredef)
 {
     DefaultValue = myPredef.DefaultValue;
     EdgeType = myPredef.EdgeType;
     InnerEdgeType = myPredef.InnerEdgeType;
     IsMandatory = myPredef.IsMandatory;
     IsUnique = myPredef.IsUnique;
     Multiplicity = myPredef.Multiplicity;
 }
Пример #2
0
        /// <summary>
        /// Adds an unknown property to the vertex type definition
        /// </summary>
        /// <param name="myUnknownPredefinition">The unknwown property definition that is going to be added</param>
        /// <returns>The reference of the current object. (fluent interface).</returns>
        public VertexTypePredefinition AddUnknownAttribute(UnknownAttributePredefinition myUnknownPredefinition)
        {
            if (myUnknownPredefinition != null)
            {
                _attributes = (_attributes) ?? new List <AAttributePredefinition>();
                _attributes.Add(myUnknownPredefinition);
                _unknown++;
            }

            return(this);
        }
 public UnknownAttributePredefinition ToUnknownAttributePredefinition()
 {
     var attributePredef = new UnknownAttributePredefinition(this.AttributeName, this.AttributeType);
     attributePredef.SetMultiplicity(this.Multiplicity);
     attributePredef.SetDefaultValue(this.DefaultValue);
     attributePredef.SetEdgeType(this.EdgeType);
     attributePredef.SetInnerEdgeType(this.InnerEdgeType);
     if (this.IsMandatory == true)
     {
         attributePredef.SetAsMandatory();
     }
     if (this.IsUnique == true)
     {
         attributePredef.SetAsUnique();
     }
     return attributePredef;
 }
Пример #4
0
        /// <summary>
        /// Generates a attribute definition
        /// </summary>
        /// <param name="aAttribute">The attribute that is going to be transfered</param>
        /// <returns>A attribute predefinition</returns>
        private UnknownAttributePredefinition GenerateUnknownAttribute(AttributeDefinition myAttributeDefinition)
        {
            UnknownAttributePredefinition result = 
                new UnknownAttributePredefinition(myAttributeDefinition.AttributeName, 
                                                    myAttributeDefinition.AttributeType.Name);

            if (myAttributeDefinition.DefaultValue != null)
                result.SetDefaultValue(myAttributeDefinition.DefaultValue.ToString());

            switch (myAttributeDefinition.AttributeType.Type)
            {
                case SonesGQLGrammar.TERMINAL_SET:
                    result.SetMultiplicityAsSet();
                    break;

                case SonesGQLGrammar.TERMINAL_LIST:
                    result.SetMultiplicityAsList();
                    break;
            }

            return result;
        }
Пример #5
0
        /// <summary>
        /// Generates a attribute definition
        /// </summary>
        /// <param name="aAttribute">The attribute that is going to be transfered</param>
        /// <returns>A attribute predefinition</returns>
        private UnknownAttributePredefinition GenerateUnknownAttribute(KeyValuePair<AttributeDefinition, string> aAttribute)
        {
            UnknownAttributePredefinition result = new UnknownAttributePredefinition(aAttribute.Key.AttributeName, aAttribute.Value);
            
            if (aAttribute.Key.AttributeType.EdgeType != null)
            {
                result.SetInnerEdgeType(aAttribute.Key.AttributeType.EdgeType);
            }

            if (aAttribute.Key.DefaultValue != null)
            {
                result.SetDefaultValue(aAttribute.Key.DefaultValue.ToString());
            }

            switch (aAttribute.Key.AttributeType.Type)
            {
                case SonesGQLGrammar.TERMINAL_SET:

                    result.SetMultiplicityAsSet();

                    break;

                case SonesGQLGrammar.TERMINAL_LIST:

                    result.SetMultiplicityAsList();

                    break;
            }

            if (aAttribute.Key.DefaultValue != null)
                result.SetDefaultValue(aAttribute.Key.DefaultValue.ToString());


            if (aAttribute.Key.AttributeType.TypeCharacteristics.IsMandatory)
                result.SetAsMandatory();

            if (aAttribute.Key.AttributeType.TypeCharacteristics.IsUnique)
                result.SetAsUnique();



            return result;
        }
Пример #6
0
        /// <summary>
        /// Defines an attribute in the type definition
        /// </summary>
        /// <param name="myUnknownPredefinition">The attribute definition that is going to be added</param>
        /// <returns>The reference of the current object. (fluent interface).</returns>
        public RequestAlterEdgeType DefineAttribute(UnknownAttributePredefinition myUnknownPredefinition)
        {
            if (myUnknownPredefinition != null)
            {
                _toBeDefinedAttributes = (_toBeDefinedAttributes) ?? new List<AAttributePredefinition>();
                _toBeDefinedAttributes.Add(myUnknownPredefinition);
                DefineAttributeCount++;
            }

            return this;
        }
Пример #7
0
        /// <summary>
        /// Adds an unknown attribute to the vertex type definition
        /// </summary>
        /// <param name="myUnknownPredefinition">The unknwown property definition that is going to be added</param>
        /// <returns>The reference of the current object. (fluent interface).</returns>
        public RequestAlterVertexType AddUnknownAttribute(UnknownAttributePredefinition myUnknownPredefinition)
        {
            if (myUnknownPredefinition != null)
            {
                _toBeAddedAttributes = (_toBeAddedAttributes) ?? new List<AAttributePredefinition>();
                _toBeAddedAttributes.Add(myUnknownPredefinition);
                AddUnknownPropertyCount++;
            }

            return this;
        }
Пример #8
0
        /// <summary>
        /// Adds an unknown property to the vertex type definition
        /// </summary>
        /// <param name="myUnknownPredefinition">The unknwown property definition that is going to be added</param>
        /// <returns>The reference of the current object. (fluent interface).</returns>
        public VertexTypePredefinition AddUnknownAttribute(UnknownAttributePredefinition myUnknownPredefinition)
        {
            if (myUnknownPredefinition != null)
            {
                _attributes = (_attributes) ?? new List<AAttributePredefinition>();
                _attributes.Add(myUnknownPredefinition);
                _unknown++;
            }

            return this;
        }