Example #1
0
        public ServiceVertexView(IVertexView myVertexView)
        {
            var singleEdges = myVertexView.GetAllSingleEdges();

            SingleEdges = (singleEdges == null) ? null : singleEdges.ToDictionary(_ => _.EdgeName, _ => new ServiceSingleEdgeView(_.Edge));
            var hyperEdges = myVertexView.GetAllHyperEdges();

            HyperEdges = (hyperEdges == null) ? null : hyperEdges.ToDictionary(_ => _.EdgeName, _ => new ServiceHyperEdgeView(_.Edge));
            var properties = myVertexView.GetAllProperties();

            if (properties == null)
            {
                Properties = null;
            }
            else
            {
                Properties = properties.ToDictionary(_ => _.PropertyName, _ =>
                {
                    object value = ConvertHelper.ToServiceObject(_.Property);
                    if (value != null)
                    {
                        return(value);
                    }
                    else
                    {
                        return(_.Property);
                    }
                });
            }
        }
Example #2
0
        public ServiceVertexView(IVertexView myVertexView)
        {
            var singleEdges = myVertexView.GetAllSingleEdges();

            SingleEdges = (singleEdges == null) ? null : singleEdges.Select(x => new Tuple <string, ServiceSingleEdgeView>(x.Item1, new ServiceSingleEdgeView(x.Item2))).ToList();
            var hyperEdges = myVertexView.GetAllHyperEdges();

            HyperEdges = (hyperEdges == null) ? null : hyperEdges.Select(x => new Tuple <string, ServiceHyperEdgeView>(x.Item1, new ServiceHyperEdgeView(x.Item2))).ToList();
            var properties = myVertexView.GetAllProperties();

            if (properties == null)
            {
                Properties = null;
            }
            else
            {
                Properties = properties.Select(x =>
                {
                    object value = ConvertHelper.ToServiceObject(x.Item2);
                    if (value != null)
                    {
                        return(new Tuple <string, object>(x.Item1, value));
                    }
                    else
                    {
                        return(x);
                    }
                }).ToList();
            }
        }
Example #3
0
 public ServiceVertexView(IVertexView myVertexView)
 {
     var singleEdges = myVertexView.GetAllSingleEdges();
     SingleEdges = (singleEdges == null) ? null : singleEdges.Select(x => new Tuple<string, ServiceSingleEdgeView>(x.Item1, new ServiceSingleEdgeView(x.Item2))).ToList();
     var hyperEdges = myVertexView.GetAllHyperEdges();
     HyperEdges = (hyperEdges == null) ? null : hyperEdges.Select(x => new Tuple<string, ServiceHyperEdgeView>(x.Item1, new ServiceHyperEdgeView(x.Item2))).ToList();
     var properties = myVertexView.GetAllProperties();
     if (properties == null)
         Properties = null;
     else
         Properties = properties.Select(x =>
         {
             object value = ConvertHelper.ToServiceObject(x.Item2);
             if (value != null)
                 return new Tuple<string, object>(x.Item1, value);
             else
                 return x;
         }).ToList();
 }
Example #4
0
 public ServiceVertexView(IVertexView myVertexView)
 {
     var singleEdges = myVertexView.GetAllSingleEdges();
     SingleEdges = (singleEdges == null) ? null : singleEdges.ToDictionary(_ => _.EdgeName, _ => new ServiceSingleEdgeView(_.Edge));
     var hyperEdges = myVertexView.GetAllHyperEdges();
     HyperEdges = (hyperEdges == null) ? null : hyperEdges.ToDictionary(_ => _.EdgeName, _ => new ServiceHyperEdgeView(_.Edge));
     var properties = myVertexView.GetAllProperties();
     if (properties == null)
         Properties = null;
     else
         Properties = properties.ToDictionary(_ => _.PropertyName, _ =>
             {
                 object value = ConvertHelper.ToServiceObject(_.Property);
                 if (value != null)
                     return value;
                 else
                     return _.Property;
             });
 }