Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- using ApproximationMethods;
- namespace MCHASolution
- {
- /// <summary>
- /// Interaction logic for MainWindow.xaml
- /// </summary>
- public partial class MainWindow : Window
- {
- private SplineApproximation spline;
- private LagrangeApproximation lagrange;
- private NewtonApproximation newton;
- private MinimalSquaresApproximation minSq;
- public MainWindow()
- {
- InitializeComponent();
- spline = new SplineApproximation();
- lagrange = new LagrangeApproximation();
- newton = new NewtonApproximation();
- minSq = new MinimalSquaresApproximation();
- }
- private void Window_SizeChanged(object sender, SizeChangedEventArgs e)
- {
- }
- private void addButton_Click(object sender, RoutedEventArgs e)
- {
- int i = tabControl.SelectedIndex;
- double x, y;
- switch (i)
- {
- case 0:
- if (!double.TryParse(xL.Text, out x) || !double.TryParse(yL.Text, out y))
- {
- MessageBox.Show("Invalid Data", "Data Format Error");
- return;
- }
- lagrange.Add(x,y);
- break;
- case 1:
- this.Title = "2";
- break;
- case 2:
- this.Title = "3";
- break;
- case 3:
- this.Title = "4";
- break;
- }
- }
- private void clearButton_Click(object sender, RoutedEventArgs e)
- {
- int i = tabControl.SelectedIndex;
- switch (i)
- {
- case 0:
- break;
- case 1:
- this.Title = "2";
- break;
- case 2:
- this.Title = "3";
- break;
- case 3:
- this.Title = "4";
- break;
- }
- }
- private void appButton_Click(object sender, RoutedEventArgs e)
- {
- int i = tabControl.SelectedIndex;
- switch (i)
- {
- case 0:
- appL.Content = lagrange.Polynom;
- break;
- case 1:
- this.Title = "2";
- break;
- case 2:
- this.Title = "3";
- break;
- case 3:
- this.Title = "4";
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement