private void Button_Click(object sender, System.Windows.RoutedEventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); if (openFileDialog.ShowDialog() == true) { graph = GraphCore.LoadGraphFromFile(openFileDialog.FileName); DrawGraph(); } }
private void MainWindow_Loaded(object sender, System.Windows.RoutedEventArgs e) { graphViewer = new GraphViewer(); graphViewer.BindToPanel(GraphDockPanel); graphViewer.ObjectUnderMouseCursorChanged += GraphViewer_ObjectUnderMouseCursorChanged; graphViewer.MouseUp += GraphViewer_MouseUp; graph = GraphCore.LoadGraphFromFile(@"C:\Users\rnamedyn\Downloads\Telegram Desktop\bez cyklu.txt"); DrawGraph(); }
private void GenerateStartGraph() { graph = new GraphCore(); for (int i = 0; i < 6; i++) { graph.AddVertex(); } graph.ConnectVertex(1, 4); graph.ConnectVertex(2, 4); graph.ConnectVertex(3, 4); graph.ConnectVertex(4, 5); graph.ConnectVertex(5, 6); }
static void Main(string[] args) { var graph = new GraphCore(); for (int i = 0; i < 6; i++) { graph.AddVertex(); } graph.ConnectVertex(1, 4); graph.ConnectVertex(2, 4); graph.ConnectVertex(3, 4); graph.ConnectVertex(4, 5); graph.ConnectVertex(5, 6); Console.WriteLine(string.Join(";", graph.GeneratePruferCode())); Console.ReadKey(); }
private void Time_Tick(object sender, EventArgs e) { double ValueAdd; int n = r.Next(1, 45); int s = r.Next(1, 3); try { if (s / 2 == 0) { ValueAdd = Convert.ToDouble(n); } else { ValueAdd = Convert.ToDouble(-n); } GraphCore.AddValue((float)ValueAdd); GraphCore.RefreshControl(); } catch { return; } }