Пример #1
0
 public ServiceHyperEdgeInstance(IHyperEdge myHyperEdge, Nullable <Int64> myEdgePropertyID)
     : base(myHyperEdge as IEdge, myEdgePropertyID)
 {
     this.SingleEdges = myHyperEdge.GetAllEdges().Select(
         x => new ServiceSingleEdgeInstance(x, null, new ServiceVertexInstance(myHyperEdge.GetSourceVertex()))
         ).ToList();
 }
Пример #2
0
 public ServiceHyperEdgeInstance(IHyperEdge myHyperEdge, Nullable<Int64> myEdgePropertyID)
     : base(myHyperEdge as IEdge, myEdgePropertyID)
 {
     this.SingleEdges = myHyperEdge.GetAllEdges().Select(
         x => new ServiceSingleEdgeInstance(x, null, new ServiceVertexInstance(myHyperEdge.GetSourceVertex()))
     ).ToList();
 }
Пример #3
0
        public List <ServicePropertyContainer> GetAllProperties(SecurityToken mySecurityToken, Int64 myTransToken, ServiceEdgeInstance myEdge)
        {
            List <ServicePropertyContainer> PropertyCollection;

            if (myEdge.EdgePropertyID != null)
            {
                var Request      = ServiceRequestFactory.MakeRequestGetVertex(myEdge.SourceVertex.TypeID, myEdge.SourceVertex.VertexID);
                var SourceVertex = this.GraphDS.GetVertex <IVertex>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyVertexInstance);
                PropertyCollection = SourceVertex.GetOutgoingEdge((Int64)myEdge.EdgePropertyID).GetAllProperties().Select(_ => new ServicePropertyContainer {
                    PropertyID = _.PropertyID, Property = _.Property
                }).ToList();
            }
            else
            {
                var Request = ServiceRequestFactory.MakeRequestGetVertex(
                    (myEdge as ServiceSingleEdgeInstance).HyperEdgeSourceVertex.TypeID,
                    (myEdge as ServiceSingleEdgeInstance).HyperEdgeSourceVertex.VertexID);
                var        SourceVertex = this.GraphDS.GetVertex <IVertex>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyVertexInstance);
                IHyperEdge HyperEdge    = SourceVertex.GetOutgoingHyperEdge((Int64)myEdge.EdgePropertyID);
                PropertyCollection = HyperEdge.GetAllEdges(delegate(ISingleEdge mySingleEdge){
                    return(mySingleEdge.GetSourceVertex().VertexID == myEdge.SourceVertex.VertexID && mySingleEdge.GetTargetVertex().VertexID == (myEdge as ServiceSingleEdgeInstance).TargetVertex.VertexID);
                }).First <ISingleEdge>().GetAllProperties().Select(_ => new ServicePropertyContainer {
                    PropertyID = _.PropertyID, Property = _.Property
                }).ToList();
            }
            return(PropertyCollection);
        }
Пример #4
0
 public int GetCountOfProperties(SecurityToken mySecurityToken, Int64 myTransToken, ServiceEdgeInstance myEdge)
 {
     if (myEdge.EdgePropertyID != null)
     {
         var Request      = ServiceRequestFactory.MakeRequestGetVertex(myEdge.SourceVertex.TypeID, myEdge.SourceVertex.VertexID);
         var SourceVertex = this.GraphDS.GetVertex <IVertex>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyVertexInstance);
         return(SourceVertex.GetOutgoingEdge((Int64)myEdge.EdgePropertyID).GetCountOfProperties());
     }
     else
     {
         var Request = ServiceRequestFactory.MakeRequestGetVertex(
             (myEdge as ServiceSingleEdgeInstance).HyperEdgeSourceVertex.TypeID,
             (myEdge as ServiceSingleEdgeInstance).HyperEdgeSourceVertex.VertexID);
         var        SourceVertex = this.GraphDS.GetVertex <IVertex>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyVertexInstance);
         IHyperEdge HyperEdge    = SourceVertex.GetOutgoingHyperEdge((Int64)myEdge.EdgePropertyID);
         return(HyperEdge.GetAllEdges(delegate(ISingleEdge mySingleEdge){
             return (mySingleEdge.GetSourceVertex().VertexID == myEdge.SourceVertex.VertexID && mySingleEdge.GetTargetVertex().VertexID == (myEdge as ServiceSingleEdgeInstance).TargetVertex.VertexID);
         }).First <ISingleEdge>().GetCountOfProperties());
     }
 }
Пример #5
0
        public List <Tuple <long, object> > GetAllProperties(SecurityToken mySecurityToken, Int64 myTransToken, ServiceEdgeInstance myEdge)
        {
            IEnumerable <Tuple <long, IComparable> > PropertyCollection;

            if (myEdge.EdgePropertyID != null)
            {
                var Request      = ServiceRequestFactory.MakeRequestGetVertex(myEdge.SourceVertex.TypeID, myEdge.SourceVertex.VertexID);
                var SourceVertex = this.GraphDS.GetVertex <IVertex>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyVertexInstance);
                PropertyCollection = SourceVertex.GetOutgoingEdge((Int64)myEdge.EdgePropertyID).GetAllProperties();
            }
            else
            {
                var Request = ServiceRequestFactory.MakeRequestGetVertex(
                    (myEdge as ServiceSingleEdgeInstance).HyperEdgeSourceVertex.TypeID,
                    (myEdge as ServiceSingleEdgeInstance).HyperEdgeSourceVertex.VertexID);
                var        SourceVertex = this.GraphDS.GetVertex <IVertex>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyVertexInstance);
                IHyperEdge HyperEdge    = SourceVertex.GetOutgoingHyperEdge((Int64)myEdge.EdgePropertyID);
                PropertyCollection = HyperEdge.GetAllEdges(delegate(ISingleEdge mySingleEdge){
                    return(mySingleEdge.GetSourceVertex().VertexID == myEdge.SourceVertex.VertexID && mySingleEdge.GetTargetVertex().VertexID == (myEdge as ServiceSingleEdgeInstance).TargetVertex.VertexID);
                }).First <ISingleEdge>().GetAllProperties();
            }
            return(PropertyCollection.Select(x => new Tuple <long, object>(x.Item1, (object)x.Item2)).ToList());
        }
Пример #6
0
        private HyperEdgeUpdateDefinition CreateHyperEdgeUpdateDefinition(IHyperEdge iHyperEdge)
        {
            var containedEdges = iHyperEdge.GetAllEdges();
            var structuredProperties = iHyperEdge.GetAllProperties();
            var unstructuredProperties = iHyperEdge.GetAllUnstructuredProperties();

            return new HyperEdgeUpdateDefinition(iHyperEdge.EdgeTypeID, iHyperEdge.Comment,
                new StructuredPropertiesUpdate(
                    structuredProperties != null && structuredProperties.Count() > 0 ? structuredProperties.ToDictionary(key => key.PropertyID, value => value.Property) : null),
                new UnstructuredPropertiesUpdate(
                    unstructuredProperties != null && unstructuredProperties.Count() > 0 ? unstructuredProperties.ToDictionary(key => key.PropertyName, value => value.Property) : null),
                null,
                containedEdges.Select(_ => CreateSingleEdgeUpdateDefinition(_)));
        }
Пример #7
0
 public ServiceHyperEdgeInstance(IHyperEdge myEdge) : base(myEdge)
 {
     SingleEdges = myEdge.GetAllEdges().Select(x => new ServiceSingleEdgeInstance(x)).ToArray();
 }
Пример #8
0
 public ServiceHyperEdgeInstance(IHyperEdge myEdge)
     : base(myEdge)
 {
     SingleEdges = myEdge.GetAllEdges().Select(x => new ServiceSingleEdgeInstance(x)).ToArray();
 }