Beispiel #1
0
        public BinaryPropertyPredefinition ToBinaryPropertyPredefinition()
        {
            var predef = new BinaryPropertyPredefinition(this.AttributeName, this.AttributeType);

            predef.SetComment(this.Comment);
            return(predef);
        }
Beispiel #2
0
        /// <summary>
        /// Adds a binary property.
        /// </summary>
        /// <param name="myBinaryPropertyPredefinition">The defintition of the binary property.</param>
        /// <returns>The reference of the current object. (fluent interface).</returns>
        public RequestAlterVertexType AddBinaryProperty(BinaryPropertyPredefinition myBinaryPropertyPredefinition)
        {
            if (myBinaryPropertyPredefinition != null)
            {
                _toBeAddedAttributes = (_toBeAddedAttributes) ?? new List <AAttributePredefinition>();
                _toBeAddedAttributes.Add(myBinaryPropertyPredefinition);
                AddBinaryPropertyCount++;
            }

            return(this);
        }
Beispiel #3
0
        /// <summary>
        /// Converts the given unknown attribute predefinition to a binary property predfeinition.
        /// </summary>
        /// <param name="unknown">The unknown attribute predegfinition.</param>
        /// <returns>The created binary property predefinition.</returns>
        private static BinaryPropertyPredefinition ConvertUnknownToBinaryProperty(UnknownAttributePredefinition unknown)
        {
            if (unknown.DefaultValue != null)
            {
                throw new Exception("A default value is not allowed on a binary property.");
            }

            if (unknown.EdgeType != null)
            {
                throw new Exception("An edge type is not allowed on a binary property.");
            }

            if (unknown.Multiplicity != null)
            {
                throw new Exception("A multiplicity is not allowed on a binary property.");
            }

            var prop = new BinaryPropertyPredefinition(unknown.AttributeName, unknown.AttributeType)
                       .SetComment(unknown.Comment);

            return(prop);
        }
 internal ServiceBinaryPropertyPredefinition(BinaryPropertyPredefinition myBinaryPropertyPredefinition) : base(myBinaryPropertyPredefinition)
 {
 }
Beispiel #5
0
        /// <summary>
        /// Adds a binary property.
        /// </summary>
        /// <param name="myBinaryPropertyPredefinition">The defintition of the binary property.</param>
        /// <returns>The reference of the current object. (fluent interface).</returns>
        public RequestAlterVertexType AddBinaryProperty(BinaryPropertyPredefinition myBinaryPropertyPredefinition)
        {
            if (myBinaryPropertyPredefinition != null)
            {
                _toBeAddedAttributes = (_toBeAddedAttributes) ?? new List<AAttributePredefinition>();
                _toBeAddedAttributes.Add(myBinaryPropertyPredefinition);
                AddBinaryPropertyCount++;
            }

            return this;
        }
Beispiel #6
0
        private static BinaryPropertyPredefinition ConvertUnknownToBinaryProperty(UnknownAttributePredefinition unknown)
        {
            if (unknown.DefaultValue != null)
                throw new Exception("A default value is not allowed on a binary property.");

            if (unknown.EdgeType != null)
                throw new Exception("An edge type is not allowed on a binary property.");

            if (unknown.Multiplicity != null)
                throw new Exception("A multiplicity is not allowed on a binary property.");

            var prop = new BinaryPropertyPredefinition(unknown.AttributeName)
                           .SetComment(unknown.Comment);
            return prop;
        }