mirror of
https://github.com/LostArtefacts/TRX.git
synced 2025-04-28 20:58:07 +03:00
tools: clean-up config tool build messages
This fixes VS messages regarding namespaces, removes some redundant usings and SDK parameters, and adds XAML design data contexts.
This commit is contained in:
parent
494c2724fc
commit
de1a63fc74
29 changed files with 69 additions and 66 deletions
|
@ -1,17 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<Nullable>disable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UseWpf>true</UseWpf>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
|
||||
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
|
||||
<AssemblyName>TR1X_ConfigTool</AssemblyName>
|
||||
<ProduceReferenceAssembly>True</ProduceReferenceAssembly>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
|
||||
<EnableWindowsTargeting>true</EnableWindowsTargeting>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<PublishTrimmed>false</PublishTrimmed>
|
||||
|
@ -23,10 +22,8 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="out\**" />
|
||||
<EmbeddedResource Remove="out\**" />
|
||||
<None Remove="out\**" />
|
||||
<Page Remove="out\**" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<ProjectReference Include="..\TRX_ConfigToolLib\TRX_ConfigToolLib.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -65,10 +62,5 @@
|
|||
<EmbeddedResource Include="Resources\Lang\fr.json" />
|
||||
<EmbeddedResource Include="Resources\Lang\it.json" />
|
||||
<EmbeddedResource Include="Resources\specification.json" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\TRX_ConfigToolLib\TRX_ConfigToolLib.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -10,8 +10,7 @@
|
|||
version="6.0.0.0"
|
||||
processorArchitecture="*"
|
||||
publicKeyToken="6595b64144ccf1df"
|
||||
language="*"
|
||||
/>
|
||||
language="*"/>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
</assembly>
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<Nullable>disable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UseWpf>true</UseWpf>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
|
||||
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
|
||||
<AssemblyName>TR2X_ConfigTool</AssemblyName>
|
||||
<ProduceReferenceAssembly>True</ProduceReferenceAssembly>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
|
||||
<EnableWindowsTargeting>true</EnableWindowsTargeting>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<PublishTrimmed>false</PublishTrimmed>
|
||||
|
@ -23,10 +22,8 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="out\**" />
|
||||
<EmbeddedResource Remove="out\**" />
|
||||
<None Remove="out\**" />
|
||||
<Page Remove="out\**" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<ProjectReference Include="..\TRX_ConfigToolLib\TRX_ConfigToolLib.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -59,10 +56,5 @@
|
|||
<EmbeddedResource Include="Resources\Lang\en.json" />
|
||||
<EmbeddedResource Include="Resources\Lang\it.json" />
|
||||
<EmbeddedResource Include="Resources\specification.json" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\TRX_ConfigToolLib\TRX_ConfigToolLib.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -10,8 +10,7 @@
|
|||
version="6.0.0.0"
|
||||
processorArchitecture="*"
|
||||
publicKeyToken="6595b64144ccf1df"
|
||||
language="*"
|
||||
/>
|
||||
language="*"/>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
</assembly>
|
||||
|
|
|
@ -4,7 +4,9 @@
|
|||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:models="clr-namespace:TRX_ConfigToolLib.Models"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance Type=models:AboutWindowViewModel}"
|
||||
Title="{Binding ViewText[window_title_about]}"
|
||||
SizeToContent="WidthAndHeight"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:controls="clr-namespace:TRX_ConfigToolLib.Controls"
|
||||
xmlns:models="clr-namespace:TRX_ConfigToolLib.Models"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance Type=models:CategoryViewModel}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800">
|
||||
|
||||
|
|
|
@ -5,9 +5,11 @@
|
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:controls="clr-namespace:TRX_ConfigToolLib.Controls"
|
||||
xmlns:models="clr-namespace:TRX_ConfigToolLib.Models"
|
||||
xmlns:utils="clr-namespace:TRX_ConfigToolLib.Utils"
|
||||
xmlns:models="clr-namespace:TRX_ConfigToolLib.Models.Specification"
|
||||
xmlns:types="clr-namespace:TRX_ConfigToolLib.Models.Specification.Types"
|
||||
xmlns:converters="clr-namespace:TRX_ConfigToolLib.Utils.Converters"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance Type=models:BaseProperty}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800">
|
||||
|
||||
|
@ -16,11 +18,11 @@
|
|||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="/TRX_ConfigToolLib;component/Resources/styles.xaml" />
|
||||
<ResourceDictionary>
|
||||
<utils:BoolToVisibilityConverter
|
||||
<converters:BoolToVisibilityConverter
|
||||
x:Key="BoolToCollapsedConverter"
|
||||
FalseValue="Collapsed"
|
||||
TrueValue="Visible"/>
|
||||
<utils:BoolToVisibilityConverter
|
||||
<converters:BoolToVisibilityConverter
|
||||
x:Key="InverseBoolToCollapsedConverter"
|
||||
FalseValue="Visible"
|
||||
TrueValue="Collapsed"/>
|
||||
|
@ -43,14 +45,14 @@
|
|||
HorizontalAlignment="Left"
|
||||
Visibility="{Binding IsEnabled, Converter={StaticResource BoolToCollapsedConverter}}">
|
||||
<ContentControl.Resources>
|
||||
<DataTemplate DataType="{x:Type models:BoolProperty}">
|
||||
<DataTemplate DataType="{x:Type types:BoolProperty}">
|
||||
<CheckBox
|
||||
IsChecked="{Binding Value, Mode=TwoWay}"
|
||||
Content="{Binding DataContext.ViewText[checkbox_enabled], RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"
|
||||
Style="{StaticResource PropertyCheckboxStyle}"/>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate DataType="{x:Type models:EnumProperty}">
|
||||
<DataTemplate DataType="{x:Type types:EnumProperty}">
|
||||
<ComboBox
|
||||
ItemsSource="{Binding Options}"
|
||||
SelectedItem="{Binding Value, Mode=TwoWay}"
|
||||
|
@ -58,7 +60,7 @@
|
|||
Style="{StaticResource PropertyComboBoxStyle}"/>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate DataType="{x:Type models:NumericProperty}">
|
||||
<DataTemplate DataType="{x:Type types:NumericProperty}">
|
||||
<controls:NumericUpDown
|
||||
MinValue="{Binding MinimumValue}"
|
||||
MaxValue="{Binding MaximumValue}"
|
||||
|
|
|
@ -5,8 +5,11 @@
|
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:controls="clr-namespace:TRX_ConfigToolLib.Controls"
|
||||
xmlns:models="clr-namespace:TRX_ConfigToolLib.Models"
|
||||
xmlns:utils="clr-namespace:TRX_ConfigToolLib.Utils"
|
||||
xmlns:converters="clr-namespace:TRX_ConfigToolLib.Utils.Converters"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance Type=models:MainWindowViewModel}"
|
||||
ResizeMode="CanResizeWithGrip"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Loaded="Window_Loaded"
|
||||
|
@ -22,15 +25,15 @@
|
|||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="/TRX_ConfigToolLib;component/Resources/styles.xaml" />
|
||||
<ResourceDictionary>
|
||||
<utils:BoolToVisibilityConverter
|
||||
<converters:BoolToVisibilityConverter
|
||||
x:Key="BoolToCollapsedConverter"
|
||||
FalseValue="Collapsed"
|
||||
TrueValue="Visible"/>
|
||||
<utils:BoolToVisibilityConverter
|
||||
<converters:BoolToVisibilityConverter
|
||||
x:Key="InverseBoolToCollapsedConverter"
|
||||
FalseValue="Visible"
|
||||
TrueValue="Collapsed"/>
|
||||
<utils:BoolToVisibilityConverter
|
||||
<converters:BoolToVisibilityConverter
|
||||
x:Key="BoolToHiddenConverter"
|
||||
FalseValue="Hidden"
|
||||
TrueValue="Visible"/>
|
||||
|
@ -126,7 +129,7 @@
|
|||
Grid.Column="1"
|
||||
BorderBrush="#666"
|
||||
BorderThickness="1"
|
||||
Background="{Binding SearchFailStatus, Converter={utils:ConditionalMarkupConverter TrueValue='#FFC7CE', FalseValue='White'}}">
|
||||
Background="{Binding SearchFailStatus, Converter={converters:ConditionalMarkupConverter TrueValue='#FFC7CE', FalseValue='White'}}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="300"/>
|
||||
|
@ -201,8 +204,8 @@
|
|||
Visibility="{Binding IsEditorActive, Converter={StaticResource BoolToHiddenConverter}}"/>
|
||||
<StatusBarItem>
|
||||
<TextBlock
|
||||
Text="{Binding IsEditorDirty, Converter={utils:ConditionalViewTextConverter TrueValue='label_unsaved', FalseValue='label_saved'}}"
|
||||
Foreground="{Binding IsEditorDirty, Converter={utils:ConditionalMarkupConverter TrueValue='DarkRed', FalseValue='DarkGreen'}}"
|
||||
Text="{Binding IsEditorDirty, Converter={converters:ConditionalViewTextConverter TrueValue='label_unsaved', FalseValue='label_saved'}}"
|
||||
Foreground="{Binding IsEditorDirty, Converter={converters:ConditionalMarkupConverter TrueValue='DarkRed', FalseValue='DarkGreen'}}"
|
||||
FontWeight="Bold"
|
||||
Visibility="{Binding IsEditorActive, Converter={StaticResource BoolToHiddenConverter}}"/>
|
||||
</StatusBarItem>
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
namespace TRX_ConfigToolLib.Models;
|
||||
using TRX_ConfigToolLib.Models.Lang;
|
||||
using TRX_ConfigToolLib.Utils;
|
||||
|
||||
namespace TRX_ConfigToolLib.Models;
|
||||
|
||||
public class BaseLanguageViewModel : BaseNotifyPropertyChanged
|
||||
{
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using TRX_ConfigToolLib.Utils;
|
||||
using TRX_ConfigToolLib.Models.Specification;
|
||||
using TRX_ConfigToolLib.Utils;
|
||||
|
||||
namespace TRX_ConfigToolLib.Models;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ using Newtonsoft.Json.Linq;
|
|||
using System.Globalization;
|
||||
using TRX_ConfigToolLib.Utils;
|
||||
|
||||
namespace TRX_ConfigToolLib.Models;
|
||||
namespace TRX_ConfigToolLib.Models.Lang;
|
||||
|
||||
public class Language
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace TRX_ConfigToolLib.Models;
|
||||
namespace TRX_ConfigToolLib.Models.Lang;
|
||||
|
||||
public class PropertyText
|
||||
{
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.IO;
|
|||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using TRX_ConfigToolLib.Controls;
|
||||
using TRX_ConfigToolLib.Models.Specification;
|
||||
using TRX_ConfigToolLib.Utils;
|
||||
|
||||
namespace TRX_ConfigToolLib.Models;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using TRX_ConfigToolLib.Utils;
|
||||
using TRX_ConfigToolLib.Models.Lang;
|
||||
using TRX_ConfigToolLib.Utils;
|
||||
|
||||
namespace TRX_ConfigToolLib.Models;
|
||||
namespace TRX_ConfigToolLib.Models.Specification;
|
||||
|
||||
public abstract class BaseProperty : BaseNotifyPropertyChanged
|
||||
{
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace TRX_ConfigToolLib.Models;
|
||||
using TRX_ConfigToolLib.Models.Lang;
|
||||
|
||||
namespace TRX_ConfigToolLib.Models.Specification;
|
||||
|
||||
public class Category
|
||||
{
|
||||
|
|
|
@ -2,8 +2,9 @@ using Newtonsoft.Json;
|
|||
using Newtonsoft.Json.Linq;
|
||||
using System.IO;
|
||||
using TRX_ConfigToolLib.Utils;
|
||||
using TRX_ConfigToolLib.Utils.Json;
|
||||
|
||||
namespace TRX_ConfigToolLib.Models;
|
||||
namespace TRX_ConfigToolLib.Models.Specification;
|
||||
|
||||
public class Configuration
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace TRX_ConfigToolLib.Models;
|
||||
namespace TRX_ConfigToolLib.Models.Specification;
|
||||
|
||||
public enum DataType
|
||||
{
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace TRX_ConfigToolLib.Models;
|
||||
using TRX_ConfigToolLib.Models.Lang;
|
||||
|
||||
namespace TRX_ConfigToolLib.Models.Specification;
|
||||
|
||||
public class EnumOption
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using TRX_ConfigToolLib.Utils;
|
||||
using TRX_ConfigToolLib.Utils.Json;
|
||||
|
||||
namespace TRX_ConfigToolLib.Models;
|
||||
namespace TRX_ConfigToolLib.Models.Specification;
|
||||
|
||||
public class Specification
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace TRX_ConfigToolLib.Models;
|
||||
namespace TRX_ConfigToolLib.Models.Specification.Types;
|
||||
|
||||
public class BoolProperty : BaseProperty
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace TRX_ConfigToolLib.Models;
|
||||
namespace TRX_ConfigToolLib.Models.Specification.Types;
|
||||
|
||||
public class EnumProperty : BaseProperty
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace TRX_ConfigToolLib.Models;
|
||||
namespace TRX_ConfigToolLib.Models.Specification.Types;
|
||||
|
||||
public class NumericProperty : BaseProperty
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace TRX_ConfigToolLib;
|
||||
namespace TRX_ConfigToolLib.Utils;
|
||||
|
||||
public abstract class BaseNotifyPropertyChanged : INotifyPropertyChanged
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace TRX_ConfigToolLib.Utils;
|
||||
namespace TRX_ConfigToolLib.Utils.Converters;
|
||||
|
||||
[ValueConversion(typeof(bool), typeof(Visibility))]
|
||||
public class BoolToVisibilityConverter : IValueConverter
|
||||
|
|
|
@ -2,7 +2,7 @@ using System.Globalization;
|
|||
using System.Windows.Data;
|
||||
using System.Windows.Markup;
|
||||
|
||||
namespace TRX_ConfigToolLib.Utils;
|
||||
namespace TRX_ConfigToolLib.Utils.Converters;
|
||||
|
||||
public class ConditionalMarkupConverter : MarkupExtension, IValueConverter
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using System.Globalization;
|
||||
using TRX_ConfigToolLib.Models;
|
||||
using TRX_ConfigToolLib.Models.Lang;
|
||||
|
||||
namespace TRX_ConfigToolLib.Utils;
|
||||
namespace TRX_ConfigToolLib.Utils.Converters;
|
||||
|
||||
public class ConditionalViewTextConverter : ConditionalMarkupConverter
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using Newtonsoft.Json;
|
||||
using System.Globalization;
|
||||
|
||||
namespace TRX_ConfigToolLib.Utils;
|
||||
namespace TRX_ConfigToolLib.Utils.Json;
|
||||
|
||||
public class NumericConverter : JsonConverter<decimal>
|
||||
{
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using TRX_ConfigToolLib.Models;
|
||||
using TRX_ConfigToolLib.Models.Specification;
|
||||
using TRX_ConfigToolLib.Models.Specification.Types;
|
||||
|
||||
namespace TRX_ConfigToolLib.Utils;
|
||||
namespace TRX_ConfigToolLib.Utils.Json;
|
||||
|
||||
public class PropertyConverter : JsonConverter
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using TRX_ConfigToolLib.Models;
|
||||
using TRX_ConfigToolLib.Models.Specification;
|
||||
|
||||
namespace TRX_ConfigToolLib.Utils;
|
||||
namespace TRX_ConfigToolLib.Utils.Json;
|
||||
|
||||
public class PropertyResolver : DefaultContractResolver
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue