public void SetAndShowGraphSuccessTest() { IGraphAdapter oGraphAdapter = new SimpleGraphAdapter(); //layoutControl1.Graph = oGraphAdapter.LoadGraphFromFile("..\\..\\SampleGraph.txt"); m_layoutControl.SetAndShowGraph(oGraphAdapter.LoadGraphFromFile("..\\..\\..\\SampleData\\SampleGraph.txt")); Assert.IsNotNull(m_layoutControl.Graph); }
PopulateGraphFromFile() { IGraphAdapter oGraphAdapter = new SimpleGraphAdapter(); /* ( (Smrf.NodeXL.Visualization.Wpf.VertexDrawer) m_oNodeXLControl.VertexDrawer ).Radius = 5; */ m_oNodeXLControl.Graph = oGraphAdapter.LoadGraphFromFile( "..\\..\\SampleGraph.txt"); AddToolTipsToVertices(); m_oNodeXLControl.DrawGraph(true); }
protected void PopulateAndDrawGraph() { IGraphAdapter oGraphAdapter = new SimpleGraphAdapter(); layoutControl1.Graph = oGraphAdapter.LoadGraphFromFile("..\\..\\SampleGraph.txt"); }
protected void ShowGraph(Boolean bLayOutGraph) { AssertValid(); if (m_oNodeXLControl.IsLayingOutGraph) { return; } GeneralUserSettings oGeneralUserSettings = new GeneralUserSettings(); oGeneralUserSettings.NotUseWorkbookSettings(); LayoutUserSettings oLayoutUserSettings = new LayoutUserSettings(); oLayoutUserSettings.NotUseWorkbookSettings(); ApplyGeneralUserSettings(oGeneralUserSettings); ApplyLayoutUserSettings(oLayoutUserSettings); EnableGraphControls(false); try { IGraphAdapter oGraphAdapter = new SimpleGraphAdapter(); m_oNodeXLControl.Graph = oGraphAdapter.LoadGraphFromFile( "..\\..\\SampleGraph.txt"); //IGraph oGraph = oWorkbookReader.ReadWorkbook( // m_oWorkbook, oReadWorkbookContext); // Load the NodeXLControl with the resulting graph. //m_oNodeXLControl.Graph = oGraph; // Collapse any groups that are supposed to be collapsed. //CollapseOrExpandGroups(GetGroupNamesToCollapse(oGraph), true, // false); // Enable tooltips in case tooltips were specified in the workbook. m_oNodeXLControl.ShowVertexToolTips = true; // If the dynamic filter dialog is open, read the dynamic filter // columns it filled in. m_oNodeXLControl.DrawGraph(bLayOutGraph); } catch (Exception oException) { // If exceptions aren't caught here, Excel consumes them without // indicating that anything is wrong. This can result in the graph // controls remaining disabled, among other problems. ErrorUtil.OnException(oException); } finally { EnableGraphControls(true); } // Change the button text to indicate that if any of the buttons is // clicked again, the graph will be read again. tsbShowGraph.Text = "Refresh Graph"; }