示例#1
0
        public static Edge Create <TOutVertex, TInVertex>(string label, Id <TOutVertex> outVertex, Id <TInVertex> inVertex, IdFactory idFactory) where TOutVertex : Vertex where TInVertex : Vertex
        {
            var inVerticesArray = new Id <Vertex> [1];

            inVerticesArray[0] = inVertex.As <TInVertex, Vertex>();

            return(new Edge(label, outVertex.As <TOutVertex, Vertex>(), inVerticesArray, idFactory));
        }
示例#2
0
        public static Edge Create <TOutVertex, TInVertex>(string label, Id <TOutVertex> outVertex, IList <Id <TInVertex> > inVertices, IdFactory idFactory) where TOutVertex : Vertex where TInVertex : Vertex
        {
            var inVerticesArray = new Id <Vertex> [inVertices.Count];

            // Note: this is ultimately just an array copy, but in a strongly-typed way. The JIT might see through this as a memory copy,
            // but might require some more explicit code if not.
            for (int i = 0; i < inVertices.Count; i++)
            {
                inVerticesArray[i] = inVertices[i].As <TInVertex, Vertex>();
            }

            return(new Edge(label, outVertex.As <TOutVertex, Vertex>(), inVerticesArray, idFactory));
        }
示例#3
0
 public Event(EventKind kind, Id <Document> data, IdFactory idFactory)
     : this(kind, "document", data.As <Document, Element>(), idFactory)
 {
 }
示例#4
0
 public Event(EventKind kind, Id <Project> data, IdFactory idFactory)
     : this(kind, "project", data.As <Project, Element>(), idFactory)
 {
 }