Skip to content

Commit

Permalink
Update Program.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Hummel009 committed Jan 19, 2024
1 parent 56ff533 commit 8d5f679
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions appCs/src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ private static IntPtr WndProc(IntPtr window, int msg, IntPtr wParam, IntPtr lPar
case BUTTON_SQUARE_ROOT_ID:
PushOperation("r");
break;

case BUTTON_EQUALS_ID:
CalculateWrapper();
break;
Expand Down Expand Up @@ -250,7 +249,7 @@ private static void Calculate(IntPtr field)
"-" => operand1 - operand2,
"*" => operand1 * operand2,
"/" => operand1 / operand2,
_ => throw new Exception("Invalid operator: " + op),
_ => throw new Exception("Invalid operator: " + op)
};

data.Clear();
Expand All @@ -267,7 +266,7 @@ private static void Calculate(IntPtr field)
"s" => operand * operand,
"i" => 1.0 / operand,
"r" => Math.Sqrt(operand),
_ => throw new Exception("Invalid operator: " + op),
_ => throw new Exception("Invalid operator: " + op)
};

data.Clear();
Expand All @@ -277,7 +276,7 @@ private static void Calculate(IntPtr field)
}
}

private static void PushOperation(String operation)
private static void PushOperation(string operation)
{
StringBuilder buffer = new(WinAPI.GetWindowTextLength(field) + 1);
WinAPI.GetWindowText(field, buffer, buffer.Capacity);
Expand All @@ -296,7 +295,7 @@ private static void PushOperation(String operation)
}
}

private static void PushSymbolWrapper(String symbol)
private static void PushSymbolWrapper(string symbol)
{
StringBuilder buffer = new(WinAPI.GetWindowTextLength(field) + 1);
WinAPI.GetWindowText(field, buffer, buffer.Capacity);
Expand Down Expand Up @@ -337,7 +336,7 @@ private static void PushSymbolWrapper(String symbol)
}
}

private static void PushSymbol(String symbol)
private static void PushSymbol(string symbol)
{
StringBuilder buffer = new(WinAPI.GetWindowTextLength(field) + 1);
WinAPI.GetWindowText(field, buffer, buffer.Capacity);
Expand All @@ -357,7 +356,7 @@ private static IntPtr RegisterField(IntPtr window)
return WinAPI.CreateWindowEx(WS_EX_CLIENTEDGE, "STATIC", "", WS_TABSTOP | WS_VISIBLE | WS_CHILD, 1, 1, 239, 48, window, 0, 0, 0);
}

private static void RegisterButton(IntPtr window, int id, String text, int gridX, int gridY)
private static void RegisterButton(IntPtr window, int id, string text, int gridX, int gridY)
{
var buttonWidth = 60;
var buttonHeight = 60;
Expand Down

0 comments on commit 8d5f679

Please sign in to comment.