Skip to content

Commit c34a89e

Browse files
committed
Apply formatting and var style
1 parent 92005bd commit c34a89e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+637
-653
lines changed

XbTool/BdatEditor/App.config

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
<?xml version="1.0" encoding="utf-8" ?>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
23
<configuration>
3-
<startup>
4-
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
5-
</startup>
4+
<startup>
5+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
6+
</startup>
67
</configuration>

XbTool/BdatEditor/App.xaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
<Application.Resources>
1010
<viewModel:ViewModelLocator x:Key="Locator" d:IsDataSource="True" />
1111
</Application.Resources>
12-
</Application>
12+
</Application>

XbTool/BdatEditor/Bdat/EditTable.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class EditTable
1212
public EditTable(BdatTable bdat)
1313
{
1414
Name = bdat.Name;
15-
foreach (var member in bdat.Members)
15+
foreach (BdatMember member in bdat.Members)
1616
{
1717
Columns.Add(member);
1818
}

XbTool/BdatEditor/MainWindow.xaml

+15-14
Original file line numberDiff line numberDiff line change
@@ -8,40 +8,41 @@
88
Title="Xenoblade 2 BDAT Editor" Height="450" Width="800">
99
<Grid>
1010
<Grid.RowDefinitions>
11-
<RowDefinition Height="Auto"/>
12-
<RowDefinition Height="*"/>
11+
<RowDefinition Height="Auto" />
12+
<RowDefinition Height="*" />
1313
</Grid.RowDefinitions>
1414
<DockPanel Grid.Row="0">
1515
<Menu DockPanel.Dock="Top">
1616
<MenuItem Header="_File">
17-
<MenuItem Header="_Open" Command="{Binding OpenBdatCommand}"/>
17+
<MenuItem Header="_Open" Command="{Binding OpenBdatCommand}" />
1818
</MenuItem>
1919
</Menu>
2020
</DockPanel>
2121

2222
<Grid Grid.Row="1">
2323
<Grid.ColumnDefinitions>
24-
<ColumnDefinition Width="*"/>
25-
<ColumnDefinition Width="5"/>
26-
<ColumnDefinition Width="4*"/>
24+
<ColumnDefinition Width="*" />
25+
<ColumnDefinition Width="5" />
26+
<ColumnDefinition Width="4*" />
2727
</Grid.ColumnDefinitions>
2828
<Grid Grid.Column="0">
2929
<Grid.RowDefinitions>
30-
<RowDefinition Height="*"/>
31-
<RowDefinition Height="Auto"/>
30+
<RowDefinition Height="*" />
31+
<RowDefinition Height="Auto" />
3232
</Grid.RowDefinitions>
33-
<ListBox Grid.Row="0" ItemsSource="{Binding TableNames}" SelectedIndex="{Binding SelectedTable}"/>
33+
<ListBox Grid.Row="0" ItemsSource="{Binding TableNames}" SelectedIndex="{Binding SelectedTable}" />
3434
<StackPanel Grid.Row="1">
35-
<Button Command="{Binding ViewTableCommand}" Content="View Table" VerticalAlignment="Top"/>
36-
<Button Command="{Binding SaveTableCommand}" Content="Save Table" VerticalAlignment="Top"/>
35+
<Button Command="{Binding ViewTableCommand}" Content="View Table" VerticalAlignment="Top" />
36+
<Button Command="{Binding SaveTableCommand}" Content="Save Table" VerticalAlignment="Top" />
3737
</StackPanel>
3838
</Grid>
39-
<GridSplitter Grid.Column="1" ShowsPreview="true" HorizontalAlignment="Stretch" Width="5"/>
39+
<GridSplitter Grid.Column="1" ShowsPreview="true" HorizontalAlignment="Stretch" Width="5" />
4040
<Grid Grid.Column="2">
4141
<DataGrid AutoGenerateColumns="true" CanUserAddRows="False" EnableColumnVirtualization="true"
42-
EnableRowVirtualization="true" ItemsSource="{Binding Path=EditingTable, Mode=TwoWay, IsAsync=True}" />
42+
EnableRowVirtualization="true"
43+
ItemsSource="{Binding Path=EditingTable, Mode=TwoWay, IsAsync=True}" />
4344
</Grid>
4445
</Grid>
4546

4647
</Grid>
47-
</Window>
48+
</Window>

XbTool/BdatEditor/Properties/Settings.Designer.cs

+9-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

XbTool/BdatEditor/ViewModel/MainViewModel.cs

+11-11
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ public void ViewTable()
4747
{
4848
if (!IsFileOpened) return;
4949

50-
var table = BdatTables.Tables[SelectedTable];
50+
BdatTable table = BdatTables.Tables[SelectedTable];
5151
var editTable = new EditTable(table);
5252
EditingTable = new DataTable();
5353
CurrentTable = table;
5454

5555
EditingTable.Columns.Add(new DataColumn("ID") { ReadOnly = true });
56-
foreach (var col in editTable.Columns)
56+
foreach (BdatMember col in editTable.Columns)
5757
{
58-
DataColumn column = new DataColumn();
58+
var column = new DataColumn();
5959
if (col.Type != BdatMemberType.Scalar)
6060
{
6161
column.ReadOnly = true;
@@ -65,17 +65,17 @@ public void ViewTable()
6565
EditingTable.Columns.Add(column);
6666
}
6767

68-
foreach (var item in editTable.Items)
68+
foreach (object[] item in editTable.Items)
6969
{
70-
var row = EditingTable.NewRow();
70+
DataRow row = EditingTable.NewRow();
7171
row.ItemArray = item;
7272
EditingTable.Rows.Add(item);
7373
}
7474

7575
EditingTable.AcceptChanges();
7676
IsTableOpened = true;
7777

78-
var temp = EditingTable;
78+
DataTable temp = EditingTable;
7979
EditingTable = null;
8080
EditingTable = temp;
8181
}
@@ -84,17 +84,17 @@ public void SaveTable()
8484
{
8585
if (!IsTableOpened) return;
8686

87-
var rows = EditingTable.GetChanges();
87+
DataTable rows = EditingTable.GetChanges();
8888
if (rows == null) return;
89-
var members = CurrentTable.Members;
89+
BdatMember[] members = CurrentTable.Members;
9090

91-
foreach (var row in rows.Rows.Cast<DataRow>())
91+
foreach (DataRow row in rows.Rows.Cast<DataRow>())
9292
{
93-
var itemId = int.Parse((string)row.ItemArray[0]);
93+
int itemId = int.Parse((string)row.ItemArray[0]);
9494
for (int m = 0; m < members.Length; m++)
9595
{
9696
if (members[m].Type != BdatMemberType.Scalar) continue;
97-
var value = (string)row.ItemArray[m + 1];
97+
string value = (string)row.ItemArray[m + 1];
9898
try
9999
{
100100
CurrentTable.WriteValue(itemId, members[m].Name, value);

XbTool/SaveEditor/App.config

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
23
<configuration>
3-
<startup>
4-
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/>
5-
</startup>
6-
</configuration>
4+
<startup>
5+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
6+
</startup>
7+
</configuration>

XbTool/SaveEditor/App.xaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
<Application.Resources>
1010
<viewModel:ViewModelLocator x:Key="Locator" d:IsDataSource="True" />
1111
</Application.Resources>
12-
</Application>
12+
</Application>
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
<UserControl x:Class="SaveEditor.Controls.GameTimeControl"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
4+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:local="clr-namespace:SaveEditor.Controls"
77
x:Name="GameTime"
8-
mc:Ignorable="d"
8+
mc:Ignorable="d"
99
d:DesignHeight="450" d:DesignWidth="800">
1010
<Grid>
1111
<StackPanel Orientation="Horizontal">
1212
<StackPanel.Resources>
1313
<Style TargetType="{x:Type local:LabeledField}">
14-
<Setter Property="Margin" Value="0,0,7,0"/>
15-
<Setter Property="Width" Value="50"/>
14+
<Setter Property="Margin" Value="0,0,7,0" />
15+
<Setter Property="Width" Value="50" />
1616
</Style>
1717
</StackPanel.Resources>
18-
<local:LabeledField Label="Day" Value="{Binding Path=Value.Day, ElementName=GameTime}"/>
19-
<local:LabeledField Label="Hour" Value="{Binding Path=Value.Hour, ElementName=GameTime}"/>
20-
<local:LabeledField Label="Minute" Value="{Binding Path=Value.Minute, ElementName=GameTime}"/>
21-
<local:LabeledField Label="Second" Value="{Binding Path=Value.Second, ElementName=GameTime}"/>
18+
<local:LabeledField Label="Day" Value="{Binding Path=Value.Day, ElementName=GameTime}" />
19+
<local:LabeledField Label="Hour" Value="{Binding Path=Value.Hour, ElementName=GameTime}" />
20+
<local:LabeledField Label="Minute" Value="{Binding Path=Value.Minute, ElementName=GameTime}" />
21+
<local:LabeledField Label="Second" Value="{Binding Path=Value.Second, ElementName=GameTime}" />
2222
</StackPanel>
2323
</Grid>
24-
</UserControl>
24+
</UserControl>
+11-11
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
<UserControl x:Class="SaveEditor.Controls.ItemControl"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
4+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:local="clr-namespace:SaveEditor.Controls"
77
x:Name="ItemCon"
8-
mc:Ignorable="d"
8+
mc:Ignorable="d"
99
d:DesignHeight="450" d:DesignWidth="800">
1010
<Grid>
1111
<StackPanel Orientation="Horizontal">
1212
<StackPanel.Resources>
1313
<Style TargetType="{x:Type local:LabeledField}">
14-
<Setter Property="Margin" Value="5"/>
15-
<Setter Property="Width" Value="50"/>
14+
<Setter Property="Margin" Value="5" />
15+
<Setter Property="Width" Value="50" />
1616
</Style>
1717
</StackPanel.Resources>
18-
<local:LabeledField Label="Id" Value="{Binding Path=Value.Id, ElementName=ItemCon}"/>
19-
<local:LabeledField Label="Count" Value="{Binding Path=Value.Count, ElementName=ItemCon}"/>
20-
<local:LabeledField Label="Equipped" Value="{Binding Path=Value.Equipped, ElementName=ItemCon}"/>
21-
<local:PlayTimeControl Margin="5" Value="{Binding Path=Value.Time, ElementName=ItemCon}"/>
22-
<local:LabeledField Label="Serial" Value="{Binding Path=Value.Serial, ElementName=ItemCon}"/>
18+
<local:LabeledField Label="Id" Value="{Binding Path=Value.Id, ElementName=ItemCon}" />
19+
<local:LabeledField Label="Count" Value="{Binding Path=Value.Count, ElementName=ItemCon}" />
20+
<local:LabeledField Label="Equipped" Value="{Binding Path=Value.Equipped, ElementName=ItemCon}" />
21+
<local:PlayTimeControl Margin="5" Value="{Binding Path=Value.Time, ElementName=ItemCon}" />
22+
<local:LabeledField Label="Serial" Value="{Binding Path=Value.Serial, ElementName=ItemCon}" />
2323

2424
</StackPanel>
2525
</Grid>
26-
</UserControl>
26+
</UserControl>
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<UserControl x:Class="SaveEditor.Controls.LabeledField"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
4+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
x:Name="Lf"
77
mc:Ignorable="d"
88
d:DesignHeight="100" d:DesignWidth="200">
99
<Grid Background="White">
1010

1111
<StackPanel Orientation="Vertical">
12-
<TextBlock Text="{Binding Path=Label, ElementName=Lf}"/>
13-
<TextBox Text="{Binding Path=Value, ElementName=Lf}"/>
12+
<TextBlock Text="{Binding Path=Label, ElementName=Lf}" />
13+
<TextBox Text="{Binding Path=Value, ElementName=Lf}" />
1414
</StackPanel>
1515
</Grid>
16-
</UserControl>
16+
</UserControl>
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
<UserControl x:Class="SaveEditor.Controls.PlayTimeControl"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
4+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:local="clr-namespace:SaveEditor.Controls"
77
x:Name="PlayTime"
8-
mc:Ignorable="d"
8+
mc:Ignorable="d"
99
d:DesignHeight="450" d:DesignWidth="800">
1010
<Grid>
1111
<StackPanel Orientation="Horizontal">
1212
<StackPanel.Resources>
1313
<Style TargetType="{x:Type local:LabeledField}">
14-
<Setter Property="Margin" Value="0,0,7,0"/>
15-
<Setter Property="Width" Value="50"/>
14+
<Setter Property="Margin" Value="0,0,7,0" />
15+
<Setter Property="Width" Value="50" />
1616
</Style>
1717
</StackPanel.Resources>
18-
<local:LabeledField Margin="0,0,5,0" Label="Hour" Value="{Binding Path=Value.Hour, ElementName=PlayTime}"/>
19-
<local:LabeledField Margin="5,0,5,0" Label="Minute" Value="{Binding Path=Value.Minute, ElementName=PlayTime}"/>
20-
<local:LabeledField Margin="5,0,0,0" Label="Second" Value="{Binding Path=Value.Second, ElementName=PlayTime}"/>
18+
<local:LabeledField Margin="0,0,5,0" Label="Hour" Value="{Binding Path=Value.Hour, ElementName=PlayTime}" />
19+
<local:LabeledField Margin="5,0,5,0" Label="Minute"
20+
Value="{Binding Path=Value.Minute, ElementName=PlayTime}" />
21+
<local:LabeledField Margin="5,0,0,0" Label="Second"
22+
Value="{Binding Path=Value.Second, ElementName=PlayTime}" />
2123
</StackPanel>
2224
</Grid>
23-
</UserControl>
25+
</UserControl>
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
<UserControl x:Class="SaveEditor.Controls.RealTimeControl"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
4+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:local="clr-namespace:SaveEditor.Controls"
77
x:Name="RealTime"
8-
mc:Ignorable="d"
8+
mc:Ignorable="d"
99
d:DesignHeight="50" d:DesignWidth="500">
1010
<Grid>
1111
<StackPanel Orientation="Horizontal">
1212
<StackPanel.Resources>
1313
<Style TargetType="{x:Type local:LabeledField}">
14-
<Setter Property="Margin" Value="0,0,7,0"/>
15-
<Setter Property="Width" Value="50"/>
14+
<Setter Property="Margin" Value="0,0,7,0" />
15+
<Setter Property="Width" Value="50" />
1616
</Style>
1717
</StackPanel.Resources>
18-
<local:LabeledField Label="Year" Value="{Binding Path=Value.Year, ElementName=RealTime}"/>
19-
<local:LabeledField Label="Month" Value="{Binding Path=Value.Month, ElementName=RealTime}"/>
20-
<local:LabeledField Label="Day" Value="{Binding Path=Value.Day, ElementName=RealTime}"/>
21-
<local:LabeledField Label="Hour" Value="{Binding Path=Value.Hour, ElementName=RealTime}"/>
22-
<local:LabeledField Label="Minute" Value="{Binding Path=Value.Minute, ElementName=RealTime}"/>
23-
<local:LabeledField Label="Second" Value="{Binding Path=Value.Second, ElementName=RealTime}"/>
24-
<local:LabeledField Label="MSecond" Value="{Binding Path=Value.Millisecond, ElementName=RealTime}"/>
18+
<local:LabeledField Label="Year" Value="{Binding Path=Value.Year, ElementName=RealTime}" />
19+
<local:LabeledField Label="Month" Value="{Binding Path=Value.Month, ElementName=RealTime}" />
20+
<local:LabeledField Label="Day" Value="{Binding Path=Value.Day, ElementName=RealTime}" />
21+
<local:LabeledField Label="Hour" Value="{Binding Path=Value.Hour, ElementName=RealTime}" />
22+
<local:LabeledField Label="Minute" Value="{Binding Path=Value.Minute, ElementName=RealTime}" />
23+
<local:LabeledField Label="Second" Value="{Binding Path=Value.Second, ElementName=RealTime}" />
24+
<local:LabeledField Label="MSecond" Value="{Binding Path=Value.Millisecond, ElementName=RealTime}" />
2525
</StackPanel>
2626
</Grid>
27-
</UserControl>
27+
</UserControl>

0 commit comments

Comments
 (0)