Пример #1
0
        /// <summary>
        ///   Creats the result
        /// </summary>
        /// <param name="graphElements"> The graph elements </param>
        /// <param name="resultTypeSpecification"> The result specification </param>
        /// <returns> </returns>
        private static IEnumerable <int> CreateResult(IEnumerable <AGraphElement> graphElements,
                                                      ResultTypeSpecification resultTypeSpecification)
        {
            switch (resultTypeSpecification)
            {
            case ResultTypeSpecification.Vertices:
                return(graphElements.OfType <VertexModel>().Select(_ => _.Id));

            case ResultTypeSpecification.Edges:
                return(graphElements.OfType <EdgeModel>().Select(_ => _.Id));

            case ResultTypeSpecification.Both:
                return(graphElements.Select(_ => _.Id));

            default:
                throw new ArgumentOutOfRangeException("resultTypeSpecification");
            }
        }
Пример #2
0
        /// <summary>
        ///   Creats the result
        /// </summary>
        /// <param name="graphElements"> The graph elements </param>
        /// <param name="resultTypeSpecification"> The result specification </param>
        /// <returns> </returns>
        private static IEnumerable<int> CreateResult(IEnumerable<AGraphElement> graphElements,
                                                     ResultTypeSpecification resultTypeSpecification)
        {
            switch (resultTypeSpecification)
            {
                case ResultTypeSpecification.Vertices:
                    return graphElements.OfType<VertexModel>().Select(_ => _.Id);

                case ResultTypeSpecification.Edges:
                    return graphElements.OfType<EdgeModel>().Select(_ => _.Id);

                case ResultTypeSpecification.Both:
                    return graphElements.Select(_ => _.Id);

                default:
                    throw new ArgumentOutOfRangeException("resultTypeSpecification");
            }
        }