using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using TemperatureManager.MVC;

namespace NombreApplication
{
    public partial class SeuilView : Form, IObserver<SeuilTemperature>

    {
        public SeuilView(SeuilTemperature seuil)
        {
            InitializeComponent();
            OnNext(seuil);
        }
        // Controller need to know about Button to catch event
        // Others soluyions are also possible
        public Button GetButtonIncremente()
        {
            return btnIncremente;
        }
        public Button GetButtonDecremente()
        {
            return btnDecremente;
        }
        // implement IObserver 
        // if model change then view is notified and update
        public void OnNext(SeuilTemperature valueSeuilTemperature)
        {
            textBoxSeuilTemperature.Text = valueSeuilTemperature.ValueTemp.ToString();
        }

        public void OnError(Exception error)
        {
            throw new NotImplementedException();
        }

        public void OnCompleted()
        {
            throw new NotImplementedException();
        }

    }
}
