Exemplo n.º 1
0
        private void methodSelect_SelectedIndexChanged(object sender, EventArgs e)
        {
            var result            = new List <Point>();
            var method            = OSUtils.LoadPlugin(this.methodSelect.SelectedItem.ToString(), this.points);
            var aproximatedPoints = (List <Tuple <float, float> >)method.calculate();

            foreach (Tuple <float, float> point in aproximatedPoints)
            {
                result.Add(new Point(point.Item1, point.Item2));
            }
            this.drawApproximatePlot(result);
        }
Exemplo n.º 2
0
 public MainForm(dynamic points)
 {
     InitializeComponent();
     foreach (dynamic point in points)
     {
         float x = point.GetType().GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)[0].GetValue(point);
         float y = point.GetType().GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)[1].GetValue(point);
         this.points.Add(new Point(x, y));
     }
     drawPlot(this.points);
     foreach (string name in OSUtils.GetPluginsNames())
     {
         this.methodSelect.Items.Add(name);
     }
 }