Przeglądaj źródła

- генерация графов
+ рефакторинг

Anton 5 lat temu
rodzic
commit
9f199d1c03
44 zmienionych plików z 765 dodań i 752 usunięć
  1. 63 0
      .gitattributes
  2. 340 0
      .gitignore
  3. BIN
      .vs/GraphDrawer/v16/.suo
  4. BIN
      .vs/GraphDrawer/v16/Server/sqlite3/storage.ide
  5. BIN
      .vs/GraphDrawer/v16/Server/sqlite3/storage.ide-shm
  6. BIN
      .vs/GraphDrawer/v16/Server/sqlite3/storage.ide-wal
  7. 1 1
      GraphDrawer/App.xaml
  8. 0 1
      GraphDrawer/ArrowLine.cs
  9. 0 22
      GraphDrawer/ChoiceMode.xaml
  10. 0 41
      GraphDrawer/ChoiceMode.xaml.cs
  11. 25 33
      GraphDrawer/Edge.cs
  12. 16 9
      GraphDrawer/EdgeCreateWindow.xaml
  13. 4 4
      GraphDrawer/EdgeCreateWindow.xaml.cs
  14. 1 2
      GraphDrawer/GraphByClick.xaml
  15. 165 92
      GraphDrawer/GraphByClick.xaml.cs
  16. 0 15
      GraphDrawer/GraphDrawer.csproj
  17. 0 28
      GraphDrawer/MainWindow.xaml
  18. 0 135
      GraphDrawer/MainWindow.xaml.cs
  19. 4 8
      GraphDrawer/Vertex.cs
  20. BIN
      GraphDrawer/bin/Debug/GraphDrawer.exe
  21. BIN
      GraphDrawer/bin/Debug/GraphDrawer.pdb
  22. 2 2
      GraphDrawer/obj/Debug/App.g.cs
  23. 2 2
      GraphDrawer/obj/Debug/App.g.i.cs
  24. BIN
      GraphDrawer/obj/Debug/ChoiceMode.baml
  25. 0 93
      GraphDrawer/obj/Debug/ChoiceMode.g.cs
  26. BIN
      GraphDrawer/obj/Debug/DesignTimeResolveAssemblyReferences.cache
  27. 82 35
      GraphDrawer/obj/Debug/EdgeCreateWindow.g.i.cs
  28. BIN
      GraphDrawer/obj/Debug/GraphByClick.baml
  29. 17 34
      GraphDrawer/obj/Debug/GraphByClick.g.cs
  30. 17 34
      GraphDrawer/obj/Debug/GraphByClick.g.i.cs
  31. BIN
      GraphDrawer/obj/Debug/GraphByMatrix.baml
  32. 18 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. 4 4
      GraphDrawer/obj/Debug/GraphDrawer_MarkupCompile.cache
  38. 3 3
      GraphDrawer/obj/Debug/GraphDrawer_MarkupCompile.i.cache
  39. 0 3
      GraphDrawer/obj/Debug/GraphDrawer_MarkupCompile.i.lref
  40. 0 1
      GraphDrawer/obj/Debug/GraphDrawer_MarkupCompile.lref
  41. BIN
      GraphDrawer/obj/Debug/MainWindow.baml
  42. 0 145
      GraphDrawer/obj/Debug/MainWindow.g.cs
  43. 1 1
      GraphDrawer/obj/Debug/MainWindow.g.i.cs
  44. BIN
      GraphDrawer/obj/Debug/MatrixOutput.baml

+ 63 - 0
.gitattributes

@@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs     diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following 
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln       merge=binary
+#*.csproj    merge=binary
+#*.vbproj    merge=binary
+#*.vcxproj   merge=binary
+#*.vcproj    merge=binary
+#*.dbproj    merge=binary
+#*.fsproj    merge=binary
+#*.lsproj    merge=binary
+#*.wixproj   merge=binary
+#*.modelproj merge=binary
+#*.sqlproj   merge=binary
+#*.wwaproj   merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg   binary
+#*.png   binary
+#*.gif   binary
+
+###############################################################################
+# diff behavior for common document formats
+# 
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the 
+# entries below.
+###############################################################################
+#*.doc   diff=astextplain
+#*.DOC   diff=astextplain
+#*.docx  diff=astextplain
+#*.DOCX  diff=astextplain
+#*.dot   diff=astextplain
+#*.DOT   diff=astextplain
+#*.pdf   diff=astextplain
+#*.PDF   diff=astextplain
+#*.rtf   diff=astextplain
+#*.RTF   diff=astextplain

+ 340 - 0
.gitignore

@@ -0,0 +1,340 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
+
+# User-specific files
+*.rsuser
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUNIT
+*.VisualState.xml
+TestResult.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_h.h
+*.ilk
+*.meta
+*.obj
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*_wpftmp.csproj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# JustCode is a .NET coding add-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+*- Backup*.rdl
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# JetBrains Rider
+.idea/
+*.sln.iml
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb

BIN
.vs/GraphDrawer/v16/.suo


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


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


BIN
.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="ChoiceMode.xaml">
+             StartupUri="GraphByClick.xaml">
     <Application.Resources>
          
     </Application.Resources>

+ 0 - 1
GraphDrawer/ArrowLine.cs

@@ -1,7 +1,6 @@
 //------------------------------------------
 // ArrowLine.cs (c) 2007 by Charles Petzold
 //------------------------------------------
-using System;
 using System.Windows;
 using System.Windows.Media;
 

+ 0 - 22
GraphDrawer/ChoiceMode.xaml

@@ -1,22 +0,0 @@
-<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"
-        mc:Ignorable="d"
-        Title="Graph Drawer" Height="250" ResizeMode="NoResize" Width="300">
-    <Window.Resources>
-        <Style TargetType="Button">
-            <Setter Property="Background" Value="White"/>
-            <Setter Property="FontSize" Value="32"/>
-        </Style>
-    </Window.Resources>
-    <Grid>
-        <Grid.RowDefinitions>
-            <RowDefinition/>
-            <RowDefinition/>
-        </Grid.RowDefinitions>
-        <Button Content="Генерация графа" Click="Button_Click"/>
-        <Button Content="Ввод графа" Grid.Row="1" Click="Button_Click_1"/>
-    </Grid>
-</Window>

+ 0 - 41
GraphDrawer/ChoiceMode.xaml.cs

@@ -1,41 +0,0 @@
-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 ChoiceMode.xaml
-    /// </summary>
-    public partial class ChoiceMode : Window
-    {
-        public ChoiceMode()
-        {
-            InitializeComponent();
-        }
-
-        private void Button_Click(object sender, RoutedEventArgs e)
-        {
-            MainWindow main = new MainWindow();
-            main.Show();
-            Close();
-        }
-
-        private void Button_Click_1(object sender, RoutedEventArgs e)
-        {
-            GraphByClick click = new GraphByClick();
-            click.Show();
-            Close();
-        }
-    }
-}

+ 25 - 33
GraphDrawer/Edge.cs

@@ -1,64 +1,56 @@
-using System.Windows.Controls;
-using System.Windows.Media;
-using System.Windows.Shapes;
+using System.Windows.Shapes;
 
 namespace GraphDrawer
 {
     public class Edge
     {
-        public Line line { get; set; }
-        public ArrowLine arrowLine { get; set; }
-        public Vertex startVertex { get; set; }
-        public Vertex finishVertex { get; set; }
+        public Line Line { get; }
+        public ArrowLine ArrowLine { get; }
+        public Vertex StartVertex { get; }
+        public Vertex FinishVertex { get; }
         public int? Weight { get; set; }
         
         public Edge(Line line, Vertex v1, Vertex v2)
         {
-            this.line = line;
-            startVertex = v1;
-            finishVertex = v2;
+            Line = line;
+            StartVertex = v1;
+            FinishVertex = v2;
         }
 
         public Edge(ArrowLine line, Vertex v1, Vertex v2)
         {
-            this.arrowLine = line;
-            startVertex = v1;
-            finishVertex = v2;
+            ArrowLine = line;
+            StartVertex = v1;
+            FinishVertex = v2;
         }
 
         public Edge(Line line, Vertex v1, Vertex v2, int weight)
         {
-            this.line = line;
-            startVertex = v1;
-            finishVertex = v2;
+            Line = line;
+            StartVertex = v1;
+            FinishVertex = v2;
             Weight = weight;
         }
 
-        public static double GetCenterByX(Edge edge)
+        public bool IsFocused
         {
-            int x;
-            if (edge.finishVertex.X - edge.startVertex.X > 0)
-            {
-                x = edge.finishVertex.X - edge.startVertex.X;
-            }
-            else
+            get
             {
-                x = edge.startVertex.X - edge.finishVertex.X;
+                if (ArrowLine == null)
+                    return true;
+                return false;
             }
+        }
+
+        public static double GetCenterByX(Edge edge)
+        {
+            var x = (edge.FinishVertex.X + edge.StartVertex.X) / 2;
             return x;
         }
 
         public static double GetCenterByY(Edge edge)
         {
-            int y;
-            if (edge.finishVertex.Y - edge.startVertex.Y > 0)
-            {
-                y = edge.finishVertex.Y - edge.startVertex.Y;
-            }
-            else
-            {
-                y = edge.startVertex.Y - edge.finishVertex.Y;
-            }
+            var y = (edge.FinishVertex.Y + edge.StartVertex.Y) / 2;
             return y;
         }
     }

+ 16 - 9
GraphDrawer/EdgeCreateWindow.xaml

@@ -5,23 +5,30 @@
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         mc:Ignorable="d"
         xmlns:wpfTool="clr-namespace:Xceed.Wpf.Toolkit;assembly=Xceed.Wpf.Toolkit"
-        Title="Create New Edge" Height="200" Width="400">
+        Title="Create New Edge" WindowStartupLocation="CenterOwner" ResizeMode="NoResize" Height="200" Width="400">
     <Grid>
         <Grid.RowDefinitions>
-            <RowDefinition Height="50"/>
-            <RowDefinition Height="50"/>
-            <RowDefinition Height="50"/>
+            <RowDefinition/>
+            <RowDefinition/>
+            <RowDefinition/>
         </Grid.RowDefinitions>
         <StackPanel Orientation="Horizontal">
             <TextBlock Text="Вес ребра" FontSize="18" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"/>
-            <Slider x:Name="weightSlider" VerticalAlignment="Center" TickPlacement="BottomRight"  Width="200" Minimum="0" Maximum="30" SmallChange="1" ValueChanged="weightSlider_ValueChanged"/>
+            <Slider x:Name="weightSlider" Margin="5,5,0,0" VerticalAlignment="Center" IsSnapToTickEnabled="True" TickFrequency="1" TickPlacement="BottomRight"  Width="200" Minimum="0" Maximum="30" SmallChange="1"/>
             <TextBox Width="30" VerticalAlignment="Center" FontSize="18" BorderThickness="1" BorderBrush="Black" x:Name="currentWeightBox" Text="{Binding ElementName=weightSlider, Path=Value}" TextAlignment="Center" IsReadOnly="True"/>
         </StackPanel>
-        <TextBlock Grid.Row="1" FontSize="18" Margin="10" VerticalAlignment="Top" HorizontalAlignment="Left" Text="Цвет:"/>
-        <wpfTool:ColorCanvas x:Name="colorCanvas" Width="230" Background="White" BorderThickness="0" HorizontalAlignment="Left" Margin="60,0,0,0" Grid.Row="1"/>
+        <TextBlock Grid.Row="1" FontSize="18" Margin="10" VerticalAlignment="Center" HorizontalAlignment="Left" Text="Цвет:"/>
+        <wpfTool:ColorPicker SelectedColor="Black" Height="22" x:Name="colorCanvas" Width="230" Background="White" BorderThickness="0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="60,0,0,0" Grid.Row="1" HeaderBackground="White" TabBackground="White" BorderBrush="White">
+            <wpfTool:ColorPicker.DropDownBackground>
+                <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
+                    <GradientStop Color="#FFF0F0F0" Offset="0"/>
+                    <GradientStop Color="White" Offset="1"/>
+                </LinearGradientBrush>
+            </wpfTool:ColorPicker.DropDownBackground>
+        </wpfTool:ColorPicker>
         <UniformGrid Columns="2" Grid.Row="2">
-            <Button x:Name="focusedBtn" Margin="20,10" Background="#FF4FCFFF" Content="Направленную"/>
-            <Button x:Name="unfocusedBtn" Margin="20,10" Background="#FF4FCFFF" Content="Ненаправленную"/>
+            <Button x:Name="focusedBtn" Margin="20,10" Background="#FF4FCFFF" Content="Направленную" Click="FocusedBtn_Click"/>
+            <Button x:Name="unfocusedBtn" Margin="20,10" Background="#FF4FCFFF" Content="Ненаправленную" Click="UnfocusedBtn_Click"/>
         </UniformGrid>
     </Grid>
 </Window>

+ 4 - 4
GraphDrawer/EdgeCreateWindow.xaml.cs

@@ -40,16 +40,16 @@ namespace GraphDrawer
             get { return focused; }
         }
 
-        private void focusedBtn_Click(object sender, RoutedEventArgs e)
+        private void FocusedBtn_Click(object sender, RoutedEventArgs e)
         {
-            this.DialogResult = true;
             focused = true;
+            this.DialogResult = true;
         }
 
-        private void unfocusedBtn_Click(object sender, RoutedEventArgs e)
+        private void UnfocusedBtn_Click(object sender, RoutedEventArgs e)
         {
-            this.DialogResult = true;
             focused = false;
+            this.DialogResult = true;
         }
     }
 }

+ 1 - 2
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" MinHeight="500" MinWidth="600">
+        Title="Graph Drawer" WindowStartupLocation="CenterScreen" Height="500" Width="800" MinHeight="500" MinWidth="600">
     <Grid  Background="LightBlue">
         <Grid.RowDefinitions>
             <RowDefinition Height="60"/>
@@ -45,7 +45,6 @@
         <StackPanel Grid.Row="2" Orientation="Horizontal">
             <Button x:Name="clearBtn" Margin="10" Height="30" Padding="10,0" Content="Очистить" Background="Blue" Foreground="White" BorderThickness="0" Click="ClearBtn_Click"/>
             <Button x:Name="exportPngBtn" Margin="10" Height="30" Content="Скачать PNG" Background="Blue" Foreground="White" BorderThickness="0" Click="ExportPngBtn_Click" Width="118"/>
-            <Button x:Name="backBtn" Padding="10,0" Margin="10" Height="30" Content="Главный экран" Background="Blue" Foreground="White" BorderThickness="0" Click="BackBtn_Click"/>
 
         </StackPanel>
         <Canvas Grid.Row="1" Background="White" x:Name="canvas" MouseLeftButtonUp="Canvas_MouseUp">

+ 165 - 92
GraphDrawer/GraphByClick.xaml.cs

@@ -1,18 +1,19 @@
-using Microsoft.Win32;
-using System;
+using System;
+using System.IO;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Input;
 using System.Windows.Media;
 using System.Windows.Media.Imaging;
 using System.Windows.Shapes;
+using Microsoft.Win32;
 
 namespace GraphDrawer
 {
     /// <summary>
     /// Interaction logic for GraphByClick.xaml
     /// </summary>
-    public partial class GraphByClick : Window
+    public partial class GraphByClick
     {
         public GraphByClick()
         {
@@ -21,6 +22,7 @@ namespace GraphDrawer
             VertexArray.vertexCount = 0;
         }
 
+        readonly Random _rand = new Random();
         public GraphByClick(int[,] matrix, bool state)
         {
             InitializeComponent();
@@ -29,10 +31,9 @@ namespace GraphDrawer
             ClearCanvas();
             if (state)
             {
-                MessageBox.Show("asd");
-                int length = (int)Math.Sqrt(matrix.Length);
+                int length = matrix.GetLength(0);
                 for(int i = 0; i < length; i++)
-                    VertexArray.AddVertex(canvas, rand.Next(1, 600), rand.Next(1, 300));
+                    VertexArray.AddVertex(canvas, _rand.Next(1, 600), _rand.Next(1, 300));
 
                 for(int i = 0; i < length; i++)
                 {
@@ -40,12 +41,12 @@ namespace GraphDrawer
                     for(int j = 0; j < length; j++)
                     {
                         var vertex2 = VertexArray.vertex[j];
-                        if (matrix[i, j] == 1)
+                        if (matrix[i, j] >= 1)
                         {
                             EdgeArray.edgeCount++;
                             Array.Resize(ref EdgeArray.edge, EdgeArray.edgeCount);
                             Array.Resize(ref EdgeArray.line, EdgeArray.edgeCount);
-                            EdgeArray.line[EdgeArray.edgeCount - 1] = new Line()
+                            EdgeArray.line[EdgeArray.edgeCount - 1] = new Line
                             {
                                 Stroke = new SolidColorBrush(Color.FromRgb(0, 0, 0)),
                                 StrokeThickness = 2,
@@ -56,7 +57,10 @@ namespace GraphDrawer
                             };
 
                             canvas.Children.Add(EdgeArray.line[EdgeArray.edgeCount - 1]);
-                            EdgeArray.edge[EdgeArray.edgeCount - 1] = new Edge(EdgeArray.line[EdgeArray.edgeCount-1], vertex1, vertex2);
+                            if(matrix[i,j]>1)
+                                EdgeArray.edge[EdgeArray.edgeCount - 1] = new Edge(EdgeArray.line[EdgeArray.edgeCount - 1], vertex1, vertex2, matrix[i, j]);
+                            else
+                                EdgeArray.edge[EdgeArray.edgeCount - 1] = new Edge(EdgeArray.line[EdgeArray.edgeCount - 1], vertex1, vertex2);
                         }
                     }
                 }
@@ -69,7 +73,7 @@ namespace GraphDrawer
 
                 for(int i = 0; i < rows; i++)
                 {
-                    VertexArray.AddVertex(canvas, rand.Next(1, 600), rand.Next(1, 300));
+                    VertexArray.AddVertex(canvas, _rand.Next(1, 600), _rand.Next(1, 300));
                 }
 
                 for(int j = 0; j < cols; j++)
@@ -90,13 +94,6 @@ namespace GraphDrawer
                 }
             }
         }
-
-        private void BackBtn_Click(object sender, RoutedEventArgs e) // Выбор режима рисования
-        {
-            ChoiceMode regime = new ChoiceMode();
-            regime.Show();
-            Close();
-        }
         private void Canvas_MouseUp(object sender, MouseButtonEventArgs e)
         {
             
@@ -136,7 +133,7 @@ namespace GraphDrawer
                                 else
                                 {
                                     VertexArray.buffer[1] = VertexArray.vertex[i];
-                                    ArrowedEdgeArray.AddArrowedEdge(canvas, VertexArray.buffer[0], VertexArray.buffer[1]);
+                                    EdgeArray.AddArrowedEdge(canvas, VertexArray.buffer[0], VertexArray.buffer[1]);
                                     VertexArray.buffer[0] = null;
                                     VertexArray.buffer[1] = null;
                                 }
@@ -151,20 +148,31 @@ namespace GraphDrawer
                     int Y = Convert.ToInt32(point1.Y);
                     for (int i = 0; i <= VertexArray.vertexCount - 1; i++)// Проверка на принадлежность точки к какой-либо вершине
                     {
-                        if (((X - VertexArray.vertex[i].X <= 15) && (X - VertexArray.vertex[i].X >= 0)) ||
-                            ((VertexArray.vertex[i].X - X <= 15) && (VertexArray.vertex[i].X - X >= 0)))
+                        if ((((X - VertexArray.vertex[i].X <= 8) && (X - VertexArray.vertex[i].X >= 0)) ||
+                             ((VertexArray.vertex[i].X - X <= 8) && (VertexArray.vertex[i].X - X >= 0))) && (((Y - VertexArray.vertex[i].Y <= 8) && (Y - VertexArray.vertex[i].Y >= 0)) ||
+                                                                                                              ((VertexArray.vertex[i].Y - Y <= 8) && (VertexArray.vertex[i].Y - Y >= 0))))
                         {
-                            if (((Y - VertexArray.vertex[i].Y <= 15) && (Y - VertexArray.vertex[i].Y >= 0)) ||
-                            ((VertexArray.vertex[i].Y - Y <= 15) && (VertexArray.vertex[i].Y - Y >= 0)))
+                            if (VertexArray.buffer[0] == null)
                             {
-                                if (VertexArray.buffer[0] == null)
-                                {
-                                    VertexArray.buffer[0] = VertexArray.vertex[i];
-                                }
-                                else
+                                VertexArray.buffer[0] = VertexArray.vertex[i];
+                            }
+                            else
+                            {
+                                if (!Vertex.Compare(VertexArray.buffer[0], VertexArray.vertex[i]))
                                 {
                                     VertexArray.buffer[1] = VertexArray.vertex[i];
-                                    EdgeArray.AddEdge(canvas, VertexArray.buffer[0], VertexArray.buffer[1]);
+                                    EdgeCreateWindow edgeCreate = new EdgeCreateWindow();
+                                    if (edgeCreate.ShowDialog() == true)
+                                    {
+                                        if (edgeCreate.State)
+                                        {
+                                            EdgeArray.AddArrowedEdge(canvas, VertexArray.buffer[0], VertexArray.buffer[1], edgeCreate.Color, edgeCreate.Weight);
+                                        }
+                                        else
+                                        {
+                                            EdgeArray.AddEdge(canvas, VertexArray.buffer[0], VertexArray.buffer[1], edgeCreate.Color, edgeCreate.Weight);
+                                        }
+                                    }
                                     VertexArray.buffer[0] = null;
                                     VertexArray.buffer[1] = null;
                                 }
@@ -175,25 +183,6 @@ namespace GraphDrawer
             }
         }
 
-
-        // Получение рандомной кисти из заданных цветов
-        readonly Random rand = new Random((DateTime.Now.Millisecond * DateTime.Now.Second) % DateTime.Now.Hour);
-        public SolidColorBrush GetBrush()
-        {
-            SolidColorBrush[] brush = new SolidColorBrush[10];
-            brush[0] = new SolidColorBrush(Color.FromRgb(235, 64, 52));
-            brush[1] = new SolidColorBrush(Color.FromRgb(235, 235, 52));
-            brush[2] = new SolidColorBrush(Color.FromRgb(64, 235, 52));
-            brush[3] = new SolidColorBrush(Color.FromRgb(52, 235, 229));
-            brush[4] = new SolidColorBrush(Color.FromRgb(0, 13, 255));
-            brush[5] = new SolidColorBrush(Color.FromRgb(140, 0, 255));
-            brush[6] = new SolidColorBrush(Color.FromRgb(255, 0, 230));
-            brush[7] = new SolidColorBrush(Color.FromRgb(255, 162, 0));
-            brush[8] = new SolidColorBrush(Color.FromRgb(0, 0, 0));
-            return brush[rand.Next(0, 8)];
-        }
-
-
         // Очистка канваса
         private void ClearBtn_Click(object sender, RoutedEventArgs e)
         {
@@ -235,7 +224,7 @@ namespace GraphDrawer
 
             double dpi = 96d;
 
-            RenderTargetBitmap rtb = new RenderTargetBitmap((int)rect.Right, (int)rect.Bottom, dpi, dpi, System.Windows.Media.PixelFormats.Default);
+            RenderTargetBitmap rtb = new RenderTargetBitmap((int)rect.Right, (int)rect.Bottom, dpi, dpi, PixelFormats.Default);
 
             rtb.Render(canvas);
 
@@ -244,12 +233,12 @@ namespace GraphDrawer
 
             try
             {
-                System.IO.MemoryStream ms = new System.IO.MemoryStream();
+                MemoryStream ms = new MemoryStream();
 
                 pngEncoder.Save(ms);
                 ms.Close();
 
-                System.IO.File.WriteAllBytes(filename, ms.ToArray());
+                File.WriteAllBytes(filename, ms.ToArray());
             }
             catch (Exception err)
             {
@@ -298,10 +287,14 @@ namespace GraphDrawer
                         for (int k = 0; k < EdgeArray.edge.Length; k++)
                         {
                             var edge = EdgeArray.edge[k];
-                            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;
+                            if (Vertex.Compare(edge.FinishVertex, vertex1) && Vertex.Compare(edge.StartVertex, vertex2))
+                                if (edge.Weight > 0)
+                                    matrix[i, j] = (int)edge.Weight;
+                                else
+                                    matrix[i, j] = 1;
+                            else if (Vertex.Compare(edge.StartVertex, vertex1) && Vertex.Compare(edge.FinishVertex, vertex2))
+                                if (edge.Weight > 0)
+                                    matrix[i, j] = (int)edge.Weight;
                         }
                     }
                     else
@@ -321,23 +314,33 @@ namespace GraphDrawer
 
         private void IncidenceMatrix_Click(object sender, RoutedEventArgs e)
         {
-            int rows = VertexArray.vertex.Length;
-            int cols = EdgeArray.edge.Length;
-            int[,] matrix = new int[rows, cols];
-            for(int i = 0; i < rows; i++)
+            var rows = VertexArray.vertex.Length;
+            var cols = EdgeArray.edge.Length;
+            var matrix = new int[rows, cols];
+            for(var i = 0; i < rows; i++)
             {
                 var vertex = VertexArray.vertex[i];
 
-                for (int j = 0; j < cols; j++)
+                for (var j = 0; j < cols; j++)
                 {
                     var edge = EdgeArray.edge[j];
-                    if (Vertex.Compare(vertex, edge.finishVertex) || Vertex.Compare(vertex, edge.startVertex))
-                        matrix[i, j] = 1;
+                    
+
+                    if (Vertex.Compare(vertex, edge.FinishVertex) && edge.IsFocused)
+                        matrix[i, j] = -1;
                     else
-                        matrix[i, j] = 0;
+                    {
+                        if (Vertex.Compare(vertex, edge.FinishVertex) || Vertex.Compare(vertex, edge.StartVertex))
+                            if (edge.Weight > 0)
+                                matrix[i, j] = (int)edge.Weight;
+                            else
+                                matrix[i, j] = 1;
+                        else
+                            matrix[i, j] = 0;
+                    }
                 }
             }
-            MatrixOutput output = new MatrixOutput(matrix);
+            var output = new MatrixOutput(matrix);
             output.Show();
 
         }
@@ -350,7 +353,7 @@ namespace GraphDrawer
         }
     }
 
-    public class VertexArray
+    public static class VertexArray
     {
         public static int vertexCount;
         public static Vertex[] vertex = new Vertex[vertexCount];
@@ -368,14 +371,13 @@ namespace GraphDrawer
             vertex[vertexCount-1] = new Vertex(x, y);
             ellipse[vertexCount - 1] = new Ellipse
             {
-                Height = 20,
-                Width = 20,
-                StrokeThickness = 2,
-                Stroke = new SolidColorBrush(Color.FromRgb(0, 0, 0))
+                Height = 10,
+                Width = 10,
+                Fill = new SolidColorBrush(Color.FromRgb(0, 0, 0))
             };
-            ellipse[vertexCount-1].Fill = ellipse[vertexCount-1].Stroke;
             Canvas.SetTop(ellipse[vertexCount-1], vertex[vertexCount-1].Y);
             Canvas.SetLeft(ellipse[vertexCount-1], vertex[vertexCount-1].X);
+            Panel.SetZIndex(ellipse[vertexCount - 1], 10);
             canvas.Children.Add(ellipse[vertexCount-1]);
             return vertexCount-1;
         }
@@ -418,6 +420,8 @@ namespace GraphDrawer
         public static int edgeCount;
         public static Edge[] edge = new Edge[edgeCount];
         public static Line[] line = new Line[edgeCount];
+        public static Label[] label = new Label[edgeCount];
+        public static ArrowLine[] ArrowLine = new ArrowLine[edgeCount];
 
         public static void AddEdge(Canvas canvas, Vertex v1, Vertex v2)
         {
@@ -427,38 +431,107 @@ namespace GraphDrawer
             line[edgeCount-1] = new Line();
             edge[edgeCount-1] = new Edge(line[edgeCount-1], v1, v2);
             line[edgeCount - 1].Stroke = new SolidColorBrush(Color.FromRgb(0, 0, 0));
-            line[edgeCount - 1].StrokeThickness = 2;
-            line[edgeCount - 1].X1 = v1.X+10;
-            line[edgeCount - 1].Y1 = v1.Y+10;
-            line[edgeCount - 1].X2 = v2.X+10;
-            line[edgeCount - 1].Y2 = v2.Y+10;
+            line[edgeCount - 1].StrokeThickness = 4;
+            line[edgeCount - 1].X1 = v1.X;
+            line[edgeCount - 1].Y1 = v1.Y;
+            line[edgeCount - 1].X2 = v2.X;
+            line[edgeCount - 1].Y2 = v2.Y;
+            Panel.SetZIndex(line[edgeCount-1], -5);
             canvas.Children.Add(line[edgeCount - 1]);
         }
-    }
 
-    public class ArrowedEdgeArray
-    {
-        public static ArrowLine[] line = new ArrowLine[EdgeArray.edgeCount];
-        public static Edge[] edge = new Edge[EdgeArray.edgeCount];
+        public static void AddEdge(Canvas canvas, Vertex v1, Vertex v2, Color lineColor, int weight)
+        {
+            edgeCount++;
+            Array.Resize(ref edge, edgeCount);
+            Array.Resize(ref line, edgeCount);
+            Array.Resize(ref label, edgeCount);
+            line[edgeCount - 1] = new Line
+            {
+                StrokeThickness = 2,
+                X1 = v1.X,
+                Y1 = v1.Y,
+                Stroke = new SolidColorBrush(lineColor),
+                Y2 = v2.Y,
+                X2 = v2.X
+            };
+            edge[edgeCount - 1] = new Edge(line[edgeCount - 1], v1, v2) {Weight = weight};
+
+            if (weight > 0)
+            {
+                Brush brush = Brushes.Black;
+                label[edgeCount - 1] = new Label
+                {
+                    FontSize = 16,
+                    Foreground = brush,
+                    Background = Brushes.White,
+                    BorderBrush = new SolidColorBrush(lineColor),
+                    BorderThickness = new Thickness(2),
+                    Content = weight.ToString()
+                };
+                double centerX = Edge.GetCenterByX(edge[edgeCount - 1]);
+                double centerY = Edge.GetCenterByY(edge[edgeCount - 1]);
+                Panel.SetZIndex(label[edgeCount - 1], 3);
+                Canvas.SetLeft(label[edgeCount - 1], centerX);
+                Canvas.SetTop(label[edgeCount - 1], centerY);
+                canvas.Children.Add(label[edgeCount - 1]);
+            }
+            canvas.Children.Add(line[edgeCount - 1]);
+        }
 
         public static void AddArrowedEdge(Canvas canvas, Vertex v1, Vertex v2)
         {
-            int edgeCount = EdgeArray.edgeCount;
+            edgeCount++;
+            Array.Resize(ref ArrowLine, edgeCount);
+            Array.Resize(ref line, edgeCount);
+            ArrowLine[edgeCount - 1] = new ArrowLine();
+            edge[edgeCount - 1] = new Edge(ArrowLine[edgeCount - 1], v1, v2);
+            ArrowLine[edgeCount - 1].Stroke = new SolidColorBrush(Color.FromRgb(0, 0, 0));
+            ArrowLine[edgeCount - 1].StrokeThickness = 2;
+            ArrowLine[edgeCount - 1].X1 = v1.CenterByX;
+            ArrowLine[edgeCount - 1].Y1 = v1.CenterByY;
+            ArrowLine[edgeCount - 1].X2 = v2.CenterByX;
+            ArrowLine[edgeCount - 1].Y2 = v2.CenterByY;
+            canvas.Children.Add(ArrowLine[edgeCount - 1]);
+        }
+
+        public static void AddArrowedEdge(Canvas canvas, Vertex v1, Vertex v2, Color lineColor, int Weight)
+        {
             edgeCount++;
             Array.Resize(ref edge, edgeCount);
             Array.Resize(ref line, edgeCount);
-            line[edgeCount - 1] = new ArrowLine();
-            edge[edgeCount - 1] = new Edge(line[edgeCount - 1], v1, v2);
-            line[edgeCount - 1].Stroke = new SolidColorBrush(Color.FromRgb(0, 0, 0));
-            line[edgeCount - 1].StrokeThickness = 2;
-            line[edgeCount - 1].X1 = v1.X + 5;
-            line[edgeCount - 1].Y1 = v1.Y + 5;
-            line[edgeCount - 1].X2 = v2.X + 5;
-            line[edgeCount - 1].Y2 = v2.Y + 5;
-            canvas.Children.Add(line[edgeCount - 1]);
-            EdgeArray.edgeCount = edgeCount;
+            Array.Resize(ref label, edgeCount);
+            Array.Resize(ref ArrowLine, edgeCount);
+            ArrowLine[edgeCount - 1] = new ArrowLine();
+            edge[edgeCount - 1] = new Edge(ArrowLine[edgeCount - 1], v1, v2);
+            ArrowLine[edgeCount - 1].Stroke = new SolidColorBrush(lineColor);
+            ArrowLine[edgeCount - 1].StrokeThickness = 2;
+            ArrowLine[edgeCount - 1].X1 = v1.CenterByX - 5;
+            ArrowLine[edgeCount - 1].Y1 = v1.CenterByY - 5;
+            ArrowLine[edgeCount - 1].X2 = v2.CenterByX - 2;
+            ArrowLine[edgeCount - 1].Y2 = v2.CenterByY - 3;
+            edge[edgeCount - 1].Weight = Weight;
+
+            if (Weight > 0)
+            {
+                Brush brush = Brushes.Black;
+                label[edgeCount - 1] = new Label
+                {
+                    FontSize = 16,
+                    Foreground = brush,
+                    Background = Brushes.White,
+                    BorderBrush = new SolidColorBrush(lineColor),
+                    BorderThickness = new Thickness(2),
+                    Content = Weight.ToString()
+                };
+                var centerX = Edge.GetCenterByX(edge[edgeCount - 1]);
+                var centerY = Edge.GetCenterByY(edge[edgeCount - 1]);
+                Panel.SetZIndex(label[edgeCount - 1], 3);
+                Canvas.SetLeft(label[edgeCount - 1], centerX);
+                Canvas.SetTop(label[edgeCount - 1], centerY);
+                canvas.Children.Add(label[edgeCount - 1]);
+            }
+            canvas.Children.Add(ArrowLine[edgeCount - 1]);
         }
     }
-
-    
 }

+ 0 - 15
GraphDrawer/GraphDrawer.csproj

@@ -73,9 +73,6 @@
     </ApplicationDefinition>
     <Compile Include="ArrowLine.cs" />
     <Compile Include="ArrowLineBase.cs" />
-    <Compile Include="ChoiceMode.xaml.cs">
-      <DependentUpon>ChoiceMode.xaml</DependentUpon>
-    </Compile>
     <Compile Include="Edge.cs" />
     <Compile Include="EdgeCreateWindow.xaml.cs">
       <DependentUpon>EdgeCreateWindow.xaml</DependentUpon>
@@ -91,10 +88,6 @@
       <DependentUpon>MatrixOutput.xaml</DependentUpon>
     </Compile>
     <Compile Include="Vertex.cs" />
-    <Page Include="ChoiceMode.xaml">
-      <SubType>Designer</SubType>
-      <Generator>MSBuild:Compile</Generator>
-    </Page>
     <Page Include="EdgeCreateWindow.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -107,18 +100,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="MainWindow.xaml">
-      <Generator>MSBuild:Compile</Generator>
-      <SubType>Designer</SubType>
-    </Page>
     <Compile Include="App.xaml.cs">
       <DependentUpon>App.xaml</DependentUpon>
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="MainWindow.xaml.cs">
-      <DependentUpon>MainWindow.xaml</DependentUpon>
-      <SubType>Code</SubType>
-    </Compile>
     <Page Include="MatrixOutput.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 0 - 28
GraphDrawer/MainWindow.xaml

@@ -1,28 +0,0 @@
-<Window x:Class="GraphDrawer.MainWindow"
-        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="MainWindow" Height="450" Width="800">
-    <Grid>
-        <Grid.RowDefinitions>
-            <RowDefinition/>
-            <RowDefinition Height="0.1*"/>
-            <RowDefinition Height="0.1*"/>
-        </Grid.RowDefinitions>
-        <Grid.ColumnDefinitions>
-            <ColumnDefinition Width="259*"/>
-            <ColumnDefinition Width="137*"/>
-        </Grid.ColumnDefinitions>
-        <Canvas x:Name="canvas" Grid.ColumnSpan="2"/>
-        <TextBlock Text="Количество вершин:" Grid.Row="1" HorizontalAlignment="Right" Margin="0,4,5,4" VerticalAlignment="Center" FontSize="20" Height="27" Width="189"/>
-        <TextBlock Text="Максимальное количество ребер у каждой вершины:" Grid.Row="2" HorizontalAlignment="Right" Margin="0,4,5,4" VerticalAlignment="Center" FontSize="20" Height="27" Width="501"/>
-
-        <TextBox TabIndex="1" x:Name="vertexBox" Grid.Row="1" Grid.Column="1" Width="100" HorizontalAlignment="Left" Margin="0,3,0,2"/>
-        <TextBox TabIndex="2" x:Name="edgeBox" Grid.Row="2" Grid.Column="1" Width="100" HorizontalAlignment="Left" Margin="0,2,0,3"/>
-        <Button TabIndex="3" x:Name="generateBtn" Grid.Row="1" Grid.Column="1" Content="Генерировать" Background="Blue" Foreground="White" BorderThickness="0" Click="generateBtn_Click" Margin="174,5,10,5"/>
-        <Button TabIndex="4" x:Name="choiceBtn" Grid.Row="2" Grid.Column="1" Content="Режим" Background="Blue" Foreground="White" BorderThickness="0" Margin="174,4,10,6" Click="choiceBtn_Click"/>
-    </Grid>
-</Window>

+ 0 - 135
GraphDrawer/MainWindow.xaml.cs

@@ -1,135 +0,0 @@
-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
-{
-    /// <summary>
-    /// Interaction logic for MainWindow.xaml
-    /// </summary>
-    public partial class MainWindow : Window
-    {
-        SolidColorBrush brush = new SolidColorBrush(Color.FromRgb(0, 0, 0));
-        Random rand = new Random();
-        public MainWindow()
-        {
-            InitializeComponent();
-        }
-
-        private void generateBtn_Click(object sender, RoutedEventArgs e)
-        {
-            canvas.Children.Clear();
-            Random rand = new Random();
-            if (!int.TryParse(vertexBox.Text, out int vertexCount) || !int.TryParse(edgeBox.Text, out int edgeCount))
-            {
-                MessageBox.Show("Values must be integer", "Error", MessageBoxButton.OK, MessageBoxImage.Exclamation);
-            }
-            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];
-                
-                //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++)
-                //{
-                //    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]);
-                //        }
-                //    }
-                //}
-            }
-        }
-
-        public void DrawEdge(Canvas canvas, Line line, Edge edge)
-        {
-            line = new Line();
-            line.Stroke = GetBrush();
-            line.StrokeThickness = 2;
-            line.X1 = edge.startVertex.X+5;
-            line.Y1 = edge.startVertex.Y+5;
-            line.X2 = edge.finishVertex.X+5;
-            line.Y2 = edge.finishVertex.Y+5;
-            canvas.Children.Add(line);
-        }
-
-        public void DrawVertex(Ellipse ellipse, Canvas canvas, Vertex vertex)
-        {
-            ellipse = new Ellipse();
-            ellipse.Height = 10;
-            ellipse.Width = 10;
-            ellipse.StrokeThickness = 2;
-            ellipse.Stroke = brush;
-            ellipse.Fill = brush;
-            Canvas.SetLeft(ellipse, vertex.X);
-            Canvas.SetTop(ellipse, vertex.Y);
-            canvas.Children.Add(ellipse);
-        }
-
-        public SolidColorBrush GetBrush()
-        {
-            SolidColorBrush[] brush = new SolidColorBrush[10];
-            brush[0] = new SolidColorBrush(Color.FromRgb(235, 64, 52));
-            brush[1] = new SolidColorBrush(Color.FromRgb(235, 235, 52));
-            brush[2] = new SolidColorBrush(Color.FromRgb(64, 235, 52));
-            brush[3] = new SolidColorBrush(Color.FromRgb(52, 235, 229));
-            brush[4] = new SolidColorBrush(Color.FromRgb(0, 13, 255));
-            brush[5] = new SolidColorBrush(Color.FromRgb(140, 0, 255));
-            brush[6] = new SolidColorBrush(Color.FromRgb(255, 0, 230));
-            brush[7] = new SolidColorBrush(Color.FromRgb(255, 162, 0));
-            brush[8] = new SolidColorBrush(Color.FromRgb(0, 0, 0));
-            return brush[rand.Next(0, 8)];
-        }
-
-        private void choiceBtn_Click(object sender, RoutedEventArgs e)
-        {
-            ChoiceMode regime = new ChoiceMode();
-            regime.Show();
-            Close();
-        }
-    }
-}

+ 4 - 8
GraphDrawer/Vertex.cs

@@ -9,14 +9,6 @@ namespace GraphDrawer
     {
         public int X { get; set; }
         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)
         {
@@ -24,6 +16,10 @@ namespace GraphDrawer
             Y = y;
         }
 
+        public int CenterByX => (X * 2 + 10) / 2;
+
+        public int CenterByY => (Y * 2 + 10) / 2;
+
         public static bool Compare(Vertex v1, Vertex v2)
         {
             if (Equals(v1, v2))

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}" "61774A8774D84CC23CB444B773686ECE0661F24E32155D5ADD578D53FD7E6E79"
+#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "D2CDC1FC1F445FA919A6948963C0A3BD90BE185788966E7DD517B6C600306C67"
 //------------------------------------------------------------------------------
 // <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("ChoiceMode.xaml", System.UriKind.Relative);
+            this.StartupUri = new System.Uri("GraphByClick.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}" "61774A8774D84CC23CB444B773686ECE0661F24E32155D5ADD578D53FD7E6E79"
+#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "D2CDC1FC1F445FA919A6948963C0A3BD90BE185788966E7DD517B6C600306C67"
 //------------------------------------------------------------------------------
 // <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("ChoiceMode.xaml", System.UriKind.Relative);
+            this.StartupUri = new System.Uri("GraphByClick.xaml", System.UriKind.Relative);
             
             #line default
             #line hidden

BIN
GraphDrawer/obj/Debug/ChoiceMode.baml


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

@@ -1,93 +0,0 @@
-#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;
-        }
-    }
-}
-

BIN
GraphDrawer/obj/Debug/DesignTimeResolveAssemblyReferences.cache


+ 82 - 35
GraphDrawer/obj/Debug/EdgeCreateWindow.g.i.cs

@@ -1,4 +1,4 @@
-#pragma checksum "..\..\EdgeCreateWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "507A858302590857B6AC67D8CFE5AB61F574564D9CBA88CADDE68763FF6DB298"
+#pragma checksum "..\..\EdgeCreateWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "38618786F77179DF5758BF0DE80DBC85988D5F1E09CA2E3E54D357970B431486"
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
@@ -29,70 +29,117 @@ using System.Windows.Media.TextFormatting;
 using System.Windows.Navigation;
 using System.Windows.Shapes;
 using System.Windows.Shell;
+using Xceed.Wpf.Toolkit;
 
 
-namespace GraphDrawer
-{
-
-
+namespace GraphDrawer {
+    
+    
     /// <summary>
     /// EdgeCreateWindow
     /// </summary>
-    public partial class EdgeCreateWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector
-    {
-
-
-#line 15 "..\..\EdgeCreateWindow.xaml"
+    public partial class EdgeCreateWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
+        
+        
+        #line 17 "..\..\EdgeCreateWindow.xaml"
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
         internal System.Windows.Controls.Slider weightSlider;
-
-#line default
-#line hidden
-
+        
+        #line default
+        #line hidden
+        
+        
+        #line 18 "..\..\EdgeCreateWindow.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.TextBox currentWeightBox;
+        
+        #line default
+        #line hidden
+        
+        
+        #line 21 "..\..\EdgeCreateWindow.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal Xceed.Wpf.Toolkit.ColorPicker colorCanvas;
+        
+        #line default
+        #line hidden
+        
+        
+        #line 30 "..\..\EdgeCreateWindow.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.Button focusedBtn;
+        
+        #line default
+        #line hidden
+        
+        
+        #line 31 "..\..\EdgeCreateWindow.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.Button unfocusedBtn;
+        
+        #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)
-            {
+        public void InitializeComponent() {
+            if (_contentLoaded) {
                 return;
             }
             _contentLoaded = true;
             System.Uri resourceLocater = new System.Uri("/GraphDrawer;component/edgecreatewindow.xaml", System.UriKind.Relative);
-
-#line 1 "..\..\EdgeCreateWindow.xaml"
+            
+            #line 1 "..\..\EdgeCreateWindow.xaml"
             System.Windows.Application.LoadComponent(this, resourceLocater);
-
-#line default
-#line hidden
+            
+            #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)
-        {
+        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
             switch (connectionId)
             {
-                case 1:
-                    this.weightSlider = ((System.Windows.Controls.Slider)(target));
-                    return;
+            case 1:
+            this.weightSlider = ((System.Windows.Controls.Slider)(target));
+            return;
+            case 2:
+            this.currentWeightBox = ((System.Windows.Controls.TextBox)(target));
+            return;
+            case 3:
+            this.colorCanvas = ((Xceed.Wpf.Toolkit.ColorPicker)(target));
+            return;
+            case 4:
+            this.focusedBtn = ((System.Windows.Controls.Button)(target));
+            
+            #line 30 "..\..\EdgeCreateWindow.xaml"
+            this.focusedBtn.Click += new System.Windows.RoutedEventHandler(this.FocusedBtn_Click);
+            
+            #line default
+            #line hidden
+            return;
+            case 5:
+            this.unfocusedBtn = ((System.Windows.Controls.Button)(target));
+            
+            #line 31 "..\..\EdgeCreateWindow.xaml"
+            this.unfocusedBtn.Click += new System.Windows.RoutedEventHandler(this.UnfocusedBtn_Click);
+            
+            #line default
+            #line hidden
+            return;
             }
             this._contentLoaded = true;
         }
-
-        internal System.Windows.Controls.TextBox currentWeightBox;
-        internal System.Windows.Controls.Button focusedBtn;
-        internal System.Windows.Controls.Button unfocusedBtn;
-        internal Xceed.Wpf.Toolkit.ColorCanvas colorCanvas;
     }
 }
 

BIN
GraphDrawer/obj/Debug/GraphByClick.baml


+ 17 - 34
GraphDrawer/obj/Debug/GraphByClick.g.cs

@@ -1,4 +1,4 @@
-#pragma checksum "..\..\GraphByClick.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "1CCAD26DC76E062C5CCDC34BB65BA922D15C711F1316FE311D3F80CE290913B3"
+#pragma checksum "..\..\GraphByClick.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "3F10DEF0D7788198B26228CE3A2C045C959A9F5547C65093DCFECA16394D95C5"
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
@@ -137,15 +137,7 @@ namespace GraphDrawer {
         #line hidden
         
         
-        #line 48 "..\..\GraphByClick.xaml"
-        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
-        internal System.Windows.Controls.Button backBtn;
-        
-        #line default
-        #line hidden
-        
-        
-        #line 51 "..\..\GraphByClick.xaml"
+        #line 50 "..\..\GraphByClick.xaml"
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
         internal System.Windows.Controls.Canvas canvas;
         
@@ -153,7 +145,7 @@ namespace GraphDrawer {
         #line hidden
         
         
-        #line 54 "..\..\GraphByClick.xaml"
+        #line 53 "..\..\GraphByClick.xaml"
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
         internal System.Windows.Controls.MenuItem saveBtn;
         
@@ -161,7 +153,7 @@ namespace GraphDrawer {
         #line hidden
         
         
-        #line 55 "..\..\GraphByClick.xaml"
+        #line 54 "..\..\GraphByClick.xaml"
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
         internal System.Windows.Controls.MenuItem printBtn;
         
@@ -169,7 +161,7 @@ namespace GraphDrawer {
         #line hidden
         
         
-        #line 60 "..\..\GraphByClick.xaml"
+        #line 59 "..\..\GraphByClick.xaml"
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
         internal System.Windows.Controls.MenuItem delEdgeBtn;
         
@@ -177,7 +169,7 @@ namespace GraphDrawer {
         #line hidden
         
         
-        #line 61 "..\..\GraphByClick.xaml"
+        #line 60 "..\..\GraphByClick.xaml"
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
         internal System.Windows.Controls.MenuItem delArcBtn;
         
@@ -185,7 +177,7 @@ namespace GraphDrawer {
         #line hidden
         
         
-        #line 62 "..\..\GraphByClick.xaml"
+        #line 61 "..\..\GraphByClick.xaml"
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
         internal System.Windows.Controls.MenuItem delAllBtn;
         
@@ -313,57 +305,48 @@ namespace GraphDrawer {
             #line hidden
             return;
             case 13:
-            this.backBtn = ((System.Windows.Controls.Button)(target));
-            
-            #line 48 "..\..\GraphByClick.xaml"
-            this.backBtn.Click += new System.Windows.RoutedEventHandler(this.BackBtn_Click);
-            
-            #line default
-            #line hidden
-            return;
-            case 14:
             this.canvas = ((System.Windows.Controls.Canvas)(target));
             
-            #line 51 "..\..\GraphByClick.xaml"
+            #line 50 "..\..\GraphByClick.xaml"
             this.canvas.MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.Canvas_MouseUp);
             
             #line default
             #line hidden
             return;
-            case 15:
+            case 14:
             this.saveBtn = ((System.Windows.Controls.MenuItem)(target));
             
-            #line 54 "..\..\GraphByClick.xaml"
+            #line 53 "..\..\GraphByClick.xaml"
             this.saveBtn.Click += new System.Windows.RoutedEventHandler(this.ExportPngBtn_Click);
             
             #line default
             #line hidden
             return;
-            case 16:
+            case 15:
             this.printBtn = ((System.Windows.Controls.MenuItem)(target));
             
-            #line 55 "..\..\GraphByClick.xaml"
+            #line 54 "..\..\GraphByClick.xaml"
             this.printBtn.Click += new System.Windows.RoutedEventHandler(this.PrintBtn_Click);
             
             #line default
             #line hidden
             return;
-            case 17:
+            case 16:
             this.delEdgeBtn = ((System.Windows.Controls.MenuItem)(target));
             
-            #line 60 "..\..\GraphByClick.xaml"
+            #line 59 "..\..\GraphByClick.xaml"
             this.delEdgeBtn.Click += new System.Windows.RoutedEventHandler(this.DelEdgeBtn_Click);
             
             #line default
             #line hidden
             return;
-            case 18:
+            case 17:
             this.delArcBtn = ((System.Windows.Controls.MenuItem)(target));
             return;
-            case 19:
+            case 18:
             this.delAllBtn = ((System.Windows.Controls.MenuItem)(target));
             
-            #line 62 "..\..\GraphByClick.xaml"
+            #line 61 "..\..\GraphByClick.xaml"
             this.delAllBtn.Click += new System.Windows.RoutedEventHandler(this.ClearBtn_Click);
             
             #line default

+ 17 - 34
GraphDrawer/obj/Debug/GraphByClick.g.i.cs

@@ -1,4 +1,4 @@
-#pragma checksum "..\..\GraphByClick.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "1CCAD26DC76E062C5CCDC34BB65BA922D15C711F1316FE311D3F80CE290913B3"
+#pragma checksum "..\..\GraphByClick.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "3F10DEF0D7788198B26228CE3A2C045C959A9F5547C65093DCFECA16394D95C5"
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
@@ -137,15 +137,7 @@ namespace GraphDrawer {
         #line hidden
         
         
-        #line 48 "..\..\GraphByClick.xaml"
-        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
-        internal System.Windows.Controls.Button backBtn;
-        
-        #line default
-        #line hidden
-        
-        
-        #line 51 "..\..\GraphByClick.xaml"
+        #line 50 "..\..\GraphByClick.xaml"
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
         internal System.Windows.Controls.Canvas canvas;
         
@@ -153,7 +145,7 @@ namespace GraphDrawer {
         #line hidden
         
         
-        #line 54 "..\..\GraphByClick.xaml"
+        #line 53 "..\..\GraphByClick.xaml"
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
         internal System.Windows.Controls.MenuItem saveBtn;
         
@@ -161,7 +153,7 @@ namespace GraphDrawer {
         #line hidden
         
         
-        #line 55 "..\..\GraphByClick.xaml"
+        #line 54 "..\..\GraphByClick.xaml"
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
         internal System.Windows.Controls.MenuItem printBtn;
         
@@ -169,7 +161,7 @@ namespace GraphDrawer {
         #line hidden
         
         
-        #line 60 "..\..\GraphByClick.xaml"
+        #line 59 "..\..\GraphByClick.xaml"
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
         internal System.Windows.Controls.MenuItem delEdgeBtn;
         
@@ -177,7 +169,7 @@ namespace GraphDrawer {
         #line hidden
         
         
-        #line 61 "..\..\GraphByClick.xaml"
+        #line 60 "..\..\GraphByClick.xaml"
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
         internal System.Windows.Controls.MenuItem delArcBtn;
         
@@ -185,7 +177,7 @@ namespace GraphDrawer {
         #line hidden
         
         
-        #line 62 "..\..\GraphByClick.xaml"
+        #line 61 "..\..\GraphByClick.xaml"
         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
         internal System.Windows.Controls.MenuItem delAllBtn;
         
@@ -313,57 +305,48 @@ namespace GraphDrawer {
             #line hidden
             return;
             case 13:
-            this.backBtn = ((System.Windows.Controls.Button)(target));
-            
-            #line 48 "..\..\GraphByClick.xaml"
-            this.backBtn.Click += new System.Windows.RoutedEventHandler(this.BackBtn_Click);
-            
-            #line default
-            #line hidden
-            return;
-            case 14:
             this.canvas = ((System.Windows.Controls.Canvas)(target));
             
-            #line 51 "..\..\GraphByClick.xaml"
+            #line 50 "..\..\GraphByClick.xaml"
             this.canvas.MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.Canvas_MouseUp);
             
             #line default
             #line hidden
             return;
-            case 15:
+            case 14:
             this.saveBtn = ((System.Windows.Controls.MenuItem)(target));
             
-            #line 54 "..\..\GraphByClick.xaml"
+            #line 53 "..\..\GraphByClick.xaml"
             this.saveBtn.Click += new System.Windows.RoutedEventHandler(this.ExportPngBtn_Click);
             
             #line default
             #line hidden
             return;
-            case 16:
+            case 15:
             this.printBtn = ((System.Windows.Controls.MenuItem)(target));
             
-            #line 55 "..\..\GraphByClick.xaml"
+            #line 54 "..\..\GraphByClick.xaml"
             this.printBtn.Click += new System.Windows.RoutedEventHandler(this.PrintBtn_Click);
             
             #line default
             #line hidden
             return;
-            case 17:
+            case 16:
             this.delEdgeBtn = ((System.Windows.Controls.MenuItem)(target));
             
-            #line 60 "..\..\GraphByClick.xaml"
+            #line 59 "..\..\GraphByClick.xaml"
             this.delEdgeBtn.Click += new System.Windows.RoutedEventHandler(this.DelEdgeBtn_Click);
             
             #line default
             #line hidden
             return;
-            case 18:
+            case 17:
             this.delArcBtn = ((System.Windows.Controls.MenuItem)(target));
             return;
-            case 19:
+            case 18:
             this.delAllBtn = ((System.Windows.Controls.MenuItem)(target));
             
-            #line 62 "..\..\GraphByClick.xaml"
+            #line 61 "..\..\GraphByClick.xaml"
             this.delAllBtn.Click += new System.Windows.RoutedEventHandler(this.ClearBtn_Click);
             
             #line default

BIN
GraphDrawer/obj/Debug/GraphByMatrix.baml


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

@@ -35,20 +35,34 @@ 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\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\GraphByClick.baml
-C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\MainWindow.baml
 C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\GraphDrawer.g.resources
 C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\GraphDrawer.Properties.Resources.resources
 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\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
+C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\EdgeCreateWindow.baml
+C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\EdgeCreateWindow.g.cs
+C:\Users\locadm\Desktop\Graphs\GraphDrawer\bin\Debug\Xceed.Wpf.AvalonDock.dll
+C:\Users\locadm\Desktop\Graphs\GraphDrawer\bin\Debug\Xceed.Wpf.AvalonDock.Themes.Aero.dll
+C:\Users\locadm\Desktop\Graphs\GraphDrawer\bin\Debug\Xceed.Wpf.AvalonDock.Themes.Metro.dll
+C:\Users\locadm\Desktop\Graphs\GraphDrawer\bin\Debug\Xceed.Wpf.AvalonDock.Themes.VS2010.dll
+C:\Users\locadm\Desktop\Graphs\GraphDrawer\bin\Debug\Xceed.Wpf.Toolkit.dll
+C:\Users\locadm\Desktop\Graphs\GraphDrawer\bin\Debug\de\Xceed.Wpf.AvalonDock.resources.dll
+C:\Users\locadm\Desktop\Graphs\GraphDrawer\bin\Debug\es\Xceed.Wpf.AvalonDock.resources.dll
+C:\Users\locadm\Desktop\Graphs\GraphDrawer\bin\Debug\fr\Xceed.Wpf.AvalonDock.resources.dll
+C:\Users\locadm\Desktop\Graphs\GraphDrawer\bin\Debug\hu\Xceed.Wpf.AvalonDock.resources.dll
+C:\Users\locadm\Desktop\Graphs\GraphDrawer\bin\Debug\it\Xceed.Wpf.AvalonDock.resources.dll
+C:\Users\locadm\Desktop\Graphs\GraphDrawer\bin\Debug\pt-BR\Xceed.Wpf.AvalonDock.resources.dll
+C:\Users\locadm\Desktop\Graphs\GraphDrawer\bin\Debug\ro\Xceed.Wpf.AvalonDock.resources.dll
+C:\Users\locadm\Desktop\Graphs\GraphDrawer\bin\Debug\ru\Xceed.Wpf.AvalonDock.resources.dll
+C:\Users\locadm\Desktop\Graphs\GraphDrawer\bin\Debug\sv\Xceed.Wpf.AvalonDock.resources.dll
+C:\Users\locadm\Desktop\Graphs\GraphDrawer\bin\Debug\zh-Hans\Xceed.Wpf.AvalonDock.resources.dll
+C:\Users\locadm\Desktop\Graphs\GraphDrawer\obj\Debug\GraphDrawer.csproj.CopyComplete

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


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

@@ -10,11 +10,11 @@ none
 false
 DEBUG;TRACE
 C:\Users\locadm\Desktop\Graphs\GraphDrawer\App.xaml
-5-61230628
+4342655817
 
-14427084280
-141183416626
-ChoiceMode.xaml;GraphByClick.xaml;GraphByMatrix.xaml;MainWindow.xaml;MatrixOutput.xaml;
+131747056765
+191470239246
+EdgeCreateWindow.xaml;GraphByClick.xaml;GraphByMatrix.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
-6344643144
+4342655817
 
-161529146020
+142147290790
 191470239246
-ChoiceMode.xaml;EdgeCreateWindow.xaml;GraphByClick.xaml;GraphByMatrix.xaml;MainWindow.xaml;MatrixOutput.xaml;
+EdgeCreateWindow.xaml;GraphByClick.xaml;GraphByMatrix.xaml;MatrixOutput.xaml;
 
 True
 

+ 0 - 3
GraphDrawer/obj/Debug/GraphDrawer_MarkupCompile.i.lref

@@ -1,7 +1,4 @@
 
 
 FC:\Users\locadm\Desktop\Graphs\GraphDrawer\GraphByClick.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;;
 

+ 0 - 1
GraphDrawer/obj/Debug/GraphDrawer_MarkupCompile.lref

@@ -2,6 +2,5 @@
 
 FC:\Users\locadm\Desktop\Graphs\GraphDrawer\GraphByClick.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/MainWindow.baml


+ 0 - 145
GraphDrawer/obj/Debug/MainWindow.g.cs

@@ -1,145 +0,0 @@
-#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "B2A5085B5D2A36954FD16FD5B0D1C36416FAF8C1779FDC4E36AEEC94EB3FC735"
-//------------------------------------------------------------------------------
-// <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>
-    /// MainWindow
-    /// </summary>
-    public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
-        
-        
-        #line 19 "..\..\MainWindow.xaml"
-        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
-        internal System.Windows.Controls.Canvas canvas;
-        
-        #line default
-        #line hidden
-        
-        
-        #line 23 "..\..\MainWindow.xaml"
-        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
-        internal System.Windows.Controls.TextBox vertexBox;
-        
-        #line default
-        #line hidden
-        
-        
-        #line 24 "..\..\MainWindow.xaml"
-        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
-        internal System.Windows.Controls.TextBox edgeBox;
-        
-        #line default
-        #line hidden
-        
-        
-        #line 25 "..\..\MainWindow.xaml"
-        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
-        internal System.Windows.Controls.Button generateBtn;
-        
-        #line default
-        #line hidden
-        
-        
-        #line 26 "..\..\MainWindow.xaml"
-        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
-        internal System.Windows.Controls.Button choiceBtn;
-        
-        #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/mainwindow.xaml", System.UriKind.Relative);
-            
-            #line 1 "..\..\MainWindow.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.canvas = ((System.Windows.Controls.Canvas)(target));
-            return;
-            case 2:
-            this.vertexBox = ((System.Windows.Controls.TextBox)(target));
-            return;
-            case 3:
-            this.edgeBox = ((System.Windows.Controls.TextBox)(target));
-            return;
-            case 4:
-            this.generateBtn = ((System.Windows.Controls.Button)(target));
-            
-            #line 25 "..\..\MainWindow.xaml"
-            this.generateBtn.Click += new System.Windows.RoutedEventHandler(this.generateBtn_Click);
-            
-            #line default
-            #line hidden
-            return;
-            case 5:
-            this.choiceBtn = ((System.Windows.Controls.Button)(target));
-            
-            #line 26 "..\..\MainWindow.xaml"
-            this.choiceBtn.Click += new System.Windows.RoutedEventHandler(this.choiceBtn_Click);
-            
-            #line default
-            #line hidden
-            return;
-            }
-            this._contentLoaded = true;
-        }
-    }
-}
-

+ 1 - 1
GraphDrawer/obj/Debug/MainWindow.g.i.cs

@@ -123,7 +123,7 @@ namespace GraphDrawer {
             this.generateBtn = ((System.Windows.Controls.Button)(target));
             
             #line 25 "..\..\MainWindow.xaml"
-            this.generateBtn.Click += new System.Windows.RoutedEventHandler(this.generateBtn_Click);
+            this.generateBtn.Click += new System.Windows.RoutedEventHandler(this.GenerateBtn_Click);
             
             #line default
             #line hidden

BIN
GraphDrawer/obj/Debug/MatrixOutput.baml