1313 using Maxstupo . LogicSandbox . Logic ;
1414 using Maxstupo . LogicSandbox . Logic . Components ;
1515 using Maxstupo . LogicSandbox . Properties ;
16- using Maxstupo . LogicSandbox . Shapes ;
17- using Maxstupo . LogicSandbox . Utility . Interaction ;
1816
1917 public partial class FormMain : Form {
2018
19+ private Version Version => System . Reflection . Assembly . GetExecutingAssembly ( ) . GetName ( ) . Version ;
20+ private string DisplayVersion {
21+ get {
22+ Version version = Version ;
23+
24+ string displayVersion = $ "v{ version . Major } .{ version . Minor } .{ version . Build } ";
25+
26+ if ( version . Revision != 0 )
27+ displayVersion += $ ".{ version . Revision } ";
28+
29+ return displayVersion ;
30+ }
31+ }
32+
33+
2134 private Circuit circuit = new Circuit ( ) ;
2235 private readonly CircuitSimulator simulator = new CircuitSimulator ( ) ;
2336
@@ -50,6 +63,8 @@ public FormMain() {
5063 simulator . Circuit = circuit ;
5164 simulator . OnUpsChanged += ( s , e ) => Invoke ( ( MethodInvoker ) delegate { UpdateStatusBar ( ) ; } ) ;
5265 simulator . OnStateChange += ( s , e ) => Invoke ( ( MethodInvoker ) delegate { canvas . Refresh ( ) ; } ) ;
66+
67+ UpdateTitle ( ) ;
5368 }
5469
5570 private void UpdateStatusBar ( ) {
@@ -60,10 +75,12 @@ private void UpdateStatusBar() {
6075 }
6176
6277 private void UpdateTitle ( ) {
78+ string version = DisplayVersion ;
79+
6380 if ( openFilepath == null ) {
64- Text = "Logic Sandbox" ;
81+ Text = $ "Logic Sandbox { version } ";
6582 } else {
66- Text = $ "Logic Sandbox - { openFilepath } { ( UnsavedChanges ? "*" : string . Empty ) } ";
83+ Text = $ "Logic Sandbox { version } - { openFilepath } { ( UnsavedChanges ? "*" : string . Empty ) } ";
6784 }
6885 }
6986
@@ -225,7 +242,7 @@ private void createICToolStripMenuItem_Click(object sender, EventArgs e) {
225242 private void toggleSimulationTsmi_Click ( object sender , EventArgs e ) {
226243 simulator . Toggle ( ) ;
227244
228- stepSimulationTsmi . Enabled = ! simulator . IsRunning ;
245+ stepSimulationTsmi . Enabled = ! simulator . IsRunning ;
229246 speedTsmi . Enabled = simulator . IsRunning ;
230247
231248 toggleSimulationTsmi . Text = simulator . IsRunning ? "&Pause" : "&Play" ;
0 commit comments