/// <summary> /// 依計畫內容回傳畫面更新 /// </summary> /// <param name="computeObject">計算物件</param> /// <returns>畫面更新</returns> public override FrameUpdate Compute(ComputeObject computeObject) { FrameUpdate frameUpdate; //等號後輸入數字 if (computeObject.LastFeature == typeof(Equal)) { //特殊情況,boardObject已在父類清空 computeObject.Init(); frameUpdate = GetUpdateDefault(computeObject); frameUpdate.RemoveLength = FrameUpdate.REMOVE_ALL; return(frameUpdate); } //backspace或clearerror之後的數字處理 if ((computeObject.LastFeature == typeof(BackSpace) || computeObject.LastFeature == typeof(ClearError)) && computeObject.NumberField.Number == 0) { frameUpdate = GetUpdateDefault(computeObject); frameUpdate.RemoveLength += 1; return(frameUpdate); } frameUpdate = GetUpdateDefault(computeObject); return(frameUpdate); }
/// <summary> /// 依計畫內容回傳畫面更新 /// </summary> /// <param name="computeObject">計算物件</param> /// <returns>畫面更新</returns> public override FrameUpdate Compute(ComputeObject computeObject) { computeObject.Init(); return(new FrameUpdate(FrameUpdate.REMOVE_ALL, string.Empty)); }