Esempio n. 1
0
        public MainWindow()
        {
            InitializeComponent();

            ElementsCollections elements   = new ElementsCollections(grid.Children);
            QuadraticEquation   equation_1 = new QuadraticEquation(2, 3, 10, "X");
        }
Esempio n. 2
0
        public MainWindow()
        {
            InitializeComponent();

            ElementsCollections collection = new ElementsCollections(GridName.Children);

            AddEvent(collection);
        }
Esempio n. 3
0
        private void AddEvent(ElementsCollections collections)
        {
            var button = (Button)collections.LogicElements.FirstOrDefault();

            button.Click += (something, args) => {
                var values = GetNumericValues(collections);
                GaussMethod.MainMethod(values);
            };
        }
Esempio n. 4
0
        public static void PrintResult(SquareMatrix matrix, ElementsCollections elementsCollection)
        {
            foreach (var element in elementsCollection.TextBoxes)
            {
                var textbox = (TextBox)element;

                if (textbox.Name == "Result")
                {
                    textbox.Text = GetStringResult(matrix);
                }
            }
        }
Esempio n. 5
0
        public static string[] GetValues(ElementsCollections elementsCollection, string textboxName)
        {
            foreach (var element in elementsCollection.TextBoxes)
            {
                var textbox = (TextBox)element;

                if (!string.IsNullOrEmpty(textbox.Text) && textbox.Name == textboxName)
                {
                    var values = textbox.Text.Split(' ');
                    return(values);
                }
            }

            return(null);
        }
Esempio n. 6
0
        private double[,] GetNumericValues(ElementsCollections collections)
        {
            var result  = new double[3, 4];
            var counter = 0;

            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    var textbox = (TextBox)collections.TextBoxes[counter];
                    result[i, j] = double.Parse(textbox.Text);
                    counter++;
                }
            }

            return(result);
        }
Esempio n. 7
0
        public MainWindow()
        {
            InitializeComponent();

            ElementsCollections elementsCollection = new ElementsCollections(grid.Children);
            var button = (Button)elementsCollection.LogicElements.Last();

            button.Click += (something, args) =>
            {
                var matrix_1 = GUILogic.GetMatrix(3, GUILogic.GetValues(elementsCollection, "AMatrix"));
                var matrix_2 = GUILogic.GetMatrix(3, GUILogic.GetValues(elementsCollection, "BMatrix"));

                var Tmatrix_1 = TransposeMethod.Transpose(matrix_1);
                var Tmatrix_2 = TransposeMethod.Transpose(matrix_2);

                var result = MatrixSum.GetSum(Tmatrix_1, Tmatrix_2);
                GUILogic.PrintResult(result, elementsCollection);
            };
        }