Ejemplo n.º 1
0
 private bool CanAddVertex(string par)
 {
     if (VertexNodes == null)
     {
         return(false);
     }
     return(!(VertexNodes.Any(item => item.Name == par) ||
              string.IsNullOrEmpty(par)));
 }
Ejemplo n.º 2
0
 private void AddVertex(string par)
 {
     if (VertexNodes.Count != 0)
     {
         NewVertexId = VertexNodes.Max(x => x.VertexId);
     }
     if (VertexNodes.Count < (int)CollectionViewVertexNumber.CurrentItem)
     {
         VertexNodes.Add(new VertexNode(NewVertexId + 1, par));
     }
     else
     {
         new ModernDialog()
         {
             Title   = "Внимание",
             Content = "Выберите другой размер матрицы смежности, чтобы добавить ещё вершин"
         }.ShowDialog();
     }
 }