diff --git a/.ignore b/.ignore
index 736de06..d0995a3 100644
--- a/.ignore
+++ b/.ignore
@@ -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/
diff --git a/csharp/Linux Group Policy/LGP.Components.Database.Mssql/MssqlDB.cs b/csharp/Linux Group Policy/LGP.Components.Database.Mssql/MssqlDB.cs
index c89338e..dc3e2b8 100644
--- a/csharp/Linux Group Policy/LGP.Components.Database.Mssql/MssqlDB.cs
+++ b/csharp/Linux Group Policy/LGP.Components.Database.Mssql/MssqlDB.cs
@@ -1,5 +1,6 @@
-#region
-
+// jscpd:ignore-start
+#region
+
using System;
using System.Data;
using System.Data.SqlClient;
@@ -25,22 +26,22 @@ public class MssqlDb : IDatabaseModule
/// Username to use in connection
/// Password to use in connection
/// Hostname to use in connection
- /// Datbase to use in connection
+ /// Datbase to use in connection // codespell:ignore datbase
///
- 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;
}
}
@@ -61,7 +62,7 @@ public bool Disconnect()
///
/// sql query
///
- public DataSet ExecuteQuery( string sql )
+ public DataSet ExecuteQuery(string sql)
{
return null;
}
@@ -72,7 +73,7 @@ public DataSet ExecuteQuery( string sql )
///
/// sql query
/// int num rows affected
- public int ExecuteNonQuery( string sql )
+ public int ExecuteNonQuery(string sql)
{
return -1;
}
@@ -89,4 +90,5 @@ public bool IsConnected()
#endregion
}
-}
\ No newline at end of file
+}
+// jscpd:ignore-end
diff --git a/csharp/Linux Group Policy/LGP.Components.Database.Mssql/Plugin.cs b/csharp/Linux Group Policy/LGP.Components.Database.Mssql/Plugin.cs
index 58607cd..760c300 100644
--- a/csharp/Linux Group Policy/LGP.Components.Database.Mssql/Plugin.cs
+++ b/csharp/Linux Group Policy/LGP.Components.Database.Mssql/Plugin.cs
@@ -1,5 +1,6 @@
-#region
-
+// jscpd:ignore-start
+#region
+
using System.Windows.Controls;
using LGP.Components.Factory;
using LGP.Components.Factory.Interfaces.Component;
@@ -32,7 +33,7 @@ public string GetName()
/// An image
public Image GetIcon()
{
- return Framework.Images.GetImage( "mssql" , "VS2010ImageLibrary" , 14 );
+ return Framework.Images.GetImage("mssql", "VS2010ImageLibrary", 14);
}
@@ -40,7 +41,7 @@ public Image GetIcon()
/// Asks the component to register is menu components
///
/// The program main menu
- public void RegisterMenuEntries( IMenu menu )
+ public void RegisterMenuEntries(IMenu menu)
{
}
@@ -99,4 +100,5 @@ public UserControl GetPreferencesControl()
#endregion
}
-}
\ No newline at end of file
+}
+// jscpd:ignore-end
diff --git a/csharp/Linux Group Policy/LGP.Components.Database.Mssql/Preferences.xaml.cs b/csharp/Linux Group Policy/LGP.Components.Database.Mssql/Preferences.xaml.cs
index 4e66814..f111fa6 100644
--- a/csharp/Linux Group Policy/LGP.Components.Database.Mssql/Preferences.xaml.cs
+++ b/csharp/Linux Group Policy/LGP.Components.Database.Mssql/Preferences.xaml.cs
@@ -1,5 +1,6 @@
-#region
-
+// jscpd:ignore-start
+#region
+
using System;
using System.Windows.Controls;
using LGP.Components.Factory;
@@ -46,7 +47,7 @@ public UserControl GetControl()
}
///
- /// Aks the preferences panel to save its entries
+ /// Aks the preferences panel to save its entries // codespell:ignore aks
///
public void Save()
{
@@ -55,7 +56,7 @@ 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);
}
///
@@ -63,11 +64,11 @@ public void Save()
///
///
/// string
- 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";
}
@@ -77,7 +78,7 @@ public void Load( ISettings settingsParent )
/// Type
public Type GetControlType()
{
- return typeof( IDatabaseModule );
+ return typeof(IDatabaseModule);
}
///
@@ -86,14 +87,15 @@ public Type GetControlType()
///
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";
}
}
-}
\ No newline at end of file
+}
+// jscpd:ignore-end
diff --git a/csharp/Linux Group Policy/LGP.Components.Database.Mysql/Plugin.cs b/csharp/Linux Group Policy/LGP.Components.Database.Mysql/Plugin.cs
index ad04fb4..04d57b7 100644
--- a/csharp/Linux Group Policy/LGP.Components.Database.Mysql/Plugin.cs
+++ b/csharp/Linux Group Policy/LGP.Components.Database.Mysql/Plugin.cs
@@ -1,5 +1,6 @@
-#region
-
+// jscpd:ignore-start
+#region
+
using System.Windows.Controls;
using LGP.Components.Factory;
using LGP.Components.Factory.Interfaces.Component;
@@ -32,7 +33,7 @@ public string GetName()
/// An image
public Image GetIcon()
{
- return Framework.Images.GetImage( "mysql" , "VS2010ImageLibrary" , 14 );
+ return Framework.Images.GetImage("mysql", "VS2010ImageLibrary", 14);
}
@@ -40,7 +41,7 @@ public Image GetIcon()
/// Asks the component to register is menu components
///
/// The program main menu
- public void RegisterMenuEntries( IMenu menu )
+ public void RegisterMenuEntries(IMenu menu)
{
}
@@ -99,4 +100,5 @@ public UserControl GetPreferencesControl()
#endregion
}
-}
\ No newline at end of file
+}
+// jscpd:ignore-end
diff --git a/csharp/Linux Group Policy/LGP.Components.Database.Mysql/Preferences.xaml.cs b/csharp/Linux Group Policy/LGP.Components.Database.Mysql/Preferences.xaml.cs
index 5c98484..cb30dd1 100644
--- a/csharp/Linux Group Policy/LGP.Components.Database.Mysql/Preferences.xaml.cs
+++ b/csharp/Linux Group Policy/LGP.Components.Database.Mysql/Preferences.xaml.cs
@@ -1,5 +1,6 @@
-#region
-
+// jscpd:ignore-start
+#region
+
using System;
using System.Windows.Controls;
using LGP.Components.Factory;
@@ -47,7 +48,7 @@ public UserControl GetControl()
}
///
- /// Aks the preferences panel to save its entries
+ /// Aks the preferences panel to save its entries // codespell:ignore aks
///
public void Save()
{
@@ -56,7 +57,7 @@ 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);
}
///
@@ -64,11 +65,11 @@ public void Save()
///
///
/// string
- 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";
}
@@ -78,7 +79,7 @@ public void Load( ISettings settingsParent )
/// Type
public Type GetControlType()
{
- return typeof( IDatabaseModule );
+ return typeof(IDatabaseModule);
}
///
@@ -87,13 +88,14 @@ public Type GetControlType()
///
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)
{
}
}
-}
\ No newline at end of file
+}
+// jscpd:ignore-end
diff --git a/csharp/Linux Group Policy/LGP.Components.Database.Oracle/OracleDB.cs b/csharp/Linux Group Policy/LGP.Components.Database.Oracle/OracleDB.cs
index 7fcbdf0..1384a9d 100644
--- a/csharp/Linux Group Policy/LGP.Components.Database.Oracle/OracleDB.cs
+++ b/csharp/Linux Group Policy/LGP.Components.Database.Oracle/OracleDB.cs
@@ -1,5 +1,6 @@
-#region
-
+// jscpd:ignore-start
+#region
+
using System.Data;
using LGP.Components.Factory.Interfaces.Database;
@@ -20,9 +21,9 @@ public class OracleDb : IDatabaseModule
/// Username to use in connection
/// Password to use in connection
/// Hostname to use in connection
- /// Datbase to use in connection
+ /// Datbase to use in connection // codespell:ignore datbase
///
- public bool Connect( string user , string pass , string host , string dbname )
+ public bool Connect(string user, string pass, string host, string dbname)
{
return true;
}
@@ -43,7 +44,7 @@ public bool Disconnect()
///
/// sql query
///
- public DataSet ExecuteQuery( string sql )
+ public DataSet ExecuteQuery(string sql)
{
return null;
}
@@ -54,7 +55,7 @@ public DataSet ExecuteQuery( string sql )
///
/// sql query
/// int num rows affected
- public int ExecuteNonQuery( string sql )
+ public int ExecuteNonQuery(string sql)
{
return -1;
}
@@ -71,4 +72,5 @@ public bool IsConnected()
#endregion
}
-}
\ No newline at end of file
+}
+// jscpd:ignore-end
diff --git a/csharp/Linux Group Policy/LGP.Components.Database.Oracle/Plugin.cs b/csharp/Linux Group Policy/LGP.Components.Database.Oracle/Plugin.cs
index bd0acea..60c3beb 100644
--- a/csharp/Linux Group Policy/LGP.Components.Database.Oracle/Plugin.cs
+++ b/csharp/Linux Group Policy/LGP.Components.Database.Oracle/Plugin.cs
@@ -1,5 +1,6 @@
-#region
-
+// jscpd:ignore-start
+#region
+
using System.Windows.Controls;
using LGP.Components.Factory;
using LGP.Components.Factory.Interfaces.Component;
@@ -32,7 +33,7 @@ public string GetName()
/// An image
public Image GetIcon()
{
- return Framework.Images.GetImage( "oracle" , "VS2010ImageLibrary" , 14 );
+ return Framework.Images.GetImage("oracle", "VS2010ImageLibrary", 14);
}
@@ -40,7 +41,7 @@ public Image GetIcon()
/// Asks the component to register is menu components
///
/// The program main menu
- public void RegisterMenuEntries( IMenu menu )
+ public void RegisterMenuEntries(IMenu menu)
{
}
@@ -99,4 +100,5 @@ public UserControl GetPreferencesControl()
#endregion
}
-}
\ No newline at end of file
+}
+// jscpd:ignore-end
diff --git a/csharp/Linux Group Policy/LGP.Components.Database.Oracle/Preferences.xaml.cs b/csharp/Linux Group Policy/LGP.Components.Database.Oracle/Preferences.xaml.cs
index 121ac6c..42098b7 100644
--- a/csharp/Linux Group Policy/LGP.Components.Database.Oracle/Preferences.xaml.cs
+++ b/csharp/Linux Group Policy/LGP.Components.Database.Oracle/Preferences.xaml.cs
@@ -1,5 +1,6 @@
-#region
-
+// jscpd:ignore-start
+#region
+
using System;
using System.Windows.Controls;
using LGP.Components.Factory;
@@ -46,7 +47,7 @@ public UserControl GetControl()
}
///
- /// Aks the preferences panel to save its entries
+ /// Aks the preferences panel to save its entries // codespell:ignore aks
///
public void Save()
{
@@ -55,7 +56,7 @@ public void Save()
var port = this.textBox1.Text;
int intport;
- regedit.WriteKey( "OraclePort" , int.TryParse( port , out intport ) ? intport : 3306 );
+ regedit.WriteKey("OraclePort", int.TryParse(port, out intport) ? intport : 3306);
}
///
@@ -63,11 +64,11 @@ public void Save()
///
///
/// string
- public void Load( ISettings settingsParent )
+ public void Load(ISettings settingsParent)
{
this._parent = settingsParent;
var regedit = Framework.Registry;
- var port = regedit.ReadKey( "OraclePort" );
+ var port = regedit.ReadKey("OraclePort");
this.textBox1.Text = port ?? "3306";
}
@@ -77,7 +78,7 @@ public void Load( ISettings settingsParent )
/// Type
public Type GetControlType()
{
- return typeof( IDatabaseModule );
+ return typeof(IDatabaseModule);
}
///
@@ -86,13 +87,14 @@ public Type GetControlType()
/// An image
public Image GetIcon()
{
- return Framework.Images.GetImage( "oracle" , "VS2010ImageLibrary" , 14 );
+ return Framework.Images.GetImage("oracle", "VS2010ImageLibrary", 14);
}
#endregion
- private void SetDefaultPortButtonClickClick( object sender , System.Windows.RoutedEventArgs e )
+ private void SetDefaultPortButtonClickClick(object sender, System.Windows.RoutedEventArgs e)
{
}
}
-}
\ No newline at end of file
+}
+// jscpd:ignore-end
diff --git a/csharp/Linux Group Policy/LGP.Components.Database.Postgresql/Plugin.cs b/csharp/Linux Group Policy/LGP.Components.Database.Postgresql/Plugin.cs
index 7f29341..4bfe3a8 100644
--- a/csharp/Linux Group Policy/LGP.Components.Database.Postgresql/Plugin.cs
+++ b/csharp/Linux Group Policy/LGP.Components.Database.Postgresql/Plugin.cs
@@ -1,5 +1,6 @@
-#region
-
+// jscpd:ignore-start
+#region
+
using System.Windows.Controls;
using LGP.Components.Factory;
using LGP.Components.Factory.Interfaces.Component;
@@ -32,7 +33,7 @@ public string GetName()
/// An image
public Image GetIcon()
{
- return Framework.Images.GetImage( "postgresql" , "VS2010ImageLibrary" , 14 );
+ return Framework.Images.GetImage("postgresql", "VS2010ImageLibrary", 14);
}
@@ -40,7 +41,7 @@ public Image GetIcon()
/// Asks the component to register is menu components
///
/// The program main menu
- public void RegisterMenuEntries( IMenu menu )
+ public void RegisterMenuEntries(IMenu menu)
{
}
@@ -99,4 +100,5 @@ public UserControl GetPreferencesControl()
#endregion
}
-}
\ No newline at end of file
+}
+// jscpd:ignore-end
diff --git a/csharp/Linux Group Policy/LGP.Components.Database/Entities/Grammer.cs b/csharp/Linux Group Policy/LGP.Components.Database/Entities/Grammer.cs
index 7e263ba..94af967 100644
--- a/csharp/Linux Group Policy/LGP.Components.Database/Entities/Grammer.cs
+++ b/csharp/Linux Group Policy/LGP.Components.Database/Entities/Grammer.cs
@@ -1,5 +1,6 @@
-#region
-
+// jscpd:ignore-start
+#region
+
using System;
using System.Collections.Generic;
using LGP.Components.Factory;
@@ -9,17 +10,17 @@
namespace LGP.Components.Database.Entities
{
- internal class Grammer : IGrammer
+ internal class Grammer : IGrammer // codespell:ignore grammer
{
private readonly int _rowid;
private string _key;
private int _moduleid;
- private List< IGrammerObserver > _observers;
+ private List _observers;
private string _value;
- public Grammer( int rowid , int moduleid , string key , string value )
+ public Grammer(int rowid, int moduleid, string key, string value) // codespell:ignore grammer
{
- this._observers = new List< IGrammerObserver >();
+ this._observers = new List();
this._key = key;
this._moduleid = moduleid;
this._rowid = rowid;
@@ -29,7 +30,7 @@ public Grammer( int rowid , int moduleid , string key , string value )
#region IGrammer Members
///
- /// Gets the grammer rowid
+ /// Gets the grammer rowid // codespell:ignore grammer
///
/// int
public int GetId()
@@ -39,7 +40,7 @@ public int GetId()
///
- /// Gets the grammer moduleid
+ /// Gets the grammer moduleid // codespell:ignore grammer
///
/// int
public int GetModuleId()
@@ -49,7 +50,7 @@ public int GetModuleId()
///
- /// Gets the grammer key
+ /// Gets the grammer key // codespell:ignore grammer
///
/// string
public string GetKey()
@@ -59,7 +60,7 @@ public string GetKey()
///
- /// Gets the grammer value
+ /// Gets the grammer value // codespell:ignore grammer
///
/// string
public string GetValue()
@@ -68,76 +69,76 @@ public string GetValue()
}
///
- /// Sets the grammer moduleid
+ /// Sets the grammer moduleid // codespell:ignore grammer
///
/// int
- public void SetModuleId( int val )
+ public void SetModuleId(int val)
{
try
{
- var sql = String.Format( "update moduleGrammerWords set m_id = '{0}' where id = '{1}' " , val , this._rowid );
+ var sql = String.Format("update moduleGrammerWords set m_id = '{0}' where id = '{1}' ", val, this._rowid);
- if( Framework.Database.IsConnected() )
+ if (Framework.Database.IsConnected())
{
- Framework.Database.ExecuteNonQuery( sql );
+ Framework.Database.ExecuteNonQuery(sql);
}
this._moduleid = val;
this.Notify();
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
///
- /// Sets the grammer key
+ /// Sets the grammer key // codespell:ignore grammer
///
/// string
- public void SetKey( string val )
+ public void SetKey(string val)
{
try
{
- var sql = String.Format( "update moduleGrammerWords set grammerkey = '{0}' where id = '{1}' " , val , this._rowid );
+ var sql = String.Format("update moduleGrammerWords set grammerkey = '{0}' where id = '{1}' ", val, this._rowid);
- if( Framework.Database.IsConnected() )
+ if (Framework.Database.IsConnected())
{
- Framework.Database.ExecuteNonQuery( sql );
+ Framework.Database.ExecuteNonQuery(sql);
}
this._key = val;
this.Notify();
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
///
- /// Sets the grammer value
+ /// Sets the grammer value // codespell:ignore grammer
///
/// string
- public void SetValue( string val )
+ public void SetValue(string val)
{
try
{
- var sql = String.Format( "update moduleGrammerWords set grammerval = '{0}' where id = '{1}' " , val , this._rowid );
+ var sql = String.Format("update moduleGrammerWords set grammerval = '{0}' where id = '{1}' ", val, this._rowid);
- if( Framework.Database.IsConnected() )
+ if (Framework.Database.IsConnected())
{
- Framework.Database.ExecuteNonQuery( sql );
+ Framework.Database.ExecuteNonQuery(sql);
}
this._value = val;
this.Notify();
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -146,71 +147,71 @@ public void SetValue( string val )
#region Implementation of IGrammerObserver
///
- /// Update this observer with a refernece to the grammer
+ /// Update this observer with a refernece to the grammer // codespell:ignore grammer,refernece
///
- /// IGrammer
+ /// IGrammer // codespell:ignore grammer
/// IGrammerObserver
- public void Update( IGrammer grammer , IGrammerObserver source )
+ public void Update(IGrammer grammer, IGrammerObserver source) // codespell:ignore grammer
{
try
{
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
///
- /// Attach objewcts that observer this grammer
+ /// Attach objewcts that observer this grammer // codespell:ignore grammer
///
/// IGrammerObserver
- public void Attach( IGrammerObserver obj )
+ public void Attach(IGrammerObserver obj)
{
try
{
- if( !this._observers.Contains( obj ) )
+ if (!this._observers.Contains(obj))
{
- this._observers.Add( obj );
+ this._observers.Add(obj);
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
///
- /// Detach objewcts that observer this grammer
+ /// Detach objewcts that observer this grammer // codespell:ignore grammer
///
/// IGrammerObserver
- public void Detach( IGrammerObserver obj )
+ public void Detach(IGrammerObserver obj)
{
try
{
- this._observers.Remove( obj );
+ this._observers.Remove(obj);
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
///
- /// Notify observers of this grammer
+ /// Notify observers of this grammer // codespell:ignore grammer
///
public void Notify()
{
try
{
- for( var h = 0; h < this._observers.Count; h++ )
+ for (var h = 0; h < this._observers.Count; h++)
{
- this._observers[ h ].Update( this , this );
+ this._observers[h].Update(this, this);
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -218,24 +219,24 @@ public void Notify()
/// Dispose this object and all the observers
///
/// IGrammerObserver
- public void Dispose( IGrammerObserver obj )
+ public void Dispose(IGrammerObserver obj)
{
try
{
- for( var h = 0; h < this._observers.Count; h++ )
+ for (var h = 0; h < this._observers.Count; h++)
{
- this._observers[ h ].Dispose( this );
+ this._observers[h].Dispose(this);
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
#endregion
- ~Grammer()
+ ~Grammer() // codespell:ignore grammer
{
this._observers = null;
}
@@ -246,4 +247,5 @@ public override string ToString()
return this.GetKey();
}
}
-}
\ No newline at end of file
+}
+// jscpd:ignore-end
diff --git a/csharp/Linux Group Policy/LGP.Components.Database/Entities/GrammerGateway.cs b/csharp/Linux Group Policy/LGP.Components.Database/Entities/GrammerGateway.cs
index a54b777..93383b6 100644
--- a/csharp/Linux Group Policy/LGP.Components.Database/Entities/GrammerGateway.cs
+++ b/csharp/Linux Group Policy/LGP.Components.Database/Entities/GrammerGateway.cs
@@ -1,5 +1,6 @@
-#region
-
+// jscpd:ignore-start
+#region
+
using System;
using System.Collections.Generic;
using System.Data;
@@ -13,288 +14,288 @@ namespace LGP.Components.Database.Gateways
{
internal class GrammerGateway : IGrammerGateway
{
- private static List< IGrammer > _grammer;
+ private static List _grammer;
private static void BuildGrammerListing()
{
- _grammer = new List< IGrammer >();
+ _grammer = new List();
try
{
- var sql = string.Format( "select * from moduleGrammerWords" );
+ var sql = string.Format("select * from moduleGrammerWords");
- if( Framework.Database.IsConnected() == false )
+ if (Framework.Database.IsConnected() == false)
{
return;
}
- var ds = Framework.Database.ExecuteQuery( sql );
+ var ds = Framework.Database.ExecuteQuery(sql);
- var clientTable = ds.Tables[ 0 ];
+ var clientTable = ds.Tables[0];
- if( clientTable.Rows.Count == 0 )
+ if (clientTable.Rows.Count == 0)
{
return;
}
- foreach( DataRow row in clientTable.Rows )
+ foreach (DataRow row in clientTable.Rows)
{
- var id = ( int ) row[ "id" ];
- var mid = ( int ) row[ "m_id" ];
- var gkey = ( string ) row[ "grammerkey" ];
- var gvalue = ( string ) row[ "grammerval" ];
+ var id = (int)row["id"];
+ var mid = (int)row["m_id"];
+ var gkey = (string)row["grammerkey"];
+ var gvalue = (string)row["grammerval"];
- var grammer = new Grammer( id , mid , gkey , gvalue );
+ var grammer = new Grammer(id, mid, gkey, gvalue); // codespell:ignore grammer
- _grammer.Add( grammer );
+ _grammer.Add(grammer); // codespell:ignore grammer
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
#region Implementation of IGrammerGateway
///
- /// Adds a grammer given a moduleid or returns existing Grammer
+ /// Adds a grammer given a moduleid or returns existing Grammer // codespell:ignore grammer
///
/// int
/// string
/// string
/// IGrammer
- public IGrammer CreateGrammer( int moduleId , string key , string val )
+ public IGrammer CreateGrammer(int moduleId, string key, string val)
{
try
{
- if( _grammer == null )
+ if (_grammer == null)
{
BuildGrammerListing();
}
- for( var y = 0; y < _grammer.Count; y++ )
+ for (var y = 0; y < _grammer.Count; y++)
{
- if( _grammer[ y ].GetModuleId() == moduleId && _grammer[ y ].GetKey().CompareTo( key ) == 0 )
+ if (_grammer[y].GetModuleId() == moduleId && _grammer[y].GetKey().CompareTo(key) == 0)
{
- return _grammer[ y ];
+ return _grammer[y];
}
}
- var sql = string.Format( "insert into moduleGrammerWords values( null , '{0}' , '{1}' ,'{2}' )" , moduleId , key , val );
+ var sql = string.Format("insert into moduleGrammerWords values( null , '{0}' , '{1}' ,'{2}' )", moduleId, key, val);
- if( Framework.Database.IsConnected() == false )
+ if (Framework.Database.IsConnected() == false)
{
return null;
}
- Framework.Database.ExecuteNonQuery( sql );
+ Framework.Database.ExecuteNonQuery(sql);
- var sql2 = string.Format( "select * from moduleGrammerWords where id = ( select MAX( id ) from moduleGrammerWords)" );
+ var sql2 = string.Format("select * from moduleGrammerWords where id = ( select MAX( id ) from moduleGrammerWords)");
- var ds = Framework.Database.ExecuteQuery( sql2 );
+ var ds = Framework.Database.ExecuteQuery(sql2);
- var grammerTable = ds.Tables[ 0 ];
- var row = grammerTable.Rows[ 0 ];
- var id = ( int ) row[ "id" ];
+ var grammerTable = ds.Tables[0];
+ var row = grammerTable.Rows[0];
+ var id = (int)row["id"];
- var grammer = new Grammer( id , moduleId , key , val );
- _grammer.Add( grammer );
+ var grammer = new Grammer(id, moduleId, key, val); // codespell:ignore grammer
+ _grammer.Add(grammer); // codespell:ignore grammer
- return _grammer[ _grammer.Count - 1 ];
+ return _grammer[_grammer.Count - 1];
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
return null;
}
}
///
- /// Deletes a grammer entry given key and moduleid
+ /// Deletes a grammer entry given key and moduleid // codespell:ignore grammer
///
/// int
/// string
- public void DeleteGrammer( int mid , string key )
+ public void DeleteGrammer(int mid, string key)
{
try
{
- if( _grammer == null )
+ if (_grammer == null)
{
BuildGrammerListing();
}
- for( var y = 0; y < _grammer.Count; y++ )
+ for (var y = 0; y < _grammer.Count; y++)
{
- if( _grammer[ y ].GetModuleId() == mid && _grammer[ y ].GetKey().CompareTo( key ) == 0 )
+ if (_grammer[y].GetModuleId() == mid && _grammer[y].GetKey().CompareTo(key) == 0)
{
- _grammer.RemoveAt( y );
+ _grammer.RemoveAt(y);
}
}
- var sql = string.Format( "delete from moduleGrammerWords where m_id= '{0}' and grammerkey = '{1}' " , mid , key );
+ var sql = string.Format("delete from moduleGrammerWords where m_id= '{0}' and grammerkey = '{1}' ", mid, key);
- if( Framework.Database.IsConnected() == false )
+ if (Framework.Database.IsConnected() == false)
{
return;
}
- Framework.Database.ExecuteNonQuery( sql );
+ Framework.Database.ExecuteNonQuery(sql);
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
///
- /// Deletes all grammer given key the moduleid
+ /// Deletes all grammer given key the moduleid // codespell:ignore grammer
///
/// int
- public void DeleteGrammer( int mid )
+ public void DeleteGrammer(int mid)
{
try
{
- if( _grammer == null )
+ if (_grammer == null)
{
BuildGrammerListing();
}
- for( var y = 0; y < _grammer.Count; y++ )
+ for (var y = 0; y < _grammer.Count; y++)
{
- if( _grammer[ y ].GetModuleId() == mid )
+ if (_grammer[y].GetModuleId() == mid)
{
- _grammer.RemoveAt( y );
+ _grammer.RemoveAt(y);
}
}
- var sql = string.Format( "delete from moduleGrammerWords where m_id= '{0}'" , mid );
+ var sql = string.Format("delete from moduleGrammerWords where m_id= '{0}'", mid);
- if( Framework.Database.IsConnected() == false )
+ if (Framework.Database.IsConnected() == false)
{
return;
}
- Framework.Database.ExecuteNonQuery( sql );
+ Framework.Database.ExecuteNonQuery(sql);
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
///
- /// Gets a Grammer given a the moduleid and key
+ /// Gets a Grammer given a the moduleid and key // codespell:ignore grammer
///
/// int
/// string
/// IGrammer
- public IGrammer GetGrammer( int mid , string key )
+ public IGrammer GetGrammer(int mid, string key)
{
try
{
- if( _grammer == null )
+ if (_grammer == null)
{
BuildGrammerListing();
}
- for( var y = 0; y < _grammer.Count; y++ )
+ for (var y = 0; y < _grammer.Count; y++)
{
- if( _grammer[ y ].GetModuleId() == mid && _grammer[ y ].GetKey().CompareTo( key ) == 0 )
+ if (_grammer[y].GetModuleId() == mid && _grammer[y].GetKey().CompareTo(key) == 0)
{
- return _grammer[ y ];
+ return _grammer[y];
}
}
return null;
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
return null;
}
}
///
- /// Gets a Grammer given a the moduleid and id
+ /// Gets a Grammer given a the moduleid and id // codespell:ignore grammer
///
/// int
/// int
/// IGrammer
- public IGrammer GetGrammer( int mid , int id )
+ public IGrammer GetGrammer(int mid, int id)
{
try
{
- if( _grammer == null )
+ if (_grammer == null)
{
BuildGrammerListing();
}
- for( var y = 0; y < _grammer.Count; y++ )
+ for (var y = 0; y < _grammer.Count; y++)
{
- if( _grammer[ y ].GetModuleId() == mid && _grammer[ y ].GetId() == id )
+ if (_grammer[y].GetModuleId() == mid && _grammer[y].GetId() == id)
{
- return _grammer[ y ];
+ return _grammer[y];
}
}
return null;
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
return null;
}
}
///
- /// Gets all Grammer given a the moduleid
+ /// Gets all Grammer given a the moduleid // codespell:ignore grammer
///
/// int
/// IGrammer list
- public List< IGrammer > GetGrammer( int mid )
+ public List GetGrammer(int mid)
{
- var found = new List< IGrammer >();
+ var found = new List();
try
{
- if( _grammer == null )
+ if (_grammer == null)
{
BuildGrammerListing();
}
- for( var y = 0; y < _grammer.Count; y++ )
+ for (var y = 0; y < _grammer.Count; y++)
{
- if( _grammer[ y ].GetModuleId() == mid )
+ if (_grammer[y].GetModuleId() == mid)
{
- found.Add( _grammer[ y ] );
+ found.Add(_grammer[y]);
}
}
return found;
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
return found;
}
}
///
- /// Gets all grammers
+ /// Gets all grammers // codespell:ignore grammers
///
/// IGrammer List
- public List< IGrammer > GetGrammer()
+ public List GetGrammer()
{
try
{
- if( _grammer == null )
+ if (_grammer == null)
{
BuildGrammerListing();
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
return _grammer;
}
@@ -306,34 +307,34 @@ public void Refresh()
{
try
{
- var sql = string.Format( "select * from moduleGrammerWords" );
+ var sql = string.Format("select * from moduleGrammerWords");
- if( Framework.Database.IsConnected() == false )
+ if (Framework.Database.IsConnected() == false)
{
return;
}
- var ds = Framework.Database.ExecuteQuery( sql );
+ var ds = Framework.Database.ExecuteQuery(sql);
- var clientTable = ds.Tables[ 0 ];
+ var clientTable = ds.Tables[0];
- if( clientTable.Rows.Count == 0 )
+ if (clientTable.Rows.Count == 0)
{
return;
}
- foreach( DataRow row in clientTable.Rows )
+ foreach (DataRow row in clientTable.Rows)
{
- var id = ( int ) row[ "id" ];
- var mid = ( int ) row[ "m_id" ];
- var gkey = ( string ) row[ "grammerkey" ];
- var gvalue = ( string ) row[ "grammerval" ];
+ var id = (int)row["id"];
+ var mid = (int)row["m_id"];
+ var gkey = (string)row["grammerkey"];
+ var gvalue = (string)row["grammerval"];
var newDbEntry = true;
- for( var y = 0; y < _grammer.Count; y++ )
+ for (var y = 0; y < _grammer.Count; y++)
{
- if( _grammer[ y ].GetId() != id )
+ if (_grammer[y].GetId() != id)
{
continue;
}
@@ -342,22 +343,23 @@ public void Refresh()
break;
}
- if( !newDbEntry )
+ if (!newDbEntry)
{
continue;
}
- var grammer = new Grammer( id , mid , gkey , gvalue );
+ var grammer = new Grammer(id, mid, gkey, gvalue); // codespell:ignore grammer
- _grammer.Add( grammer );
+ _grammer.Add(grammer); // codespell:ignore grammer
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
#endregion
}
-}
\ No newline at end of file
+}
+// jscpd:ignore-end
diff --git a/csharp/Linux Group Policy/LGP.Components.Database/Entities/Module.cs b/csharp/Linux Group Policy/LGP.Components.Database/Entities/Module.cs
index f44b8b5..d48d705 100644
--- a/csharp/Linux Group Policy/LGP.Components.Database/Entities/Module.cs
+++ b/csharp/Linux Group Policy/LGP.Components.Database/Entities/Module.cs
@@ -1,5 +1,6 @@
-#region
-
+// jscpd:ignore-start
+#region
+
using System;
using System.Collections.Generic;
using LGP.Components.Database.Gateways;
@@ -15,16 +16,16 @@ internal class Module : IModule
private static readonly IGrammerGateway GrammerGateway;
private readonly int _moduleid;
private string _moduleName;
- private List< IModuleObserver > _observers;
+ private List _observers;
static Module()
{
GrammerGateway = new GrammerGateway();
}
- public Module( int moduleid , string modulename )
+ public Module(int moduleid, string modulename)
{
- this._observers = new List< IModuleObserver >();
+ this._observers = new List();
this._moduleid = moduleid;
this._moduleName = modulename;
}
@@ -32,11 +33,11 @@ public Module( int moduleid , string modulename )
#region Implementation of IModuleObserver
///
- /// Update this observer with a refernece to the module
+ /// Update this observer with a refernece to the module // codespell:ignore refernece
///
/// IModule
/// IModuleObserver
- public void Update( IModule module , IModuleObserver source )
+ public void Update(IModule module, IModuleObserver source)
{
throw new NotImplementedException();
}
@@ -46,18 +47,18 @@ public void Update( IModule module , IModuleObserver source )
/// Attach objewcts that observer this module
///
/// IModuleObserver
- public void Attach( IModuleObserver obj )
+ public void Attach(IModuleObserver obj)
{
try
{
- if( !this._observers.Contains( obj ) )
+ if (!this._observers.Contains(obj))
{
- this._observers.Add( obj );
+ this._observers.Add(obj);
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -66,15 +67,15 @@ public void Attach( IModuleObserver obj )
/// Detach objewcts that observer this module
///
/// IModuleObserver
- public void Detach( IModuleObserver obj )
+ public void Detach(IModuleObserver obj)
{
try
{
- this._observers.Remove( obj );
+ this._observers.Remove(obj);
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -86,14 +87,14 @@ public void Notify()
{
try
{
- for( var h = 0; h < this._observers.Count; h++ )
+ for (var h = 0; h < this._observers.Count; h++)
{
- this._observers[ h ].Update( this , this );
+ this._observers[h].Update(this, this);
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -102,18 +103,18 @@ public void Notify()
/// Dispose this object and all the observers
///
/// IModuleObserver
- public void Dispose( IModuleObserver obj )
+ public void Dispose(IModuleObserver obj)
{
try
{
- for( var h = 0; h < this._observers.Count; h++ )
+ for (var h = 0; h < this._observers.Count; h++)
{
- this._observers[ h ].Dispose( this );
+ this._observers[h].Dispose(this);
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -154,109 +155,109 @@ public string GetModuleName()
/// Sets the module name
///
///
- public void SetModuleName( string name )
+ public void SetModuleName(string name)
{
try
{
- var sql = String.Format( "update modules set name = '{0}' where id = '{1}' " , name , this._moduleid );
+ var sql = String.Format("update modules set name = '{0}' where id = '{1}' ", name, this._moduleid);
- if( Framework.Database.IsConnected() )
+ if (Framework.Database.IsConnected())
{
- Framework.Database.ExecuteNonQuery( sql );
+ Framework.Database.ExecuteNonQuery(sql);
}
this._moduleName = name;
this.Notify();
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
///
- /// Adds a grammer to this module
+ /// Adds a grammer to this module // codespell:ignore grammer
///
/// string
/// string
/// IGrammer
- public IGrammer AddGrammer( string key , string value )
+ public IGrammer AddGrammer(string key, string value)
{
try
{
- var grammer = GrammerGateway.CreateGrammer( this._moduleid , key , value );
+ var grammer = GrammerGateway.CreateGrammer(this._moduleid, key, value); // codespell:ignore grammer
this.Notify();
- return grammer;
+ return grammer; // codespell:ignore grammer
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
return null;
}
}
///
- /// Deletes a grammer given a key
+ /// Deletes a grammer given a key // codespell:ignore grammer
///
///
- public void DeleteGrammer( string key )
+ public void DeleteGrammer(string key)
{
try
{
- GrammerGateway.DeleteGrammer( this._moduleid , key );
+ GrammerGateway.DeleteGrammer(this._moduleid, key);
this.Notify();
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
///
- /// Dletes all the grammers associated with this module
+ /// Dletes all the grammers associated with this module // codespell:ignore grammers
///
public void DeleteAllGrammer()
{
try
{
- GrammerGateway.DeleteGrammer( this._moduleid );
+ GrammerGateway.DeleteGrammer(this._moduleid);
this.Notify();
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
///
- /// Gets all the grammers for this module
+ /// Gets all the grammers for this module // codespell:ignore grammers
///
/// IGrammer
- public List< IGrammer > GetAllGrammers()
+ public List GetAllGrammers()
{
- return GrammerGateway.GetGrammer( this._moduleid );
+ return GrammerGateway.GetGrammer(this._moduleid);
}
///
- /// Gets a grammer given a key
+ /// Gets a grammer given a key // codespell:ignore grammer
///
- /// grammer lvale
+ /// grammer lvale // codespell:ignore grammer
/// KeyValuePair
- public IGrammer GetGrammer( string key )
+ public IGrammer GetGrammer(string key)
{
- return GrammerGateway.GetGrammer( this._moduleid , key );
+ return GrammerGateway.GetGrammer(this._moduleid, key);
}
///
- /// Gets a grammer given an id
+ /// Gets a grammer given an id // codespell:ignore grammer
///
- /// grammer id
+ /// grammer id // codespell:ignore grammer
/// IGrammer
- public IGrammer GetGrammer( int id )
+ public IGrammer GetGrammer(int id)
{
- return GrammerGateway.GetGrammer( this._moduleid , id );
+ return GrammerGateway.GetGrammer(this._moduleid, id);
}
///
@@ -284,4 +285,5 @@ public string GetModuleLocation()
this._observers = null;
}
}
-}
\ No newline at end of file
+}
+// jscpd:ignore-end
diff --git a/csharp/Linux Group Policy/LGP.Components.Database/Entities/Ou.cs b/csharp/Linux Group Policy/LGP.Components.Database/Entities/Ou.cs
index c53f037..915af47 100644
--- a/csharp/Linux Group Policy/LGP.Components.Database/Entities/Ou.cs
+++ b/csharp/Linux Group Policy/LGP.Components.Database/Entities/Ou.cs
@@ -1,5 +1,6 @@
-#region
-
+// jscpd:ignore-start
+#region
+
using System;
using System.Collections.Generic;
using System.Windows.Controls;
@@ -12,16 +13,16 @@ namespace LGP.Components.Database.Entities
{
internal class Ou : IOu
{
- private List< IOuObserver > _observers;
+ private List _observers;
private int _ouId;
private string _ouName;
private int _ouParentId;
private string _oupolicyGroup;
- public Ou( int id , string name , int parentid , string group )
+ public Ou(int id, string name, int parentid, string group)
{
- this._observers = new List< IOuObserver >();
+ this._observers = new List();
this._ouId = id;
this._ouName = name;
this._ouParentId = parentid;
@@ -34,23 +35,23 @@ public Ou( int id , string name , int parentid , string group )
/// Sets the ou Id
///
/// int
- public void SetOuId( int val )
+ public void SetOuId(int val)
{
try
{
- var sql = String.Format( "update ous set ou_id = '{0}' where ou_id = '{1}' " , val , this._ouId );
+ var sql = String.Format("update ous set ou_id = '{0}' where ou_id = '{1}' ", val, this._ouId);
- if( Framework.Database.IsConnected() )
+ if (Framework.Database.IsConnected())
{
- Framework.Database.ExecuteNonQuery( sql );
+ Framework.Database.ExecuteNonQuery(sql);
}
this._ouId = val;
this.Notify();
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -69,23 +70,23 @@ public int GetOuId()
/// Sets the ou name
///
/// string
- public void SetName( string val )
+ public void SetName(string val)
{
try
{
- var sql = String.Format( "update ous set ou_name = '{0}' where ou_id = '{1}' " , val , this._ouId );
+ var sql = String.Format("update ous set ou_name = '{0}' where ou_id = '{1}' ", val, this._ouId);
- if( Framework.Database.IsConnected() )
+ if (Framework.Database.IsConnected())
{
- Framework.Database.ExecuteNonQuery( sql );
+ Framework.Database.ExecuteNonQuery(sql);
}
this._ouName = val;
this.Notify();
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -104,23 +105,23 @@ public string GetName()
/// Sets the parent ou Id
///
/// int
- public void SetParentOuId( int val )
+ public void SetParentOuId(int val)
{
try
{
- var sql = String.Format( "update ous set ou_parent_id = '{0}' where ou_id = '{1}' " , val , this._ouId );
+ var sql = String.Format("update ous set ou_parent_id = '{0}' where ou_id = '{1}' ", val, this._ouId);
- if( Framework.Database.IsConnected() )
+ if (Framework.Database.IsConnected())
{
- Framework.Database.ExecuteNonQuery( sql );
+ Framework.Database.ExecuteNonQuery(sql);
}
this._ouParentId = val;
this.Notify();
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -139,23 +140,23 @@ public int GetParentOuId()
/// Sets the ou policy group
///
///
- public void SetPolicyGroup( string val )
+ public void SetPolicyGroup(string val)
{
try
{
- var sql = String.Format( "update ous set ou_policygroup = '{0}' where ou_id = '{1}' " , val , this._ouId );
+ var sql = String.Format("update ous set ou_policygroup = '{0}' where ou_id = '{1}' ", val, this._ouId);
- if( Framework.Database.IsConnected() )
+ if (Framework.Database.IsConnected())
{
- Framework.Database.ExecuteNonQuery( sql );
+ Framework.Database.ExecuteNonQuery(sql);
}
this._oupolicyGroup = val;
this.Notify();
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -175,51 +176,51 @@ public string GetPolicyGroup()
///
/// int
/// image
- public Image GetOuImage( int size )
+ public Image GetOuImage(int size)
{
try
{
var sizeFolder = "distros/";
- switch( size )
+ switch (size)
{
- case 32 :
+ case 32:
sizeFolder += "32";
break;
- case 48 :
+ case 48:
sizeFolder += "48";
break;
- case 64 :
+ case 64:
sizeFolder += "64";
break;
- case 128 :
+ case 128:
sizeFolder += "128";
break;
- default :
+ default:
sizeFolder += "32";
break;
}
- return Framework.Images.GetImage( "workgroup" , sizeFolder );
+ return Framework.Images.GetImage("workgroup", sizeFolder);
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
return null;
}
}
///
- /// Update this observer with a refernece to the ou
+ /// Update this observer with a refernece to the ou // codespell:ignore refernece
///
/// Iou
/// source observer
- public void Update( IOu ou , IOuObserver source )
+ public void Update(IOu ou, IOuObserver source)
{
throw new NotImplementedException();
}
@@ -228,18 +229,18 @@ public void Update( IOu ou , IOuObserver source )
/// Attach objewcts that observer this IOu
///
/// IOuObserver
- public void Attach( IOuObserver obj )
+ public void Attach(IOuObserver obj)
{
try
{
- if( !this._observers.Contains( obj ) )
+ if (!this._observers.Contains(obj))
{
- this._observers.Add( obj );
+ this._observers.Add(obj);
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -248,15 +249,15 @@ public void Attach( IOuObserver obj )
/// Detach objewcts that observer this IOu
///
/// IOuObserver
- public void Detach( IOuObserver obj )
+ public void Detach(IOuObserver obj)
{
try
{
- this._observers.Remove( obj );
+ this._observers.Remove(obj);
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -268,14 +269,14 @@ public void Notify()
{
try
{
- for( var h = 0; h < this._observers.Count; h++ )
+ for (var h = 0; h < this._observers.Count; h++)
{
- this._observers[ h ].Update( this , this );
+ this._observers[h].Update(this, this);
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -284,18 +285,18 @@ public void Notify()
/// Dispose this object and all the observers
///
/// IOuObserver
- public void Dispose( IOuObserver obj )
+ public void Dispose(IOuObserver obj)
{
try
{
- for( var h = 0; h < this._observers.Count; h++ )
+ for (var h = 0; h < this._observers.Count; h++)
{
- this._observers[ h ].Dispose( this );
+ this._observers[h].Dispose(this);
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -310,4 +311,5 @@ public void Dispose( IOuObserver obj )
this._observers = null;
}
}
-}
\ No newline at end of file
+}
+// jscpd:ignore-end
diff --git a/csharp/Linux Group Policy/LGP.Components.Database/Gateways/ModuleGateway.cs b/csharp/Linux Group Policy/LGP.Components.Database/Gateways/ModuleGateway.cs
index 5363de2..f442d03 100644
--- a/csharp/Linux Group Policy/LGP.Components.Database/Gateways/ModuleGateway.cs
+++ b/csharp/Linux Group Policy/LGP.Components.Database/Gateways/ModuleGateway.cs
@@ -1,5 +1,6 @@
-#region
-
+// jscpd:ignore-start
+#region
+
using System;
using System.Collections.Generic;
using System.Data;
@@ -13,44 +14,44 @@ namespace LGP.Components.Database.Gateways
{
internal class ModuleGateway : IModuleGateway
{
- private static List< IModule > _modules;
+ private static List _modules;
#region Implementation of IModuleGateway
- public IModule CreateModule( string modulename )
+ public IModule CreateModule(string modulename)
{
try
{
- if( _modules == null )
+ if (_modules == null)
{
BuildModuleListing();
}
- var sql = string.Format( "insert into modules values( null, '{0}' )" , modulename );
- if( Framework.Database.IsConnected() == false )
+ var sql = string.Format("insert into modules values( null, '{0}' )", modulename);
+ if (Framework.Database.IsConnected() == false)
{
return null;
}
- if( Framework.Database.ExecuteNonQuery( sql ) > 0 )
+ if (Framework.Database.ExecuteNonQuery(sql) > 0)
{
- sql = string.Format( "select * from modules where id = ( select MAX( id ) from modules )" );
- var ds = Framework.Database.ExecuteQuery( sql );
- var ouTable = ds.Tables[ 0 ];
- if( ouTable.Rows.Count == 0 )
+ sql = string.Format("select * from modules where id = ( select MAX( id ) from modules )");
+ var ds = Framework.Database.ExecuteQuery(sql);
+ var ouTable = ds.Tables[0];
+ if (ouTable.Rows.Count == 0)
{
return null;
}
- var row = ouTable.Rows[ 0 ];
- var module = new Module( ( int ) row[ "id" ] , ( string ) row[ "name" ] );
- _modules.Add( module );
- return _modules[ _modules.Count - 1 ];
+ var row = ouTable.Rows[0];
+ var module = new Module((int)row["id"], (string)row["name"]);
+ _modules.Add(module);
+ return _modules[_modules.Count - 1];
}
return null;
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
return null;
}
}
@@ -59,38 +60,38 @@ public IModule CreateModule( string modulename )
/// Deletes an Module
///
/// the module to delete
- public void DeleteModule( string modulename )
+ public void DeleteModule(string modulename)
{
try
{
- if( _modules == null )
+ if (_modules == null)
{
BuildModuleListing();
}
- var sql1 = string.Format( "delete from moduleGrammerWords where m_id = '{0}'" , this.GetModuleByName( modulename ).GetModuleId() );
- var sql2 = string.Format( "delete from modules where id = '{0}'" , this.GetModuleByName( modulename ).GetModuleId() );
+ var sql1 = string.Format("delete from moduleGrammerWords where m_id = '{0}'", this.GetModuleByName(modulename).GetModuleId());
+ var sql2 = string.Format("delete from modules where id = '{0}'", this.GetModuleByName(modulename).GetModuleId());
- if( Framework.Database.IsConnected() )
+ if (Framework.Database.IsConnected())
{
- Framework.Database.ExecuteNonQuery( sql1 );
- Framework.Database.ExecuteNonQuery( sql2 );
+ Framework.Database.ExecuteNonQuery(sql1);
+ Framework.Database.ExecuteNonQuery(sql2);
- for( var y = 0; y < _modules.Count; y++ )
+ for (var y = 0; y < _modules.Count; y++)
{
- if( _modules[ y ].GetModuleName().CompareTo( modulename ) == 0 )
+ if (_modules[y].GetModuleName().CompareTo(modulename) == 0)
{
- _modules[ y ].Dispose( _modules[ y ] );
- _modules.RemoveAt( y );
+ _modules[y].Dispose(_modules[y]);
+ _modules.RemoveAt(y);
break;
}
}
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -99,28 +100,28 @@ public void DeleteModule( string modulename )
///
/// the module name
/// IModule
- public IModule GetModuleByName( string modulename )
+ public IModule GetModuleByName(string modulename)
{
try
{
- if( _modules == null )
+ if (_modules == null)
{
BuildModuleListing();
}
- for( var y = 0; y < _modules.Count; y++ )
+ for (var y = 0; y < _modules.Count; y++)
{
- if( _modules[ y ].GetModuleName().CompareTo( modulename ) == 0 )
+ if (_modules[y].GetModuleName().CompareTo(modulename) == 0)
{
- return _modules[ y ];
+ return _modules[y];
}
}
return null;
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
return null;
}
}
@@ -129,9 +130,9 @@ public IModule GetModuleByName( string modulename )
/// Get the list of modules in the database
///
/// List IModule
- public List< IModule > GetModules()
+ public List GetModules()
{
- if( _modules == null )
+ if (_modules == null)
{
BuildModuleListing();
}
@@ -146,30 +147,30 @@ public void Refresh()
{
try
{
- var sql = string.Format( "select * from modules" );
+ var sql = string.Format("select * from modules");
- if( Framework.Database.IsConnected() == false )
+ if (Framework.Database.IsConnected() == false)
{
return;
}
- var modulesds = Framework.Database.ExecuteQuery( sql );
+ var modulesds = Framework.Database.ExecuteQuery(sql);
- var modulesTable = modulesds.Tables[ 0 ];
+ var modulesTable = modulesds.Tables[0];
- if( modulesTable.Rows.Count == 0 )
+ if (modulesTable.Rows.Count == 0)
{
return;
}
- foreach( DataRow moduleRow in modulesTable.Rows )
+ foreach (DataRow moduleRow in modulesTable.Rows)
{
var newDbEntry = true;
- var modid = ( int ) moduleRow[ "id" ];
+ var modid = (int)moduleRow["id"];
- for( var y = 0; y < _modules.Count; y++ )
+ for (var y = 0; y < _modules.Count; y++)
{
- if( _modules[ y ].GetModuleId() != modid )
+ if (_modules[y].GetModuleId() != modid)
{
continue;
}
@@ -178,18 +179,18 @@ public void Refresh()
break;
}
- if( !newDbEntry )
+ if (!newDbEntry)
{
continue;
}
- var module = new Module( modid , ( string ) moduleRow[ "name" ] );
- _modules.Add( module );
+ var module = new Module(modid, (string)moduleRow["name"]);
+ _modules.Add(module);
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -197,36 +198,37 @@ public void Refresh()
private static void BuildModuleListing()
{
- _modules = new List< IModule >();
+ _modules = new List();
try
{
- var sql = string.Format( "select * from modules" );
+ var sql = string.Format("select * from modules");
- if( Framework.Database.IsConnected() == false )
+ if (Framework.Database.IsConnected() == false)
{
return;
}
- var modulesds = Framework.Database.ExecuteQuery( sql );
+ var modulesds = Framework.Database.ExecuteQuery(sql);
- var modulesTable = modulesds.Tables[ 0 ];
+ var modulesTable = modulesds.Tables[0];
- if( modulesTable.Rows.Count == 0 )
+ if (modulesTable.Rows.Count == 0)
{
return;
}
- foreach( DataRow moduleRow in modulesTable.Rows )
+ foreach (DataRow moduleRow in modulesTable.Rows)
{
- var module = new Module( ( int ) moduleRow[ "id" ] , ( string ) moduleRow[ "name" ] );
- _modules.Add( module );
+ var module = new Module((int)moduleRow["id"], (string)moduleRow["name"]);
+ _modules.Add(module);
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
}
-}
\ No newline at end of file
+}
+// jscpd:ignore-end
diff --git a/csharp/Linux Group Policy/LGP.Components.Database/Gateways/OuGateway.cs b/csharp/Linux Group Policy/LGP.Components.Database/Gateways/OuGateway.cs
index 5caf23a..bff42cb 100644
--- a/csharp/Linux Group Policy/LGP.Components.Database/Gateways/OuGateway.cs
+++ b/csharp/Linux Group Policy/LGP.Components.Database/Gateways/OuGateway.cs
@@ -1,5 +1,6 @@
-#region
-
+// jscpd:ignore-start
+#region
+
using System;
using System.Collections.Generic;
using System.Data;
@@ -13,7 +14,7 @@ namespace LGP.Components.Database.Gateways
{
internal class OuGateway : IOuGateway
{
- private static List< IOu > _ous;
+ private static List _ous;
#region IOuGateway Members
@@ -23,61 +24,61 @@ internal class OuGateway : IOuGateway
/// The new ou name
/// The new parent id
/// IOu
- public IOu CreateOu( string ouName , int parentId )
+ public IOu CreateOu(string ouName, int parentId)
{
try
{
- if( _ous == null )
+ if (_ous == null)
{
BuildOuListing();
}
- var sql = string.Format( "insert into ous values( null, '{0}' , '{1}' , '' )" , ouName , parentId );
+ var sql = string.Format("insert into ous values( null, '{0}' , '{1}' , '' )", ouName, parentId);
- if( Framework.Database.IsConnected() == false )
+ if (Framework.Database.IsConnected() == false)
{
return null;
}
- if( Framework.Database.ExecuteNonQuery( sql ) > 0 )
+ if (Framework.Database.ExecuteNonQuery(sql) > 0)
{
- sql = string.Format( "select * from ous where ou_id = ( select MAX( ou_id ) from ous )" );
+ sql = string.Format("select * from ous where ou_id = ( select MAX( ou_id ) from ous )");
- var ds = Framework.Database.ExecuteQuery( sql );
+ var ds = Framework.Database.ExecuteQuery(sql);
- var ouTable = ds.Tables[ 0 ];
+ var ouTable = ds.Tables[0];
- if( ouTable.Rows.Count == 0 )
+ if (ouTable.Rows.Count == 0)
{
return null;
}
- var row = ouTable.Rows[ 0 ];
+ var row = ouTable.Rows[0];
int parentou;
try
{
- parentou = ( int ) row[ "ou_parent_id" ];
+ parentou = (int)row["ou_parent_id"];
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
parentou = -1;
}
- var ou = new Ou( ( int ) row[ "ou_id" ] , ( string ) row[ "ou_name" ] , parentou , ( string ) row[ "ou_policygroup" ] );
+ var ou = new Ou((int)row["ou_id"], (string)row["ou_name"], parentou, (string)row["ou_policygroup"]);
- _ous.Add( ou );
+ _ous.Add(ou);
- return _ous[ _ous.Count - 1 ];
+ return _ous[_ous.Count - 1];
}
return null;
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
return null;
}
}
@@ -87,35 +88,35 @@ public IOu CreateOu( string ouName , int parentId )
/// Deletes an Ou to a given parent ou
///
/// the ou id to delete
- public void DeleteOu( int ouid )
+ public void DeleteOu(int ouid)
{
try
{
- if( _ous == null )
+ if (_ous == null)
{
BuildOuListing();
}
- var sql = string.Format( "delete from ous where ou_id = '{0}'" , ouid );
+ var sql = string.Format("delete from ous where ou_id = '{0}'", ouid);
- if( Framework.Database.IsConnected() )
+ if (Framework.Database.IsConnected())
{
- Framework.Database.ExecuteNonQuery( sql );
+ Framework.Database.ExecuteNonQuery(sql);
- for( var y = 0; y < _ous.Count; y++ )
+ for (var y = 0; y < _ous.Count; y++)
{
- if( _ous[ y ].GetOuId() == ouid )
+ if (_ous[y].GetOuId() == ouid)
{
- _ous[ y ].Dispose( _ous[ y ] );
- _ous.RemoveAt( y );
+ _ous[y].Dispose(_ous[y]);
+ _ous.RemoveAt(y);
break;
}
}
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -125,28 +126,28 @@ public void DeleteOu( int ouid )
///
/// int id
/// IOu
- public IOu GetOuById( int ouid )
+ public IOu GetOuById(int ouid)
{
try
{
- if( _ous == null )
+ if (_ous == null)
{
BuildOuListing();
}
- for( var y = 0; y < _ous.Count; y++ )
+ for (var y = 0; y < _ous.Count; y++)
{
- if( _ous[ y ].GetOuId() == ouid )
+ if (_ous[y].GetOuId() == ouid)
{
- return _ous[ y ];
+ return _ous[y];
}
}
return null;
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
return null;
}
}
@@ -157,28 +158,28 @@ public IOu GetOuById( int ouid )
///
/// int id
/// IOu
- public IOu GetOuParentById( int ouid )
+ public IOu GetOuParentById(int ouid)
{
try
{
- if( _ous == null )
+ if (_ous == null)
{
BuildOuListing();
}
- for( var y = 0; y < _ous.Count; y++ )
+ for (var y = 0; y < _ous.Count; y++)
{
- if( _ous[ y ].GetOuId() == ouid )
+ if (_ous[y].GetOuId() == ouid)
{
- return this.GetOuById( _ous[ y ].GetParentOuId() );
+ return this.GetOuById(_ous[y].GetParentOuId());
}
}
return null;
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
return null;
}
}
@@ -188,9 +189,9 @@ public IOu GetOuParentById( int ouid )
/// Gets a listing of Ous
///
/// IOu List
- public List< IOu > GetOuListing()
+ public List GetOuListing()
{
- if( _ous == null )
+ if (_ous == null)
{
BuildOuListing();
}
@@ -204,30 +205,30 @@ public List< IOu > GetOuListing()
///
/// int outid
/// IOu List
- public List< IOu > GetChildren( int ouid )
+ public List GetChildren(int ouid)
{
try
{
- if( _ous == null )
+ if (_ous == null)
{
BuildOuListing();
}
- var children = new List< IOu >();
+ var children = new List();
- for( var y = 0; y < _ous.Count; y++ )
+ for (var y = 0; y < _ous.Count; y++)
{
- if( _ous[ y ].GetParentOuId() == ouid && _ous[ y ].GetOuId() != _ous[ y ].GetParentOuId() )
+ if (_ous[y].GetParentOuId() == ouid && _ous[y].GetOuId() != _ous[y].GetParentOuId())
{
- children.Add( _ous[ y ] );
+ children.Add(_ous[y]);
}
}
return children;
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
return null;
}
}
@@ -237,30 +238,30 @@ public List< IOu > GetChildren( int ouid )
/// Get the parents with no parents
///
/// IOu List
- public List< IOu > GetRoots()
+ public List GetRoots()
{
try
{
- if( _ous == null )
+ if (_ous == null)
{
BuildOuListing();
}
- var roots = new List< IOu >();
+ var roots = new List();
- for( var y = 0; y < _ous.Count; y++ )
+ for (var y = 0; y < _ous.Count; y++)
{
- if( _ous[ y ].GetOuId() == _ous[ y ].GetParentOuId() )
+ if (_ous[y].GetOuId() == _ous[y].GetParentOuId())
{
- roots.Add( _ous[ y ] );
+ roots.Add(_ous[y]);
}
}
return roots;
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
return null;
}
}
@@ -278,71 +279,71 @@ public void Refresh()
private static void BuildOuListing()
{
var refresh = true;
- if( _ous == null )
+ if (_ous == null)
{
- _ous = new List< IOu >();
+ _ous = new List();
refresh = false;
}
try
{
- var sql = string.Format( "select * from ous" );
+ var sql = string.Format("select * from ous");
- if( Framework.Database.IsConnected() == false )
+ if (Framework.Database.IsConnected() == false)
{
return;
}
- var ds = Framework.Database.ExecuteQuery( sql );
+ var ds = Framework.Database.ExecuteQuery(sql);
- var ouTable = ds.Tables[ 0 ];
+ var ouTable = ds.Tables[0];
- if( ouTable.Rows.Count == 0 )
+ if (ouTable.Rows.Count == 0)
{
return;
}
- foreach( DataRow row in ouTable.Rows )
+ foreach (DataRow row in ouTable.Rows)
{
int parentou;
try
{
- parentou = ( int ) row[ "ou_parent_id" ];
+ parentou = (int)row["ou_parent_id"];
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
parentou = -1;
}
- var ou = new Ou( ( int ) row[ "ou_id" ] , ( string ) row[ "ou_name" ] , parentou , ( string ) row[ "ou_policygroup" ] );
+ var ou = new Ou((int)row["ou_id"], (string)row["ou_name"], parentou, (string)row["ou_policygroup"]);
- if( refresh )
+ if (refresh)
{
- if( Contains( ou ) == false )
+ if (Contains(ou) == false)
{
- _ous.Add( ou );
+ _ous.Add(ou);
}
}
else
{
- _ous.Add( ou );
+ _ous.Add(ou);
}
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
- private static bool Contains( Ou ou )
+ private static bool Contains(Ou ou)
{
- foreach( Ou cou in _ous )
+ foreach (Ou cou in _ous)
{
- if( cou.GetOuId() == ou.GetOuId() )
+ if (cou.GetOuId() == ou.GetOuId())
{
return true;
}
@@ -350,4 +351,5 @@ private static bool Contains( Ou ou )
return false;
}
}
-}
\ No newline at end of file
+}
+// jscpd:ignore-end
diff --git a/csharp/Linux Group Policy/LGP.Components.Database/Gateways/PolicyGateway.cs b/csharp/Linux Group Policy/LGP.Components.Database/Gateways/PolicyGateway.cs
index 2743df1..0a69c6b 100644
--- a/csharp/Linux Group Policy/LGP.Components.Database/Gateways/PolicyGateway.cs
+++ b/csharp/Linux Group Policy/LGP.Components.Database/Gateways/PolicyGateway.cs
@@ -1,5 +1,6 @@
-#region
-
+// jscpd:ignore-start
+#region
+
using System;
using System.Collections.Generic;
using System.Data;
@@ -14,7 +15,7 @@ namespace LGP.Components.Database.Gateways
internal class PolicyGateway : IPolicyGateway
{
private static readonly IOuGateway OuGateway;
- private static List< IPolicy > _policies;
+ private static List _policies;
static PolicyGateway()
{
@@ -29,57 +30,57 @@ static PolicyGateway()
/// the associated ou
/// default policy
/// IPolicy
- public IPolicy CreatePolicy( IOu ou , string defaultPolicy )
+ public IPolicy CreatePolicy(IOu ou, string defaultPolicy)
{
try
{
- if( _policies == null )
+ if (_policies == null)
{
BuildPolicyListing();
}
- var now = DateTime.Now.ToString( "yyyy-MM-dd HH:mm:ss" );
+ var now = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
- var sql = string.Format( "insert into policy values( null, '{1}' , '{1}' ,'1' ,'{2}' ,'{0}' ,'' )" , ou.GetOuId() , now , Framework.Utils.Base64Encode( defaultPolicy ) );
+ var sql = string.Format("insert into policy values( null, '{1}' , '{1}' ,'1' ,'{2}' ,'{0}' ,'' )", ou.GetOuId(), now, Framework.Utils.Base64Encode(defaultPolicy));
- if( Framework.Database.IsConnected() == false )
+ if (Framework.Database.IsConnected() == false)
{
return null;
}
- if( Framework.Database.ExecuteNonQuery( sql ) > 0 )
+ if (Framework.Database.ExecuteNonQuery(sql) > 0)
{
- var sql2 = string.Format( "select * from policy where p_id = ( select MAX(p_id) from policy )" );
+ var sql2 = string.Format("select * from policy where p_id = ( select MAX(p_id) from policy )");
- var policies = Framework.Database.ExecuteQuery( sql2 );
+ var policies = Framework.Database.ExecuteQuery(sql2);
- var policiesTable = policies.Tables[ 0 ];
+ var policiesTable = policies.Tables[0];
- if( policiesTable.Rows.Count == 0 )
+ if (policiesTable.Rows.Count == 0)
{
return null;
}
- var row = policiesTable.Rows[ 0 ];
+ var row = policiesTable.Rows[0];
- var pid = ( int ) row[ "p_id" ];
- var created = ( string ) row[ "p_created" ];
- var edited = ( string ) row[ "p_edited" ];
+ var pid = (int)row["p_id"];
+ var created = (string)row["p_created"];
+ var edited = (string)row["p_edited"];
const int enabled = 1;
var dsl = defaultPolicy;
var ouid = ou.GetOuId();
const string version = "";
- var policy = new Policy( pid , created , edited , enabled , dsl , ouid , version );
- _policies.Add( policy );
+ var policy = new Policy(pid, created, edited, enabled, dsl, ouid, version);
+ _policies.Add(policy);
- return _policies[ _policies.Count - 1 ];
+ return _policies[_policies.Count - 1];
}
return null;
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
return null;
}
}
@@ -88,36 +89,36 @@ public IPolicy CreatePolicy( IOu ou , string defaultPolicy )
/// Deletes a policy
///
/// IOu
- public void DeletePolicy( IOu ou )
+ public void DeletePolicy(IOu ou)
{
try
{
- if( _policies == null )
+ if (_policies == null)
{
BuildPolicyListing();
}
- var sql = string.Format( "delete from policy where p_ou_id='{0}'" , ou.GetOuId() );
+ var sql = string.Format("delete from policy where p_ou_id='{0}'", ou.GetOuId());
- if( Framework.Database.IsConnected() == false )
+ if (Framework.Database.IsConnected() == false)
{
return;
}
- Framework.Database.ExecuteNonQuery( sql );
+ Framework.Database.ExecuteNonQuery(sql);
- for( var h = 0; h < _policies.Count; h++ )
+ for (var h = 0; h < _policies.Count; h++)
{
- if( _policies[ h ].GetOuId() == ou.GetOuId() )
+ if (_policies[h].GetOuId() == ou.GetOuId())
{
- _policies.RemoveAt( h );
+ _policies.RemoveAt(h);
return;
}
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -125,29 +126,29 @@ public void DeletePolicy( IOu ou )
/// Deletes a policy
///
/// IPolicy
- public void DeletePolicy( IPolicy policy )
+ public void DeletePolicy(IPolicy policy)
{
try
{
- if( _policies == null )
+ if (_policies == null)
{
BuildPolicyListing();
}
- var sql = string.Format( "delete from policy where p_id='{0}'" , policy.GetId() );
+ var sql = string.Format("delete from policy where p_id='{0}'", policy.GetId());
- if( Framework.Database.IsConnected() == false )
+ if (Framework.Database.IsConnected() == false)
{
return;
}
- Framework.Database.ExecuteNonQuery( sql );
+ Framework.Database.ExecuteNonQuery(sql);
- _policies.Remove( policy );
+ _policies.Remove(policy);
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -155,36 +156,36 @@ public void DeletePolicy( IPolicy policy )
/// Deletes a policy
///
/// policy id
- public void DeletePolicy( int policyid )
+ public void DeletePolicy(int policyid)
{
try
{
- if( _policies == null )
+ if (_policies == null)
{
BuildPolicyListing();
}
- for( var h = 0; h < _policies.Count; h++ )
+ for (var h = 0; h < _policies.Count; h++)
{
- if( _policies[ h ].GetId() == policyid )
+ if (_policies[h].GetId() == policyid)
{
- var sql = string.Format( "delete from policy where p_id='{0}'" , policyid );
+ var sql = string.Format("delete from policy where p_id='{0}'", policyid);
- if( Framework.Database.IsConnected() == false )
+ if (Framework.Database.IsConnected() == false)
{
return;
}
- Framework.Database.ExecuteNonQuery( sql );
+ Framework.Database.ExecuteNonQuery(sql);
- _policies.RemoveAt( h );
+ _policies.RemoveAt(h);
return;
}
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -193,26 +194,26 @@ public void DeletePolicy( int policyid )
///
/// policy id
/// IPolicy
- public IPolicy GetPolicy( int id )
+ public IPolicy GetPolicy(int id)
{
try
{
- if( _policies == null )
+ if (_policies == null)
{
BuildPolicyListing();
}
- for( var h = 0; h < _policies.Count; h++ )
+ for (var h = 0; h < _policies.Count; h++)
{
- if( _policies[ h ].GetId() == id )
+ if (_policies[h].GetId() == id)
{
- return _policies[ h ];
+ return _policies[h];
}
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
return null;
@@ -223,26 +224,26 @@ public IPolicy GetPolicy( int id )
///
/// IOu
/// IPolicy
- public IPolicy GetPolicy( IOu ou )
+ public IPolicy GetPolicy(IOu ou)
{
try
{
- if( _policies == null )
+ if (_policies == null)
{
BuildPolicyListing();
}
- for( var h = 0; h < _policies.Count; h++ )
+ for (var h = 0; h < _policies.Count; h++)
{
- if( _policies[ h ].GetOuId() == ou.GetOuId() )
+ if (_policies[h].GetOuId() == ou.GetOuId())
{
- return _policies[ h ];
+ return _policies[h];
}
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
return null;
@@ -253,36 +254,36 @@ public IPolicy GetPolicy( IOu ou )
///
/// IPolicy
/// IPolicy
- public IPolicy GetPredecessorPolicy( IPolicy policy )
+ public IPolicy GetPredecessorPolicy(IPolicy policy)
{
try
{
- if( _policies == null )
+ if (_policies == null)
{
BuildPolicyListing();
}
- var children = OuGateway.GetChildren( policy.GetOuId() );
+ var children = OuGateway.GetChildren(policy.GetOuId());
- if( children == null )
+ if (children == null)
{
return null;
}
- foreach( var iou in children )
+ foreach (var iou in children)
{
- for( var h = 0; h < _policies.Count; h++ )
+ for (var h = 0; h < _policies.Count; h++)
{
- if( _policies[ h ].GetOuId() == iou.GetOuId() )
+ if (_policies[h].GetOuId() == iou.GetOuId())
{
- return _policies[ h ];
+ return _policies[h];
}
}
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
return null;
@@ -293,36 +294,36 @@ public IPolicy GetPredecessorPolicy( IPolicy policy )
///
/// IOu
/// IPolicy
- public IPolicy GetPredecessorPolicy( IOu ou )
+ public IPolicy GetPredecessorPolicy(IOu ou)
{
try
{
- if( _policies == null )
+ if (_policies == null)
{
BuildPolicyListing();
}
- var children = OuGateway.GetChildren( ou.GetOuId() );
+ var children = OuGateway.GetChildren(ou.GetOuId());
- if( children == null )
+ if (children == null)
{
return null;
}
- foreach( var iou in children )
+ foreach (var iou in children)
{
- for( var h = 0; h < _policies.Count; h++ )
+ for (var h = 0; h < _policies.Count; h++)
{
- if( _policies[ h ].GetOuId() == iou.GetOuId() )
+ if (_policies[h].GetOuId() == iou.GetOuId())
{
- return _policies[ h ];
+ return _policies[h];
}
}
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
return null;
@@ -333,33 +334,33 @@ public IPolicy GetPredecessorPolicy( IOu ou )
///
/// IPolicy
/// IPolicy
- public IPolicy GetAncestorPolicy( IPolicy policy )
+ public IPolicy GetAncestorPolicy(IPolicy policy)
{
try
{
- if( _policies == null )
+ if (_policies == null)
{
BuildPolicyListing();
}
- var parentOu = OuGateway.GetOuParentById( policy.GetOuId() );
+ var parentOu = OuGateway.GetOuParentById(policy.GetOuId());
- if( parentOu == null )
+ if (parentOu == null)
{
return null;
}
- for( var h = 0; h < _policies.Count; h++ )
+ for (var h = 0; h < _policies.Count; h++)
{
- if( _policies[ h ].GetOuId() == parentOu.GetOuId() )
+ if (_policies[h].GetOuId() == parentOu.GetOuId())
{
- return _policies[ h ];
+ return _policies[h];
}
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
return null;
@@ -370,28 +371,28 @@ public IPolicy GetAncestorPolicy( IPolicy policy )
///
/// IOu
/// IPolicy
- public IPolicy GetAncestorPolicy( IOu ou )
+ public IPolicy GetAncestorPolicy(IOu ou)
{
try
{
- if( _policies == null )
+ if (_policies == null)
{
BuildPolicyListing();
}
var parentou = ou.GetParentOuId();
- for( var h = 0; h < _policies.Count; h++ )
+ for (var h = 0; h < _policies.Count; h++)
{
- if( _policies[ h ].GetOuId() == parentou )
+ if (_policies[h].GetOuId() == parentou)
{
- return _policies[ h ];
+ return _policies[h];
}
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
return null;
@@ -401,9 +402,9 @@ public IPolicy GetAncestorPolicy( IOu ou )
/// Gets a list of all policies
///
/// List IPolicy
- public List< IPolicy > GetPolicies()
+ public List GetPolicies()
{
- if( _policies == null )
+ if (_policies == null)
{
BuildPolicyListing();
}
@@ -416,26 +417,26 @@ public List< IPolicy > GetPolicies()
///
/// IOu
/// IPolicy
- public IPolicy GetPolicyByOu( IOu ou )
+ public IPolicy GetPolicyByOu(IOu ou)
{
try
{
- if( _policies == null )
+ if (_policies == null)
{
BuildPolicyListing();
}
- for( var h = 0; h < _policies.Count; h++ )
+ for (var h = 0; h < _policies.Count; h++)
{
- if( _policies[ h ].GetOuId() == ou.GetOuId() )
+ if (_policies[h].GetOuId() == ou.GetOuId())
{
- return _policies[ h ];
+ return _policies[h];
}
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
return null;
@@ -448,37 +449,37 @@ public void Refresh()
{
try
{
- var sql = string.Format( "select * from policy" );
+ var sql = string.Format("select * from policy");
- if( Framework.Database.IsConnected() == false )
+ if (Framework.Database.IsConnected() == false)
{
return;
}
- var policies = Framework.Database.ExecuteQuery( sql );
+ var policies = Framework.Database.ExecuteQuery(sql);
- var policiesTable = policies.Tables[ 0 ];
+ var policiesTable = policies.Tables[0];
- if( policiesTable.Rows.Count == 0 )
+ if (policiesTable.Rows.Count == 0)
{
return;
}
- foreach( DataRow policyRow in policiesTable.Rows )
+ foreach (DataRow policyRow in policiesTable.Rows)
{
- var pid = ( int ) policyRow[ "p_id" ];
- var created = ( string ) policyRow[ "p_created" ];
- var edited = ( string ) policyRow[ "p_edited" ];
- var enabled = ( int ) policyRow[ "p_enabled" ];
- var dsl = ( string ) policyRow[ "p_dsl" ];
- var ouid = ( int ) policyRow[ "p_ou_id" ];
- var version = ( string ) policyRow[ "p_version" ];
+ var pid = (int)policyRow["p_id"];
+ var created = (string)policyRow["p_created"];
+ var edited = (string)policyRow["p_edited"];
+ var enabled = (int)policyRow["p_enabled"];
+ var dsl = (string)policyRow["p_dsl"];
+ var ouid = (int)policyRow["p_ou_id"];
+ var version = (string)policyRow["p_version"];
var newDbEntry = true;
- for( var y = 0; y < _policies.Count; y++ )
+ for (var y = 0; y < _policies.Count; y++)
{
- if( _policies[ y ].GetId() != pid )
+ if (_policies[y].GetId() != pid)
{
continue;
}
@@ -487,63 +488,64 @@ public void Refresh()
break;
}
- if( !newDbEntry )
+ if (!newDbEntry)
{
continue;
}
- var policy = new Policy( pid , created , edited , enabled , dsl , ouid , version );
- _policies.Add( policy );
+ var policy = new Policy(pid, created, edited, enabled, dsl, ouid, version);
+ _policies.Add(policy);
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
private static void BuildPolicyListing()
{
- _policies = new List< IPolicy >();
+ _policies = new List();
try
{
- var sql = string.Format( "select * from policy" );
+ var sql = string.Format("select * from policy");
- if( Framework.Database.IsConnected() == false )
+ if (Framework.Database.IsConnected() == false)
{
return;
}
- var policies = Framework.Database.ExecuteQuery( sql );
+ var policies = Framework.Database.ExecuteQuery(sql);
- var policiesTable = policies.Tables[ 0 ];
+ var policiesTable = policies.Tables[0];
- if( policiesTable.Rows.Count == 0 )
+ if (policiesTable.Rows.Count == 0)
{
return;
}
- foreach( DataRow policyRow in policiesTable.Rows )
+ foreach (DataRow policyRow in policiesTable.Rows)
{
- var pid = ( int ) policyRow[ "p_id" ];
- var created = ( string ) policyRow[ "p_created" ];
- var edited = ( string ) policyRow[ "p_edited" ];
- var enabled = ( int ) policyRow[ "p_enabled" ];
- var dsl = ( string ) policyRow[ "p_dsl" ];
- var ouid = ( int ) policyRow[ "p_ou_id" ];
- var version = ( string ) policyRow[ "p_version" ];
- var policy = new Policy( pid , created , edited , enabled , dsl , ouid , version );
- _policies.Add( policy );
+ var pid = (int)policyRow["p_id"];
+ var created = (string)policyRow["p_created"];
+ var edited = (string)policyRow["p_edited"];
+ var enabled = (int)policyRow["p_enabled"];
+ var dsl = (string)policyRow["p_dsl"];
+ var ouid = (int)policyRow["p_ou_id"];
+ var version = (string)policyRow["p_version"];
+ var policy = new Policy(pid, created, edited, enabled, dsl, ouid, version);
+ _policies.Add(policy);
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
#endregion
}
-}
\ No newline at end of file
+}
+// jscpd:ignore-end
diff --git a/csharp/Linux Group Policy/LGP.Components.Database/Plugin.cs b/csharp/Linux Group Policy/LGP.Components.Database/Plugin.cs
index 7326382..e3f5f72 100644
--- a/csharp/Linux Group Policy/LGP.Components.Database/Plugin.cs
+++ b/csharp/Linux Group Policy/LGP.Components.Database/Plugin.cs
@@ -1,5 +1,6 @@
-#region
-
+// jscpd:ignore-start
+#region
+
using System.Windows.Controls;
using LGP.Components.Factory;
using LGP.Components.Factory.Interfaces.Component;
@@ -32,7 +33,7 @@ public string GetName()
/// An image
public Image GetIcon()
{
- return Framework.Images.GetImage( "database2" , "VS2010ImageLibrary" , 14 );
+ return Framework.Images.GetImage("database2", "VS2010ImageLibrary", 14);
}
@@ -40,7 +41,7 @@ public Image GetIcon()
/// Asks the component to register is menu components
///
/// The program main menu
- public void RegisterMenuEntries( IMenu menu )
+ public void RegisterMenuEntries(IMenu menu)
{
}
@@ -99,4 +100,5 @@ public UserControl GetPreferencesControl()
#endregion
}
-}
\ No newline at end of file
+}
+// jscpd:ignore-end
diff --git a/csharp/Linux Group Policy/LGP.Components.Dialog/Plugin.cs b/csharp/Linux Group Policy/LGP.Components.Dialog/Plugin.cs
index 5165363..7a0b8af 100644
--- a/csharp/Linux Group Policy/LGP.Components.Dialog/Plugin.cs
+++ b/csharp/Linux Group Policy/LGP.Components.Dialog/Plugin.cs
@@ -1,5 +1,6 @@
-#region
-
+// jscpd:ignore-start
+#region
+
using System.Windows.Controls;
using LGP.Components.Factory;
using LGP.Components.Factory.Interfaces.Component;
@@ -32,7 +33,7 @@ public string GetName()
/// An image
public Image GetIcon()
{
- return Framework.Images.GetImage( "WindowsHS" , "VS2010ImageLibrary" , 14 );
+ return Framework.Images.GetImage("WindowsHS", "VS2010ImageLibrary", 14);
}
@@ -40,7 +41,7 @@ public Image GetIcon()
/// Asks the component to register is menu components
///
/// The program main menu
- public void RegisterMenuEntries( IMenu menu )
+ public void RegisterMenuEntries(IMenu menu)
{
}
@@ -99,4 +100,5 @@ public UserControl GetPreferencesControl()
#endregion
}
-}
\ No newline at end of file
+}
+// jscpd:ignore-end
diff --git a/csharp/Linux Group Policy/LGP.Components.Dialog/Preferences.xaml.cs b/csharp/Linux Group Policy/LGP.Components.Dialog/Preferences.xaml.cs
index 7cf7b84..e083df4 100644
--- a/csharp/Linux Group Policy/LGP.Components.Dialog/Preferences.xaml.cs
+++ b/csharp/Linux Group Policy/LGP.Components.Dialog/Preferences.xaml.cs
@@ -1,5 +1,6 @@
-#region
-
+// jscpd:ignore-start
+#region
+
using System;
using System.Windows.Controls;
using LGP.Components.Factory;
@@ -46,7 +47,7 @@ public UserControl GetControl()
}
///
- /// Aks the preferences panel to save its entries
+ /// Aks the preferences panel to save its entries // codespell:ignore aks
///
public void Save()
{
@@ -58,7 +59,7 @@ public void Save()
///
///
/// string
- public void Load( ISettings settingsParent )
+ public void Load(ISettings settingsParent)
{
this._parent = settingsParent;
}
@@ -69,7 +70,7 @@ public void Load( ISettings settingsParent )
/// Type
public Type GetControlType()
{
- return typeof( IDialog );
+ return typeof(IDialog);
}
///
@@ -78,9 +79,10 @@ public Type GetControlType()
///
public Image GetIcon()
{
- return Framework.Images.GetImage( "WindowsHS" , "VS2010ImageLibrary" , 14 );
+ return Framework.Images.GetImage("WindowsHS", "VS2010ImageLibrary", 14);
}
#endregion
}
-}
\ No newline at end of file
+}
+// jscpd:ignore-end
diff --git a/csharp/Linux Group Policy/LGP.Components.Dialog/Properties/AssemblyInfo.cs b/csharp/Linux Group Policy/LGP.Components.Dialog/Properties/AssemblyInfo.cs
index 1dd3413..34ca971 100644
--- a/csharp/Linux Group Policy/LGP.Components.Dialog/Properties/AssemblyInfo.cs
+++ b/csharp/Linux Group Policy/LGP.Components.Dialog/Properties/AssemblyInfo.cs
@@ -1,5 +1,6 @@
-#region
-
+// jscpd:ignore-start
+#region
+
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
@@ -10,20 +11,20 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
-[assembly:AssemblyTitle( "LGP.Components.Dialog" )]
-[assembly:AssemblyDescription( "" )]
-[assembly:AssemblyConfiguration( "" )]
-[assembly:AssemblyCompany( "" )]
-[assembly:AssemblyProduct( "LGP.Components.Dialog" )]
-[assembly:AssemblyCopyright( "Copyright © 2012" )]
-[assembly:AssemblyTrademark( "" )]
-[assembly:AssemblyCulture( "" )]
+[assembly: AssemblyTitle("LGP.Components.Dialog")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("LGP.Components.Dialog")]
+[assembly: AssemblyCopyright("Copyright © 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
-[assembly:ComVisible( false )]
+[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//CultureYouAreCodingWith in your .csproj file
@@ -35,13 +36,13 @@
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-[assembly:ThemeInfo(
- ResourceDictionaryLocation.None , //where theme specific resource dictionaries are located
- //(used if a resource is not found in the page,
- // or application resource dictionaries)
- ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
- //(used if a resource is not found in the page,
- // app, or any theme specific resource dictionaries)
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
)]
@@ -56,6 +57,7 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly:AssemblyVersion( "1.0.1675.1438" )]
-[assembly:AssemblyFileVersion( "1.0.1675.1438" )]
-[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("LGP.Test")]
\ No newline at end of file
+[assembly: AssemblyVersion("1.0.1675.1438")]
+[assembly: AssemblyFileVersion("1.0.1675.1438")]
+[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("LGP.Test")]
+// jscpd:ignore-end
diff --git a/csharp/Linux Group Policy/LGP.Components.Factory/Internal/ServerControl/ServerController.cs b/csharp/Linux Group Policy/LGP.Components.Factory/Internal/ServerControl/ServerController.cs
index 9d2e67b..ee4fefc 100644
--- a/csharp/Linux Group Policy/LGP.Components.Factory/Internal/ServerControl/ServerController.cs
+++ b/csharp/Linux Group Policy/LGP.Components.Factory/Internal/ServerControl/ServerController.cs
@@ -1,5 +1,6 @@
-#region
-
+// jscpd:ignore-start
+#region
+
using System;
using System.Collections.Generic;
using System.Net;
@@ -19,7 +20,7 @@ namespace LGP.Components.Factory.Internal.ServerControl
///
///
///
- public delegate void DataReceived( string data );
+ public delegate void DataReceived(string data);
#endregion
@@ -42,22 +43,22 @@ internal class ServerController : IServerController
///
///
///
- public ServerController( string serverIp , int clientId )
+ public ServerController(string serverIp, int clientId)
{
try
{
this._clientPort = clientId;
this._serverAddr = serverIp;
- this._tcpListenerThread = new Thread( this.Listener )
+ this._tcpListenerThread = new Thread(this.Listener)
{
IsBackground = true
};
this._tcpListenerThread.Start();
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -85,13 +86,13 @@ public bool Connect()
{
try
{
- this._sendingClient = new TcpClient( this._serverAddr , 50000 );
+ this._sendingClient = new TcpClient(this._serverAddr, 50000);
this._connected = true;
return this._connected;
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
this._connected = false;
return this._connected;
}
@@ -109,9 +110,9 @@ public bool Disconnect()
this._connected = false;
return !this._connected;
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
this._connected = false;
return this._connected;
}
@@ -122,30 +123,30 @@ public bool Disconnect()
///
///
///
- public bool SendMesssage( List< KeyValuePair< string , string > > message )
+ public bool SendMesssage(List> message)
{
try
{
var msg = "{";
- msg += "\"peerPort\" : " + "\"" + ( this._clientPort + 1 ) + "\",";
+ msg += "\"peerPort\" : " + "\"" + (this._clientPort + 1) + "\",";
- for( var h = 0; h < message.Count - 1; h++ )
+ for (var h = 0; h < message.Count - 1; h++)
{
- msg += "\"" + message[ h ].Key + "\" : " + "\"" + message[ h ].Value + "\",";
+ msg += "\"" + message[h].Key + "\" : " + "\"" + message[h].Value + "\",";
}
- msg += "\"" + message[ message.Count - 1 ].Key + "\" : " + "\"" + message[ message.Count - 1 ].Value + "\"";
+ msg += "\"" + message[message.Count - 1].Key + "\" : " + "\"" + message[message.Count - 1].Value + "\"";
msg += "}";
- var data = Encoding.UTF8.GetBytes( Framework.Utils.Base64Encode( msg ) );
+ var data = Encoding.UTF8.GetBytes(Framework.Utils.Base64Encode(msg));
var stream = this._sendingClient.GetStream();
- stream.Write( data , 0 , data.Length );
+ stream.Write(data, 0, data.Length);
stream.Flush();
return true;
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
return false;
}
}
@@ -159,19 +160,19 @@ public void SendPolicyUpdated()
try
{
var msg = "{";
- msg += "\"peerPort\" : " + "\"" + ( this._clientPort + 1 ) + "\",";
- msg += "\"admin\" : " + "\"" + ( this._clientPort + 1 ) + "\",";
+ msg += "\"peerPort\" : " + "\"" + (this._clientPort + 1) + "\",";
+ msg += "\"admin\" : " + "\"" + (this._clientPort + 1) + "\",";
msg += "\"request\" : " + "\"updatepolicies\"";
msg += "}";
- var data = Encoding.UTF8.GetBytes( Framework.Utils.Base64Encode( msg ) );
+ var data = Encoding.UTF8.GetBytes(Framework.Utils.Base64Encode(msg));
var stream = this._sendingClient.GetStream();
- stream.Write( data , 0 , data.Length );
+ stream.Write(data, 0, data.Length);
stream.Flush();
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -184,19 +185,19 @@ public void SendPushPolicies()
try
{
var msg = "{";
- msg += "\"peerPort\" : " + "\"" + ( this._clientPort + 1 ) + "\",";
- msg += "\"admin\" : " + "\"" + ( this._clientPort + 1 ) + "\",";
+ msg += "\"peerPort\" : " + "\"" + (this._clientPort + 1) + "\",";
+ msg += "\"admin\" : " + "\"" + (this._clientPort + 1) + "\",";
msg += "\"request\" : " + "\"pushpolicies\"";
msg += "}";
- var data = Encoding.UTF8.GetBytes( Framework.Utils.Base64Encode( msg ) );
+ var data = Encoding.UTF8.GetBytes(Framework.Utils.Base64Encode(msg));
var stream = this._sendingClient.GetStream();
- stream.Write( data , 0 , data.Length );
+ stream.Write(data, 0, data.Length);
stream.Flush();
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -209,19 +210,19 @@ public void SendPushModules()
try
{
var msg = "{";
- msg += "\"peerPort\" : " + "\"" + ( this._clientPort + 1 ) + "\",";
- msg += "\"admin\" : " + "\"" + ( this._clientPort + 1 ) + "\",";
+ msg += "\"peerPort\" : " + "\"" + (this._clientPort + 1) + "\",";
+ msg += "\"admin\" : " + "\"" + (this._clientPort + 1) + "\",";
msg += "\"request\" : " + "\"pushmodules\"";
msg += "}";
- var data = Encoding.UTF8.GetBytes( Framework.Utils.Base64Encode( msg ) );
+ var data = Encoding.UTF8.GetBytes(Framework.Utils.Base64Encode(msg));
var stream = this._sendingClient.GetStream();
- stream.Write( data , 0 , data.Length );
+ stream.Write(data, 0, data.Length);
stream.Flush();
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -234,19 +235,19 @@ public void FetchModules()
try
{
var msg = "{";
- msg += "\"peerPort\" : " + "\"" + ( this._clientPort + 1 ) + "\",";
- msg += "\"admin\" : " + "\"" + ( this._clientPort + 1 ) + "\",";
+ msg += "\"peerPort\" : " + "\"" + (this._clientPort + 1) + "\",";
+ msg += "\"admin\" : " + "\"" + (this._clientPort + 1) + "\",";
msg += "\"request\" : " + "\"fetchmodules\"";
msg += "}";
- var data = Encoding.UTF8.GetBytes( Framework.Utils.Base64Encode( msg ) );
+ var data = Encoding.UTF8.GetBytes(Framework.Utils.Base64Encode(msg));
var stream = this._sendingClient.GetStream();
- stream.Write( data , 0 , data.Length );
+ stream.Write(data, 0, data.Length);
stream.Flush();
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -254,26 +255,26 @@ public void FetchModules()
///
///
///
- public void SaveModule( string name , string contents )
+ public void SaveModule(string name, string contents)
{
try
{
var msg = "{";
- msg += "\"peerPort\" : " + "\"" + ( this._clientPort + 1 ) + "\",";
- msg += "\"admin\" : " + "\"" + ( this._clientPort + 1 ) + "\",";
+ msg += "\"peerPort\" : " + "\"" + (this._clientPort + 1) + "\",";
+ msg += "\"admin\" : " + "\"" + (this._clientPort + 1) + "\",";
msg += "\"request\" : " + "\"savemodule\",";
msg += "\"moduleName\" : \"" + name + "\",";
- msg += "\"moduleContents\" : \"" + Framework.Utils.Base64Encode( contents ) + "\"";
+ msg += "\"moduleContents\" : \"" + Framework.Utils.Base64Encode(contents) + "\"";
msg += "}";
- var data = Encoding.UTF8.GetBytes( Framework.Utils.Base64Encode( msg ) );
+ var data = Encoding.UTF8.GetBytes(Framework.Utils.Base64Encode(msg));
var stream = this._sendingClient.GetStream();
- stream.Write( data , 0 , data.Length );
+ stream.Write(data, 0, data.Length);
stream.Flush();
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -281,25 +282,25 @@ public void SaveModule( string name , string contents )
///
///
///
- public void DeleteModule( string name )
+ public void DeleteModule(string name)
{
try
{
var msg = "{";
- msg += "\"peerPort\" : " + "\"" + ( this._clientPort + 1 ) + "\",";
- msg += "\"admin\" : " + "\"" + ( this._clientPort + 1 ) + "\",";
+ msg += "\"peerPort\" : " + "\"" + (this._clientPort + 1) + "\",";
+ msg += "\"admin\" : " + "\"" + (this._clientPort + 1) + "\",";
msg += "\"request\" : " + "\"deletemodule\",";
msg += "\"moduleName\" : \"" + name + "\"";
msg += "}";
- var data = Encoding.UTF8.GetBytes( Framework.Utils.Base64Encode( msg ) );
+ var data = Encoding.UTF8.GetBytes(Framework.Utils.Base64Encode(msg));
var stream = this._sendingClient.GetStream();
- stream.Write( data , 0 , data.Length );
+ stream.Write(data, 0, data.Length);
stream.Flush();
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -309,15 +310,15 @@ public void Listener()
{
try
{
- var localAddr = IPAddress.Parse( "0.0.0.0" );
+ var localAddr = IPAddress.Parse("0.0.0.0");
- this._receivingClient = new TcpListener( localAddr , this._clientPort + 1 );
+ this._receivingClient = new TcpListener(localAddr, this._clientPort + 1);
this._receivingClient.Start();
// Buffer for reading data
var bytes = new Byte[1024];
- while( true )
+ while (true)
{
var client = this._receivingClient.AcceptTcpClient();
var stream = client.GetStream();
@@ -326,21 +327,21 @@ public void Listener()
var data = "";
- while( ( i = stream.Read( bytes , 0 , bytes.Length ) ) != 0 )
+ while ((i = stream.Read(bytes, 0, bytes.Length)) != 0)
{
- data += Encoding.ASCII.GetString( bytes , 0 , i );
+ data += Encoding.ASCII.GetString(bytes, 0, i);
}
- data = Framework.Utils.Base64Decode( data );
+ data = Framework.Utils.Base64Decode(data);
- this.OnDataReceived( data );
+ this.OnDataReceived(data);
client.Close();
}
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
@@ -355,12 +356,13 @@ public void Shutdown()
this._tcpListenerThread.Abort();
this._receivingClient.Stop();
}
- catch( Exception error )
+ catch (Exception error)
{
- Framework.EventBus.Publish( error );
+ Framework.EventBus.Publish(error);
}
}
#endregion
}
-}
\ No newline at end of file
+}
+// jscpd:ignore-end
diff --git a/csharp/Linux Group Policy/LGP.Components.Menus/ContextMenusHandler.cs b/csharp/Linux Group Policy/LGP.Components.Menus/ContextMenusHandler.cs
index 507cf42..40a3949 100644
--- a/csharp/Linux Group Policy/LGP.Components.Menus/ContextMenusHandler.cs
+++ b/csharp/Linux Group Policy/LGP.Components.Menus/ContextMenusHandler.cs
@@ -1,5 +1,6 @@
-#region
-
+// jscpd:ignore-start
+#region
+
using System;
using System.Collections.Generic;
using System.Windows;
@@ -13,18 +14,18 @@
namespace LGP.Components.Menus
{
///
- /// Conext menus handler
+ /// Conext menus handler // codespell:ignore conext
///
public class ContextMenusHandler : IContextMenus
{
- private readonly List< Entry > _registrations;
+ private readonly List _registrations;
///
/// Constructor
///
public ContextMenusHandler()
{
- this._registrations = new List< Entry >();
+ this._registrations = new List();
}
#region Implementation of IContextMenus
@@ -32,19 +33,19 @@ public ContextMenusHandler()
///
/// Asks the Context menu handler to append menu entries for a given context menu
///
- /// Conext menu to add entries to
- /// Type of item that the conext is being appended to
+ /// Conext menu to add entries to // codespell:ignore conext
+ /// Type of item that the conext is being appended to // codespell:ignore conext
/// callback
- public void AttachMenuItemRegistrations( ref ContextMenu menuparent , Type type , Action< Object , RoutedEventArgs > action )
+ public void AttachMenuItemRegistrations(ref ContextMenu menuparent, Type type, Action