Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .ignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ csharp/prism/Bin/

# JetBrains dotCover HTML coverage report (generated) embedded in the project report.
report/report/resources/dotcover/

# Vendored third-party: Json.NET (Newtonsoft) XML API docs.
csharp/json.net/
22 changes: 12 additions & 10 deletions csharp/Linux Group Policy/LGP.Components.Database.Mssql/MssqlDB.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#region

// jscpd:ignore-start
#region

using System;
using System.Data;
using System.Data.SqlClient;
Expand All @@ -25,22 +26,22 @@ public class MssqlDb : IDatabaseModule
/// <param name = "user">Username to use in connection</param>
/// <param name = "pass">Password to use in connection</param>
/// <param name = "host">Hostname to use in connection</param>
/// <param name = "dbname">Datbase to use in connection</param>
/// <param name = "dbname">Datbase to use in connection</param> // codespell:ignore datbase
/// <returns></returns>
public bool Connect( string user , string pass , string host , string dbname )
public bool Connect(string user, string pass, string host, string dbname)
{
this._connection = new SqlConnection
{
ConnectionString = string.Format( "user id={0};password={1};server={2};database={3}" , host , user , pass , dbname )
ConnectionString = string.Format("user id={0};password={1};server={2};database={3}", host, user, pass, dbname)
};
try
{
this._connection.Open();
return true;
}
catch( Exception error )
catch (Exception error)
{
Framework.EventBus.Publish( error );
Framework.EventBus.Publish(error);
return false;
}
}
Expand All @@ -61,7 +62,7 @@ public bool Disconnect()
/// </summary>
/// <param name = "sql">sql query</param>
/// <returns></returns>
public DataSet ExecuteQuery( string sql )
public DataSet ExecuteQuery(string sql)
{
return null;
}
Expand All @@ -72,7 +73,7 @@ public DataSet ExecuteQuery( string sql )
/// </summary>
/// <param name = "sql">sql query</param>
/// <returns>int num rows affected</returns>
public int ExecuteNonQuery( string sql )
public int ExecuteNonQuery(string sql)
{
return -1;
}
Expand All @@ -89,4 +90,5 @@ public bool IsConnected()

#endregion
}
}
}
// jscpd:ignore-end
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#region

// jscpd:ignore-start
#region

using System.Windows.Controls;
using LGP.Components.Factory;
using LGP.Components.Factory.Interfaces.Component;
Expand Down Expand Up @@ -32,15 +33,15 @@ public string GetName()
/// <returns>An image</returns>
public Image GetIcon()
{
return Framework.Images.GetImage( "mssql" , "VS2010ImageLibrary" , 14 );
return Framework.Images.GetImage("mssql", "VS2010ImageLibrary", 14);
}


/// <summary>
/// Asks the component to register is menu components
/// </summary>
/// <param name = "menu">The program main menu</param>
public void RegisterMenuEntries( IMenu menu )
public void RegisterMenuEntries(IMenu menu)
{
}

Expand Down Expand Up @@ -99,4 +100,5 @@ public UserControl GetPreferencesControl()

#endregion
}
}
}
// jscpd:ignore-end
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#region

// jscpd:ignore-start
#region

using System;
using System.Windows.Controls;
using LGP.Components.Factory;
Expand Down Expand Up @@ -46,7 +47,7 @@ public UserControl GetControl()
}

/// <summary>
/// Aks the preferences panel to save its entries
/// Aks the preferences panel to save its entries // codespell:ignore aks
/// </summary>
public void Save()
{
Expand All @@ -55,19 +56,19 @@ public void Save()
var port = this.textBox1.Text;
int intport;

regedit.WriteKey( "MssqlPort" , int.TryParse( port , out intport ) ? intport : 3306 );
regedit.WriteKey("MssqlPort", int.TryParse(port, out intport) ? intport : 3306);
}

/// <summary>
/// Asks the preferences to load its settings
/// </summary>
/// <param name="settingsParent"></param>
/// <returns>string</returns>
public void Load( ISettings settingsParent )
public void Load(ISettings settingsParent)
{
this._parent = settingsParent;
var regedit = Framework.Registry;
var port = regedit.ReadKey( "MssqlPort" );
var port = regedit.ReadKey("MssqlPort");
this.textBox1.Text = port ?? "3306";
}

Expand All @@ -77,7 +78,7 @@ public void Load( ISettings settingsParent )
/// <returns>Type</returns>
public Type GetControlType()
{
return typeof( IDatabaseModule );
return typeof(IDatabaseModule);
}

/// <summary>
Expand All @@ -86,14 +87,15 @@ public Type GetControlType()
/// <returns></returns>
public Image GetIcon()
{
return Framework.Images.GetImage( "mssql" , "VS2010ImageLibrary" , 14 );
return Framework.Images.GetImage("mssql", "VS2010ImageLibrary", 14);
}

#endregion

private void SetDefaultPortButtonClickClick( object sender , System.Windows.RoutedEventArgs e )
private void SetDefaultPortButtonClickClick(object sender, System.Windows.RoutedEventArgs e)
{
this.textBox1.Text = "3306";
}
}
}
}
// jscpd:ignore-end
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#region

// jscpd:ignore-start
#region

using System.Windows.Controls;
using LGP.Components.Factory;
using LGP.Components.Factory.Interfaces.Component;
Expand Down Expand Up @@ -32,15 +33,15 @@ public string GetName()
/// <returns>An image</returns>
public Image GetIcon()
{
return Framework.Images.GetImage( "mysql" , "VS2010ImageLibrary" , 14 );
return Framework.Images.GetImage("mysql", "VS2010ImageLibrary", 14);
}


/// <summary>
/// Asks the component to register is menu components
/// </summary>
/// <param name = "menu">The program main menu</param>
public void RegisterMenuEntries( IMenu menu )
public void RegisterMenuEntries(IMenu menu)
{
}

Expand Down Expand Up @@ -99,4 +100,5 @@ public UserControl GetPreferencesControl()

#endregion
}
}
}
// jscpd:ignore-end
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#region

// jscpd:ignore-start
#region

using System;
using System.Windows.Controls;
using LGP.Components.Factory;
Expand Down Expand Up @@ -47,7 +48,7 @@ public UserControl GetControl()
}

/// <summary>
/// Aks the preferences panel to save its entries
/// Aks the preferences panel to save its entries // codespell:ignore aks
/// </summary>
public void Save()
{
Expand All @@ -56,19 +57,19 @@ public void Save()
var port = this.textBox1.Text;
int intport;

regedit.WriteKey( "MysqlPort" , int.TryParse( port , out intport ) ? intport : 3306 );
regedit.WriteKey("MysqlPort", int.TryParse(port, out intport) ? intport : 3306);
}

/// <summary>
/// Asks the preferences to load its settings
/// </summary>
/// <param name="settingsParent"></param>
/// <returns>string</returns>
public void Load( ISettings settingsParent )
public void Load(ISettings settingsParent)
{
this._parent = settingsParent;
var regedit = Framework.Registry;
var port = regedit.ReadKey( "MysqlPort" );
var port = regedit.ReadKey("MysqlPort");
this.textBox1.Text = port ?? "3306";
}

Expand All @@ -78,7 +79,7 @@ public void Load( ISettings settingsParent )
/// <returns>Type</returns>
public Type GetControlType()
{
return typeof( IDatabaseModule );
return typeof(IDatabaseModule);
}

/// <summary>
Expand All @@ -87,13 +88,14 @@ public Type GetControlType()
/// <returns></returns>
public Image GetIcon()
{
return Framework.Images.GetImage( "mysql" , "VS2010ImageLibrary" , 14 );
return Framework.Images.GetImage("mysql", "VS2010ImageLibrary", 14);
}

#endregion

private void SetDefaultPortButtonClickClick( object sender , System.Windows.RoutedEventArgs e )
private void SetDefaultPortButtonClickClick(object sender, System.Windows.RoutedEventArgs e)
{
}
}
}
}
// jscpd:ignore-end
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#region

// jscpd:ignore-start
#region

using System.Data;
using LGP.Components.Factory.Interfaces.Database;

Expand All @@ -20,9 +21,9 @@ public class OracleDb : IDatabaseModule
/// <param name = "user">Username to use in connection</param>
/// <param name = "pass">Password to use in connection</param>
/// <param name = "host">Hostname to use in connection</param>
/// <param name = "dbname">Datbase to use in connection</param>
/// <param name = "dbname">Datbase to use in connection</param> // codespell:ignore datbase
/// <returns></returns>
public bool Connect( string user , string pass , string host , string dbname )
public bool Connect(string user, string pass, string host, string dbname)
{
return true;
}
Expand All @@ -43,7 +44,7 @@ public bool Disconnect()
/// </summary>
/// <param name = "sql">sql query</param>
/// <returns></returns>
public DataSet ExecuteQuery( string sql )
public DataSet ExecuteQuery(string sql)
{
return null;
}
Expand All @@ -54,7 +55,7 @@ public DataSet ExecuteQuery( string sql )
/// </summary>
/// <param name = "sql">sql query</param>
/// <returns>int num rows affected</returns>
public int ExecuteNonQuery( string sql )
public int ExecuteNonQuery(string sql)
{
return -1;
}
Expand All @@ -71,4 +72,5 @@ public bool IsConnected()

#endregion
}
}
}
// jscpd:ignore-end
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#region

// jscpd:ignore-start
#region

using System.Windows.Controls;
using LGP.Components.Factory;
using LGP.Components.Factory.Interfaces.Component;
Expand Down Expand Up @@ -32,15 +33,15 @@ public string GetName()
/// <returns>An image</returns>
public Image GetIcon()
{
return Framework.Images.GetImage( "oracle" , "VS2010ImageLibrary" , 14 );
return Framework.Images.GetImage("oracle", "VS2010ImageLibrary", 14);
}


/// <summary>
/// Asks the component to register is menu components
/// </summary>
/// <param name = "menu">The program main menu</param>
public void RegisterMenuEntries( IMenu menu )
public void RegisterMenuEntries(IMenu menu)
{
}

Expand Down Expand Up @@ -99,4 +100,5 @@ public UserControl GetPreferencesControl()

#endregion
}
}
}
// jscpd:ignore-end
Loading
Loading