Ejemplo n.º 1
0
        private async void OpenMenuItem_Click(object sender, RoutedEventArgs e)
        {
            GraphArray = await File.File.OpenFile("Text files (*.txt)|*.txt", false);

            if (GraphArray != null)
            {
                GraphArea.LogicCore = GraphAreaModel.GraphArea_Setup(Graph.Graph_Setup(GraphArray));
                InitializeGraph();
            }
        }
Ejemplo n.º 2
0
        private async void OpenCommandBinding_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            GraphArray = await File.File.OpenFile("Text files (*.txt)|*.txt", false);

            if (GraphArray != null)
            {
                GraphArea.LogicCore = GraphAreaModel.GraphArea_Setup(Graph.Graph_Setup(GraphArray));
                InitializeGraph();
            }
        }
Ejemplo n.º 3
0
        private async void DrawGraphBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (!int.TryParse(TextBoxVertices.Text, out int verticesResult) ||
                !double.TryParse(TextBoxPropability.Text, out double propabilityResult))
            {
                return;
            }
            GraphArray = await ArrayCreator.GenerateGraphArray(verticesResult, propabilityResult);

            GraphArea.LogicCore = GraphAreaModel.GraphArea_Setup(Graph.Graph_Setup(GraphArray));
            GraphAreaModel.GraphAreaSetupLayoutAlgorithm((LayoutAlgorithmTypeEnum)LayoutAlgorithmComboBox.SelectedIndex);

            InitializeGraph();
            if (!await TheCorrectnessOfData.checkGraphCompact(GraphArray))
            {
                MessageBox.Show("Graph is not compact!!");
            }
        }