Пример #1
0
        private void SaveMatrixWeight()
        {
            int value;

            for (int i = 0; i < matrix.Count; ++i)
            {
                for (int j = 0; j < matrix.Count; ++j)
                {
                    try
                    {
                        value = Int32.Parse(matrix[i][j].Text);
                    }
                    catch
                    {
                        value = matrix[i][j].FirstDigit - '0';
                    }

                    if (value != 0)
                    {
                        if (adjacencyList.adjacencyList[i][adjacencyList.FindNumberInList(i, j)].Weight != value)
                        {
                            adjacencyList.ChangeWeight(i, adjacencyList.FindNumberInList(i, j), value);
                        }
                    }
                }
            }
        }