首页 > 代码库 > 两个小时写了一个加法计算器

两个小时写了一个加法计算器

第一次进行WPF开发。。。calculator

class Number    {        private string str_buffer = null;        private decimal dec_buffer = 0m;        public void plus()        {            dec_buffer = Convert.ToDecimal(str_buffer);              this.Result += dec_buffer;            str_buffer = null;            dec_buffer = 0m;            this.expression += "+";        }        public void equal()        {            dec_buffer = Convert.ToDecimal(str_buffer);            this.Result += dec_buffer;            str_buffer = null;            dec_buffer = 0m;        }        private string expression;        public string Expression        {            get { return expression; }            set             {                str_buffer += value;                expression = this.Expression + value;            }        }        private decimal result;        public decimal Result        {            get { return result; }            set { result = value; }        }        public void clear()        {            dec_buffer = 0m;            str_buffer = null;            expression = "";            result = 0m;        }    }
binding想用但不会用啊。。

两个小时写了一个加法计算器