示例#1
0
        private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            if (openFileDialog.ShowDialog() == true)
            {
                graph = GraphCore.LoadGraphFromFile(openFileDialog.FileName);

                DrawGraph();
            }
        }
示例#2
0
        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();
        }
示例#3
0
        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);
        }
示例#4
0
        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();
        }
示例#5
0
        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;
            }
        }