using System; using System.Windows.Controls; using System.Windows.Media; using System.Windows.Shapes; namespace DrawGraph { public class Settings { public static int NodeWidth = 10; public static int NodeHeight = 10; public static int StrokeThickness = 2; public static int FontSize = 16; public static Brush FillColor = Brushes.Black; public static void ClearCanvas(Edge[] edges, Node[] nodes) { if (edges != null && nodes != null) { Array.Clear(edges, 0, edges.Length); Array.Clear(nodes, 0, nodes.Length); } else { throw new NullReferenceException(); } } public static void RemoveAllEdges(Canvas canvas, Line[] lines, Edge[] edges) { Array.Clear(edges, 0, edges.Length); for (int i = 0; i < lines.Length; i++) { canvas.Children.Remove(lines[i]); } } public static void RemoveLastAdded(Canvas canvas) { int removingElement = canvas.Children.Count-1; canvas.Children.RemoveAt(removingElement); } } }