//Constructor that sets up the Kalkylator reference with the the kalkylator object used elsewhere (in Form1)
 //also adds two Methods to the events in the kalkylator object
 public Logger(Kalkylator calc)
 {
     Calc = calc;
     calc.Negative += NegativeResult;
     calc.ClearButton += ClearPressing;
     calc.DivideByZero += DividingByZero;
 }
        public Form1()
        {
            InitializeComponent();

            //Instanisering och sättning av min formateringsinfo
            fmt = new NumberFormatInfo();
            fmt.NegativeSign = "-";
            fmt.NumberDecimalSeparator = ",";

            //Instancing my binaryFormatter
            binForm = new BinaryFormatter();

            //Instansiering och sättning av min räknesättslista
            CalcMethod = new List<string>();
            CalcMethod.Add("+");
            CalcMethod.Add("-");
            CalcMethod.Add("*");
            CalcMethod.Add("/");

            //Loading previous history and calculations
            LoadHistory();
            LoadCurrentCalc();

            //Instancing the calkylator with the CalcInfo Loaded above
            Calkisen = new Kalkylator(CI);
            //Instancing the EventCatcher with the calkylator
            Loggarn = new Logger(Calkisen);
        }
Exemple #3
0
        public Form1()
        {
            InitializeComponent();

            //Instanisering och sättning av min formateringsinfo
            fmt = new NumberFormatInfo();
            fmt.NegativeSign           = "-";
            fmt.NumberDecimalSeparator = ",";

            //Instancing my binaryFormatter
            binForm = new BinaryFormatter();

            //Instansiering och sättning av min räknesättslista
            CalcMethod = new List <string>();
            CalcMethod.Add("+");
            CalcMethod.Add("-");
            CalcMethod.Add("*");
            CalcMethod.Add("/");

            //Loading previous history and calculations
            LoadHistory();
            LoadCurrentCalc();

            //Instancing the calkylator with the CalcInfo Loaded above
            Calkisen = new Kalkylator(CI);
            //Instancing the EventCatcher with the calkylator
            Loggarn = new Logger(Calkisen);
        }
 //Constructor that sets up the Kalkylator reference with the the kalkylator object used elsewhere (in Form1)
 //also adds two Methods to the events in the kalkylator object
 public Logger(Kalkylator calc)
 {
     Calc               = calc;
     calc.Negative     += NegativeResult;
     calc.ClearButton  += ClearPressing;
     calc.DivideByZero += DividingByZero;
 }