Graph ( GraphDirectedness directedness ) : base( m_oIDGenerator.GetNextID() ) { const String MethodName = "Constructor"; this.ArgumentChecker.CheckArgumentIsDefined( MethodName, "directedness", directedness, typeof(GraphDirectedness) ); m_eDirectedness = directedness; m_oVertexCollection = new VertexCollection(this); m_oEdgeCollection = new EdgeCollection(this); AssertValid(); }
GetEdgeCollection ( out EdgeCollection oEdgeCollection ) { AssertValid(); const String MethodName = "GetEdgeCollection"; oEdgeCollection = null; if (m_oParentGraph == null) { // The vertex does not belong to a graph. return (false); } if ( !(m_oParentGraph.Edges is EdgeCollection) ) { Debug.Assert(false); throw new ApplicationException( String.Format( "{0}.{1}: The Edges property of the graph that owns this" + " vertex is not of type EdgeCollection." , this.ClassName, MethodName ) ); } oEdgeCollection = (EdgeCollection)(m_oParentGraph.Edges); return (true); }