static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            stack           = new Stack();
            adder           = new Operators.Adder();
            subtractor      = new Operators.Subtractor();
            multiplier      = new Operators.Multiplier();
            divider         = new Operators.Divider();
            resultPresenter = new Operators.ResultPresenter();
            operand         = new Operand.Operand();
            calc            = new CalculatorGUI.CalculatorGUI(stack, adder, subtractor, divider, multiplier, resultPresenter, operand);

            Application.Run(calc);
        }
Beispiel #2
0
        public CalculatorGUI(Stack stack, Operators.Adder adder, Operators.Subtractor subtractor, Operators.Divider divider,
                             Operators.Multiplier multiplier, Operators.ResultPresenter resultPresenter, Operand.Operand operand)
        {
            this.stack      = stack;
            this.adder      = adder;
            this.subtractor = subtractor;
            this.multiplier = multiplier;
            this.divider    = divider;
            this.operand    = operand;

            this.Text            = "RPN Calculator";
            this.MaximizeBox     = false;
            this.MinimizeBox     = false;
            this.FormBorderStyle = FormBorderStyle.FixedSingle;
            InitializeComponent();
        }