yodanimal / EchoEarnings

SalaryWageCalculator
1 stars 0 forks source link

show message on Mac that GUI mode is not supported yet #4

Closed javaswinger closed 9 months ago

javaswinger commented 10 months ago

gracefully handle GUI mode on Mac by showing message that it is unsupported

currently this is what happens on a Mac:

PS /Users/javaswinger/workspaces/EchoEarnings> ./Main.ps1
Enter 'C' for Console Interface or 'G' for GUI Interface: G
Add-Type: /Users/javaswinger/workspaces/EchoEarnings/GUI/GUI.ps1:5
Line |
   5 |  Add-Type -AssemblyName PresentationFramework
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot find path '/Users/javaswinger/workspaces/EchoEarnings/PresentationFramework.dll'
     | because it does not exist.
InvalidOperation: /Users/javaswinger/workspaces/EchoEarnings/GUI/GUI.ps1:10
Line |
  10 |  $window = [Windows.Markup.XamlReader]::Load($reader)
     |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Unable to find type [Windows.Markup.XamlReader].
InvalidOperation: /Users/javaswinger/workspaces/EchoEarnings/GUI/GUI.ps1:13
Line |
  13 |  $radioHourly = $window.FindName('radioHourly')
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.
InvalidOperation: /Users/javaswinger/workspaces/EchoEarnings/GUI/GUI.ps1:14
Line |
  14 |  $radioSalary = $window.FindName('radioSalary')
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.
InvalidOperation: /Users/javaswinger/workspaces/EchoEarnings/GUI/GUI.ps1:15
Line |
  15 |  $inputValue = $window.FindName('inputValue')
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.
InvalidOperation: /Users/javaswinger/workspaces/EchoEarnings/GUI/GUI.ps1:16
Line |
  16 |  $calculateButton = $window.FindName('calculateButton')
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.
InvalidOperation: /Users/javaswinger/workspaces/EchoEarnings/GUI/GUI.ps1:17
Line |
  17 |  $outputText = $window.FindName('outputText')
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.
InvalidOperation: /Users/javaswinger/workspaces/EchoEarnings/GUI/GUI.ps1:25
Line |
  25 |  $calculateButton.Add_Click({
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.
InvalidOperation: /Users/javaswinger/workspaces/EchoEarnings/GUI/GUI.ps1:50
Line |
  50 |  [void]$window.ShowDialog()
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.