private void onModify(object sender, GraphEventArgs e) { isModified = true; history.Add(graph.get()); undoButton.Enabled = true; if (history.Count > 20) { history.RemoveAt(0); } }
private void updateInfo(object sender = null, GraphEventArgs e = null) { fileName = getFileName(); string fileNameTitle = fileName + (isModified ? "*" : ""); mainWindow.Text = $"{fileNameTitle} - {title}"; filePathLabel.Text = currentFilePath; vertexValue.Text = $"{titles.verticesTitle} {graph?.VerticesNumber}"; edgesValue.Text = $"{titles.edgesTitle} {graph?.EdgesNumber}"; isDirectedCheckBox.Checked = graph.IsDirected; isWeightedCheckBox.Checked = graphVisual.IsWeighted; if (isModified) { filePathLabel.Text += "*"; } }
private void updateInputBounds(object sender = null, GraphEventArgs e = null) { int maxVertexNumber = graph.getMaxVertexNumber(); int minVertexNumber = graph.getMinVertexNumber(); changeVertValue.Maximum = maxVertexNumber; traversalStartVertex.Maximum = maxVertexNumber; fromEdgeValue.Maximum = maxVertexNumber; toEdgeValue.Maximum = maxVertexNumber; changeVertValue.Minimum = minVertexNumber; traversalStartVertex.Minimum = minVertexNumber; fromEdgeValue.Minimum = minVertexNumber; toEdgeValue.Minimum = minVertexNumber; validateButtons(); }