Skip to content

Commit

Permalink
Added proper version number output
Browse files Browse the repository at this point in the history
  • Loading branch information
rtrahan504 committed Aug 29, 2022
1 parent 1051b04 commit 14a9111
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 120 deletions.
68 changes: 28 additions & 40 deletions Budgeter/About.xaml
Original file line number Diff line number Diff line change
@@ -1,47 +1,35 @@
<Window x:Class="Budgeter.About"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Budgeter"
mc:Ignorable="d"
Title="About" Height="400" Width="550">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Budgeter"
x:Name="_this"
mc:Ignorable="d"
Title="About" Height="400" Width="550">

<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>

<Label Grid.Row="0" Grid.Column="1" FontSize="28" VerticalContentAlignment="Center">Budgeter</Label>
<Separator Grid.Row="1"/>
<Label Grid.Row="2" xml:space="preserve" Padding="5,5,5,0">Version: 0.0.1
Copyright (C) 2022 Russell Trahan
This product is licensed under the MIT License.</Label>
<Label Grid.Row="3" Padding="5,0,5,5">
<Hyperlink NavigateUri="https://github.com/rtrahan504/budgeter" RequestNavigate="Hyperlink_RequestNavigate" >https://github.com/rtrahan504/budgeter</Hyperlink>
</Label>
<Border Grid.Row="4" BorderThickness="1">
<ScrollViewer>
<TextBlock xml:space="preserve" ScrollViewer.VerticalScrollBarVisibility="Visible" TextWrapping="Wrap" ScrollViewer.CanContentScroll="True" HorizontalAlignment="Left" Margin="3">Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
<DockPanel Margin="5">
<Label DockPanel.Dock="Top" FontSize="28" VerticalContentAlignment="Center">Budgeter</Label>
<Separator DockPanel.Dock="Top" VerticalAlignment="Top" />
<StackPanel DockPanel.Dock="Top" Margin="5,2,5,0" Orientation="Horizontal">
<Label Padding="0" Margin="0,0,5,0">Version: </Label>
<Label Padding="0" Content="{Binding ElementName=_this, Path=VersionString}"/>
</StackPanel>
<Label DockPanel.Dock="Top" Margin="5,2,5,0" Padding="0">Copyright (C) 2022 Russell Trahan</Label>
<Label DockPanel.Dock="Top" Margin="5,2,5,0" Padding="0">This product is licensed under the MIT License.</Label>
<Label DockPanel.Dock="Top" Margin="5,2,5,5" Padding="0">
<Hyperlink NavigateUri="https://github.com/rtrahan504/budgeter" RequestNavigate="Hyperlink_RequestNavigate" >https://github.com/rtrahan504/budgeter</Hyperlink>
</Label>
<Button DockPanel.Dock="Bottom" Width="75px" HorizontalContentAlignment="Center" Click="CloseButton_Click" HorizontalAlignment="Right" Margin="0,5,0,0">OK</Button>
<Border BorderThickness="1" BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}">
<ScrollViewer>
<TextBlock xml:space="preserve" ScrollViewer.VerticalScrollBarVisibility="Visible" TextWrapping="Wrap" ScrollViewer.CanContentScroll="True" HorizontalAlignment="Left" Margin="3">Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</TextBlock>
</ScrollViewer>
</Border>
<Grid Grid.Row="5" Margin="0,10,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="auto"></ColumnDefinition>
</Grid.ColumnDefinitions>

<Button Grid.Row="6" Grid.Column="1" Width="75px" HorizontalContentAlignment="Center" Click="CloseButton_Click">OK</Button>
</Grid>
</Grid>
</TextBlock>
</ScrollViewer>
</Border>
</DockPanel>
</Window>
25 changes: 11 additions & 14 deletions Budgeter/About.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Budgeter
{
Expand All @@ -28,6 +15,16 @@ public About()
InitializeComponent();
}

public string VersionString
{
get
{
var v = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
return v != null ? v.ToString() : "{unknown}";
}
}


private void CloseButton_Click(object sender, RoutedEventArgs e)
{
this.Close();
Expand Down
11 changes: 1 addition & 10 deletions Budgeter/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows;

namespace Budgeter
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
Expand Down
10 changes: 0 additions & 10 deletions Budgeter/AssemblyInfo.cs

This file was deleted.

5 changes: 0 additions & 5 deletions Budgeter/Budget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.Json;
using System.Runtime.Serialization.Formatters.Binary;
using System.Collections.ObjectModel;
using System.Text.Json.Serialization;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Xml.Linq;

namespace Budgeter
{
Expand Down
10 changes: 1 addition & 9 deletions Budgeter/Budgeter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,8 @@
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<StartupObject>Budgeter.App</StartupObject>
</PropertyGroup>

<ItemGroup>
</ItemGroup>

<ItemGroup>
<Page Remove="Icons\Open_16x.xaml" />
</ItemGroup>

<ItemGroup>
<Resource Include="Icons\Exit_16x.png">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
Expand All @@ -34,5 +27,4 @@
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Resource>
</ItemGroup>

</Project>
3 changes: 3 additions & 0 deletions Budgeter/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@
<MenuItem Header="_Refresh" Name="MenuItem_Refresh" Click="OnMenuClick" Icon="{StaticResource Icon_Refresh}"/>
</MenuItem>
<MenuItem Header="_Account">
<MenuItem x:Name="MenuItem_Account_NewAccount" Header="New Account" Click="OnMenuClick"/>
<MenuItem x:Name="MenuItem_Account_DeleteAccount" Header="Delete Account" Click="OnMenuClick"/>
<Separator/>
<MenuItem x:Name="MenuItem_BalanceSheet_NewCharge" Header="New Charge" Click="OnMenuClick"/>
<MenuItem x:Name="MenuItem_BalanceSheet_NewBalanceOverride" Header="New Balance Override" Click="OnMenuClick"/>
<MenuItem x:Name="MenuItem_BalanceSheet_Activate" Click="OnMenuClick" Header="Activate Transaction"/>
Expand Down
6 changes: 2 additions & 4 deletions Budgeter/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Threading;
using Budgeter;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Linq;

namespace Budgeter
{
Expand Down Expand Up @@ -261,11 +259,11 @@ private void OnMenuClick(object sender, RoutedEventArgs e)
dataGrid_Balance.Items.Refresh();
dataGrid_Templates.Items.Refresh();
}
else if (e.Source == ToolButton_Account_New)
else if (e.Source == ToolButton_Account_New || e.Source == MenuItem_Account_NewAccount)
{
Budgeter.Accounts.Add(new Account());
}
else if (e.Source == ToolButton_Account_Delete)
else if (e.Source == ToolButton_Account_Delete || e.Source == MenuItem_Account_DeleteAccount)
{
if (SelectedAccount != null && System.Windows.MessageBox.Show("Are you sure you want to delete the selected account?", "Confirm", System.Windows.MessageBoxButton.YesNo) == MessageBoxResult.Yes)
{
Expand Down
34 changes: 17 additions & 17 deletions Budgeter/NumericUpDown.xaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<UserControl x:Class="Budgeter.NumericUpDown"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Budgeter"
x:Name="_this"
mc:Ignorable="d" Width="230" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" MinHeight="20" MouseEnter="_this_MouseEnter" MouseLeave="_this_MouseLeave">
<Border Name="border" BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}" BorderThickness="1">
<Grid Margin="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox Grid.Column="0" Name="textBox" VerticalAlignment="Center" MinWidth="25" Text="{Binding ElementName=_this, Path=ValueString}" Background="{x:Null}" Padding="2" BorderBrush="{x:Null}" PreviewKeyDown="TextBox_PreviewKeyDown" BorderThickness ="0"/>
<ScrollBar Grid.Column="1" Name="scrollBar" Scroll="ScrollBar_Scroll" Minimum="0" Maximum="2" Value="1" SmallChange="1" Height="{Binding ActualHeight, ElementName=textBox}" MinHeight="28" BorderThickness="1,0,1,0"/>
</Grid>
</Border>
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Budgeter"
x:Name="_this"
mc:Ignorable="d" Width="230" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" MinHeight="20" MouseEnter="_this_MouseEnter" MouseLeave="_this_MouseLeave">
<Border Name="border" BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}" BorderThickness="1">
<Grid Margin="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox Grid.Column="0" Name="textBox" VerticalAlignment="Center" MinWidth="25" Text="{Binding ElementName=_this, Path=ValueString}" Background="{x:Null}" Padding="2" BorderBrush="{x:Null}" PreviewKeyDown="TextBox_PreviewKeyDown" BorderThickness ="0"/>
<ScrollBar Grid.Column="1" Name="scrollBar" Scroll="ScrollBar_Scroll" Minimum="0" Maximum="2" Value="1" SmallChange="1" Height="{Binding ActualHeight, ElementName=textBox}" MinHeight="28" BorderThickness="1,0,1,0"/>
</Grid>
</Border>
</UserControl>
11 changes: 0 additions & 11 deletions Budgeter/NumericUpDown.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Budgeter
{
Expand Down

0 comments on commit 14a9111

Please sign in to comment.