Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
LoneWandererProductions committed Dec 26, 2023
1 parent b92cc98 commit 240d117
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 46 deletions.
2 changes: 1 addition & 1 deletion CommonControls/FileIoHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static string ShowFolder(string folder)
}

/// <summary>
/// Shows the login screen.
/// Shows the login screen.
/// </summary>
/// <returns>Connection String</returns>
public static string ShowLoginScreen()
Expand Down
2 changes: 1 addition & 1 deletion CommonControls/SqlConnect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ internal SqlConnect(string database, string server, bool isActive)
/// <value>
/// <c>true</c> if [trust server certificate]; otherwise, <c>false</c>.
/// </value>
internal bool TrustServerCertificate { get; set; } = true;
internal bool TrustServerCertificate { get; set; }

/// <summary>
/// Gets the connection string to a SQL Server.
Expand Down
50 changes: 28 additions & 22 deletions CommonControls/SqlLogin.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,39 @@
</Window.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="5"/>
<RowDefinition Height="25"/>
<RowDefinition Height="25"/>
<RowDefinition Height="25"/>
<RowDefinition Height="25"/>
<RowDefinition Height="25"/>
<RowDefinition Height="25"/>
<RowDefinition Height="25"/>
<RowDefinition Height="25"/>
<RowDefinition Height="5" />
<RowDefinition Height="25" />
<RowDefinition Height="25" />
<RowDefinition Height="25" />
<RowDefinition Height="25" />
<RowDefinition Height="25" />
<RowDefinition Height="25" />
<RowDefinition Height="25" />
<RowDefinition Height="25" />
<RowDefinition Height="50" />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="5" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="5" />
</Grid.ColumnDefinitions>
<Label Content="Server Name" Grid.Column="1" Grid.Row="1"/>
<Label Content="Database Name" Grid.Column="1" Grid.Row="3"/>
<Label Content="Trust Server Certificate" Grid.Column="1" Grid.Row="5"/>
<CheckBox Grid.Column="2" Grid.Row="5" IsEnabled="{Binding Path =IsActive}"/>
<TextBox Grid.ColumnSpan="2" Grid.Column="2" Grid.Row="1" TextWrapping="Wrap" Text="{Binding Path=Server, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<TextBox Grid.ColumnSpan="2" Grid.Column="2" Grid.Row="3" TextWrapping="Wrap" Text="{Binding Path=Database, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<Button Content="Connect" Grid.Column="2" HorizontalAlignment="Left" Grid.Row="7" VerticalAlignment="Top" Command="{Binding ConnectCommand}"/>
<Button Content="Close" Grid.Column="3" HorizontalAlignment="Left" Grid.Row="7" VerticalAlignment="Top" Command="{Binding CloseCommand}"/>
<TextBox Grid.ColumnSpan="2" Grid.Column="2" HorizontalAlignment="Stretch" Grid.Row="9" TextWrapping="Wrap" VerticalAlignment="Stretch" Text="{Binding Path=Log, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsEnabled="False"/>
<Label Content="Server Name" Grid.Column="1" Grid.Row="1" />
<Label Content="Database Name" Grid.Column="1" Grid.Row="3" />
<Label Content="Trust Server Certificate" Grid.Column="1" Grid.Row="5" />
<CheckBox Grid.Column="2" Grid.Row="5" IsEnabled="{Binding Path =IsActive}" />
<TextBox Grid.ColumnSpan="2" Grid.Column="2" Grid.Row="1" TextWrapping="Wrap"
Text="{Binding Path=Server, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<TextBox Grid.ColumnSpan="2" Grid.Column="2" Grid.Row="3" TextWrapping="Wrap"
Text="{Binding Path=Database, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<Button Content="Connect" Grid.Column="2" HorizontalAlignment="Left" Grid.Row="7" VerticalAlignment="Top"
Command="{Binding ConnectCommand}" />
<Button Content="Close" Grid.Column="3" HorizontalAlignment="Left" Grid.Row="7" VerticalAlignment="Top"
Command="{Binding CloseCommand}" />
<TextBox Grid.ColumnSpan="2" Grid.Column="2" HorizontalAlignment="Stretch" Grid.Row="9" TextWrapping="Wrap"
VerticalAlignment="Stretch"
Text="{Binding Path=Log, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsEnabled="False" />
</Grid>
</Window>
</Window>
6 changes: 3 additions & 3 deletions CommonControls/SqlLogin.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ namespace CommonControls
{
/// <inheritdoc cref="Window" />
/// <summary>
/// Login Window for Sql Server
/// Login Window for Sql Server
/// </summary>
/// <seealso cref="Window" />
/// <seealso cref="IComponentConnector" />
public partial class SqlLogin
public sealed partial class SqlLogin
{
/// <inheritdoc />
/// <summary>
/// Initializes a new instance of the <see cref="T:CommonControls.SqlLogin" /> class.
/// Initializes a new instance of the <see cref="T:CommonControls.SqlLogin" /> class.
/// </summary>
public SqlLogin()
{
Expand Down
12 changes: 6 additions & 6 deletions CommonControls/SqlView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ namespace CommonControls
public sealed class SqlView : INotifyPropertyChanged
{
/// <summary>
/// The connect command
/// The close command
/// </summary>
private ICommand _connectCommand;
private ICommand _closeCommand;

/// <summary>
/// The close command
/// The connect command
/// </summary>
private ICommand _closeCommand;
private ICommand _connectCommand;

/// <summary>
/// The data base
Expand Down Expand Up @@ -143,10 +143,10 @@ public string Log
_connectCommand ??= new DelegateCommand<object>(ConnectAction, CanExecute);

/// <summary>
/// Gets the close command.
/// Gets the close command.
/// </summary>
/// <value>
/// The close command.
/// The close command.
/// </value>
public ICommand CloseCommand =>
_closeCommand ??= new DelegateCommand<object>(CloseAction, CanExecute);
Expand Down
3 changes: 2 additions & 1 deletion CommonControls/Thumbnails.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ public sealed partial class Thumbnails
/// <summary>
/// The Thumb Cell Size
/// </summary>
public static readonly DependencyProperty DepThumbCellSize = DependencyProperty.Register(nameof(DepThumbCellSize),
public static readonly DependencyProperty DepThumbCellSize = DependencyProperty.Register(
nameof(DepThumbCellSize),
typeof(int),
typeof(Thumbnails), null);

Expand Down
7 changes: 5 additions & 2 deletions CommonLibraryGuiTests/CommonCtrl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public void Win32Api()
}

/// <summary>
/// Test of the ConnectionString Dialog.
/// Test of the ConnectionString Dialog.
/// </summary>
[Test]
[Apartment(ApartmentState.STA)]
Expand All @@ -130,7 +130,10 @@ public void ConnectionString()
var result = login.View.ConnectionString;
login.Close();

Assert.IsTrue(result.Equals(@"PersistSecurity Info= False;TrustServerCertificate=False;Integrated Security=True;SqlServer;MyDB\Hello", StringComparison.Ordinal),
Assert.IsTrue(
result.Equals(
@"PersistSecurity Info= False;TrustServerCertificate=False;Integrated Security=True;SqlServer;MyDB\Hello",
StringComparison.Ordinal),
string.Concat("Wrong Connection string: ", result));
}
}
Expand Down
5 changes: 4 additions & 1 deletion CommonLibrarySqlLiteTests/SqlLiteInternals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ public void TestCreateDatabaseBigInternals()

var data = Target.Pragma_index_list(TableThree);

if (data == null) Assert.Fail("Pragma was empty");
if (data == null)
{
Assert.Fail("Pragma was empty");
}

foreach (var item in data)
{
Expand Down
4 changes: 2 additions & 2 deletions CommonLibraryTests/Communication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ namespace CommonLibraryTests
public class Communication
{
/// <summary>
/// The path
/// The path
/// </summary>
private readonly string _path = Path.Combine(Directory.GetCurrentDirectory(), nameof(Communication));

/// <summary>
/// Communicationses this instance.
/// Communicationses this instance.
/// </summary>
[TestMethod]
public void Communications()
Expand Down
4 changes: 2 additions & 2 deletions Mathematics/Vector2D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,12 @@ public double Angle()
}

/// <summary>
/// Converts to matrix.
/// Converts to matrix.
/// </summary>
/// <returns>Vector transformed to Matrix</returns>
public BaseMatrix ToMatrix()
{
return new() { [0, 0] = X, [0, 1] = Y};
return new BaseMatrix { [0, 0] = X, [0, 1] = Y };
}
}
}
10 changes: 5 additions & 5 deletions Mathematics/Vector3D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,22 +217,22 @@ public Vector3D Normalize()
}

/// <summary>
/// Converts to matrix.
/// Converts to matrix.
/// </summary>
/// <returns>Vector transformed to Matrix</returns>
public BaseMatrix ToMatrix()
{
return new() {[0, 0] = X, [0, 1] = Y, [0, 2] = Z};
return new BaseMatrix { [0, 0] = X, [0, 1] = Y, [0, 2] = Z };
}

/// <summary>
/// Converts to matrix.
/// In this case especially for 3D Projection
/// Converts to matrix.
/// In this case especially for 3D Projection
/// </summary>
/// <returns>Vector transformed to Matrix</returns>
public BaseMatrix To3DMatrix()
{
return new() { [0, 0] = X, [0, 1] = Y, [0, 2] = Z, [0, 3] = 1 };
return new BaseMatrix { [0, 0] = X, [0, 1] = Y, [0, 2] = Z, [0, 3] = 1 };
}
}
}

0 comments on commit 240d117

Please sign in to comment.