Exemple #1
0
        public MainWindow()
        {
            InitializeComponent();
            IResultText resultTxt = new Win10Text(main_textfield);
            IResultText secondTxt = new Win10Text(second_textfield);
            IButton     button1   = new Win10Button(button_1);
            IButton     button2   = new Win10Button(button_2);
            IButton     button3   = new Win10Button(button_3);
            IButton     button4   = new Win10Button(button_4);
            IButton     button5   = new Win10Button(button_5);
            IButton     button6   = new Win10Button(button_6);
            IButton     button7   = new Win10Button(button_7);
            IButton     button8   = new Win10Button(button_8);
            IButton     button9   = new Win10Button(button_9);
            IButton     button0   = new Win10Button(button_0);
            IButton     buttondot = new Win10Button(button_dot);

            IButton clrBtn      = new Win10Button(button_clr);
            IButton multiplyBtn = new Win10Button(button_multiply);
            IButton divBtn      = new Win10Button(button_division);
            IButton minusBtn    = new Win10Button(button_minus);
            IButton plusBtn     = new Win10Button(button_plus);
            IButton eqBtn       = new Win10Button(button_eq);

            IButton [] buttons = new IButton[11] {
                button1, button2, button3, button4, button5, button6, button7, button8, button9, button0, buttondot
            };
            IButton [] operators = new IButton[6] {
                clrBtn, multiplyBtn, divBtn, minusBtn, plusBtn, eqBtn
            };



            var Calculator = new CalculatorPortable.CalculatorPortable(buttons, operators, resultTxt, secondTxt);
        }
Exemple #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            IButton btn_0    = new AndroidButton(FindViewById <Button>(Resource.Id.btn_0));
            IButton btn_1    = new AndroidButton(FindViewById <Button>(Resource.Id.btn_1));
            IButton btn_2    = new AndroidButton(FindViewById <Button>(Resource.Id.btn_2));
            IButton btn_3    = new AndroidButton(FindViewById <Button>(Resource.Id.btn_3));
            IButton btn_4    = new AndroidButton(FindViewById <Button>(Resource.Id.btn_4));
            IButton btn_5    = new AndroidButton(FindViewById <Button>(Resource.Id.btn_5));
            IButton btn_6    = new AndroidButton(FindViewById <Button>(Resource.Id.btn_6));
            IButton btn_7    = new AndroidButton(FindViewById <Button>(Resource.Id.btn_7));
            IButton btn_8    = new AndroidButton(FindViewById <Button>(Resource.Id.btn_8));
            IButton btn_9    = new AndroidButton(FindViewById <Button>(Resource.Id.btn_9));
            IButton btn_coma = new AndroidButton(FindViewById <Button>(Resource.Id.btn_dot));

            IButton btn_plus     = new AndroidButton(FindViewById <Button>(Resource.Id.btn_plus));
            IButton btn_minus    = new AndroidButton(FindViewById <Button>(Resource.Id.btn_minus));
            IButton btn_equal    = new AndroidButton(FindViewById <Button>(Resource.Id.btn_equal));
            IButton btn_multiply = new AndroidButton(FindViewById <Button>(Resource.Id.btn_multiply));
            IButton btn_divide   = new AndroidButton(FindViewById <Button>(Resource.Id.btn_divide));
            IButton btn_clear    = new AndroidButton(FindViewById <Button>(Resource.Id.btn_clr));

            IResultText resultTxt = new AndroidTextView(FindViewById <TextView>(Resource.Id.txtResult));
            IResultText smallTxt  = new AndroidTextView(FindViewById <TextView>(Resource.Id.secondTxt));

            IButton[] buttons = new IButton[11] {
                btn_0, btn_1, btn_2, btn_3, btn_4, btn_5, btn_6, btn_7, btn_8, btn_9, btn_coma
            };
            IButton[] operators = new IButton[6] {
                btn_plus, btn_minus, btn_equal, btn_multiply, btn_divide, btn_clear
            };

            var Calc = new CalculatorPortable.CalculatorPortable(buttons, operators, resultTxt, smallTxt);
        }