//名字空間MyCalClass
//類名: CalClass
//無參的構造函數CalClass()
//6個用到的私有變量
//void PointClick() 按小數點
//string CE() 是計算器復位用的,clear函數
//string BackSpace(string Txt) 倒退鍵,參數是計算過程中現在顯示的計算結果
//string NumClick(string Txt,int NumKey) 0-9數字鍵按下的響應,Txt是計算的當前結果,NumKey是按下的數字值
//string OpClick(string Txt,int OpKey) +,-,*,/,=幾個鍵按下時的處理,Txt是計算的當前結果,OpKey是按下操作鍵的數字ID
namespace MyCalClass
{
public class CalClass
{
private string ResultTxt; //Get and Show The Result of the TextBox in application
private bool PointIsDown; //If the radix point was clicked;
private double MidResult; //To Store middle results
private double Results; //To store finally result
private int LastClick; //To sign last clicking button class,is number(1) or operator(2)
private int LastOperator; //To sign last clicked button of operator is who?0 is Null,1 is +,2 is - ,3 is *,4 is /,5 is =;
public CalClass()
{
ResultTxt = "0.";
PointIsDown = false;
MidResult = 0;
Results = 0;
LastClick = 0;