예제 #1
0
        /// <summary>
        /// Clears all the currently displayed data, resets key values.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnClear_Click(object sender, RoutedEventArgs e)
        {
            drawingCanvas.Clear();
            modifiedCanvas.Clear();

            graph = new Graph();
            graph.StateVectorChanged  += PrintVector;
            graph.StateVectorPChanged += PrintVectorP;
            graph.StateVectorSChanged += PrintVectorS;

            vectorsListBox.Items.Clear();
            vectorsPListBox.Items.Clear();
            vectorsSListBox.Items.Clear();

            foreach (Label label in weightLabels)
            {
                inputGraph.Children.Remove(label);
            }
            weightLabels.Clear();

            timeInfo.Content   = "";
            timePInfo.Content  = "";
            timeSInfo.Content  = "";
            timeDataBlock.Text = "";

            inputGraph.Children.Clear();
            for (int i = 0; i < graph.vertices.Count; i++)
            {
                graph.vertices[i].PtReceived -= FirePoints;
            }
            inputGraph.Children.Add(drawingCanvas);
            inputGraph.Children.Add(hintBlock);

            modifiedGraph.Children.Clear();
            modifiedGraph.Children.Add(modifiedCanvas);

            power = 1;
            time  = 0;

            btnSave.IsEnabled       = false;
            btnCalculate.IsEnabled  = false;
            btnAnimate.IsEnabled    = false;
            btnCharValues.IsEnabled = false;
        }