-
-
Notifications
You must be signed in to change notification settings - Fork 56
Updates to menu items #280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <?xml version="1.0" encoding="utf-8" ?> | ||
| <configuration> | ||
| <configSections> | ||
| <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > | ||
| <section name="BBSFW.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> | ||
| </sectionGroup> | ||
| </configSections> | ||
| <userSettings> | ||
| <BBSFW.Properties.Settings> | ||
| <setting name="UseFreedomUnits" serializeAs="String"> | ||
| <value>False</value> | ||
| </setting> | ||
| <setting name="LastLoadedFile" serializeAs="String"> | ||
| <value /> | ||
| </setting> | ||
| </BBSFW.Properties.Settings> | ||
| </userSettings> | ||
| </configuration> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,12 @@ | ||
| <?xml version='1.0' encoding='utf-8'?> | ||
| <?xml version='1.0' encoding='utf-8'?> | ||
| <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="BBSFW.Properties" GeneratedClassName="Settings"> | ||
| <Profiles /> | ||
| <Settings> | ||
| <Setting Name="UseFreedomUnits" Type="System.Boolean" Scope="User"> | ||
| <Value Profile="(Default)">False</Value> | ||
| </Setting> | ||
| <Setting Name="LastLoadedFile" Type="System.String" Scope="User"> | ||
| <Value Profile="(Default)" /> | ||
| </Setting> | ||
| </Settings> | ||
| </SettingsFile> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.ComponentModel; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
|
|
@@ -24,5 +25,19 @@ public MainWindow() | |
| { | ||
| InitializeComponent(); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Application closing callback. | ||
| /// </summary> | ||
| /// <param name="sender"></param> | ||
| /// <param name="e"></param> | ||
| private void Window_Closing(object sender, CancelEventArgs e) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to intercept closing if we want to save the name of the currently open file. I could have just saved this upon load (and this is a bit more complicated a solution than doing that) so if that would be preferred I could change it, but I think this is a pretty reasonable solution. Note also that we can't cancel Application.shutDown() as it's just not supported. But window.close() is. |
||
| { | ||
| // Get the view model | ||
| if (DataContext is ViewModel.MainViewModel viewModel) | ||
| { | ||
| e.Cancel = viewModel.OnExitCancellable(); | ||
| } | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment. This definitely looks like it should work, but with the hotkeys you can cause an exception by just saving the config repeatedly very quickly. I suspect some part of the close() is asynchronous but I'm not too familiar with C# streaming.