Browse Source

0.0.7b

- Минорные багфиксы
+ Добавление вершин из матрицы смежности
Anton 5 years ago
parent
commit
b5c8b34119
43 changed files with 598 additions and 300 deletions
  1. BIN
      .vs/GraphDrawer/v16/.suo
  2. BIN
      .vs/GraphDrawer/v16/Server/sqlite3/storage.ide
  3. BIN
      .vs/GraphDrawer/v16/Server/sqlite3/storage.ide-shm
  4. 0 0
      .vs/GraphDrawer/v16/Server/sqlite3/storage.ide-wal
  5. 1 1
      GraphDrawer/App.xaml
  6. 4 7
      GraphDrawer/ChoiseRegime.xaml
  7. 3 10
      GraphDrawer/ChoiseRegime.xaml.cs
  8. 4 4
      GraphDrawer/GraphByClick.xaml
  9. 40 76
      GraphDrawer/GraphByClick.xaml.cs
  10. 21 12
      GraphDrawer/GraphByMatrix.xaml
  11. 43 43
      GraphDrawer/GraphByMatrix.xaml.cs
  12. 10 10
      GraphDrawer/GraphDrawer.csproj
  13. 53 30
      GraphDrawer/MainWindow.xaml.cs
  14. 12 0
      GraphDrawer/MatrixOutput.xaml
  15. 36 0
      GraphDrawer/MatrixOutput.xaml.cs
  16. 10 9
      GraphDrawer/Vertex.cs
  17. BIN
      GraphDrawer/bin/Debug/GraphDrawer.exe
  18. BIN
      GraphDrawer/bin/Debug/GraphDrawer.pdb
  19. 2 2
      GraphDrawer/obj/Debug/App.g.cs
  20. 2 2
      GraphDrawer/obj/Debug/App.g.i.cs
  21. BIN
      GraphDrawer/obj/Debug/ChoiceMode.baml
  22. 7 16
      GraphDrawer/obj/Debug/ChoiseRegime.g.cs
  23. 93 0
      GraphDrawer/obj/Debug/ChoiceMode.g.i.cs
  24. 3 11
      GraphDrawer/obj/Debug/ChoiseRegime.g.i.cs
  25. BIN
      GraphDrawer/obj/Debug/DesignTimeResolveAssemblyReferences.cache
  26. BIN
      GraphDrawer/obj/Debug/GraphByClick.baml
  27. 12 12
      GraphDrawer/obj/Debug/GraphByClick.g.cs
  28. 12 12
      GraphDrawer/obj/Debug/GraphByClick.g.i.cs
  29. BIN
      GraphDrawer/obj/Debug/GraphByMatrix.baml
  30. 19 14
      GraphDrawer/obj/Debug/GraphByMatrix.g.cs
  31. 19 14
      GraphDrawer/obj/Debug/GraphByMatrix.g.i.cs
  32. 4 4
      GraphDrawer/obj/Debug/GraphDrawer.csproj.FileListAbsolute.txt
  33. BIN
      GraphDrawer/obj/Debug/GraphDrawer.csprojAssemblyReference.cache
  34. BIN
      GraphDrawer/obj/Debug/GraphDrawer.exe
  35. BIN
      GraphDrawer/obj/Debug/GraphDrawer.g.resources
  36. BIN
      GraphDrawer/obj/Debug/GraphDrawer.pdb
  37. 3 3
      GraphDrawer/obj/Debug/GraphDrawer_MarkupCompile.cache
  38. 3 3
      GraphDrawer/obj/Debug/GraphDrawer_MarkupCompile.i.cache
  39. 2 2
      GraphDrawer/obj/Debug/GraphDrawer_MarkupCompile.i.lref
  40. 2 3
      GraphDrawer/obj/Debug/GraphDrawer_MarkupCompile.lref
  41. BIN
      GraphDrawer/obj/Debug/ChoiseRegime.baml
  42. 89 0
      GraphDrawer/obj/Debug/MatrixOutput.g.cs
  43. 89 0
      GraphDrawer/obj/Debug/MatrixOutput.g.i.cs

BIN
.vs/GraphDrawer/v16/.suo


BIN
.vs/GraphDrawer/v16/Server/sqlite3/storage.ide


BIN
.vs/GraphDrawer/v16/Server/sqlite3/storage.ide-shm


+ 0 - 0
.vs/GraphDrawer/v16/Server/sqlite3/storage.ide-wal


+ 1 - 1
GraphDrawer/App.xaml

@@ -2,7 +2,7 @@
              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:local="clr-namespace:GraphDrawer"
-             StartupUri="ChoiseRegime.xaml">
+             StartupUri="ChoiceMode.xaml">
     <Application.Resources>
          
     </Application.Resources>

+ 4 - 7
GraphDrawer/ChoiseRegime.xaml

@@ -1,11 +1,10 @@
-<Window x:Class="GraphDrawer.ChoiseRegime"
+<Window x:Class="GraphDrawer.ChoiceMode"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
-        xmlns:local="clr-namespace:GraphDrawer"
         mc:Ignorable="d"
-        Title="Graph Drawer" WindowStartupLocation="CenterScreen" Height="400" ResizeMode="NoResize" Width="300">
+        Title="Graph Drawer" Height="250" ResizeMode="NoResize" Width="300">
     <Window.Resources>
         <Style TargetType="Button">
             <Setter Property="Background" Value="White"/>
@@ -16,10 +15,8 @@
         <Grid.RowDefinitions>
             <RowDefinition/>
             <RowDefinition/>
-            <RowDefinition/>
         </Grid.RowDefinitions>
-        <Button Content="Ввести количество" Click="Button_Click"/>
-        <Button Content="Ввести кликами" Grid.Row="1" Click="Button_Click_1"/>
-        <Button Content="Граф из матрицы" Grid.Row="2" Click="Button_Click_2"/>
+        <Button Content="Генерация графа" Click="Button_Click"/>
+        <Button Content="Ввод графа" Grid.Row="1" Click="Button_Click_1"/>
     </Grid>
 </Window>

+ 3 - 10
GraphDrawer/ChoiseRegime.xaml.cs

@@ -15,11 +15,11 @@ using System.Windows.Shapes;
 namespace GraphDrawer
 {
     /// <summary>
-    /// Interaction logic for ChoiseRegime.xaml
+    /// Interaction logic for ChoiceMode.xaml
     /// </summary>
-    public partial class ChoiseRegime : Window
+    public partial class ChoiceMode : Window
     {
-        public ChoiseRegime()
+        public ChoiceMode()
         {
             InitializeComponent();
         }
@@ -37,12 +37,5 @@ namespace GraphDrawer
             click.Show();
             Close();
         }
-
-        private void Button_Click_2(object sender, RoutedEventArgs e)
-        {
-            GraphByMatrix matrix = new GraphByMatrix();
-            matrix.Show();
-            Close();
-        }
     }
 }

+ 4 - 4
GraphDrawer/GraphByClick.xaml

@@ -5,7 +5,7 @@
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:local="clr-namespace:GraphDrawer.Properties"
         mc:Ignorable="d"
-        Title="Graph Drawer" Height="500" Width="800">
+        Title="Graph Drawer" Height="500" Width="800" MinHeight="500" MinWidth="600">
     <Grid  Background="LightBlue">
         <Grid.RowDefinitions>
             <RowDefinition Height="0.8*"/>
@@ -28,10 +28,10 @@
                     
                 </MenuItem>
                 <MenuItem Header="Матрицы">
-                    <MenuItem Header="Матрица смежности" Name="AdjacencyBtn" Click="AdjacencyBtn_Click"/>
-                    <MenuItem Header="Матрица инцидентности" Name="IncidenceBtn" Click="IncidenceBtn_Click"/>
+                    <MenuItem Header="Матрица смежности" Name="AdjacencyMatrix" Click="AdjacencyMatrix_Click"/>
+                    <MenuItem Header="Матрица инцидентности" Name="IncidenceMatrix" Click="IncidenceMatrix_Click"/>
+                    <MenuItem Header="Ввести на основе матрицы" Name="CreateGraphByMatrixBtn" Click="CreateGraphByMatrixBtn_Click"/>
                 </MenuItem>
-                <MenuItem Header="Ввести граф из матрицы" Name="GraphByMatrixBtn" Click="GraphByMatrix_Click"/>
             </MenuItem>
         </Menu>
         <Grid x:Name="choiceGrid" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,25,0,0">

+ 40 - 76
GraphDrawer/GraphByClick.xaml.cs

@@ -26,26 +26,25 @@ namespace GraphDrawer
 
             VertexArray.vertexCount = 0;
         }
+
         public GraphByClick(int[,] matrix, bool state)
         {
             InitializeComponent();
             VertexArray.vertexCount = 0;
+
+
             if (state)
             {
                 int length = (int)Math.Sqrt(matrix.Length);
                 for(int i = 0; i < length; i++)
-                {
-                    VertexArray.AddVertex(canvas, rand.Next(0, (int)canvas.ActualWidth/2), rand.Next(0, (int)canvas.ActualHeight/2));
-                }
+                    VertexArray.AddVertex(canvas, rand.Next(1, 600), rand.Next(1, 300));
 
                 for(int i = 0; i < length; i++)
                 {
                     for(int j = 0; j < length; j++)
                     {
                         if (matrix[i, j] == 1)
-                        {
                             EdgeArray.AddEdge(canvas, VertexArray.vertex[i], VertexArray.vertex[j]);
-                        }
                     }
                 }
             }
@@ -53,7 +52,7 @@ namespace GraphDrawer
 
         private void backBtn_Click(object sender, RoutedEventArgs e) // Выбор режима рисования
         {
-            ChoiseRegime regime = new ChoiseRegime();
+            ChoiceMode regime = new ChoiceMode();
             regime.Show();
             Close();
         }
@@ -238,106 +237,70 @@ namespace GraphDrawer
             GraphState.named = false;
         }
 
-        private void AdjacencyBtn_Click(object sender, RoutedEventArgs e)
+        private void AdjacencyMatrix_Click(object sender, RoutedEventArgs e)
         {
-            if (!GraphState.focused)
+            int length = VertexArray.vertex.Length;
+            int[,] matrix = new int[length, length];
+            for(int i = 0; i < VertexArray.vertex.Length; i++)
             {
-                int length = VertexArray.vertex.Length;
-                int[,] matrix = new int[length, length];
-                for (int i = 0; i < length; i++)
+                var vertex1 = VertexArray.vertex[i];
+                for(int j = 0; j < VertexArray.vertex.Length; j++)
                 {
-                    var vertex1 = VertexArray.vertex[i];
-                    for (int j = 0; j < length; j++)
+                    if (i != j)
                     {
                         var vertex2 = VertexArray.vertex[j];
                         for (int k = 0; k < EdgeArray.edge.Length; k++)
                         {
                             var edge = EdgeArray.edge[k];
-                            if (i == j)
-                            {
-                                matrix[i, j] = 0;
-                            }
-                            else if ((Vertex.Compare(vertex1, edge.startVertex) && Vertex.Compare(vertex2, edge.finishVertex)) || (Vertex.Compare(vertex1, edge.finishVertex) && Vertex.Compare(vertex2, edge.startVertex)))
-                            {
+                            if (Vertex.Compare(edge.finishVertex, vertex1) && Vertex.Compare(edge.startVertex, vertex2))
+                                matrix[i, j] = 1;
+                            else if (Vertex.Compare(edge.startVertex, vertex1) && Vertex.Compare(edge.finishVertex, vertex2))
                                 matrix[i, j] = 1;
-                                matrix[j, i] = matrix[i, j];
-                            }
-                            else
-                            {
-                                matrix[i, j] = 0;
-                            }
                         }
                     }
-                }
-                for (int i = 0; i < length; i++)
-                    for (int j = 0; j < length; j++)
-                        if (i > j)
-                            matrix[i, j] = matrix[j, i];
-                AdjacencyMatrix adjacencyMatrix = new AdjacencyMatrix(matrix, false);
-                adjacencyMatrix.Show();
-            }
-            else
-            {
-                int length = VertexArray.vertex.Length;
-                int[,] matrix = new int[length, length];
-                for (int i = 0; i < length; i++)
-                {
-                    var vertex1 = VertexArray.vertex[i];
-                    for (int j = 0; j < length; j++)
+                    else
                     {
-                        var vertex2 = VertexArray.vertex[j];
-                        for (int k = 0; k < ArrowedEdgeArray.edge.Length; k++)
-                        {
-                            var edge = ArrowedEdgeArray.edge[k];
-                            if (i == j)
-                            {
-                                matrix[i, j] = 0;
-                            }
-                            else if ((Vertex.Compare(vertex1, edge.startVertex) && Vertex.Compare(vertex2, edge.finishVertex)))
-                            {
-                                matrix[i, j] = 1;
-                            }
-                            else
-                            {
-                                matrix[i, j] = 0;
-                            }
-                        }
+                        matrix[i, j] = 0;
                     }
                 }
-                AdjacencyMatrix adjacencyMatrix = new AdjacencyMatrix(matrix, false);
-                adjacencyMatrix.Show();
             }
+
+            for (int i = 0; i < length; i++)
+                for (int j = 0; j < length; j++)
+                    matrix[i, j] = matrix[j, i];
+
+            MatrixOutput output = new MatrixOutput(matrix);
+            output.Show();
         }
 
-        private void IncidenceBtn_Click(object sender, RoutedEventArgs e)
+        private void IncidenceMatrix_Click(object sender, RoutedEventArgs e)
         {
-            int vertexLength = VertexArray.vertex.Length;
-            int edgeLength = EdgeArray.edge.Length;
-            int[,] matrix = new int[vertexLength, edgeLength];
-            for(int i = 0; i < vertexLength; i++)
+            int rows = VertexArray.vertex.Length;
+            int cols = EdgeArray.edge.Length;
+            int[,] matrix = new int[rows, cols];
+            for(int i = 0; i < rows; i++)
             {
                 var vertex = VertexArray.vertex[i];
-                for(int j = 0; j < edgeLength; j++)
+
+                for (int j = 0; j < cols; j++)
                 {
                     var edge = EdgeArray.edge[j];
-                    if(Vertex.Compare(vertex, edge.startVertex) || Vertex.Compare(vertex, edge.finishVertex))
-                    {
+                    if (Vertex.Compare(vertex, edge.finishVertex) || Vertex.Compare(vertex, edge.startVertex))
                         matrix[i, j] = 1;
-                    }
                     else
-                    {
                         matrix[i, j] = 0;
-                    }
                 }
             }
-            AdjacencyMatrix incidence = new AdjacencyMatrix(matrix, true);
-            incidence.Show();
+            MatrixOutput output = new MatrixOutput(matrix);
+            output.Show();
+
         }
 
-        private void GraphByMatrix_Click(object sender, RoutedEventArgs e)
+        private void CreateGraphByMatrixBtn_Click(object sender, RoutedEventArgs e)
         {
-            GraphByMatrix graph = new GraphByMatrix();
-            graph.Show();
+            GraphByMatrix matrix = new GraphByMatrix();
+            matrix.Show();
+            Close();
         }
     }
 
@@ -352,6 +315,7 @@ namespace GraphDrawer
 
         public static int AddVertex(Canvas canvas, int x, int y)
         {
+
             vertexCount++;
             Array.Resize(ref vertex, vertexCount);
             Array.Resize(ref ellipse, vertexCount);

+ 21 - 12
GraphDrawer/GraphByMatrix.xaml

@@ -5,21 +5,30 @@
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:local="clr-namespace:GraphDrawer"
         mc:Ignorable="d"
-        Title="Graph Drawer" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" Height="450" Width="500">
+        Title="GraphByMatrix" Height="500" Width="400">
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition/>
-            <RowDefinition Height="50"/>
+            <RowDefinition Height="100"/>
         </Grid.RowDefinitions>
-        <TextBox x:Name="MatrixTextBox" TextWrapping="Wrap" AcceptsReturn="True"/>
-        <StackPanel Grid.Row="1" Orientation="Horizontal">
-            <ComboBox Width="150" x:Name="SelectModeComboBox" VerticalAlignment="Center" Margin="10,0,0,0">
-                <ComboBoxItem Content="Матрица смежности"/>
-                <ComboBoxItem Content="Матрица инцидентности"/>
-            </ComboBox>
-            <TextBlock Text="Разделитель: запятая (,)" VerticalAlignment="Center" Margin="10,0,0,0"/>
-            <Button x:Name="submitBtn" Content="Сохранить" Height="30" Margin="20,0" Width="80" Background="LightBlue" VerticalAlignment="Center" Click="submitBtn_Click"/>
-            <Button x:Name="backBtn" Content="Назад" Height="30" Width="60" Margin="5,0" Background="IndianRed" Click="backBtn_Click"/>
-        </StackPanel>
+        <TextBox x:Name="MatrixTextBox" TextWrapping="Wrap" AcceptsReturn="True" FontSize="18"/>
+        <Grid x:Name="controlGrid" Grid.Row="1">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition/>
+                <ColumnDefinition/>
+            </Grid.ColumnDefinitions>
+            <StackPanel>
+                <TextBlock Text="Выберите матрицу:" FontSize="18" Margin="5"/>
+                <ComboBox Name="ModeSelection" Height="30" Width="150">
+                    <ComboBoxItem Content="Матрица смежности"/>
+                    <ComboBoxItem Content="Матрица инцидентности"/>
+                </ComboBox>
+            </StackPanel>
+            <StackPanel Grid.Column="1" VerticalAlignment="Center">
+                <Button x:Name="submitBtn" Content="Сохранить" Width="100" Height="30" Margin="5" VerticalAlignment="Center" Background="LightBlue" Click="submitBtn_Click"/>
+                <Button x:Name="backBtn" Content="Назад" Width="100" Height="30" Margin="5" VerticalAlignment="Center" Background="IndianRed"/>
+            </StackPanel>
+            
+        </Grid>
     </Grid>
 </Window>

+ 43 - 43
GraphDrawer/GraphByMatrix.xaml.cs

@@ -19,17 +19,6 @@ namespace GraphDrawer
     /// </summary>
     public partial class GraphByMatrix : Window
     {
-        T[,] ResizeArray<T>(T[,] original, int rows, int cols)
-        {
-            var newArray = new T[rows, cols];
-            int minRows = Math.Min(rows, original.GetLength(0));
-            int minCols = Math.Min(cols, original.GetLength(1));
-            for (int i = 0; i < minRows; i++)
-                for (int j = 0; j < minCols; j++)
-                    newArray[i, j] = original[i, j];
-            return newArray;
-        }
-
         public GraphByMatrix()
         {
             InitializeComponent();
@@ -37,46 +26,57 @@ namespace GraphDrawer
 
         private void submitBtn_Click(object sender, RoutedEventArgs e)
         {
-            try
+            ComboBoxItem selectedItem = (ComboBoxItem)ModeSelection.SelectedItem;
+            if (selectedItem.Content.ToString() == "Матрица смежности")
             {
-                var row = MatrixTextBox.GetLineText(0);
-                row = row.Replace(" ", "");
-                var elements = row.Split(',');
-                int rows = elements.Length;
-                int cols = 0;
-                while (true)
-                {
-                    var String = MatrixTextBox.GetLineText(cols);
-                    if (!(String.Length > 0))
-                        cols++;
-                    else
-                        break;
-                }
-                int[,] matrix = new int[rows, cols];
-                for(int i = 0; i < rows; i++)
-                {
-                    row = MatrixTextBox.GetLineText(i);
-                    row = row.Replace(" ", "");
-                    var rowArray = row.Split(',');
-                    for(int j = 0; j < cols; j++)
-                    {
-                        matrix[i, j] = int.Parse(rowArray[j]);
-                    }
-                }
+                int[,] matrix = CreateMatrix(MatrixTextBox);
                 GraphByClick graphByClick = new GraphByClick(matrix, true);
+                graphByClick.Show();
+                Close();
+            }
+            if(selectedItem.Content.ToString()=="Матрица инцидентности")
+            {
+                int[,] matrix = CreateMatrix(MatrixTextBox);
+                GraphByClick graphByClick = new GraphByClick(matrix, false);
+                graphByClick.Show();
+                Close();
             }
-            catch(Exception ex)
+        }
+
+        public int[,] CreateMatrix(TextBox MatrixTextBox)
+        {
+            var line = MatrixTextBox.GetLineText(0);
+            line = RemoveEmptyEntries(line);
+            var length = line.Length;
+            string newText = String.Empty;
+            List<string> lines = MatrixTextBox.Text.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries).ToList();
+            for (int i = 0; i < lines.Count; i++)
             {
-                MessageBox.Show("Разделитель - запятая\nПопробуйте еще раз", "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
-                MessageBox.Show(ex.Message);
+                lines[i] = RemoveEmptyEntries(lines[i]);
             }
+
+            int[,] matrix = new int[length, lines.Count];
+            for (int i = 0; i < length; i++)
+            {
+                line = lines[i];
+                for (int j = 0; j < lines.Count; j++)
+                {
+                    matrix[i, j] = line[j];
+                }
+            }
+
+            return matrix;
         }
 
-        private void backBtn_Click(object sender, RoutedEventArgs e)
+        public string RemoveEmptyEntries(string line)
         {
-            ChoiseRegime choice = new ChoiseRegime();
-            choice.Show();
-            Close();
+            line = line.Replace(", ", string.Empty);
+            line = line.Replace(",", string.Empty);
+            line = line.Replace(" ", string.Empty);
+            line = line.Replace("\0", string.Empty);
+            line = line.Replace("\n", string.Empty);
+            line = line.Replace("\r", string.Empty);
+            return line;
         }
     }
 }

+ 10 - 10
GraphDrawer/GraphDrawer.csproj

@@ -56,13 +56,10 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </ApplicationDefinition>
-    <Compile Include="AdjacencyMatrix.xaml.cs">
-      <DependentUpon>AdjacencyMatrix.xaml</DependentUpon>
-    </Compile>
     <Compile Include="ArrowLine.cs" />
     <Compile Include="ArrowLineBase.cs" />
-    <Compile Include="ChoiseRegime.xaml.cs">
-      <DependentUpon>ChoiseRegime.xaml</DependentUpon>
+    <Compile Include="ChoiceMode.xaml.cs">
+      <DependentUpon>ChoiceMode.xaml</DependentUpon>
     </Compile>
     <Compile Include="Edge.cs" />
     <Compile Include="GraphByClick.xaml.cs">
@@ -72,12 +69,11 @@
       <DependentUpon>GraphByMatrix.xaml</DependentUpon>
     </Compile>
     <Compile Include="GraphState.cs" />
+    <Compile Include="MatrixOutput.xaml.cs">
+      <DependentUpon>MatrixOutput.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Vertex.cs" />
-    <Page Include="AdjacencyMatrix.xaml">
-      <SubType>Designer</SubType>
-      <Generator>MSBuild:Compile</Generator>
-    </Page>
-    <Page Include="ChoiseRegime.xaml">
+    <Page Include="ChoiceMode.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
@@ -101,6 +97,10 @@
       <DependentUpon>MainWindow.xaml</DependentUpon>
       <SubType>Code</SubType>
     </Compile>
+    <Page Include="MatrixOutput.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
   </ItemGroup>
   <ItemGroup>
     <Compile Include="Properties\AssemblyInfo.cs">

+ 53 - 30
GraphDrawer/MainWindow.xaml.cs

@@ -1,7 +1,16 @@
 using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
 using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
 using System.Windows.Shapes;
 
 namespace GraphDrawer
@@ -28,37 +37,51 @@ namespace GraphDrawer
             }
             else
             {
-                int canvasWidth = Convert.ToInt32(canvas.ActualWidth)-50;
-                int canvasHeight = Convert.ToInt32(canvas.ActualHeight)-50;
-                Ellipse[] ellipse = new Ellipse[vertexCount];
-                Line[] lines = new Line[edgeCount * vertexCount];
-                Vertex[] vertices = new Vertex[vertexCount];
-                Edge[] edges = new Edge[vertexCount * edgeCount];
+                //int canvasWidth = Convert.ToInt32(canvas.ActualWidth)-50;
+                //int canvasHeight = Convert.ToInt32(canvas.ActualHeight)-50;
+                //Ellipse[] ellipse = new Ellipse[vertexCount];
+                //Line[] lines = new Line[edgeCount * vertexCount];
+                //Vertex[] vertices = new Vertex[vertexCount];
+                //Edge[] edges = new Edge[vertexCount * edgeCount];
                 
-                for(int i = 0; i< vertexCount; i++)
-                {
-                    int x = rand.Next(50, canvasWidth);
-                    int y = rand.Next(50, canvasHeight);
-                    //vertices[i] = new Vertex(x, y, 0);
-                    DrawVertex(ellipse[i], canvas, vertices[i]);
-                }
+                //for(int i = 0; i< vertexCount; i++)
+                //{
+                //    int x = rand.Next(50, canvasWidth);
+                //    int y = rand.Next(50, canvasHeight);
+                //    vertices[i] = new Vertex(x, y, 0);
+                //    DrawVertex(ellipse[i], canvas, vertices[i]);
+                //}
 
-                for (int i = 0; i < vertexCount; i++)
-                {
-                    //if (vertices[i].edgeCount < edgeCount)
-                    //{
-                    //    for (int j = 0; j < vertexCount; j++)
-                    //    {
-                    //        if (vertices[j].edgeCount < edgeCount)
-                    //        {
-                    //            edges[i] = new Edge(lines[i], vertices[j], vertices[i]);
-                    //            //vertices[i].edgeCount++;
-                    //            //vertices[j].edgeCount++;
-                    //            DrawEdge(canvas, lines[i], edges[i]);
-                    //        }
-                    //    }
-                    //}
-                }
+                //for (int i = 0; i < vertexCount; i++)
+                //{
+                //    if (vertices[i].edgeCount < edgeCount)
+                //    {
+                //        for (int j = 0; j < vertexCount; j++)
+                //        {
+                //            if (vertices[j].edgeCount < edgeCount)
+                //            {
+                //                edges[i] = new Edge(lines[i], vertices[j], vertices[i]);
+                //                vertices[i].edgeCount++;
+                //                vertices[j].edgeCount++;
+                //                DrawEdge(canvas, lines[i], edges[i]);
+                //            }
+                //        }
+                //    }
+                //}
+
+                //for (int i = 0; i < vertexCount; i++)
+                //{
+                //    for (int j = i; j < vertexCount; j++ )
+                //    {
+                //        if (vertices[j].edgeCount <= edgeCount && vertices[i].edgeCount<=edgeCount)
+                //        {
+                //            edges[i] = new Edge(lines[i], vertices[j], vertices[i]);
+                //            vertices[j].edgeCount++;
+                //            vertices[i].edgeCount++;
+                //            DrawEdge(canvas, lines[i], edges[i]);
+                //        }
+                //    }
+                //}
             }
         }
 
@@ -104,7 +127,7 @@ namespace GraphDrawer
 
         private void choiceBtn_Click(object sender, RoutedEventArgs e)
         {
-            ChoiseRegime regime = new ChoiseRegime();
+            ChoiceMode regime = new ChoiceMode();
             regime.Show();
             Close();
         }

+ 12 - 0
GraphDrawer/MatrixOutput.xaml

@@ -0,0 +1,12 @@
+<Window x:Class="GraphDrawer.MatrixOutput"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:GraphDrawer"
+        mc:Ignorable="d"
+        Title="MatrixOutput" Height="400" Width="400">
+    <Grid>
+        <TextBox IsReadOnly="True" x:Name="MatrixOutputBox"/>
+    </Grid>
+</Window>

+ 36 - 0
GraphDrawer/MatrixOutput.xaml.cs

@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace GraphDrawer
+{
+    /// <summary>
+    /// Interaction logic for MatrixOutput.xaml
+    /// </summary>
+    public partial class MatrixOutput : Window
+    {
+        public MatrixOutput(int[,] matrix)
+        {
+            InitializeComponent();
+                MatrixOutputBox.Text = "";
+                for(int i = 0; i < matrix.GetLength(0); i++)
+                {
+                    for(int j = 0; j < matrix.GetLength(1); j++)
+                    {
+                        MatrixOutputBox.Text += matrix[i, j].ToString() + ", ";
+                    }
+                    MatrixOutputBox.Text += "\n";
+                }
+        }
+    }
+}

+ 10 - 9
GraphDrawer/Vertex.cs

@@ -1,5 +1,4 @@
 using System;
-using System.Reflection;
 using System.Windows.Controls;
 using System.Windows.Media;
 using System.Windows.Shapes;
@@ -12,12 +11,12 @@ namespace GraphDrawer
         public int Y { get; set; }
         //public int edgeCount { get; set; }
 
-        public Vertex(int x, int y, int edgeCount)
-        {
-            X = x;
-            Y = y;
-            //this.edgeCount = edgeCount;
-        }
+        //public Vertex(int x, int y, int edgeCount)
+        //{
+        //    X = x;
+        //    Y = y;
+        //    this.edgeCount = edgeCount;
+        //}
 
         public Vertex(int x, int y)
         {
@@ -27,9 +26,11 @@ namespace GraphDrawer
 
         public static bool Compare(Vertex v1, Vertex v2)
         {
-            if (Equals(v1.X, v2.X) && Equals(v1.Y, v2.Y))
+            if (Equals(v1, v2))
+                return true;
+            if (v1 == v2)
                 return true;
-            else if (v1.X == v2.X && v1.Y == v2.Y)
+            if (v1.X == v2.X && v1.Y == v2.Y)
                 return true;
             return false;
         }

BIN
GraphDrawer/bin/Debug/GraphDrawer.exe


BIN
GraphDrawer/bin/Debug/GraphDrawer.pdb


+ 2 - 2
GraphDrawer/obj/Debug/App.g.cs

@@ -1,4 +1,4 @@
-#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "1ADE9B60C60715476238314653A35623A48A6C6DF28BB92DF9833B3B8B6EC77B"
+#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "61774A8774D84CC23CB444B773686ECE0661F24E32155D5ADD578D53FD7E6E79"
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
@@ -48,7 +48,7 @@ namespace GraphDrawer {
         public void InitializeComponent() {
             
             #line 5 "..\..\App.xaml"
-            this.StartupUri = new System.Uri("ChoiseRegime.xaml", System.UriKind.Relative);
+            this.StartupUri = new System.Uri("ChoiceMode.xaml", System.UriKind.Relative);
             
             #line default
             #line hidden

+ 2 - 2
GraphDrawer/obj/Debug/App.g.i.cs

@@ -1,4 +1,4 @@
-#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "1ADE9B60C60715476238314653A35623A48A6C6DF28BB92DF9833B3B8B6EC77B"
+#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "61774A8774D84CC23CB444B773686ECE0661F24E32155D5ADD578D53FD7E6E79"
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
@@ -48,7 +48,7 @@ namespace GraphDrawer {
         public void InitializeComponent() {
             
             #line 5 "..\..\App.xaml"
-            this.StartupUri = new System.Uri("ChoiseRegime.xaml", System.UriKind.Relative);
+            this.StartupUri = new System.Uri("ChoiceMode.xaml", System.UriKind.Relative);
             
             #line default
             #line hidden

BIN
GraphDrawer/obj/Debug/ChoiceMode.baml


+ 7 - 16
GraphDrawer/obj/Debug/ChoiseRegime.g.cs

@@ -1,4 +1,4 @@
-#pragma checksum "..\..\ChoiseRegime.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "51ADE619A72EC6D76F093CA8C9B531DE987EA41108CF669A19D8714D5C3877DC"
+#pragma checksum "..\..\ChoiceMode.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "79F2F697116CBEB71FA32849990CA81652BCE07911BF167765B58FFDAD171A89"
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
@@ -9,7 +9,6 @@
 // </auto-generated>
 //------------------------------------------------------------------------------
 
-using GraphDrawer;
 using System;
 using System.Diagnostics;
 using System.Windows;
@@ -36,9 +35,9 @@ namespace GraphDrawer {
     
     
     /// <summary>
-    /// ChoiseRegime
+    /// ChoiceMode
     /// </summary>
-    public partial class ChoiseRegime : System.Windows.Window, System.Windows.Markup.IComponentConnector {
+    public partial class ChoiceMode : System.Windows.Window, System.Windows.Markup.IComponentConnector {
         
         private bool _contentLoaded;
         
@@ -52,9 +51,9 @@ namespace GraphDrawer {
                 return;
             }
             _contentLoaded = true;
-            System.Uri resourceLocater = new System.Uri("/GraphDrawer;component/choiseregime.xaml", System.UriKind.Relative);
+            System.Uri resourceLocater = new System.Uri("/GraphDrawer;component/choicemode.xaml", System.UriKind.Relative);
             
-            #line 1 "..\..\ChoiseRegime.xaml"
+            #line 1 "..\..\ChoiceMode.xaml"
             System.Windows.Application.LoadComponent(this, resourceLocater);
             
             #line default
@@ -72,7 +71,7 @@ namespace GraphDrawer {
             {
             case 1:
             
-            #line 21 "..\..\ChoiseRegime.xaml"
+            #line 19 "..\..\ChoiceMode.xaml"
             ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click);
             
             #line default
@@ -80,20 +79,12 @@ namespace GraphDrawer {
             return;
             case 2:
             
-            #line 22 "..\..\ChoiseRegime.xaml"
+            #line 20 "..\..\ChoiceMode.xaml"
             ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_1);
             
             #line default
             #line hidden
             return;
-            case 3:
-            
-            #line 23 "..\..\ChoiseRegime.xaml"
-            ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_2);
-            
-            #line default
-            #line hidden
-            return;
             }
             this._contentLoaded = true;
         }

+ 93 - 0
GraphDrawer/obj/Debug/ChoiceMode.g.i.cs

@@ -0,0 +1,93 @@
+#pragma checksum "..\..\ChoiceMode.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "79F2F697116CBEB71FA32849990CA81652BCE07911BF167765B58FFDAD171A89"
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using System;
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Automation;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Media.Effects;
+using System.Windows.Media.Imaging;
+using System.Windows.Media.Media3D;
+using System.Windows.Media.TextFormatting;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Windows.Shell;
+
+
+namespace GraphDrawer {
+    
+    
+    /// <summary>
+    /// ChoiceMode
+    /// </summary>
+    public partial class ChoiceMode : System.Windows.Window, System.Windows.Markup.IComponentConnector {
+        
+        private bool _contentLoaded;
+        
+        /// <summary>
+        /// InitializeComponent
+        /// </summary>
+        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+        public void InitializeComponent() {
+            if (_contentLoaded) {
+                return;
+            }
+            _contentLoaded = true;
+            System.Uri resourceLocater = new System.Uri("/GraphDrawer;component/choicemode.xaml", System.UriKind.Relative);
+            
+            #line 1 "..\..\ChoiceMode.xaml"
+            System.Windows.Application.LoadComponent(this, resourceLocater);
+            
+            #line default
+            #line hidden
+        }
+        
+        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
+            switch (connectionId)
+            {
+            case 1:
+            
+            #line 19 "..\..\ChoiceMode.xaml"
+            ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click);
+            
+            #line default
+            #line hidden
+            return;
+            case 2:
+            
+            #line 20 "..\..\ChoiceMode.xaml"
+            ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_1);
+            
+            #line default
+            #line hidden
+            return;
+            }
+            this._contentLoaded = true;
+        }
+    }
+}
+

+ 3 - 11
GraphDrawer/obj/Debug/ChoiseRegime.g.i.cs

@@ -1,4 +1,4 @@
-#pragma checksum "..\..\ChoiseRegime.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "51ADE619A72EC6D76F093CA8C9B531DE987EA41108CF669A19D8714D5C3877DC"
+#pragma checksum "..\..\ChoiseRegime.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "A8ADBB8E4B9B0AD408883526C6DDA9A250B34E1B14EF12ACC6EA854889AA1C50"
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
@@ -72,7 +72,7 @@ namespace GraphDrawer {
             {
             case 1:
             
-            #line 21 "..\..\ChoiseRegime.xaml"
+            #line 20 "..\..\ChoiseRegime.xaml"
             ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click);
             
             #line default
@@ -80,20 +80,12 @@ namespace GraphDrawer {
             return;
             case 2:
             
-            #line 22 "..\..\ChoiseRegime.xaml"
+            #line 21 "..\..\ChoiseRegime.xaml"
             ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_1);
             
             #line default
             #line hidden
             return;
-            case 3:
-            
-            #line 23 "..\..\ChoiseRegime.xaml"
-            ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_2);
-            
-            #line default
-            #line hidden
-            return;
             }
             this._contentLoaded = true;
         }

BIN
GraphDrawer/obj/Debug/DesignTimeResolveAssemblyReferences.cache


BIN
GraphDrawer/obj/Debug/GraphByClick.baml


+ 12 - 12
GraphDrawer/obj/Debug/GraphByClick.g.cs

@@ -1,4 +1,4 @@
-#pragma checksum "..\..\GraphByClick.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "59E82A882709272D1CC59D9EC1655131E84A84875301DE10CAA3C1DFA3A2CD09"
+#pragma checksum "..\..\GraphByClick.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "482C1987395841D59809FCC2DFB25DF4C7E2BEB738323A9183526CEF3BEAFF9D"
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
@@ -75,7 +75,7 @@ namespace GraphDrawer {
         
         #line 31 "..\..\GraphByClick.xaml"
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
-        internal System.Windows.Controls.MenuItem AdjacencyBtn;
+        internal System.Windows.Controls.MenuItem AdjacencyMatrix;
         
         #line default
         #line hidden
@@ -83,15 +83,15 @@ namespace GraphDrawer {
         
         #line 32 "..\..\GraphByClick.xaml"
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
-        internal System.Windows.Controls.MenuItem IncidenceBtn;
+        internal System.Windows.Controls.MenuItem IncidenceMatrix;
         
         #line default
         #line hidden
         
         
-        #line 34 "..\..\GraphByClick.xaml"
+        #line 33 "..\..\GraphByClick.xaml"
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
-        internal System.Windows.Controls.MenuItem GraphByMatrixBtn;
+        internal System.Windows.Controls.MenuItem CreateGraphByMatrixBtn;
         
         #line default
         #line hidden
@@ -259,28 +259,28 @@ namespace GraphDrawer {
             #line hidden
             return;
             case 5:
-            this.AdjacencyBtn = ((System.Windows.Controls.MenuItem)(target));
+            this.AdjacencyMatrix = ((System.Windows.Controls.MenuItem)(target));
             
             #line 31 "..\..\GraphByClick.xaml"
-            this.AdjacencyBtn.Click += new System.Windows.RoutedEventHandler(this.AdjacencyBtn_Click);
+            this.AdjacencyMatrix.Click += new System.Windows.RoutedEventHandler(this.AdjacencyMatrix_Click);
             
             #line default
             #line hidden
             return;
             case 6:
-            this.IncidenceBtn = ((System.Windows.Controls.MenuItem)(target));
+            this.IncidenceMatrix = ((System.Windows.Controls.MenuItem)(target));
             
             #line 32 "..\..\GraphByClick.xaml"
-            this.IncidenceBtn.Click += new System.Windows.RoutedEventHandler(this.IncidenceBtn_Click);
+            this.IncidenceMatrix.Click += new System.Windows.RoutedEventHandler(this.IncidenceMatrix_Click);
             
             #line default
             #line hidden
             return;
             case 7:
-            this.GraphByMatrixBtn = ((System.Windows.Controls.MenuItem)(target));
+            this.CreateGraphByMatrixBtn = ((System.Windows.Controls.MenuItem)(target));
             
-            #line 34 "..\..\GraphByClick.xaml"
-            this.GraphByMatrixBtn.Click += new System.Windows.RoutedEventHandler(this.GraphByMatrix_Click);
+            #line 33 "..\..\GraphByClick.xaml"
+            this.CreateGraphByMatrixBtn.Click += new System.Windows.RoutedEventHandler(this.CreateGraphByMatrixBtn_Click);
             
             #line default
             #line hidden

+ 12 - 12
GraphDrawer/obj/Debug/GraphByClick.g.i.cs

@@ -1,4 +1,4 @@
-#pragma checksum "..\..\GraphByClick.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "59E82A882709272D1CC59D9EC1655131E84A84875301DE10CAA3C1DFA3A2CD09"
+#pragma checksum "..\..\GraphByClick.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "482C1987395841D59809FCC2DFB25DF4C7E2BEB738323A9183526CEF3BEAFF9D"
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
@@ -75,7 +75,7 @@ namespace GraphDrawer {
         
         #line 31 "..\..\GraphByClick.xaml"
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
-        internal System.Windows.Controls.MenuItem AdjacencyBtn;
+        internal System.Windows.Controls.MenuItem AdjacencyMatrix;
         
         #line default
         #line hidden
@@ -83,15 +83,15 @@ namespace GraphDrawer {
         
         #line 32 "..\..\GraphByClick.xaml"
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
-        internal System.Windows.Controls.MenuItem IncidenceBtn;
+        internal System.Windows.Controls.MenuItem IncidenceMatrix;
         
         #line default
         #line hidden
         
         
-        #line 34 "..\..\GraphByClick.xaml"
+        #line 33 "..\..\GraphByClick.xaml"
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
-        internal System.Windows.Controls.MenuItem GraphByMatrixBtn;
+        internal System.Windows.Controls.MenuItem CreateGraphByMatrixBtn;
         
         #line default
         #line hidden
@@ -259,28 +259,28 @@ namespace GraphDrawer {
             #line hidden
             return;
             case 5:
-            this.AdjacencyBtn = ((System.Windows.Controls.MenuItem)(target));
+            this.AdjacencyMatrix = ((System.Windows.Controls.MenuItem)(target));
             
             #line 31 "..\..\GraphByClick.xaml"
-            this.AdjacencyBtn.Click += new System.Windows.RoutedEventHandler(this.AdjacencyBtn_Click);
+            this.AdjacencyMatrix.Click += new System.Windows.RoutedEventHandler(this.AdjacencyMatrix_Click);
             
             #line default
             #line hidden
             return;
             case 6:
-            this.IncidenceBtn = ((System.Windows.Controls.MenuItem)(target));
+            this.IncidenceMatrix = ((System.Windows.Controls.MenuItem)(target));
             
             #line 32 "..\..\GraphByClick.xaml"
-            this.IncidenceBtn.Click += new System.Windows.RoutedEventHandler(this.IncidenceBtn_Click);
+            this.IncidenceMatrix.Click += new System.Windows.RoutedEventHandler(this.IncidenceMatrix_Click);
             
             #line default
             #line hidden
             return;
             case 7:
-            this.GraphByMatrixBtn = ((System.Windows.Controls.MenuItem)(target));
+            this.CreateGraphByMatrixBtn = ((System.Windows.Controls.MenuItem)(target));
             
-            #line 34 "..\..\GraphByClick.xaml"
-            this.GraphByMatrixBtn.Click += new System.Windows.RoutedEventHandler(this.GraphByMatrix_Click);
+            #line 33 "..\..\GraphByClick.xaml"
+            this.CreateGraphByMatrixBtn.Click += new System.Windows.RoutedEventHandler(this.CreateGraphByMatrixBtn_Click);
             
             #line default
             #line hidden

BIN
GraphDrawer/obj/Debug/GraphByMatrix.baml


+ 19 - 14
GraphDrawer/obj/Debug/GraphByMatrix.g.cs

@@ -1,4 +1,4 @@
-#pragma checksum "..\..\GraphByMatrix.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "453FCE708EF09FCA2B6784CE3A46E9A27A2BDE04E947F8E57015F0B16CB9C270"
+#pragma checksum "..\..\GraphByMatrix.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "CAF739FF9254FDE185A4182EF86DE4975E74CF50D3CC2D451F255D02676FF1FC"
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
@@ -49,15 +49,23 @@ namespace GraphDrawer {
         #line hidden
         
         
-        #line 16 "..\..\GraphByMatrix.xaml"
+        #line 15 "..\..\GraphByMatrix.xaml"
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
-        internal System.Windows.Controls.ComboBox SelectModeComboBox;
+        internal System.Windows.Controls.Grid controlGrid;
         
         #line default
         #line hidden
         
         
-        #line 21 "..\..\GraphByMatrix.xaml"
+        #line 22 "..\..\GraphByMatrix.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.ComboBox ModeSelection;
+        
+        #line default
+        #line hidden
+        
+        
+        #line 28 "..\..\GraphByMatrix.xaml"
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
         internal System.Windows.Controls.Button submitBtn;
         
@@ -65,7 +73,7 @@ namespace GraphDrawer {
         #line hidden
         
         
-        #line 22 "..\..\GraphByMatrix.xaml"
+        #line 29 "..\..\GraphByMatrix.xaml"
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
         internal System.Windows.Controls.Button backBtn;
         
@@ -106,25 +114,22 @@ namespace GraphDrawer {
             this.MatrixTextBox = ((System.Windows.Controls.TextBox)(target));
             return;
             case 2:
-            this.SelectModeComboBox = ((System.Windows.Controls.ComboBox)(target));
+            this.controlGrid = ((System.Windows.Controls.Grid)(target));
             return;
             case 3:
+            this.ModeSelection = ((System.Windows.Controls.ComboBox)(target));
+            return;
+            case 4:
             this.submitBtn = ((System.Windows.Controls.Button)(target));
             
-            #line 21 "..\..\GraphByMatrix.xaml"
+            #line 28 "..\..\GraphByMatrix.xaml"
             this.submitBtn.Click += new System.Windows.RoutedEventHandler(this.submitBtn_Click);
             
             #line default
             #line hidden
             return;
-            case 4:
+            case 5:
             this.backBtn = ((System.Windows.Controls.Button)(target));
-            
-            #line 22 "..\..\GraphByMatrix.xaml"
-            this.backBtn.Click += new System.Windows.RoutedEventHandler(this.backBtn_Click);
-            
-            #line default
-            #line hidden
             return;
             }
             this._contentLoaded = true;

+ 19 - 14
GraphDrawer/obj/Debug/GraphByMatrix.g.i.cs

@@ -1,4 +1,4 @@
-#pragma checksum "..\..\GraphByMatrix.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "453FCE708EF09FCA2B6784CE3A46E9A27A2BDE04E947F8E57015F0B16CB9C270"
+#pragma checksum "..\..\GraphByMatrix.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "CAF739FF9254FDE185A4182EF86DE4975E74CF50D3CC2D451F255D02676FF1FC"
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
@@ -49,15 +49,23 @@ namespace GraphDrawer {
         #line hidden
         
         
-        #line 16 "..\..\GraphByMatrix.xaml"
+        #line 15 "..\..\GraphByMatrix.xaml"
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
-        internal System.Windows.Controls.ComboBox SelectModeComboBox;
+        internal System.Windows.Controls.Grid controlGrid;
         
         #line default
         #line hidden
         
         
-        #line 21 "..\..\GraphByMatrix.xaml"
+        #line 22 "..\..\GraphByMatrix.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.ComboBox ModeSelection;
+        
+        #line default
+        #line hidden
+        
+        
+        #line 28 "..\..\GraphByMatrix.xaml"
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
         internal System.Windows.Controls.Button submitBtn;
         
@@ -65,7 +73,7 @@ namespace GraphDrawer {
         #line hidden
         
         
-        #line 22 "..\..\GraphByMatrix.xaml"
+        #line 29 "..\..\GraphByMatrix.xaml"
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
         internal System.Windows.Controls.Button backBtn;
         
@@ -106,25 +114,22 @@ namespace GraphDrawer {
             this.MatrixTextBox = ((System.Windows.Controls.TextBox)(target));
             return;
             case 2:
-            this.SelectModeComboBox = ((System.Windows.Controls.ComboBox)(target));
+            this.controlGrid = ((System.Windows.Controls.Grid)(target));
             return;
             case 3:
+            this.ModeSelection = ((System.Windows.Controls.ComboBox)(target));
+            return;
+            case 4:
             this.submitBtn = ((System.Windows.Controls.Button)(target));
             
-            #line 21 "..\..\GraphByMatrix.xaml"
+            #line 28 "..\..\GraphByMatrix.xaml"
             this.submitBtn.Click += new System.Windows.RoutedEventHandler(this.submitBtn_Click);
             
             #line default
             #line hidden
             return;
-            case 4:
+            case 5:
             this.backBtn = ((System.Windows.Controls.Button)(target));
-            
-            #line 22 "..\..\GraphByMatrix.xaml"
-            this.backBtn.Click += new System.Windows.RoutedEventHandler(this.backBtn_Click);
-            
-            #line default
-            #line hidden
             return;
             }
             this._contentLoaded = true;

+ 4 - 4
GraphDrawer/obj/Debug/GraphDrawer.csproj.FileListAbsolute.txt

@@ -34,13 +34,11 @@ C:\Users\locadm\Desktop\Graphs\GraphDrawer\bin\Debug\GraphDrawer.exe.config
 C:\Users\locadm\Desktop\Graphs\GraphDrawer\bin\Debug\GraphDrawer.exe
 C:\Users\locadm\Desktop\Graphs\GraphDrawer\bin\Debug\GraphDrawer.pdb
 C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\GraphDrawer.csprojAssemblyReference.cache
-C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\ChoiseRegime.g.cs
 C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\GraphByClick.g.cs
 C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\MainWindow.g.cs
 C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\App.g.cs
 C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\GraphDrawer_MarkupCompile.cache
 C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\GraphDrawer_MarkupCompile.lref
-C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\ChoiseRegime.baml
 C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\GraphByClick.baml
 C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\MainWindow.baml
 C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\GraphDrawer.g.resources
@@ -48,7 +46,9 @@ C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\GraphDrawer.Properties.Reso
 C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\GraphDrawer.csproj.GenerateResource.cache
 C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\GraphDrawer.exe
 C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\GraphDrawer.pdb
-C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\AdjacencyMatrix.g.cs
-C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\AdjacencyMatrix.baml
+C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\ChoiceMode.baml
+C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\ChoiceMode.g.cs
 C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\GraphByMatrix.g.cs
 C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\GraphByMatrix.baml
+C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\MatrixOutput.g.cs
+C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\MatrixOutput.baml

BIN
GraphDrawer/obj/Debug/GraphDrawer.csprojAssemblyReference.cache


BIN
GraphDrawer/obj/Debug/GraphDrawer.exe


BIN
GraphDrawer/obj/Debug/GraphDrawer.g.resources


BIN
GraphDrawer/obj/Debug/GraphDrawer.pdb


+ 3 - 3
GraphDrawer/obj/Debug/GraphDrawer_MarkupCompile.cache

@@ -10,11 +10,11 @@ none
 false
 DEBUG;TRACE
 C:\Users\locadm\Desktop\Graphs\GraphDrawer\App.xaml
-52056349942
+5-61230628
 
-141380625537
+14427084280
 141183416626
-AdjacencyMatrix.xaml;ChoiseRegime.xaml;GraphByClick.xaml;GraphByMatrix.xaml;MainWindow.xaml;
+ChoiceMode.xaml;GraphByClick.xaml;GraphByMatrix.xaml;MainWindow.xaml;MatrixOutput.xaml;
 
 False
 

+ 3 - 3
GraphDrawer/obj/Debug/GraphDrawer_MarkupCompile.i.cache

@@ -10,11 +10,11 @@ none
 false
 DEBUG;TRACE
 C:\Users\locadm\Desktop\Graphs\GraphDrawer\App.xaml
-52056349942
+5-61230628
 
-151780859562
+15827318305
 141183416626
-AdjacencyMatrix.xaml;ChoiseRegime.xaml;GraphByClick.xaml;GraphByMatrix.xaml;MainWindow.xaml;
+ChoiceMode.xaml;GraphByClick.xaml;GraphByMatrix.xaml;MainWindow.xaml;MatrixOutput.xaml;
 
 True
 

+ 2 - 2
GraphDrawer/obj/Debug/GraphDrawer_MarkupCompile.i.lref

@@ -1,5 +1,5 @@
 
 
-FC:\Users\locadm\Desktop\Graphs\GraphDrawer\ChoiseRegime.xaml;;
-FC:\Users\locadm\Desktop\Graphs\GraphDrawer\GraphByMatrix.xaml;;
+FC:\Users\locadm\Desktop\Graphs\GraphDrawer\GraphByClick.xaml;;
+FC:\Users\locadm\Desktop\Graphs\GraphDrawer\MatrixOutput.xaml;;
 

+ 2 - 3
GraphDrawer/obj/Debug/GraphDrawer_MarkupCompile.lref

@@ -1,8 +1,7 @@
 
 
-FC:\Users\locadm\Desktop\Graphs\GraphDrawer\ChoiseRegime.xaml;;
 FC:\Users\locadm\Desktop\Graphs\GraphDrawer\GraphByClick.xaml;;
-FC:\Users\locadm\Desktop\Graphs\GraphDrawer\MainWindow.xaml;;
-FC:\Users\locadm\Desktop\Graphs\GraphDrawer\AdjacencyMatrix.xaml;;
 FC:\Users\locadm\Desktop\Graphs\GraphDrawer\GraphByMatrix.xaml;;
+FC:\Users\locadm\Desktop\Graphs\GraphDrawer\MainWindow.xaml;;
+FC:\Users\locadm\Desktop\Graphs\GraphDrawer\MatrixOutput.xaml;;
 

BIN
GraphDrawer/obj/Debug/ChoiseRegime.baml


+ 89 - 0
GraphDrawer/obj/Debug/MatrixOutput.g.cs

@@ -0,0 +1,89 @@
+#pragma checksum "..\..\MatrixOutput.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "6CEF5C7DE7A39D235EDBA4D7B2DAFE43B84D9F97E7886A33C3FC740D5FB11E61"
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using GraphDrawer;
+using System;
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Automation;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Media.Effects;
+using System.Windows.Media.Imaging;
+using System.Windows.Media.Media3D;
+using System.Windows.Media.TextFormatting;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Windows.Shell;
+
+
+namespace GraphDrawer {
+    
+    
+    /// <summary>
+    /// MatrixOutput
+    /// </summary>
+    public partial class MatrixOutput : System.Windows.Window, System.Windows.Markup.IComponentConnector {
+        
+        
+        #line 10 "..\..\MatrixOutput.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.TextBox MatrixOutputBox;
+        
+        #line default
+        #line hidden
+        
+        private bool _contentLoaded;
+        
+        /// <summary>
+        /// InitializeComponent
+        /// </summary>
+        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+        public void InitializeComponent() {
+            if (_contentLoaded) {
+                return;
+            }
+            _contentLoaded = true;
+            System.Uri resourceLocater = new System.Uri("/GraphDrawer;component/matrixoutput.xaml", System.UriKind.Relative);
+            
+            #line 1 "..\..\MatrixOutput.xaml"
+            System.Windows.Application.LoadComponent(this, resourceLocater);
+            
+            #line default
+            #line hidden
+        }
+        
+        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
+            switch (connectionId)
+            {
+            case 1:
+            this.MatrixOutputBox = ((System.Windows.Controls.TextBox)(target));
+            return;
+            }
+            this._contentLoaded = true;
+        }
+    }
+}
+

+ 89 - 0
GraphDrawer/obj/Debug/MatrixOutput.g.i.cs

@@ -0,0 +1,89 @@
+#pragma checksum "..\..\MatrixOutput.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "6CEF5C7DE7A39D235EDBA4D7B2DAFE43B84D9F97E7886A33C3FC740D5FB11E61"
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using GraphDrawer;
+using System;
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Automation;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Media.Effects;
+using System.Windows.Media.Imaging;
+using System.Windows.Media.Media3D;
+using System.Windows.Media.TextFormatting;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Windows.Shell;
+
+
+namespace GraphDrawer {
+    
+    
+    /// <summary>
+    /// MatrixOutput
+    /// </summary>
+    public partial class MatrixOutput : System.Windows.Window, System.Windows.Markup.IComponentConnector {
+        
+        
+        #line 10 "..\..\MatrixOutput.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.TextBox MatrixOutputBox;
+        
+        #line default
+        #line hidden
+        
+        private bool _contentLoaded;
+        
+        /// <summary>
+        /// InitializeComponent
+        /// </summary>
+        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+        public void InitializeComponent() {
+            if (_contentLoaded) {
+                return;
+            }
+            _contentLoaded = true;
+            System.Uri resourceLocater = new System.Uri("/GraphDrawer;component/matrixoutput.xaml", System.UriKind.Relative);
+            
+            #line 1 "..\..\MatrixOutput.xaml"
+            System.Windows.Application.LoadComponent(this, resourceLocater);
+            
+            #line default
+            #line hidden
+        }
+        
+        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
+            switch (connectionId)
+            {
+            case 1:
+            this.MatrixOutputBox = ((System.Windows.Controls.TextBox)(target));
+            return;
+            }
+            this._contentLoaded = true;
+        }
+    }
+}
+