Exemple #1
0
 private void RemoveEdges()
 {
     for (int i = 0; i < edgesToRemove.Count; i++)
     {
         string edgeUid = DrawObj.GenerateEdgeUid(edgesToRemove[i]);
         for (int j = 0; j < MWindow.mainCanvas.Children.Count; j++)
         {
             if (MWindow.mainCanvas.Children[j].Uid == edgeUid)
             {
                 MWindow.mainCanvas.Children.RemoveAt(j);
                 break;
             }
         }
     }
     edgesToRemove.Clear();
 }
Exemple #2
0
        private void AddEdge(EdgesAddedOrRemoved edge)
        {
            edgesToChangeColor.Add(edge);

            Line edgeElem = new Line
            {
                Uid             = DrawObj.GenerateEdgeUid(edge),
                Stroke          = (SolidColorBrush) new BrushConverter().ConvertFromString("#006600"),
                StrokeThickness = 2,
                X1 = DrawObj.Vertices[edge.Vertex1].X,
                Y1 = DrawObj.Vertices[edge.Vertex1].Y,
                X2 = DrawObj.Vertices[edge.Vertex2].X,
                Y2 = DrawObj.Vertices[edge.Vertex2].Y
            };

            MWindow.mainCanvas.Children.Add(edgeElem);
        }
Exemple #3
0
        private void PrepareEdgeToRemove(EdgesAddedOrRemoved edge)
        {
            edgesToRemove.Add(edge);

            string edgeUid = DrawObj.GenerateEdgeUid(edge);

            for (int j = 0; j < MWindow.mainCanvas.Children.Count; j++)
            {
                if (MWindow.mainCanvas.Children[j].Uid == edgeUid)
                {
                    Line line = (Line)MWindow.mainCanvas.Children[j];
                    line.Stroke          = (SolidColorBrush) new BrushConverter().ConvertFromString("#ff0000");
                    line.StrokeThickness = 2;
                    break;
                }
            }
        }
Exemple #4
0
 private void FixAddedEdes()
 {
     for (int i = 0; i < edgesToChangeColor.Count; i++)
     {
         string edgeUid = DrawObj.GenerateEdgeUid(edgesToChangeColor[i]);
         for (int j = 0; j < MWindow.mainCanvas.Children.Count; j++)
         {
             if (MWindow.mainCanvas.Children[j].Uid == edgeUid)
             {
                 Line line = (Line)MWindow.mainCanvas.Children[j];
                 line.Stroke          = (SolidColorBrush) new BrushConverter().ConvertFromString("#323336");
                 line.StrokeThickness = 1;
                 break;
             }
         }
     }
     edgesToChangeColor.Clear();
 }