-
Notifications
You must be signed in to change notification settings - Fork 0
/
Expression.cs
35 lines (33 loc) · 875 Bytes
/
Expression.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Calculator {
class Expression : DynamicText{
public Expression() {
text="";
}
public override void Append(string s) {
text+=s;
OnPropertyChanged();
}
public override void Delete() {
if(text.Equals("")) {
return;
}
try {
text=text.Remove(_text.Length-1, 1);
} catch(ArgumentOutOfRangeException) {
Debug.WriteLine("daha fazla silinemez!");
}
if(String.IsNullOrEmpty(text))
text="0";
OnPropertyChanged();
}
public override void Clear() {
text="";
}
}
}