Ejemplo n.º 1
0
        /// <summary>
        /// Create a new graph using the given GraphId.
        /// </summary>
        /// <param name="GraphId">An optional GraphId.</param>
        /// <param name="Graph">A optional Graph.</param>
        public GeraGraph CreateGraph(GraphId GraphId = null, GeraGraph Graph = null)
        {
            if (GraphId == null)
                GraphId = GraphId.NewGraphId;

            if (Graph   == null)
                Graph   = new GeraGraph(GraphId);

            _Graphs.Add(GraphId, Graph);

            return Graph;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Return a specific graph.
        /// </summary>
        /// <param name="GraphId">The GraphId.</param>
        /// <param name="Graph">The Graph.</param>
        public Boolean TryGetGraph(GraphId GraphId, out GeraGraph Graph)
        {
            if (GraphId != null)
                return _Graphs.TryGetValue(GraphId, out Graph);

            Graph = null;
            return false;
        }