コード例 #1
0
        private String GenerateEdgeViewHTML(IEdgeView aEdge)
        {
            StringBuilder Output = new StringBuilder();

            Output.Append("<table class=\"gql_table\"border=\"1\"> <!-- EdgeView -->");

            #region Edge Properties
            if (aEdge.GetCountOfProperties() > 0)
            {
                Output.Append("<tr><td style=\"width:250px\">properties</td><td style=\"width:400px\">");
                Output.Append("<table class=\"gql_table\"border=\"1\"><tr><td style=\"width:400px\"> <!-- EdgeViewProperties -->");

                foreach (var _property in aEdge.GetAllProperties())
                {
                    if (_property.Item2 == null)
                    {
                        Output.Append(EscapeForXMLandHTML(_property.Item1)).Append("</td><td style=\"width:400px\"></td></tr>");
                    }
                    else
                    if (_property.Item2 is Stream)
                    {
                        Output.Append(EscapeForXMLandHTML(_property.Item1)).Append("</td><td style=\"width:400px\">BinaryProperty</td></tr>");
                    }
                    else
                    {
                        Output.Append(EscapeForXMLandHTML(_property.Item1)).Append("</td><td style=\"width:400px\">").Append(EscapeForXMLandHTML(_property.Item2.ToString())).Append("</td></tr>");
                    }
                }

                Output.Append("</table></td></tr> <!-- EdgeViewProperties -->");
            }
            #endregion


            #region Target Vertices
            Output.Append("<tr><td style=\"width:250px\">targetvertices</td><td style=\"width:400px\">");
            Output.Append("<table class=\"gql_table\"border=\"1\"><tr><td style=\"width:400px\"> <!-- TargetVertices -->");

            foreach (IVertexView _vertex in aEdge.GetTargetVertices())
            {
                Output.Append("<table class=\"gql_table\" border=\"1\"> <!-- Vertices-2 -->");
                Output.Append(GenerateVertexViewHTML(_vertex));
                Output.Append("</table> <!-- Vertices-2 -->");
            }

            Output.Append("</td></table> <!-- TargetVertices -->");

            Output.Append("</table></td></tr> <!-- EdgesView -->");

            return(Output.ToString());

            #endregion
        }
コード例 #2
0
ファイル: QueryResultComparer.cs プロジェクト: alrehamy/sones
        public bool Equals(IEdgeView x, IEdgeView y)
        {
            if (x.GetCountOfProperties() != y.GetCountOfProperties())
            {
                return(false);
            }

            var xProperties = x.GetAllProperties().ToList();
            var yProperties = y.GetAllProperties().ToList();

            if (xProperties.Count != yProperties.Count)
            {
                return(false);
            }

            for (int i = 0; i <= xProperties.Count; i++)
            {
                if (xProperties[i].PropertyName != xProperties[i].PropertyName)
                {
                    return(false);
                }

                if (!xProperties[i].Property.Equals(xProperties[i].Property))
                {
                    return(false);
                }
            }

            var xTargetVertices = x.GetTargetVertices().ToList();
            var yTargetVertices = y.GetTargetVertices().ToList();

            if (xTargetVertices.Count != xTargetVertices.Count)
            {
                return(false);
            }


            for (int i = 0; i <= xTargetVertices.Count; i++)
            {
                if (!this.Equals(xTargetVertices[i], xTargetVertices[i]))
                {
                    return(false);
                }
            }


            return(true);
        }
コード例 #3
0
ファイル: HTML_IO.cs プロジェクト: ramz/sones
        private String GenerateEdgeViewHTML(IEdgeView aEdge)
        {
            StringBuilder Output = new StringBuilder();
            Output.Append("<table class=\"gql_table\"border=\"1\"> <!-- EdgeView -->");

            #region Edge Properties
            if (aEdge.GetCountOfProperties() > 0)
            {
                Output.Append("<tr><td style=\"width:250px\">properties</td><td style=\"width:400px\">");
                Output.Append("<table class=\"gql_table\"border=\"1\"><tr><td style=\"width:400px\"> <!-- EdgeViewProperties -->");

                foreach (var _property in aEdge.GetAllProperties())
                {
                    if (_property.Item2 == null)
                        Output.Append(EscapeForXMLandHTML(_property.Item1)).Append("</td><td style=\"width:400px\"></td></tr>");
                    else
                        if (_property.Item2 is Stream)
                        {
                            Output.Append(EscapeForXMLandHTML(_property.Item1)).Append("</td><td style=\"width:400px\">BinaryProperty</td></tr>");
                        }
                        else
                            Output.Append(EscapeForXMLandHTML(_property.Item1)).Append("</td><td style=\"width:400px\">").Append(EscapeForXMLandHTML(_property.Item2.ToString())).Append("</td></tr>");
                }

                Output.Append("</table></td></tr> <!-- EdgeViewProperties -->");
            }
            #endregion

            #region Target Vertices
            Output.Append("<tr><td style=\"width:250px\">targetvertices</td><td style=\"width:400px\">");
            Output.Append("<table class=\"gql_table\"border=\"1\"><tr><td style=\"width:400px\"> <!-- TargetVertices -->");

            foreach (IVertexView _vertex in aEdge.GetTargetVertices())
            {
                Output.Append("<table class=\"gql_table\" border=\"1\"> <!-- Vertices-2 -->");
                Output.Append(GenerateVertexViewHTML(_vertex));
                Output.Append("</table> <!-- Vertices-2 -->");
            }

            Output.Append("</td></table> <!-- TargetVertices -->");

            Output.Append("</table></td></tr> <!-- EdgesView -->");

            return Output.ToString();
            #endregion
        }