コード例 #1
0
        /// <summary>
        /// Generates an incoming edge attribute
        /// </summary>
        /// <param name="aIncomingEdge">The incoming edge definition by the gql</param>
        /// <returns>An incoming edge predefinition</returns>
        private IncomingEdgePredefinition GenerateAIncomingEdge(IncomingEdgeDefinition aIncomingEdge)
        {
            IncomingEdgePredefinition result = new IncomingEdgePredefinition(aIncomingEdge.AttributeName,
                                                                             aIncomingEdge.TypeName,
                                                                             aIncomingEdge.TypeAttributeName);

            return(result);
        }
コード例 #2
0
        public IncomingEdgePredefinition ToIncomingEdgePredefinition()
        {
            IncomingEdgePredefinition IncomingEdgePredef = new IncomingEdgePredefinition(this.AttributeName,this.AttributeType,this.OutgoingEdgeName);

            if(this.Comment != null)
                IncomingEdgePredef.SetComment(this.Comment);

            return IncomingEdgePredef;
        }
コード例 #3
0
        /// <summary>
        /// Adds a incoming edge.
        /// </summary>
        /// <param name="myIncomingEdgePredefinition">The definition of the incoming edge.</param>
        /// <returns>The reference of the current object. (fluent interface).</returns>
        public RequestAlterVertexType AddIncomingEdge(IncomingEdgePredefinition myIncomingEdgePredefinition)
        {
            if (myIncomingEdgePredefinition != null)
            {
                _toBeAddedAttributes = (_toBeAddedAttributes) ?? new List <AAttributePredefinition>();
                _toBeAddedAttributes.Add(myIncomingEdgePredefinition);
                AddIncomingEdgeCount++;
            }

            return(this);
        }
コード例 #4
0
        public IncomingEdgePredefinition ToIncomingEdgePredefinition()
        {
            IncomingEdgePredefinition IncomingEdgePredef = new IncomingEdgePredefinition(this.AttributeName, this.AttributeType, this.OutgoingEdgeName);


            if (this.Comment != null)
            {
                IncomingEdgePredef.SetComment(this.Comment);
            }

            return(IncomingEdgePredef);
        }
コード例 #5
0
        /// <summary>
        /// Converts the given unknown attribute predefinition to an incoming edge predfeinition.
        /// </summary>
        /// <param name="unknown">The unknown attribute predegfinition.</param>
        /// <returns>The created incoming edge predefinition.</returns>
        private static IncomingEdgePredefinition ConvertUnknownToIncomingEdge(UnknownAttributePredefinition unknown)
        {
            if (unknown.DefaultValue != null)
            {
                throw new Exception("A default value is not allowed on an incoming edge.");
            }

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

            if (unknown.Multiplicity != null)
            {
                throw new Exception("A multiplicity is not allowed on an incoming edge.");
            }

            var prop = new IncomingEdgePredefinition(unknown.AttributeType,
                                                     GetTargetVertexTypeFromAttributeType(unknown.AttributeType),
                                                     GetTargetEdgeNameFromAttributeType(unknown.AttributeType))
                       .SetComment(unknown.Comment);

            return(prop);
        }
コード例 #6
0
        /// <summary>
        /// Generates an incoming edge attribute
        /// </summary>
        /// <param name="aIncomingEdge">The incoming edge definition by the gql</param>
        /// <returns>An incoming edge predefinition</returns>
        private IncomingEdgePredefinition GenerateAIncomingEdge(IncomingEdgeDefinition aIncomingEdge)
        {
            IncomingEdgePredefinition result = new IncomingEdgePredefinition(aIncomingEdge.AttributeName,
                                                                                aIncomingEdge.TypeName, 
                                                                                aIncomingEdge.TypeAttributeName);

            return result;
        }
コード例 #7
0
 /// <summary>
 /// Creates an instance of OutgoingEdgeNotFoundException.
 /// </summary>
 /// <param name="myPredefinition">
 /// The predefinition, that contains the incoming edge.
 /// </param>
 /// <param name="myIncomingEdge">
 /// The incoming edge that causes the exception.
 /// </param>
 public OutgoingEdgeNotFoundException(VertexTypePredefinition myPredefinition, IncomingEdgePredefinition myIncomingEdge, Exception innerException = null) : base(innerException)
 {
     Predefinition = myPredefinition;
     IncomingEdge  = myIncomingEdge;
     _msg          = string.Format("Vertextype {0} defines an incoming edge on a nonexisting outgoing edge ({1}).", myPredefinition.TypeName, myIncomingEdge.AttributeType);
 }
コード例 #8
0
ファイル: RequestAlterVertexType.cs プロジェクト: cosh/sones
        /// <summary>
        /// Adds a incoming edge.
        /// </summary>
        /// <param name="myIncomingEdgePredefinition">The definition of the incoming edge.</param>
        /// <returns>The reference of the current object. (fluent interface).</returns>
        public RequestAlterVertexType AddIncomingEdge(IncomingEdgePredefinition myIncomingEdgePredefinition)
        {
            if (myIncomingEdgePredefinition != null)
            {
                _toBeAddedAttributes = (_toBeAddedAttributes) ?? new List<AAttributePredefinition>();
                _toBeAddedAttributes.Add(myIncomingEdgePredefinition);
                AddIncomingEdgeCount++;
            }

            return this;
        }
コード例 #9
0
 internal ServiceIncomingEdgePredefinition(IncomingEdgePredefinition myIncomingEdgePredefinition) : base(myIncomingEdgePredefinition)
 {
     this.OutgoingEdgeName = myIncomingEdgePredefinition.AttributeType.Substring(myIncomingEdgePredefinition.AttributeType.IndexOf(IncomingEdgePredefinition.TypeSeparator) + 1);
 }
コード例 #10
0
ファイル: CheckVertexTypeManager.cs プロジェクト: loubo/sones
        private static IncomingEdgePredefinition ConvertUnknownToIncomingEdge(UnknownAttributePredefinition unknown)
        {
            if (unknown.DefaultValue != null)
                throw new Exception("A default value is not allowed on an incoming edge.");

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

            if (unknown.Multiplicity != null)
                throw new Exception("A multiplicity is not allowed on an incoming edge.");

            var prop = new IncomingEdgePredefinition(unknown.AttributeType)
                           .SetComment(unknown.Comment)
                           .SetOutgoingEdge(GetTargetVertexTypeFromAttributeType(unknown.AttributeType), GetTargetEdgeNameFromAttributeType(unknown.AttributeType));
            return prop;
        }