Added some basic OS properties
This commit is contained in:
parent
692d21d437
commit
20c8d62a21
@ -16,6 +16,7 @@
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
<Style TargetType="Label">
|
||||
<Setter Property="FontFamily" Value="Segoe UI Light"/>
|
||||
<Setter Property="FontSize" Value="24px"/>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
|
@ -70,6 +70,7 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="Util\OSVersionInfo.cs" />
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
@ -9,24 +9,37 @@
|
||||
Title="Derping Drivers - Windows driver settings detection tool"
|
||||
Height="450" Width="800"
|
||||
ShowMaxRestoreButton="False"
|
||||
ResizeMode="NoResize">
|
||||
<Grid>
|
||||
ResizeMode="NoResize"
|
||||
DataContext="{Binding RelativeSource={RelativeSource Self}}">
|
||||
<Grid Margin="15">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Grid.Row="0" />
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="20" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Label Grid.Row="0" Grid.Column="0">Windows version name:</Label>
|
||||
<Label Grid.Row="0" Grid.Column="2" Content="{Binding Path=OsVersionName}"/>
|
||||
|
||||
<Label Grid.Row="1" Grid.Column="0">Windows version number:</Label>
|
||||
<Label Grid.Row="1" Grid.Column="2" Content="{Binding Path=OsVersion}"/>
|
||||
|
||||
<Label Grid.Row="2" Grid.Column="0">Windows architecture:</Label>
|
||||
<Label Grid.Row="2" Grid.Column="2" Content="{Binding Path=OsArchitecture}"/>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Controls:MetroWindow>
|
@ -1,23 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
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;
|
||||
using DerpingDrivers.Util;
|
||||
using MahApps.Metro.Controls;
|
||||
|
||||
namespace DerpingDrivers
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : MetroWindow
|
||||
{
|
||||
@ -25,5 +12,21 @@ namespace DerpingDrivers
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Operating System Architecture display name
|
||||
/// </summary>
|
||||
public string OsArchitecture =>
|
||||
OsVersionInfo.OsBits == OsVersionInfo.SoftwareArchitecture.Bit64 ? "64-bit" : "32-bit";
|
||||
|
||||
/// <summary>
|
||||
/// Operating System display name
|
||||
/// </summary>
|
||||
public string OsVersionName => $"{OsVersionInfo.Name} {OsVersionInfo.Edition}";
|
||||
|
||||
/// <summary>
|
||||
/// Operating System build number
|
||||
/// </summary>
|
||||
public string OsVersion => OsVersionInfo.VersionString;
|
||||
}
|
||||
}
|
1103
DerpingDrivers/Util/OSVersionInfo.cs
Normal file
1103
DerpingDrivers/Util/OSVersionInfo.cs
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user