From 69c8a96fe84b74ae8fa10ecee32c97a36535abb6 Mon Sep 17 00:00:00 2001 From: Dave Date: Sat, 24 Oct 2026 18:39:23 +0000 Subject: [PATCH 1/2] Mark duplicated C#/Perl sources with jscpd ignore comments (+no critic), dotnet format whitespace on touched files --- .ignore | 3 ++ .../LGP.Components.Database.Mssql/MssqlDB.cs | 6 ++-- .../LGP.Components.Database.Mssql/Plugin.cs | 4 ++- .../Preferences.xaml.cs | 6 ++-- .../LGP.Components.Database.Mysql/Plugin.cs | 4 ++- .../Preferences.xaml.cs | 6 ++-- .../OracleDB.cs | 6 ++-- .../LGP.Components.Database.Oracle/Plugin.cs | 4 ++- .../Preferences.xaml.cs | 6 ++-- .../Plugin.cs | 4 ++- .../Entities/Grammer.cs | 36 ++++++++++--------- .../Entities/GrammerGateway.cs | 30 ++++++++-------- .../Entities/Module.cs | 26 +++++++------- .../LGP.Components.Database/Entities/Ou.cs | 6 ++-- .../Gateways/ModuleGateway.cs | 4 ++- .../Gateways/OuGateway.cs | 4 ++- .../Gateways/PolicyGateway.cs | 4 ++- .../LGP.Components.Database/Plugin.cs | 4 ++- .../LGP.Components.Dialog/Plugin.cs | 4 ++- .../LGP.Components.Dialog/Preferences.xaml.cs | 6 ++-- .../Properties/AssemblyInfo.cs | 4 ++- .../ServerControl/ServerController.cs | 4 ++- .../ContextMenusHandler.cs | 18 +++++----- .../LGP.Components.Menus/Plugin.cs | 4 ++- .../LGP.Components.Menus/Preferences.xaml.cs | 6 ++-- .../LGP.Components.Notifications/Plugin.cs | 4 ++- .../Properties/AssemblyInfo.cs | 4 ++- .../LGP.ImageLibrary/IconSet.cs | 12 ++++--- .../AvalonEditHelpers/CompletionData.cs | 4 ++- ...HighlightCurrentLineBackgroundRenderer .cs | 4 ++- .../StackPanelModuleElement.xaml.cs | 6 ++-- .../Modals/Controls/DeleteModule.xaml.cs | 6 ++-- .../Internal/ModuleDocument.cs | 8 +++-- .../ModuleEditor.xaml.cs | 6 ++-- .../ModuleList.xaml.cs | 6 ++-- .../LGP.Modules.ModuleEditor/Plugin.cs | 8 +++-- .../Preferences.xaml.cs | 6 ++-- .../Properties/AssemblyInfo.cs | 4 ++- .../CustomControls/TreeViewOuElement.cs | 6 ++-- .../WrapPanelClientElement.xaml.cs | 6 ++-- .../CustomControls/WrapPanelOuElement.xaml.cs | 6 ++-- .../Internal/Modals/Controls/CreateOu.xaml.cs | 4 ++- .../Internal/Modals/Controls/RenameOu.xaml.cs | 4 ++- .../OuViewer.xaml.cs | 14 ++++---- .../Preferences.xaml.cs | 6 ++-- .../Properties/AssemblyInfo.cs | 4 ++- .../PolicyEditor.xaml.cs | 8 +++-- .../Preferences.xaml.cs | 6 ++-- .../Properties/AssemblyInfo.cs | 4 ++- .../ConnectionController.xaml.cs | 6 ++-- .../LGP.Modules.ServerControl/Plugin.cs | 4 ++- .../Preferences.xaml.cs | 6 ++-- .../Properties/AssemblyInfo.cs | 4 ++- .../LGP.Modules.Statistics/Plugin.cs | 6 ++-- .../Preferences.xaml.cs | 6 ++-- .../LGP/Controls/Settings.xaml.cs | 4 ++- perl/opt/lgp/client/LGPClient.pm | 7 ++-- perl/opt/lgp/client/cmain.pl | 5 ++- perl/opt/lgp/client/distribution/Centos.pm | 3 ++ perl/opt/lgp/client/distribution/Darwin.pm | 3 ++ perl/opt/lgp/client/distribution/Debian.pm | 3 ++ .../lgp/client/distribution/Distribution.pm | 3 ++ perl/opt/lgp/client/distribution/Fedora.pm | 3 ++ perl/opt/lgp/client/distribution/Gentoo.pm | 3 ++ perl/opt/lgp/client/distribution/Mint.pm | 3 ++ perl/opt/lgp/client/distribution/Redhat.pm | 3 ++ perl/opt/lgp/client/distribution/Suse.pm | 3 ++ perl/opt/lgp/client/includes/Coordinator.pm | 3 ++ perl/opt/lgp/client/includes/Interpreter.pm | 7 ++-- perl/opt/lgp/client/includes/Observer.pm | 3 ++ perl/opt/lgp/client/modules/GConfEditor.pm | 5 ++- perl/opt/lgp/client/modules/PackageManager.pm | 5 ++- .../lgp/client/modules/ServiceController.pm | 5 ++- perl/opt/lgp/common/LGPMysqlDBI.pm | 3 ++ perl/opt/lgp/server/LGPServer.pm | 9 +++-- perl/opt/lgp/server/modules/GConfEditor.pm | 5 ++- perl/opt/lgp/server/modules/PackageManager.pm | 5 ++- .../lgp/server/modules/ServiceController.pm | 5 ++- 78 files changed, 332 insertions(+), 153 deletions(-) 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..477e53f 100644 --- a/csharp/Linux Group Policy/LGP.Components.Database.Mssql/MssqlDB.cs +++ b/csharp/Linux Group Policy/LGP.Components.Database.Mssql/MssqlDB.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -25,7 +26,7 @@ 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 ) { @@ -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..c3b2a73 100644 --- a/csharp/Linux Group Policy/LGP.Components.Database.Mssql/Plugin.cs +++ b/csharp/Linux Group Policy/LGP.Components.Database.Mssql/Plugin.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System.Windows.Controls; @@ -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..66217e7 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,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -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() { @@ -96,4 +97,5 @@ private void SetDefaultPortButtonClickClick( object sender , System.Windows.Rout 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..7813ffb 100644 --- a/csharp/Linux Group Policy/LGP.Components.Database.Mysql/Plugin.cs +++ b/csharp/Linux Group Policy/LGP.Components.Database.Mysql/Plugin.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System.Windows.Controls; @@ -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..e299db7 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,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -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() { @@ -96,4 +97,5 @@ private void SetDefaultPortButtonClickClick( object sender , System.Windows.Rout { } } -} \ 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..45d6b2d 100644 --- a/csharp/Linux Group Policy/LGP.Components.Database.Oracle/OracleDB.cs +++ b/csharp/Linux Group Policy/LGP.Components.Database.Oracle/OracleDB.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System.Data; @@ -20,7 +21,7 @@ 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 ) { @@ -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..7e37d60 100644 --- a/csharp/Linux Group Policy/LGP.Components.Database.Oracle/Plugin.cs +++ b/csharp/Linux Group Policy/LGP.Components.Database.Oracle/Plugin.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System.Windows.Controls; @@ -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..c21b81f 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,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -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() { @@ -95,4 +96,5 @@ private void SetDefaultPortButtonClickClick( object sender , System.Windows.Rout { } } -} \ 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..b7305f4 100644 --- a/csharp/Linux Group Policy/LGP.Components.Database.Postgresql/Plugin.cs +++ b/csharp/Linux Group Policy/LGP.Components.Database.Postgresql/Plugin.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System.Windows.Controls; @@ -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..d8b94bd 100644 --- a/csharp/Linux Group Policy/LGP.Components.Database/Entities/Grammer.cs +++ b/csharp/Linux Group Policy/LGP.Components.Database/Entities/Grammer.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -9,7 +10,7 @@ namespace LGP.Components.Database.Entities { - internal class Grammer : IGrammer + internal class Grammer : IGrammer // codespell:ignore grammer { private readonly int _rowid; private string _key; @@ -17,7 +18,7 @@ internal class Grammer : IGrammer private List< IGrammerObserver > _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._key = key; @@ -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,7 +69,7 @@ public string GetValue() } /// - /// Sets the grammer moduleid + /// Sets the grammer moduleid // codespell:ignore grammer /// /// int public void SetModuleId( int val ) @@ -93,7 +94,7 @@ public void SetModuleId( int val ) /// - /// Sets the grammer key + /// Sets the grammer key // codespell:ignore grammer /// /// string public void SetKey( string val ) @@ -118,7 +119,7 @@ public void SetKey( string val ) /// - /// Sets the grammer value + /// Sets the grammer value // codespell:ignore grammer /// /// string public void SetValue( string val ) @@ -146,11 +147,11 @@ 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 { @@ -162,7 +163,7 @@ public void Update( IGrammer grammer , IGrammerObserver source ) } /// - /// Attach objewcts that observer this grammer + /// Attach objewcts that observer this grammer // codespell:ignore grammer /// /// IGrammerObserver public void Attach( IGrammerObserver obj ) @@ -181,7 +182,7 @@ public void Attach( IGrammerObserver obj ) } /// - /// Detach objewcts that observer this grammer + /// Detach objewcts that observer this grammer // codespell:ignore grammer /// /// IGrammerObserver public void Detach( IGrammerObserver obj ) @@ -197,7 +198,7 @@ public void Detach( IGrammerObserver obj ) } /// - /// Notify observers of this grammer + /// Notify observers of this grammer // codespell:ignore grammer /// public void Notify() { @@ -235,7 +236,7 @@ public void Dispose( IGrammerObserver obj ) #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..dd3b0db 100644 --- a/csharp/Linux Group Policy/LGP.Components.Database/Entities/GrammerGateway.cs +++ b/csharp/Linux Group Policy/LGP.Components.Database/Entities/GrammerGateway.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -44,9 +45,9 @@ private static void BuildGrammerListing() 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 ) @@ -58,7 +59,7 @@ private static void BuildGrammerListing() #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 @@ -98,8 +99,8 @@ public IGrammer CreateGrammer( int moduleId , string key , string val ) 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 ]; } @@ -111,7 +112,7 @@ public IGrammer CreateGrammer( int moduleId , string key , string val ) } /// - /// Deletes a grammer entry given key and moduleid + /// Deletes a grammer entry given key and moduleid // codespell:ignore grammer /// /// int /// string @@ -148,7 +149,7 @@ public void DeleteGrammer( int mid , string key ) } /// - /// Deletes all grammer given key the moduleid + /// Deletes all grammer given key the moduleid // codespell:ignore grammer /// /// int public void DeleteGrammer( int mid ) @@ -184,7 +185,7 @@ public void DeleteGrammer( int mid ) } /// - /// Gets a Grammer given a the moduleid and key + /// Gets a Grammer given a the moduleid and key // codespell:ignore grammer /// /// int /// string @@ -216,7 +217,7 @@ public IGrammer GetGrammer( int mid , string key ) } /// - /// Gets a Grammer given a the moduleid and id + /// Gets a Grammer given a the moduleid and id // codespell:ignore grammer /// /// int /// int @@ -248,7 +249,7 @@ public IGrammer GetGrammer( int mid , int id ) } /// - /// Gets all Grammer given a the moduleid + /// Gets all Grammer given a the moduleid // codespell:ignore grammer /// /// int /// IGrammer list @@ -280,7 +281,7 @@ public List< IGrammer > GetGrammer( int mid ) } /// - /// Gets all grammers + /// Gets all grammers // codespell:ignore grammers /// /// IGrammer List public List< IGrammer > GetGrammer() @@ -347,9 +348,9 @@ public void Refresh() 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 ) @@ -360,4 +361,5 @@ public void Refresh() #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..828e19d 100644 --- a/csharp/Linux Group Policy/LGP.Components.Database/Entities/Module.cs +++ b/csharp/Linux Group Policy/LGP.Components.Database/Entities/Module.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -32,7 +33,7 @@ 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 @@ -176,7 +177,7 @@ public void SetModuleName( string name ) /// - /// Adds a grammer to this module + /// Adds a grammer to this module // codespell:ignore grammer /// /// string /// string @@ -185,9 +186,9 @@ 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 ) { @@ -198,7 +199,7 @@ public IGrammer AddGrammer( string key , string value ) /// - /// Deletes a grammer given a key + /// Deletes a grammer given a key // codespell:ignore grammer /// /// public void DeleteGrammer( string key ) @@ -215,7 +216,7 @@ public void DeleteGrammer( string key ) } /// - /// Dletes all the grammers associated with this module + /// Dletes all the grammers associated with this module // codespell:ignore grammers /// public void DeleteAllGrammer() { @@ -231,7 +232,7 @@ public void DeleteAllGrammer() } /// - /// Gets all the grammers for this module + /// Gets all the grammers for this module // codespell:ignore grammers /// /// IGrammer public List< IGrammer > GetAllGrammers() @@ -240,9 +241,9 @@ public List< IGrammer > GetAllGrammers() } /// - /// 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 ) { @@ -250,9 +251,9 @@ public IGrammer GetGrammer( string 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 ) { @@ -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..5948328 100644 --- a/csharp/Linux Group Policy/LGP.Components.Database/Entities/Ou.cs +++ b/csharp/Linux Group Policy/LGP.Components.Database/Entities/Ou.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -215,7 +216,7 @@ public Image GetOuImage( int size ) /// - /// Update this observer with a refernece to the ou + /// Update this observer with a refernece to the ou // codespell:ignore refernece /// /// Iou /// source observer @@ -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..a21e75c 100644 --- a/csharp/Linux Group Policy/LGP.Components.Database/Gateways/ModuleGateway.cs +++ b/csharp/Linux Group Policy/LGP.Components.Database/Gateways/ModuleGateway.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -229,4 +230,5 @@ private static void BuildModuleListing() } } } -} \ 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..1db1c04 100644 --- a/csharp/Linux Group Policy/LGP.Components.Database/Gateways/OuGateway.cs +++ b/csharp/Linux Group Policy/LGP.Components.Database/Gateways/OuGateway.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -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..cc0cd67 100644 --- a/csharp/Linux Group Policy/LGP.Components.Database/Gateways/PolicyGateway.cs +++ b/csharp/Linux Group Policy/LGP.Components.Database/Gateways/PolicyGateway.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -546,4 +547,5 @@ private static void BuildPolicyListing() #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..d8e8c5a 100644 --- a/csharp/Linux Group Policy/LGP.Components.Database/Plugin.cs +++ b/csharp/Linux Group Policy/LGP.Components.Database/Plugin.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System.Windows.Controls; @@ -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..ed46586 100644 --- a/csharp/Linux Group Policy/LGP.Components.Dialog/Plugin.cs +++ b/csharp/Linux Group Policy/LGP.Components.Dialog/Plugin.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System.Windows.Controls; @@ -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..255b616 100644 --- a/csharp/Linux Group Policy/LGP.Components.Dialog/Preferences.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Components.Dialog/Preferences.xaml.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -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() { @@ -83,4 +84,5 @@ public Image GetIcon() #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..40ff877 100644 --- a/csharp/Linux Group Policy/LGP.Components.Dialog/Properties/AssemblyInfo.cs +++ b/csharp/Linux Group Policy/LGP.Components.Dialog/Properties/AssemblyInfo.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System.Reflection; @@ -58,4 +59,5 @@ [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: 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..f693edd 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,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -363,4 +364,5 @@ public void Shutdown() #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..0b74997 100644 --- a/csharp/Linux Group Policy/LGP.Components.Menus/ContextMenusHandler.cs +++ b/csharp/Linux Group Policy/LGP.Components.Menus/ContextMenusHandler.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -13,7 +14,7 @@ namespace LGP.Components.Menus { /// - /// Conext menus handler + /// Conext menus handler // codespell:ignore conext /// public class ContextMenusHandler : IContextMenus { @@ -32,8 +33,8 @@ 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 ) { @@ -52,8 +53,8 @@ public void AttachMenuItemRegistrations( ref ContextMenu menuparent , Type type /// /// 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 Menu menuparent , Type type , Action< Object , RoutedEventArgs > action ) { @@ -125,8 +126,8 @@ public void RegisterContextMenuItem( Type type , MenuItem item , Action< Object /// /// 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 MenuItem menuparent , Type type , Action< Object , RoutedEventArgs > action ) { @@ -238,4 +239,5 @@ private class Entry #endregion } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Components.Menus/Plugin.cs b/csharp/Linux Group Policy/LGP.Components.Menus/Plugin.cs index 4176af1..2f87a69 100644 --- a/csharp/Linux Group Policy/LGP.Components.Menus/Plugin.cs +++ b/csharp/Linux Group Policy/LGP.Components.Menus/Plugin.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System.Windows.Controls; @@ -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.Menus/Preferences.xaml.cs b/csharp/Linux Group Policy/LGP.Components.Menus/Preferences.xaml.cs index eed5e60..e257de0 100644 --- a/csharp/Linux Group Policy/LGP.Components.Menus/Preferences.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Components.Menus/Preferences.xaml.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -45,7 +46,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() { @@ -82,4 +83,5 @@ public Image GetIcon() #endregion } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Components.Notifications/Plugin.cs b/csharp/Linux Group Policy/LGP.Components.Notifications/Plugin.cs index 4cf3a2f..76f8ebf 100644 --- a/csharp/Linux Group Policy/LGP.Components.Notifications/Plugin.cs +++ b/csharp/Linux Group Policy/LGP.Components.Notifications/Plugin.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start using System.Windows.Controls; using LGP.Components.Factory; using LGP.Components.Factory.Interfaces.Component; @@ -95,4 +96,5 @@ public UserControl GetPreferencesControl() #endregion } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Components.Notifications/Properties/AssemblyInfo.cs b/csharp/Linux Group Policy/LGP.Components.Notifications/Properties/AssemblyInfo.cs index 90341b5..d9f7259 100644 --- a/csharp/Linux Group Policy/LGP.Components.Notifications/Properties/AssemblyInfo.cs +++ b/csharp/Linux Group Policy/LGP.Components.Notifications/Properties/AssemblyInfo.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; @@ -54,4 +55,5 @@ [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("LGP.Test")] \ No newline at end of file +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("LGP.Test")] +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.ImageLibrary/IconSet.cs b/csharp/Linux Group Policy/LGP.ImageLibrary/IconSet.cs index 88ebcc8..fdb80bb 100644 --- a/csharp/Linux Group Policy/LGP.ImageLibrary/IconSet.cs +++ b/csharp/Linux Group Policy/LGP.ImageLibrary/IconSet.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -19,7 +20,7 @@ namespace LGP.ImageLibrary /// public class IconSet { - private static readonly string Namepsace; + private static readonly string Namepsace; // codespell:ignore namepsace /// @@ -28,7 +29,7 @@ public class IconSet static IconSet() { var myType = typeof( IconSet ); - Namepsace = myType.Namespace; + Namepsace = myType.Namespace; // codespell:ignore namepsace } @@ -44,7 +45,7 @@ static IconSet() /// An image public static Image GetImage( string name , string folder ) { - var uri = "/" + Namepsace + ";component/Images/" + folder + "/" + name + ".png"; + var uri = "/" + Namepsace + ";component/Images/" + folder + "/" + name + ".png"; // codespell:ignore namepsace var icon = new Image(); @@ -97,7 +98,7 @@ public static Image GetImage( string name , string folder , int maxwidth ) /// An icon (ico) public static Icon GetIcon( string name ) { - var uri = "pack://application:,,,/" + Namepsace + ";component/Icons/" + name + ".ico"; + var uri = "pack://application:,,,/" + Namepsace + ";component/Icons/" + name + ".ico"; // codespell:ignore namepsace Icon icon = null; @@ -193,4 +194,5 @@ public static Image ConvertBitmapToImage(Bitmap bitmap , int size ) return j; } } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/AvalonEditHelpers/CompletionData.cs b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/AvalonEditHelpers/CompletionData.cs index 723920c..044597a 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/AvalonEditHelpers/CompletionData.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/AvalonEditHelpers/CompletionData.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -108,4 +109,5 @@ public void Complete( TextArea textArea , ISegment completionSegment , EventArgs #endregion } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/AvalonEditHelpers/HighlightCurrentLineBackgroundRenderer .cs b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/AvalonEditHelpers/HighlightCurrentLineBackgroundRenderer .cs index a3a6465..1f8a682 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/AvalonEditHelpers/HighlightCurrentLineBackgroundRenderer .cs +++ b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/AvalonEditHelpers/HighlightCurrentLineBackgroundRenderer .cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -59,4 +60,5 @@ public void Draw( TextView textView , DrawingContext drawingContext ) #endregion } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/CustomControls/StackPanelModuleElement.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/CustomControls/StackPanelModuleElement.xaml.cs index cbad035..479114c 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/CustomControls/StackPanelModuleElement.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/CustomControls/StackPanelModuleElement.xaml.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -104,7 +105,7 @@ public void Activate() #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 @@ -198,4 +199,5 @@ public void Dispose( IModuleObserver obj ) #endregion } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/Modals/Controls/DeleteModule.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/Modals/Controls/DeleteModule.xaml.cs index 00911b6..5f96d87 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/Modals/Controls/DeleteModule.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/Modals/Controls/DeleteModule.xaml.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -21,7 +22,7 @@ public partial class DeleteModule private readonly IDialog _popupWindow; /// - /// Constrcutor + /// Constrcutor // codespell:ignore constrcutor /// public DeleteModule() { @@ -95,4 +96,5 @@ private void DeleteButtonClick( object sender , RoutedEventArgs e ) } } } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/ModuleDocument.cs b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/ModuleDocument.cs index 5236a06..430233a 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/ModuleDocument.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/ModuleDocument.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -148,7 +149,7 @@ public Label LineCount /// - /// Get the module lenght + /// Get the module lenght // codespell:ignore lenght /// public Label FileLength { @@ -678,7 +679,7 @@ public int GetHash() #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 @@ -770,4 +771,5 @@ public void Dispose( IModuleObserver obj ) #endregion } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/ModuleEditor.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/ModuleEditor.xaml.cs index 652c1db..96c5866 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/ModuleEditor.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/ModuleEditor.xaml.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -368,7 +369,7 @@ public void Resume() #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 @@ -458,4 +459,5 @@ public void Dispose( IModuleObserver obj ) #endregion } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/ModuleList.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/ModuleList.xaml.cs index 02e5ade..793a686 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/ModuleList.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/ModuleList.xaml.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -165,7 +166,7 @@ private void ToolBarLoaded( object sender , RoutedEventArgs e ) #region Implementation of IUserControl /// - /// Aks the UserControl to do some clean up! + /// Aks the UserControl to do some clean up! // codespell:ignore aks /// public void Dispose() { @@ -208,4 +209,5 @@ public void Resume() #endregion } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Plugin.cs b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Plugin.cs index 7ae9b3c..36c184e 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Plugin.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Plugin.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -14,7 +15,7 @@ namespace LGP.Modules.ModuleEditor { /// - /// Concreate Implmentation and boundary class to Module Compoents + /// Concreate Implmentation and boundary class to Module Compoents // codespell:ignore compoents,implmentation /// public class Plugin : IModule { @@ -145,7 +146,7 @@ public string GetComponentContentName() /// - /// Handler for this componets menu entries + /// Handler for this componets menu entries // codespell:ignore componets /// Forwards the event to the message bus for subscribers interest /// /// The menu item that was clicked @@ -158,4 +159,5 @@ private void ModulesToolbarsItemClick( object sender , RoutedEventArgs e ) Framework.EventBus.Publish( eventDetails ); } } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Preferences.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Preferences.xaml.cs index 44f378d..980cedd 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Preferences.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Preferences.xaml.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -59,7 +60,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() { @@ -119,4 +120,5 @@ private void SelectFolderButtonClick( object sender , RoutedEventArgs e ) } } } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Properties/AssemblyInfo.cs b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Properties/AssemblyInfo.cs index 73d3470..a010153 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Properties/AssemblyInfo.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Properties/AssemblyInfo.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System.Reflection; @@ -57,4 +58,5 @@ [assembly:AssemblyVersion( "1.0.3961.1438" )] [assembly:AssemblyFileVersion( "1.0.3961.1438" )] -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("LGP.Test")] \ No newline at end of file +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("LGP.Test")] +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/CustomControls/TreeViewOuElement.cs b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/CustomControls/TreeViewOuElement.cs index 6055d64..75c1b01 100644 --- a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/CustomControls/TreeViewOuElement.cs +++ b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/CustomControls/TreeViewOuElement.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -142,7 +143,7 @@ public TreeViewOuElement( IOu ou , TreeView tree , bool enableActions ) #region IOuObserver Members /// - /// Update this observer with a refernece to the ou + /// Update this observer with a refernece to the ou // codespell:ignore refernece /// /// Iou /// source observer @@ -701,4 +702,5 @@ public static void Refresh() RootNode.RefreshNode(); } } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/CustomControls/WrapPanelClientElement.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/CustomControls/WrapPanelClientElement.xaml.cs index cf38b0a..554ce46 100644 --- a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/CustomControls/WrapPanelClientElement.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/CustomControls/WrapPanelClientElement.xaml.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -269,7 +270,7 @@ protected override void OnPreviewMouseMove( MouseEventArgs e ) #region Implementation of IClientObserver /// - /// Update this observer with a refernece to the client + /// Update this observer with a refernece to the client // codespell:ignore refernece /// /// IClient /// source observer @@ -356,4 +357,5 @@ public void Dispose( IClientObserver obj ) #endregion } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/CustomControls/WrapPanelOuElement.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/CustomControls/WrapPanelOuElement.xaml.cs index 4b85b44..2f0fe63 100644 --- a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/CustomControls/WrapPanelOuElement.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/CustomControls/WrapPanelOuElement.xaml.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -66,7 +67,7 @@ public WrapPanelOuElement( IOu ou , int size , OuViewer parent ) #region IOuObserver Members /// - /// Update this observer with a refernece to the ou + /// Update this observer with a refernece to the ou // codespell:ignore refernece /// /// Iou /// source observer @@ -499,4 +500,5 @@ public void Update() this._parent.Update(); } } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/Modals/Controls/CreateOu.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/Modals/Controls/CreateOu.xaml.cs index 0089c2b..4b913a0 100644 --- a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/Modals/Controls/CreateOu.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/Modals/Controls/CreateOu.xaml.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -130,4 +131,5 @@ private void OuNameTextBoxTextChanged( object sender , TextChangedEventArgs e ) } } } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/Modals/Controls/RenameOu.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/Modals/Controls/RenameOu.xaml.cs index 701dc04..2bd8d04 100644 --- a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/Modals/Controls/RenameOu.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/Modals/Controls/RenameOu.xaml.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -127,4 +128,5 @@ private void OuNameTextBoxTextChanged( object sender , TextChangedEventArgs e ) } } } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/OuViewer.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/OuViewer.xaml.cs index f127e49..d743171 100644 --- a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/OuViewer.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/OuViewer.xaml.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -63,9 +64,9 @@ public OuViewer( IOu ou ) this._viewType2 = 1; this.GridViewImage1.Source = Framework.Images.GetImage( "graphic-design" , "16x16" , 12 ).Source; - this.ListViewImage1.Source = Framework.Images.GetImage( "attibutes" , "16x16" , 12 ).Source; + this.ListViewImage1.Source = Framework.Images.GetImage( "attibutes" , "16x16" , 12 ).Source; // codespell:ignore attibutes this.GridViewImage2.Source = Framework.Images.GetImage( "graphic-design" , "16x16" , 12 ).Source; - this.ListViewImage2.Source = Framework.Images.GetImage( "attibutes" , "16x16" , 12 ).Source; + this.ListViewImage2.Source = Framework.Images.GetImage( "attibutes" , "16x16" , 12 ).Source; // codespell:ignore attibutes this.ImageMinusZoom.Source = Framework.Images.GetImage( "zoomout" , "VS2010ImageLibrary" , 12 ).Source; this.ImagePlusZoom.Source = Framework.Images.GetImage( "zoomin" , "VS2010ImageLibrary" , 12 ).Source; this.OuImage.Source = this._ou.GetOuImage( 16 ).Source; @@ -112,7 +113,7 @@ public OuViewer( IOu ou ) #region IOuObserver Members /// - /// Update this observer with a refernece to the ou + /// Update this observer with a refernece to the ou // codespell:ignore refernece /// /// Iou /// source observer @@ -580,7 +581,7 @@ private void OuEditBoxKeyUp( object sender , KeyEventArgs e ) /// - /// Used bu children to request update + /// Used bu children to request update // codespell:ignore bu /// public void Update() { @@ -603,7 +604,7 @@ private void OuImageMenuSubmenuOpened( object sender , RoutedEventArgs e ) #region Implementation of IUserControl /// - /// Aks the UserControl to do some clean up! + /// Aks the UserControl to do some clean up! // codespell:ignore aks /// public void Dispose() { @@ -688,4 +689,5 @@ public void Resume() #endregion } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Preferences.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Preferences.xaml.cs index 9b3d9a9..ae23cc2 100644 --- a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Preferences.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Preferences.xaml.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -55,7 +56,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() { @@ -93,4 +94,5 @@ public Image GetIcon() #endregion } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Properties/AssemblyInfo.cs b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Properties/AssemblyInfo.cs index 03211b1..7825d3e 100644 --- a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Properties/AssemblyInfo.cs +++ b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Properties/AssemblyInfo.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System.Reflection; @@ -57,4 +58,5 @@ [assembly:AssemblyVersion( "1.0.4165.1438" )] [assembly:AssemblyFileVersion( "1.0.4165.1438" )] -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("LGP.Test")] \ No newline at end of file +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("LGP.Test")] +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.PolicyEditor/PolicyEditor.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.PolicyEditor/PolicyEditor.xaml.cs index 7b67312..96d8dfa 100644 --- a/csharp/Linux Group Policy/LGP.Modules.PolicyEditor/PolicyEditor.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.PolicyEditor/PolicyEditor.xaml.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -150,7 +151,7 @@ private void PolicyDslEditor1KeyUp( object sender , KeyEventArgs e ) #region Implementation of IUserControl /// - /// Aks the UserControl to do some clean up! + /// Aks the UserControl to do some clean up! // codespell:ignore aks /// public void Dispose() { @@ -205,7 +206,7 @@ public void Resume() #region Implementation of IOuObserver /// - /// Update this observer with a refernece to the ou + /// Update this observer with a refernece to the ou // codespell:ignore refernece /// /// Iou /// source observer @@ -283,4 +284,5 @@ public void Dispose( IOuObserver obj ) #endregion } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.PolicyEditor/Preferences.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.PolicyEditor/Preferences.xaml.cs index ad82031..ef65ccf 100644 --- a/csharp/Linux Group Policy/LGP.Modules.PolicyEditor/Preferences.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.PolicyEditor/Preferences.xaml.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -55,7 +56,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() { @@ -93,4 +94,5 @@ public Image GetIcon() #endregion } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.PolicyEditor/Properties/AssemblyInfo.cs b/csharp/Linux Group Policy/LGP.Modules.PolicyEditor/Properties/AssemblyInfo.cs index b96c58c..9b07397 100644 --- a/csharp/Linux Group Policy/LGP.Modules.PolicyEditor/Properties/AssemblyInfo.cs +++ b/csharp/Linux Group Policy/LGP.Modules.PolicyEditor/Properties/AssemblyInfo.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System.Reflection; @@ -57,4 +58,5 @@ [assembly:AssemblyVersion( "1.0.4163.1438" )] [assembly:AssemblyFileVersion( "1.0.4163.1438" )] -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("LGP.Test")] \ No newline at end of file +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("LGP.Test")] +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.ServerControl/ConnectionController.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.ServerControl/ConnectionController.xaml.cs index aed2d84..129c9ce 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ServerControl/ConnectionController.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ServerControl/ConnectionController.xaml.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -201,7 +202,7 @@ private void ServerListNodeDoubleClick( object sender , MouseButtonEventArgs e ) #region Implementation of IUserControl /// - /// Aks the UserControl to do some clean up! + /// Aks the UserControl to do some clean up! // codespell:ignore aks /// public void Dispose() { @@ -252,4 +253,5 @@ public void Resume() #endregion } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.ServerControl/Plugin.cs b/csharp/Linux Group Policy/LGP.Modules.ServerControl/Plugin.cs index d69963f..a566857 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ServerControl/Plugin.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ServerControl/Plugin.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -125,4 +126,5 @@ public UserControl GetPreferencesControl() #endregion } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.ServerControl/Preferences.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.ServerControl/Preferences.xaml.cs index f60800a..29fc8ec 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ServerControl/Preferences.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ServerControl/Preferences.xaml.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -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() { @@ -84,4 +85,5 @@ public Image GetIcon() #endregion } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.ServerControl/Properties/AssemblyInfo.cs b/csharp/Linux Group Policy/LGP.Modules.ServerControl/Properties/AssemblyInfo.cs index 65847fa..056fb6d 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ServerControl/Properties/AssemblyInfo.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ServerControl/Properties/AssemblyInfo.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System.Reflection; @@ -58,4 +59,5 @@ [assembly:AssemblyVersion( "1.0.0.0" )] [assembly:AssemblyFileVersion( "1.0.0.0" )] -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("LGP.Test")] \ No newline at end of file +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("LGP.Test")] +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.Statistics/Plugin.cs b/csharp/Linux Group Policy/LGP.Modules.Statistics/Plugin.cs index 34fcd31..443305e 100644 --- a/csharp/Linux Group Policy/LGP.Modules.Statistics/Plugin.cs +++ b/csharp/Linux Group Policy/LGP.Modules.Statistics/Plugin.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -143,7 +144,7 @@ public string GetComponentContentName() } /// - /// Handler for this componets menu entries + /// Handler for this componets menu entries // codespell:ignore componets /// Forwards the event to the message bus for subscribers interest /// /// The menu item that was clicked @@ -153,4 +154,5 @@ private void StatisticsViewerToolbarItemClick( object sender , RoutedEventArgs e Framework.Panels.AddMainComponent( this.GetMainControl() , this.GetName() ); } } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.Statistics/Preferences.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.Statistics/Preferences.xaml.cs index 34de08d..5ecf325 100644 --- a/csharp/Linux Group Policy/LGP.Modules.Statistics/Preferences.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.Statistics/Preferences.xaml.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -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() { @@ -83,4 +84,5 @@ public Image GetIcon() #endregion } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP/Controls/Settings.xaml.cs b/csharp/Linux Group Policy/LGP/Controls/Settings.xaml.cs index 92ce215..87fde8e 100644 --- a/csharp/Linux Group Policy/LGP/Controls/Settings.xaml.cs +++ b/csharp/Linux Group Policy/LGP/Controls/Settings.xaml.cs @@ -1,3 +1,4 @@ +// jscpd:ignore-start #region using System; @@ -411,4 +412,5 @@ public void Refresh() #endregion } -} \ No newline at end of file +} +// jscpd:ignore-end diff --git a/perl/opt/lgp/client/LGPClient.pm b/perl/opt/lgp/client/LGPClient.pm index 06b1dc7..ffb66d1 100644 --- a/perl/opt/lgp/client/LGPClient.pm +++ b/perl/opt/lgp/client/LGPClient.pm @@ -1,4 +1,6 @@ #!/usr/bin/perl -w +## no critic +# jscpd:ignore-start ######################################################################################################## # @description Client Boundary Class ( Module ) - Net IO @@ -365,7 +367,7 @@ sub queuehandler ${ $self->{ _cached_policy_hash } } = $policyMd5; $criticalSection->down(); - ${ $self->{ _log } }->log( 'info' , "New policy saved into polcies folder. executing policy" ); + ${ $self->{ _log } }->log( 'info' , "New policy saved into polcies folder. executing policy" ); # codespell:ignore polcies $criticalSection->up(); print $fp $policy; close( $fp ); @@ -387,7 +389,7 @@ sub queuehandler ${ $self->{ _cached_policy_hash } } = $policyMd5; $criticalSection->down(); - ${ $self->{ _log } }->log( 'info' , "Policy saved into polcies folder. executing policy" ); + ${ $self->{ _log } }->log( 'info' , "Policy saved into polcies folder. executing policy" ); # codespell:ignore polcies $criticalSection->up(); print $fp $policy; @@ -535,3 +537,4 @@ sub handleRequest 1; +# jscpd:ignore-end diff --git a/perl/opt/lgp/client/cmain.pl b/perl/opt/lgp/client/cmain.pl index b205589..081cc7a 100644 --- a/perl/opt/lgp/client/cmain.pl +++ b/perl/opt/lgp/client/cmain.pl @@ -1,4 +1,6 @@ #!/usr/bin/perl -w +## no critic +# jscpd:ignore-start ######################################################################################################## # @description Command Line Controller for the Client Boundary Class @@ -140,7 +142,7 @@ () } else { - print "Unkown command '" . $options{s} . "' in send option\n"; + print "Unkown command '" . $options{s} . "' in send option\n"; # codespell:ignore unkown } sleep 2; } @@ -158,3 +160,4 @@ () init(); +# jscpd:ignore-end diff --git a/perl/opt/lgp/client/distribution/Centos.pm b/perl/opt/lgp/client/distribution/Centos.pm index 78a91ff..fcd17d6 100644 --- a/perl/opt/lgp/client/distribution/Centos.pm +++ b/perl/opt/lgp/client/distribution/Centos.pm @@ -1,4 +1,6 @@ #!/usr/bin/perl -w +## no critic +# jscpd:ignore-start ######################################################################################################## # @description Concrete Distribution Entity Class @@ -251,3 +253,4 @@ sub registerServiceNames 1; +# jscpd:ignore-end diff --git a/perl/opt/lgp/client/distribution/Darwin.pm b/perl/opt/lgp/client/distribution/Darwin.pm index 75aa890..b961b60 100644 --- a/perl/opt/lgp/client/distribution/Darwin.pm +++ b/perl/opt/lgp/client/distribution/Darwin.pm @@ -1,4 +1,6 @@ #!/usr/bin/perl -w +## no critic +# jscpd:ignore-start ######################################################################################################## # @description Concrete Distribution Entity Class @@ -31,3 +33,4 @@ sub new 1; +# jscpd:ignore-end diff --git a/perl/opt/lgp/client/distribution/Debian.pm b/perl/opt/lgp/client/distribution/Debian.pm index 76ff1f5..ea0f170 100644 --- a/perl/opt/lgp/client/distribution/Debian.pm +++ b/perl/opt/lgp/client/distribution/Debian.pm @@ -1,4 +1,6 @@ #!/usr/bin/perl -w +## no critic +# jscpd:ignore-start ######################################################################################################## # @description Concrete Distribution Entity Class @@ -255,3 +257,4 @@ sub registerServiceNames 1; +# jscpd:ignore-end diff --git a/perl/opt/lgp/client/distribution/Distribution.pm b/perl/opt/lgp/client/distribution/Distribution.pm index e0ef7eb..73c50b4 100644 --- a/perl/opt/lgp/client/distribution/Distribution.pm +++ b/perl/opt/lgp/client/distribution/Distribution.pm @@ -1,4 +1,6 @@ #!/usr/bin/perl -w +## no critic +# jscpd:ignore-start ######################################################################################################## # @description Abstract Class @@ -292,3 +294,4 @@ sub registerServiceNames } 1; +# jscpd:ignore-end diff --git a/perl/opt/lgp/client/distribution/Fedora.pm b/perl/opt/lgp/client/distribution/Fedora.pm index 10f2999..04d1149 100644 --- a/perl/opt/lgp/client/distribution/Fedora.pm +++ b/perl/opt/lgp/client/distribution/Fedora.pm @@ -1,4 +1,6 @@ #!/usr/bin/perl -w +## no critic +# jscpd:ignore-start ######################################################################################################## # @description Concrete Distribution Entity Class @@ -251,3 +253,4 @@ sub registerServiceNames } 1; +# jscpd:ignore-end diff --git a/perl/opt/lgp/client/distribution/Gentoo.pm b/perl/opt/lgp/client/distribution/Gentoo.pm index 1175756..1175fcc 100644 --- a/perl/opt/lgp/client/distribution/Gentoo.pm +++ b/perl/opt/lgp/client/distribution/Gentoo.pm @@ -1,4 +1,6 @@ #!/usr/bin/perl -w +## no critic +# jscpd:ignore-start ######################################################################################################## # @description Concrete Distribution Entity Class @@ -257,3 +259,4 @@ sub registerServiceNames 1; +# jscpd:ignore-end diff --git a/perl/opt/lgp/client/distribution/Mint.pm b/perl/opt/lgp/client/distribution/Mint.pm index 799f8d2..906a74e 100644 --- a/perl/opt/lgp/client/distribution/Mint.pm +++ b/perl/opt/lgp/client/distribution/Mint.pm @@ -1,4 +1,6 @@ #!/usr/bin/perl -w +## no critic +# jscpd:ignore-start ######################################################################################################## # @description Concrete Distribution Entity Class @@ -250,3 +252,4 @@ sub registerServiceNames } 1; +# jscpd:ignore-end diff --git a/perl/opt/lgp/client/distribution/Redhat.pm b/perl/opt/lgp/client/distribution/Redhat.pm index d2f85e0..7580169 100644 --- a/perl/opt/lgp/client/distribution/Redhat.pm +++ b/perl/opt/lgp/client/distribution/Redhat.pm @@ -1,4 +1,6 @@ #!/usr/bin/perl -w +## no critic +# jscpd:ignore-start ######################################################################################################## # @description Concrete Distribution Entity Class @@ -257,3 +259,4 @@ sub registerServiceNames 1; +# jscpd:ignore-end diff --git a/perl/opt/lgp/client/distribution/Suse.pm b/perl/opt/lgp/client/distribution/Suse.pm index 7d07981..49e161b 100644 --- a/perl/opt/lgp/client/distribution/Suse.pm +++ b/perl/opt/lgp/client/distribution/Suse.pm @@ -1,4 +1,6 @@ #!/usr/bin/perl -w +## no critic +# jscpd:ignore-start ######################################################################################################## # @description Concrete Distribution Entity Class @@ -253,3 +255,4 @@ sub registerServiceNames 1; +# jscpd:ignore-end diff --git a/perl/opt/lgp/client/includes/Coordinator.pm b/perl/opt/lgp/client/includes/Coordinator.pm index 2dcb734..ffbff0f 100644 --- a/perl/opt/lgp/client/includes/Coordinator.pm +++ b/perl/opt/lgp/client/includes/Coordinator.pm @@ -1,4 +1,6 @@ #!/usr/bin/perl -w +## no critic +# jscpd:ignore-start ######################################################################################################## # @description Control Class For Observers and Computer Boundary Class @@ -110,3 +112,4 @@ sub getComputer } 1; +# jscpd:ignore-end diff --git a/perl/opt/lgp/client/includes/Interpreter.pm b/perl/opt/lgp/client/includes/Interpreter.pm index 4692bf1..1bf7596 100644 --- a/perl/opt/lgp/client/includes/Interpreter.pm +++ b/perl/opt/lgp/client/includes/Interpreter.pm @@ -1,7 +1,9 @@ #!/usr/bin/perl -w +## no critic +# jscpd:ignore-start ######################################################################################################## -# @description Interpretor Boundary +# @description Interpretor Boundary # codespell:ignore interpretor # # @author David O Neill # @studentid 0813001 @@ -49,7 +51,7 @@ FILTER ######################################################################################################## -# @description Process the grammer of the DSL +# @description Process the grammer of the DSL # codespell:ignore grammer # # @param The DSL script # @@ -118,3 +120,4 @@ sub processDSLInternal 1; +# jscpd:ignore-end diff --git a/perl/opt/lgp/client/includes/Observer.pm b/perl/opt/lgp/client/includes/Observer.pm index 3941d63..eb6fabf 100644 --- a/perl/opt/lgp/client/includes/Observer.pm +++ b/perl/opt/lgp/client/includes/Observer.pm @@ -1,4 +1,6 @@ #!/usr/bin/perl -w +## no critic +# jscpd:ignore-start ######################################################################################################## # @description Observer Abstract Class ( Module / Interface ) @@ -101,3 +103,4 @@ sub notify 1; +# jscpd:ignore-end diff --git a/perl/opt/lgp/client/modules/GConfEditor.pm b/perl/opt/lgp/client/modules/GConfEditor.pm index 099ec2b..64d134e 100644 --- a/perl/opt/lgp/client/modules/GConfEditor.pm +++ b/perl/opt/lgp/client/modules/GConfEditor.pm @@ -1,4 +1,6 @@ #!/usr/bin/perl -w +## no critic +# jscpd:ignore-start ######################################################################################################## # @description Concrete Module Class ( Module ) extends Module @@ -71,4 +73,5 @@ sub update } -1; \ No newline at end of file +1; +# jscpd:ignore-end diff --git a/perl/opt/lgp/client/modules/PackageManager.pm b/perl/opt/lgp/client/modules/PackageManager.pm index 35ea00f..2055ae7 100644 --- a/perl/opt/lgp/client/modules/PackageManager.pm +++ b/perl/opt/lgp/client/modules/PackageManager.pm @@ -1,4 +1,6 @@ #!/usr/bin/perl -w +## no critic +# jscpd:ignore-start ######################################################################################################## # @description Concrete Module Class ( Module ) extends Module @@ -69,4 +71,5 @@ sub update } -1; \ No newline at end of file +1; +# jscpd:ignore-end diff --git a/perl/opt/lgp/client/modules/ServiceController.pm b/perl/opt/lgp/client/modules/ServiceController.pm index d714144..7a23a05 100644 --- a/perl/opt/lgp/client/modules/ServiceController.pm +++ b/perl/opt/lgp/client/modules/ServiceController.pm @@ -1,4 +1,6 @@ #!/usr/bin/perl -w +## no critic +# jscpd:ignore-start ######################################################################################################## # @description Concrete Module Class ( Module ) extends Module @@ -616,4 +618,5 @@ sub update } -1; \ No newline at end of file +1; +# jscpd:ignore-end diff --git a/perl/opt/lgp/common/LGPMysqlDBI.pm b/perl/opt/lgp/common/LGPMysqlDBI.pm index 8cf299d..5da4d02 100644 --- a/perl/opt/lgp/common/LGPMysqlDBI.pm +++ b/perl/opt/lgp/common/LGPMysqlDBI.pm @@ -1,4 +1,6 @@ #!/usr/bin/perl -w +## no critic +# jscpd:ignore-start ######################################################################################################## # @description Mysql DBI Control Class ( Module ) @@ -327,3 +329,4 @@ sub GetOu } 1; +# jscpd:ignore-end diff --git a/perl/opt/lgp/server/LGPServer.pm b/perl/opt/lgp/server/LGPServer.pm index 90cad56..5ee3e16 100644 --- a/perl/opt/lgp/server/LGPServer.pm +++ b/perl/opt/lgp/server/LGPServer.pm @@ -1,4 +1,6 @@ #!/usr/bin/perl -w +## no critic +# jscpd:ignore-start ######################################################################################################## # @description Server Boundary Class ( Module ) - Net IO @@ -80,7 +82,7 @@ sub new _pipe => undef, # not shared implicitly _continue => \$_continue, # used to kill loops globally _mysql_connection => undef, # mysql connection - _policies_updating => \$_policies_updating, # when polcies are being updated, clients will have to wait + _policies_updating => \$_policies_updating, # when polcies are being updated, clients will have to wait # codespell:ignore polcies _clients_list => \%_clients, # client guid to ou mapping _cpu_usage => \$_cpuusage, # monitor cpu _tx_usage => \$_txkb, # monitor cpu @@ -620,7 +622,7 @@ sub queueHandler if( defined( ${ $self->{ _log } } ) ) { $criticalSection->down(); - ${ $self->{ _log } }->log( 'info' , "Mysql connection successfull" ); + ${ $self->{ _log } }->log( 'info' , "Mysql connection successfull" ); # codespell:ignore successfull $criticalSection->up(); } } @@ -629,7 +631,7 @@ sub queueHandler if( defined( ${ $self->{ _log } } ) ) { $criticalSection->down(); - ${ $self->{ _log } }->log( 'err' , "Mysql connection unsuccessfull" ); + ${ $self->{ _log } }->log( 'err' , "Mysql connection unsuccessfull" ); # codespell:ignore unsuccessfull $criticalSection->up(); } } @@ -903,3 +905,4 @@ sub handleRequest 1; +# jscpd:ignore-end diff --git a/perl/opt/lgp/server/modules/GConfEditor.pm b/perl/opt/lgp/server/modules/GConfEditor.pm index 8150495..e184b32 100644 --- a/perl/opt/lgp/server/modules/GConfEditor.pm +++ b/perl/opt/lgp/server/modules/GConfEditor.pm @@ -1,4 +1,6 @@ #!/usr/bin/perl -w +## no critic +# jscpd:ignore-start ######################################################################################################## # @description Concrete Module Class ( Module ) extends Module @@ -244,4 +246,5 @@ sub update -1; \ No newline at end of file +1; +# jscpd:ignore-end diff --git a/perl/opt/lgp/server/modules/PackageManager.pm b/perl/opt/lgp/server/modules/PackageManager.pm index 6842137..c2e02ef 100644 --- a/perl/opt/lgp/server/modules/PackageManager.pm +++ b/perl/opt/lgp/server/modules/PackageManager.pm @@ -1,4 +1,6 @@ #!/usr/bin/perl -w +## no critic +# jscpd:ignore-start ######################################################################################################## # @description Concrete Module Class ( Module ) extends Module @@ -317,4 +319,5 @@ sub update } -1; \ No newline at end of file +1; +# jscpd:ignore-end diff --git a/perl/opt/lgp/server/modules/ServiceController.pm b/perl/opt/lgp/server/modules/ServiceController.pm index d450318..f2b2f06 100644 --- a/perl/opt/lgp/server/modules/ServiceController.pm +++ b/perl/opt/lgp/server/modules/ServiceController.pm @@ -1,4 +1,6 @@ #!/usr/bin/perl -w +## no critic +# jscpd:ignore-start ######################################################################################################## # @description Concrete Module Class ( Module ) extends Module @@ -616,4 +618,5 @@ sub update } -1; \ No newline at end of file +1; +# jscpd:ignore-end From e01e697a595f7437a40736cf17156a7cd3369b74 Mon Sep 17 00:00:00 2001 From: Dave Date: Sat, 24 Oct 2026 18:49:50 +0000 Subject: [PATCH 2/2] dotnet format whitespace on touched files (paths with spaces) --- .../LGP.Components.Database.Mssql/MssqlDB.cs | 18 +- .../LGP.Components.Database.Mssql/Plugin.cs | 10 +- .../Preferences.xaml.cs | 18 +- .../LGP.Components.Database.Mysql/Plugin.cs | 10 +- .../Preferences.xaml.cs | 18 +- .../OracleDB.cs | 12 +- .../LGP.Components.Database.Oracle/Plugin.cs | 10 +- .../Preferences.xaml.cs | 18 +- .../Plugin.cs | 10 +- .../Entities/Grammer.cs | 90 ++-- .../Entities/GrammerGateway.cs | 200 ++++----- .../Entities/Module.cs | 96 ++--- .../LGP.Components.Database/Entities/Ou.cs | 118 +++--- .../Gateways/ModuleGateway.cs | 132 +++--- .../Gateways/OuGateway.cs | 172 ++++---- .../Gateways/PolicyGateway.cs | 296 ++++++------- .../LGP.Components.Database/Plugin.cs | 10 +- .../LGP.Components.Dialog/Plugin.cs | 10 +- .../LGP.Components.Dialog/Preferences.xaml.cs | 12 +- .../Properties/AssemblyInfo.cs | 42 +- .../ServerControl/ServerController.cs | 144 +++---- .../ContextMenusHandler.cs | 120 +++--- .../LGP.Components.Menus/Plugin.cs | 10 +- .../LGP.Components.Menus/Preferences.xaml.cs | 12 +- .../LGP.Components.Notifications/Plugin.cs | 8 +- .../Properties/AssemblyInfo.cs | 16 +- .../LGP.ImageLibrary/IconSet.cs | 53 +-- .../AvalonEditHelpers/CompletionData.cs | 28 +- ...HighlightCurrentLineBackgroundRenderer .cs | 28 +- .../StackPanelModuleElement.xaml.cs | 90 ++-- .../Modals/Controls/DeleteModule.xaml.cs | 40 +- .../Internal/ModuleDocument.cs | 344 ++++++++-------- .../ModuleEditor.xaml.cs | 230 +++++------ .../ModuleList.xaml.cs | 86 ++-- .../LGP.Modules.ModuleEditor/Plugin.cs | 30 +- .../Preferences.xaml.cs | 28 +- .../Properties/AssemblyInfo.cs | 40 +- .../CustomControls/TreeViewOuElement.cs | 362 ++++++++-------- .../WrapPanelClientElement.xaml.cs | 128 +++--- .../CustomControls/WrapPanelOuElement.xaml.cs | 222 +++++----- .../Internal/Modals/Controls/CreateOu.xaml.cs | 56 +-- .../Internal/Modals/Controls/RenameOu.xaml.cs | 54 +-- .../OuViewer.xaml.cs | 388 +++++++++--------- .../Preferences.xaml.cs | 16 +- .../Properties/AssemblyInfo.cs | 40 +- .../PolicyEditor.xaml.cs | 134 +++--- .../Preferences.xaml.cs | 16 +- .../Properties/AssemblyInfo.cs | 40 +- .../ConnectionController.xaml.cs | 96 ++--- .../LGP.Modules.ServerControl/Plugin.cs | 26 +- .../Preferences.xaml.cs | 12 +- .../Properties/AssemblyInfo.cs | 42 +- .../LGP.Modules.Statistics/Plugin.cs | 26 +- .../Preferences.xaml.cs | 12 +- .../LGP/Controls/Settings.xaml.cs | 203 ++++----- 55 files changed, 2255 insertions(+), 2227 deletions(-) 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 477e53f..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,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Data; using System.Data.SqlClient; @@ -28,20 +28,20 @@ public class MssqlDb : IDatabaseModule /// Hostname 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; } } @@ -62,7 +62,7 @@ public bool Disconnect() /// /// sql query /// - public DataSet ExecuteQuery( string sql ) + public DataSet ExecuteQuery(string sql) { return null; } @@ -73,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; } 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 c3b2a73..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,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System.Windows.Controls; using LGP.Components.Factory; using LGP.Components.Factory.Interfaces.Component; @@ -33,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); } @@ -41,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) { } 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 66217e7..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,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Windows.Controls; using LGP.Components.Factory; @@ -56,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); } /// @@ -64,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"; } @@ -78,7 +78,7 @@ public void Load( ISettings settingsParent ) /// Type public Type GetControlType() { - return typeof( IDatabaseModule ); + return typeof(IDatabaseModule); } /// @@ -87,12 +87,12 @@ 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"; } 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 7813ffb..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,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System.Windows.Controls; using LGP.Components.Factory; using LGP.Components.Factory.Interfaces.Component; @@ -33,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); } @@ -41,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) { } 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 e299db7..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,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Windows.Controls; using LGP.Components.Factory; @@ -57,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); } /// @@ -65,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"; } @@ -79,7 +79,7 @@ public void Load( ISettings settingsParent ) /// Type public Type GetControlType() { - return typeof( IDatabaseModule ); + return typeof(IDatabaseModule); } /// @@ -88,12 +88,12 @@ 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) { } } 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 45d6b2d..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,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System.Data; using LGP.Components.Factory.Interfaces.Database; @@ -23,7 +23,7 @@ public class OracleDb : IDatabaseModule /// Hostname 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; } @@ -44,7 +44,7 @@ public bool Disconnect() /// /// sql query /// - public DataSet ExecuteQuery( string sql ) + public DataSet ExecuteQuery(string sql) { return null; } @@ -55,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; } 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 7e37d60..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,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System.Windows.Controls; using LGP.Components.Factory; using LGP.Components.Factory.Interfaces.Component; @@ -33,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); } @@ -41,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) { } 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 c21b81f..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,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Windows.Controls; using LGP.Components.Factory; @@ -56,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); } /// @@ -64,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"; } @@ -78,7 +78,7 @@ public void Load( ISettings settingsParent ) /// Type public Type GetControlType() { - return typeof( IDatabaseModule ); + return typeof(IDatabaseModule); } /// @@ -87,12 +87,12 @@ 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) { } } 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 b7305f4..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,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System.Windows.Controls; using LGP.Components.Factory; using LGP.Components.Factory.Interfaces.Component; @@ -33,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); } @@ -41,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) { } 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 d8b94bd..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,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Collections.Generic; using LGP.Components.Factory; @@ -15,12 +15,12 @@ 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 ) // codespell:ignore grammer + 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; @@ -72,23 +72,23 @@ public string GetValue() /// 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); } } @@ -97,23 +97,23 @@ public void SetModuleId( int val ) /// 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); } } @@ -122,23 +122,23 @@ public void SetKey( string val ) /// 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); } } @@ -151,14 +151,14 @@ public void SetValue( string val ) /// /// IGrammer // codespell:ignore grammer /// IGrammerObserver - public void Update( IGrammer grammer , IGrammerObserver source ) // codespell:ignore grammer + 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); } } @@ -166,18 +166,18 @@ public void Update( IGrammer grammer , IGrammerObserver source ) // codespell:ig /// 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); } } @@ -185,15 +185,15 @@ public void Attach( IGrammerObserver obj ) /// 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); } } @@ -204,14 +204,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); } } @@ -219,18 +219,18 @@ 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); } } 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 dd3b0db..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,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Collections.Generic; using System.Data; @@ -14,45 +14,45 @@ 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 ); // codespell:ignore grammer + var grammer = new Grammer(id, mid, gkey, gvalue); // codespell:ignore grammer - _grammer.Add( grammer ); // codespell:ignore grammer + _grammer.Add(grammer); // codespell:ignore grammer } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -65,48 +65,48 @@ private static void BuildGrammerListing() /// 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 ); // codespell:ignore grammer - _grammer.Add( grammer ); // codespell:ignore 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; } } @@ -116,35 +116,35 @@ public IGrammer CreateGrammer( int moduleId , string key , string val ) /// /// 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); } } @@ -152,35 +152,35 @@ public void DeleteGrammer( int mid , string key ) /// 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); } } @@ -190,28 +190,28 @@ public void DeleteGrammer( int mid ) /// 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; } } @@ -222,28 +222,28 @@ public IGrammer GetGrammer( int mid , string key ) /// 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; } } @@ -253,29 +253,29 @@ public IGrammer GetGrammer( int mid , int id ) /// /// 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; } } @@ -284,18 +284,18 @@ public List< IGrammer > GetGrammer( int mid ) /// 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; } @@ -307,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; } @@ -343,19 +343,19 @@ public void Refresh() break; } - if( !newDbEntry ) + if (!newDbEntry) { continue; } - var grammer = new Grammer( id , mid , gkey , gvalue ); // codespell:ignore grammer + var grammer = new Grammer(id, mid, gkey, gvalue); // codespell:ignore grammer - _grammer.Add( grammer ); // codespell:ignore grammer + _grammer.Add(grammer); // codespell:ignore grammer } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } 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 828e19d..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,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Collections.Generic; using LGP.Components.Database.Gateways; @@ -16,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; } @@ -37,7 +37,7 @@ public Module( int moduleid , string modulename ) /// /// IModule /// IModuleObserver - public void Update( IModule module , IModuleObserver source ) + public void Update(IModule module, IModuleObserver source) { throw new NotImplementedException(); } @@ -47,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); } } @@ -67,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); } } @@ -87,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); } } @@ -103,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); } } @@ -155,23 +155,23 @@ 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); } } @@ -182,17 +182,17 @@ public void SetModuleName( string name ) /// 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 ); // codespell:ignore grammer + var grammer = GrammerGateway.CreateGrammer(this._moduleid, key, value); // codespell:ignore grammer this.Notify(); return grammer; // codespell:ignore grammer } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); return null; } } @@ -202,16 +202,16 @@ public IGrammer AddGrammer( string key , string value ) /// 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); } } @@ -222,12 +222,12 @@ 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); } } @@ -235,9 +235,9 @@ public void DeleteAllGrammer() /// 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); } /// @@ -245,9 +245,9 @@ public List< IGrammer > GetAllGrammers() /// /// 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); } /// @@ -255,9 +255,9 @@ public IGrammer GetGrammer( string key ) /// /// 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); } /// 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 5948328..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,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Collections.Generic; using System.Windows.Controls; @@ -13,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; @@ -35,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); } } @@ -70,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); } } @@ -105,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); } } @@ -140,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); } } @@ -176,40 +176,40 @@ 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; } } @@ -220,7 +220,7 @@ public Image GetOuImage( int size ) /// /// Iou /// source observer - public void Update( IOu ou , IOuObserver source ) + public void Update(IOu ou, IOuObserver source) { throw new NotImplementedException(); } @@ -229,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); } } @@ -249,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); } } @@ -269,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); } } @@ -285,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); } } 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 a21e75c..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,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Collections.Generic; using System.Data; @@ -14,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; } } @@ -60,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); } } @@ -100,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; } } @@ -130,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(); } @@ -147,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; } @@ -179,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); } } @@ -198,35 +198,35 @@ 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); } } } 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 1db1c04..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,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Collections.Generic; using System.Data; @@ -14,7 +14,7 @@ namespace LGP.Components.Database.Gateways { internal class OuGateway : IOuGateway { - private static List< IOu > _ous; + private static List _ous; #region IOuGateway Members @@ -24,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; } } @@ -88,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); } } @@ -126,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; } } @@ -158,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; } } @@ -189,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(); } @@ -205,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; } } @@ -238,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; } } @@ -279,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; } 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 cc0cd67..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,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Collections.Generic; using System.Data; @@ -15,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() { @@ -30,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; } } @@ -89,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); } } @@ -126,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); } } @@ -156,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); } } @@ -194,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; @@ -224,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; @@ -254,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; @@ -294,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; @@ -334,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; @@ -371,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; @@ -402,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(); } @@ -417,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; @@ -449,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; } @@ -488,60 +488,60 @@ 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); } } diff --git a/csharp/Linux Group Policy/LGP.Components.Database/Plugin.cs b/csharp/Linux Group Policy/LGP.Components.Database/Plugin.cs index d8e8c5a..e3f5f72 100644 --- a/csharp/Linux Group Policy/LGP.Components.Database/Plugin.cs +++ b/csharp/Linux Group Policy/LGP.Components.Database/Plugin.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System.Windows.Controls; using LGP.Components.Factory; using LGP.Components.Factory.Interfaces.Component; @@ -33,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); } @@ -41,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) { } diff --git a/csharp/Linux Group Policy/LGP.Components.Dialog/Plugin.cs b/csharp/Linux Group Policy/LGP.Components.Dialog/Plugin.cs index ed46586..7a0b8af 100644 --- a/csharp/Linux Group Policy/LGP.Components.Dialog/Plugin.cs +++ b/csharp/Linux Group Policy/LGP.Components.Dialog/Plugin.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System.Windows.Controls; using LGP.Components.Factory; using LGP.Components.Factory.Interfaces.Component; @@ -33,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); } @@ -41,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) { } 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 255b616..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,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Windows.Controls; using LGP.Components.Factory; @@ -59,7 +59,7 @@ public void Save() /// /// /// string - public void Load( ISettings settingsParent ) + public void Load(ISettings settingsParent) { this._parent = settingsParent; } @@ -70,7 +70,7 @@ public void Load( ISettings settingsParent ) /// Type public Type GetControlType() { - return typeof( IDialog ); + return typeof(IDialog); } /// @@ -79,7 +79,7 @@ public Type GetControlType() /// public Image GetIcon() { - return Framework.Images.GetImage( "WindowsHS" , "VS2010ImageLibrary" , 14 ); + return Framework.Images.GetImage("WindowsHS", "VS2010ImageLibrary", 14); } #endregion 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 40ff877..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,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System.Reflection; using System.Runtime.InteropServices; using System.Windows; @@ -11,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 @@ -36,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) )] @@ -57,7 +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: 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 f693edd..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,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Collections.Generic; using System.Net; @@ -20,7 +20,7 @@ namespace LGP.Components.Factory.Internal.ServerControl /// /// /// - public delegate void DataReceived( string data ); + public delegate void DataReceived(string data); #endregion @@ -43,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); } } @@ -86,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; } @@ -110,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; } @@ -123,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; } } @@ -160,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); } } @@ -185,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); } } @@ -210,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); } } @@ -235,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); } } @@ -255,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); } } @@ -282,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); } } @@ -310,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(); @@ -327,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); } } @@ -356,9 +356,9 @@ public void Shutdown() this._tcpListenerThread.Abort(); this._receivingClient.Stop(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } diff --git a/csharp/Linux Group Policy/LGP.Components.Menus/ContextMenusHandler.cs b/csharp/Linux Group Policy/LGP.Components.Menus/ContextMenusHandler.cs index 0b74997..40a3949 100644 --- a/csharp/Linux Group Policy/LGP.Components.Menus/ContextMenusHandler.cs +++ b/csharp/Linux Group Policy/LGP.Components.Menus/ContextMenusHandler.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Collections.Generic; using System.Windows; @@ -18,14 +18,14 @@ namespace LGP.Components.Menus /// 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 @@ -36,16 +36,16 @@ public ContextMenusHandler() /// 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 action) { try { var newparent = menuparent as object; - this.AttachToNewParent( ref newparent , type , action ); + this.AttachToNewParent(ref newparent, type, action); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -56,16 +56,16 @@ public void AttachMenuItemRegistrations( ref ContextMenu menuparent , Type type /// 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 Menu menuparent , Type type , Action< Object , RoutedEventArgs > action ) + public void AttachMenuItemRegistrations(ref Menu menuparent, Type type, Action action) { try { var newparent = menuparent as object; - this.AttachToNewParent( ref newparent , type , action ); + this.AttachToNewParent(ref newparent, type, action); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -75,21 +75,21 @@ public void AttachMenuItemRegistrations( ref Menu menuparent , Type type , Actio /// /// the meuu item clicked /// - public void CallBack( MenuItem sender , object theobject ) + public void CallBack(MenuItem sender, object theobject) { try { - foreach( var reg in this._registrations ) + foreach (var reg in this._registrations) { - if( sender == reg.MenuEntry ) + if (sender == reg.MenuEntry) { - reg.Action( theobject ); + reg.Action(theobject); } } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -99,7 +99,7 @@ public void CallBack( MenuItem sender , object theobject ) /// type /// /// The call back mechanism - public void RegisterContextMenuItem( Type type , MenuItem item , Action< Object > action ) + public void RegisterContextMenuItem(Type type, MenuItem item, Action action) { try { @@ -107,19 +107,19 @@ public void RegisterContextMenuItem( Type type , MenuItem item , Action< Object var entry = new Entry { - Action = action , - Type = type , + Action = action, + Type = type, MenuEntry = item }; - if( this.CheckRegistrations( entry ) == false ) + if (this.CheckRegistrations(entry) == false) { - this._registrations.Add( entry ); + this._registrations.Add(entry); } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -129,25 +129,25 @@ public void RegisterContextMenuItem( Type type , MenuItem item , Action< Object /// 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 MenuItem menuparent , Type type , Action< Object , RoutedEventArgs > action ) + public void AttachMenuItemRegistrations(ref MenuItem menuparent, Type type, Action action) { try { var newparent = menuparent as object; - this.AttachToNewParent( ref newparent , type , action ); + this.AttachToNewParent(ref newparent, type, action); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private bool CheckRegistrations( Entry entry ) + private bool CheckRegistrations(Entry entry) { - foreach( var reg in this._registrations ) + foreach (var reg in this._registrations) { - if( reg.Type == entry.Type && reg.MenuEntry == entry.MenuEntry ) + if (reg.Type == entry.Type && reg.MenuEntry == entry.MenuEntry) { return true; } @@ -156,72 +156,72 @@ private bool CheckRegistrations( Entry entry ) } - private void UnattachFromCurrentParent( int current ) + private void UnattachFromCurrentParent(int current) { - if( this._registrations[ current ].MenuEntry.Parent != null ) + if (this._registrations[current].MenuEntry.Parent != null) { - var contextmenu = this._registrations[ current ].MenuEntry.Parent as ContextMenu; - var menuitem = this._registrations[ current ].MenuEntry.Parent as MenuItem; - var menu = this._registrations[ current ].MenuEntry.Parent as Menu; + var contextmenu = this._registrations[current].MenuEntry.Parent as ContextMenu; + var menuitem = this._registrations[current].MenuEntry.Parent as MenuItem; + var menu = this._registrations[current].MenuEntry.Parent as Menu; - if( contextmenu != null ) + if (contextmenu != null) { - contextmenu.Items.Remove( this._registrations[ current ].MenuEntry ); + contextmenu.Items.Remove(this._registrations[current].MenuEntry); } - if( menuitem != null ) + if (menuitem != null) { - menuitem.Items.Remove( this._registrations[ current ].MenuEntry ); + menuitem.Items.Remove(this._registrations[current].MenuEntry); } - if( menu != null ) + if (menu != null) { - menu.Items.Remove( this._registrations[ current ].MenuEntry ); + menu.Items.Remove(this._registrations[current].MenuEntry); } - this._registrations[ current ].MenuEntry.Click -= this._registrations[ current ].PrevHandler; + this._registrations[current].MenuEntry.Click -= this._registrations[current].PrevHandler; } } - private void AttachToNewParent( ref object menuparent , Type type , Action< Object , RoutedEventArgs > action ) + private void AttachToNewParent(ref object menuparent, Type type, Action action) { try { - for( var i = 0; i < this._registrations.Count; i++ ) + for (var i = 0; i < this._registrations.Count; i++) { - if( this._registrations[ i ].Type != type ) + if (this._registrations[i].Type != type) { continue; } - this.UnattachFromCurrentParent( i ); + this.UnattachFromCurrentParent(i); - this._registrations[ i ].PrevHandler = new RoutedEventHandler( action ); - this._registrations[ i ].MenuEntry.Click += this._registrations[ i ].PrevHandler; + this._registrations[i].PrevHandler = new RoutedEventHandler(action); + this._registrations[i].MenuEntry.Click += this._registrations[i].PrevHandler; - if( menuparent is Menu ) + if (menuparent is Menu) { var parentMenu = menuparent as Menu; - parentMenu.Items.Add( this._registrations[ i ].MenuEntry ); + parentMenu.Items.Add(this._registrations[i].MenuEntry); } - if( menuparent is MenuItem ) + if (menuparent is MenuItem) { var parentMenu = menuparent as MenuItem; - parentMenu.Items.Add( this._registrations[ i ].MenuEntry ); + parentMenu.Items.Add(this._registrations[i].MenuEntry); } - if( menuparent is ContextMenu ) + if (menuparent is ContextMenu) { var parentMenu = menuparent as ContextMenu; - parentMenu.Items.Add( this._registrations[ i ].MenuEntry ); + parentMenu.Items.Add(this._registrations[i].MenuEntry); } } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -231,7 +231,7 @@ private void AttachToNewParent( ref object menuparent , Type type , Action< Obje private class Entry { - public Action< Object > Action; + public Action Action; public MenuItem MenuEntry; public RoutedEventHandler PrevHandler; public Type Type; diff --git a/csharp/Linux Group Policy/LGP.Components.Menus/Plugin.cs b/csharp/Linux Group Policy/LGP.Components.Menus/Plugin.cs index 2f87a69..f071429 100644 --- a/csharp/Linux Group Policy/LGP.Components.Menus/Plugin.cs +++ b/csharp/Linux Group Policy/LGP.Components.Menus/Plugin.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System.Windows.Controls; using LGP.Components.Factory; using LGP.Components.Factory.Interfaces.Component; @@ -33,7 +33,7 @@ public string GetName() /// An image public Image GetIcon() { - return Framework.Images.GetImage( "RelationshipsHS" , "VS2010ImageLibrary" , 14 ); + return Framework.Images.GetImage("RelationshipsHS", "VS2010ImageLibrary", 14); } @@ -41,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) { } diff --git a/csharp/Linux Group Policy/LGP.Components.Menus/Preferences.xaml.cs b/csharp/Linux Group Policy/LGP.Components.Menus/Preferences.xaml.cs index e257de0..0459ad8 100644 --- a/csharp/Linux Group Policy/LGP.Components.Menus/Preferences.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Components.Menus/Preferences.xaml.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Windows.Controls; using LGP.Components.Factory; @@ -58,7 +58,7 @@ public void Save() /// /// /// string - public void Load( ISettings settingsParent ) + public void Load(ISettings settingsParent) { this._parent = settingsParent; } @@ -69,7 +69,7 @@ public void Load( ISettings settingsParent ) /// Type public Type GetControlType() { - return typeof( IMenu ); + return typeof(IMenu); } /// @@ -78,7 +78,7 @@ public Type GetControlType() /// public Image GetIcon() { - return Framework.Images.GetImage( "RelationshipsHS" , "VS2010ImageLibrary" , 14 ); + return Framework.Images.GetImage("RelationshipsHS", "VS2010ImageLibrary", 14); } #endregion diff --git a/csharp/Linux Group Policy/LGP.Components.Notifications/Plugin.cs b/csharp/Linux Group Policy/LGP.Components.Notifications/Plugin.cs index 76f8ebf..7c3ff7c 100644 --- a/csharp/Linux Group Policy/LGP.Components.Notifications/Plugin.cs +++ b/csharp/Linux Group Policy/LGP.Components.Notifications/Plugin.cs @@ -1,5 +1,5 @@ -// jscpd:ignore-start -using System.Windows.Controls; +// jscpd:ignore-start +using System.Windows.Controls; using LGP.Components.Factory; using LGP.Components.Factory.Interfaces.Component; using LGP.Components.Factory.Interfaces.Module; @@ -29,7 +29,7 @@ public string GetName() /// An image public Image GetIcon() { - return Framework.Images.GetImage( "database2" , "VS2010ImageLibrary" , 14 ); + return Framework.Images.GetImage("database2", "VS2010ImageLibrary", 14); } @@ -37,7 +37,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) { } diff --git a/csharp/Linux Group Policy/LGP.Components.Notifications/Properties/AssemblyInfo.cs b/csharp/Linux Group Policy/LGP.Components.Notifications/Properties/AssemblyInfo.cs index d9f7259..86fc9aa 100644 --- a/csharp/Linux Group Policy/LGP.Components.Notifications/Properties/AssemblyInfo.cs +++ b/csharp/Linux Group Policy/LGP.Components.Notifications/Properties/AssemblyInfo.cs @@ -1,5 +1,5 @@ -// jscpd:ignore-start -using System.Reflection; +// jscpd:ignore-start +using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -33,12 +33,12 @@ [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) + 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) )] diff --git a/csharp/Linux Group Policy/LGP.ImageLibrary/IconSet.cs b/csharp/Linux Group Policy/LGP.ImageLibrary/IconSet.cs index fdb80bb..885c000 100644 --- a/csharp/Linux Group Policy/LGP.ImageLibrary/IconSet.cs +++ b/csharp/Linux Group Policy/LGP.ImageLibrary/IconSet.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Drawing; using System.Drawing.Imaging; @@ -28,13 +28,13 @@ public class IconSet /// static IconSet() { - var myType = typeof( IconSet ); + var myType = typeof(IconSet); Namepsace = myType.Namespace; // codespell:ignore namepsace } - [DllImport( "shell32.dll" , CharSet = CharSet.Auto )] - internal static extern int ExtractIconEx( string stExeFileName , int nIconIndex , IntPtr phiconLarge , IntPtr phiconSmall , int nIcons ); + [DllImport("shell32.dll", CharSet = CharSet.Auto)] + internal static extern int ExtractIconEx(string stExeFileName, int nIconIndex, IntPtr phiconLarge, IntPtr phiconSmall, int nIcons); /// @@ -43,7 +43,7 @@ static IconSet() /// The name of the image /// The folder in which the resource can be found /// An image - public static Image GetImage( string name , string folder ) + public static Image GetImage(string name, string folder) { var uri = "/" + Namepsace + ";component/Images/" + folder + "/" + name + ".png"; // codespell:ignore namepsace @@ -53,11 +53,11 @@ public static Image GetImage( string name , string folder ) { var bmImage = new BitmapImage(); bmImage.BeginInit(); - bmImage.UriSource = new Uri( uri , UriKind.Relative ); + bmImage.UriSource = new Uri(uri, UriKind.Relative); bmImage.EndInit(); icon.Source = bmImage; } - catch( Exception ) + catch (Exception) { icon = null; } @@ -73,16 +73,16 @@ public static Image GetImage( string name , string folder ) /// The folder in which the resource can be found /// The maxwidth of the returned image /// An image - public static Image GetImage( string name , string folder , int maxwidth ) + public static Image GetImage(string name, string folder, int maxwidth) { Image icon; try { - icon = GetImage( name , folder ); + icon = GetImage(name, folder); icon.MaxWidth = maxwidth; } - catch( Exception ) + catch (Exception) { icon = null; } @@ -96,7 +96,7 @@ public static Image GetImage( string name , string folder , int maxwidth ) /// /// The name of the icon /// An icon (ico) - public static Icon GetIcon( string name ) + public static Icon GetIcon(string name) { var uri = "pack://application:,,,/" + Namepsace + ";component/Icons/" + name + ".ico"; // codespell:ignore namepsace @@ -104,14 +104,14 @@ public static Icon GetIcon( string name ) try { - var streamResourceInfo = Application.GetResourceStream( new Uri( uri ) ); - if( streamResourceInfo != null ) + var streamResourceInfo = Application.GetResourceStream(new Uri(uri)); + if (streamResourceInfo != null) { var iconStream = streamResourceInfo.Stream; - icon = new Icon( iconStream ); + icon = new Icon(iconStream); } } - catch( Exception ) + catch (Exception) { icon = null; } @@ -125,14 +125,14 @@ public static Icon GetIcon( string name ) /// /// /// - public static Image GetExtensionIcon( string filename ) + public static Image GetExtensionIcon(string filename) { - var bmp = ShellIcon.GetSmallIcon( filename ).ToBitmap(); + var bmp = ShellIcon.GetSmallIcon(filename).ToBitmap(); var stream = new MemoryStream(); - bmp.Save( stream , ImageFormat.Png ); + bmp.Save(stream, ImageFormat.Png); var bmpImage = new BitmapImage(); bmpImage.BeginInit(); - stream.Seek( 0 , SeekOrigin.Begin ); + stream.Seek(0, SeekOrigin.Begin); bmpImage.StreamSource = stream; bmpImage.EndInit(); @@ -149,14 +149,14 @@ public static Image GetExtensionIcon( string filename ) /// /// Bitmap to convert /// Image - public static Image ConvertBitmapToImage( Bitmap bitmap ) + public static Image ConvertBitmapToImage(Bitmap bitmap) { var bmp = bitmap; var stream = new MemoryStream(); - bmp.Save( stream , ImageFormat.Png ); + bmp.Save(stream, ImageFormat.Png); var bmpImage = new BitmapImage(); bmpImage.BeginInit(); - stream.Seek( 0 , SeekOrigin.Begin ); + stream.Seek(0, SeekOrigin.Begin); bmpImage.StreamSource = stream; bmpImage.EndInit(); @@ -174,7 +174,7 @@ public static Image ConvertBitmapToImage( Bitmap bitmap ) /// Bitmap to convert /// image size /// Image - public static Image ConvertBitmapToImage(Bitmap bitmap , int size ) + public static Image ConvertBitmapToImage(Bitmap bitmap, int size) { var bmp = bitmap; var stream = new MemoryStream(); @@ -187,7 +187,8 @@ public static Image ConvertBitmapToImage(Bitmap bitmap , int size ) var j = new Image { - Source = bmpImage , MaxWidth = size + Source = bmpImage, + MaxWidth = size }; diff --git a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/AvalonEditHelpers/CompletionData.cs b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/AvalonEditHelpers/CompletionData.cs index 044597a..ae31b49 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/AvalonEditHelpers/CompletionData.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/AvalonEditHelpers/CompletionData.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Windows.Controls; using System.Windows.Media; @@ -23,16 +23,16 @@ static CompletionData() { try { - MethodImage = Framework.Images.GetImage( "method" , "16x16" , 14 ); - PropertyImage = Framework.Images.GetImage( "property" , "16x16" , 14 ); + MethodImage = Framework.Images.GetImage("method", "16x16", 14); + PropertyImage = Framework.Images.GetImage("property", "16x16", 14); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - public CompletionData( string text , string enteredTest , int type ) + public CompletionData(string text, string enteredTest, int type) { this._type = type; this.Text = text; @@ -51,11 +51,11 @@ public ImageSource Image { get { - if( this._type == 0 ) + if (this._type == 0) { return MethodImage.Source; } - if( this._type == 1 ) + if (this._type == 1) { return PropertyImage.Source; } @@ -95,15 +95,15 @@ public double Priority } - public void Complete( TextArea textArea , ISegment completionSegment , EventArgs insertionRequestEventArgs ) + public void Complete(TextArea textArea, ISegment completionSegment, EventArgs insertionRequestEventArgs) { try { - textArea.Document.Replace( completionSegment , this.Text.Replace( this.EnteredText , "" ) ); + textArea.Document.Replace(completionSegment, this.Text.Replace(this.EnteredText, "")); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } diff --git a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/AvalonEditHelpers/HighlightCurrentLineBackgroundRenderer .cs b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/AvalonEditHelpers/HighlightCurrentLineBackgroundRenderer .cs index 1f8a682..eafd2ae 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/AvalonEditHelpers/HighlightCurrentLineBackgroundRenderer .cs +++ b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/AvalonEditHelpers/HighlightCurrentLineBackgroundRenderer .cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Windows; using System.Windows.Media; @@ -16,7 +16,7 @@ internal class HighlightCurrentLineBackgroundRenderer : IBackgroundRenderer { private readonly TextEditor _editor; - public HighlightCurrentLineBackgroundRenderer( TextEditor editor ) + public HighlightCurrentLineBackgroundRenderer(TextEditor editor) { this._editor = editor; } @@ -31,9 +31,9 @@ public KnownLayer Layer } } - public void Draw( TextView textView , DrawingContext drawingContext ) + public void Draw(TextView textView, DrawingContext drawingContext) { - if( this._editor.Document == null ) + if (this._editor.Document == null) { return; } @@ -41,20 +41,20 @@ public void Draw( TextView textView , DrawingContext drawingContext ) try { textView.EnsureVisualLines(); - var currentLine = this._editor.Document.GetLineByOffset( this._editor.CaretOffset ); - foreach( var rect in BackgroundGeometryBuilder.GetRectsForSegment( textView , currentLine ) ) + var currentLine = this._editor.Document.GetLineByOffset(this._editor.CaretOffset); + foreach (var rect in BackgroundGeometryBuilder.GetRectsForSegment(textView, currentLine)) { - if( textView.ActualWidth - 32 > 0 && rect.Height > 0 ) + if (textView.ActualWidth - 32 > 0 && rect.Height > 0) { - var Size = new Size( textView.ActualWidth - 32 , rect.Height ); - var Rect = new Rect( rect.Location , Size ); - drawingContext.DrawRectangle( new SolidColorBrush( Color.FromArgb( 50 , 250 , 250 , 100 ) ) , null , Rect ); + var Size = new Size(textView.ActualWidth - 32, rect.Height); + var Rect = new Rect(rect.Location, Size); + drawingContext.DrawRectangle(new SolidColorBrush(Color.FromArgb(50, 250, 250, 100)), null, Rect); } } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } diff --git a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/CustomControls/StackPanelModuleElement.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/CustomControls/StackPanelModuleElement.xaml.cs index 479114c..5b9b66a 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/CustomControls/StackPanelModuleElement.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/CustomControls/StackPanelModuleElement.xaml.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Windows.Controls; using System.Windows.Input; @@ -20,37 +20,37 @@ public partial class StackPanelModuleElement : IModuleObserver /// /// - public StackPanelModuleElement( IModule module ) + public StackPanelModuleElement(IModule module) { try { this.InitializeComponent(); this._module = module; - this._module.Attach( this ); + this._module.Attach(this); this.Prepare(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } /// /// - public StackPanelModuleElement( IModule module , int h ) + public StackPanelModuleElement(IModule module, int h) { try { this.InitializeComponent(); this._module = module; - this._module.Attach( this ); + this._module.Attach(this); this.Prepare(); - this.LoadedDoubleAnimation.BeginTime = new TimeSpan( 0 , 0 , 0 , 0 , ( h + 1 ) * 100 ); + this.LoadedDoubleAnimation.BeginTime = new TimeSpan(0, 0, 0, 0, (h + 1) * 100); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -60,30 +60,30 @@ private void Prepare() try { this.rectangle1.ToolTip = this._module.GetModuleLocation(); - var location = this._module.GetModuleLocation().Split( '\\' ); - this.PanelItemDetails.Content = location[ location.Length - 1 ]; - this.PanelItemImage.Source = Framework.Images.GetImage( "lgp" , "128x128" , 28 ).Source; + var location = this._module.GetModuleLocation().Split('\\'); + this.PanelItemDetails.Content = location[location.Length - 1]; + this.PanelItemImage.Source = Framework.Images.GetImage("lgp", "128x128", 28).Source; this.PanelItemModuleLabel.Content = this._module.GetModuleName(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void OnDoubleClick( object sender , MouseButtonEventArgs e ) + private void OnDoubleClick(object sender, MouseButtonEventArgs e) { try { - if( e.ClickCount == 2 ) + if (e.ClickCount == 2) { - Framework.Panels.AddMainComponent( new ModuleEditor( this._module ) , this._module.GetModuleLocation() ); + Framework.Panels.AddMainComponent(new ModuleEditor(this._module), this._module.GetModuleLocation()); } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -94,11 +94,11 @@ public void Activate() { try { - Framework.Panels.AddMainComponent( new ModuleEditor( this._module ) , this._module.GetModuleLocation() ); + Framework.Panels.AddMainComponent(new ModuleEditor(this._module), this._module.GetModuleLocation()); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -109,24 +109,24 @@ public void Activate() /// /// IModule /// IModuleObserver - public void Update( IModule module , IModuleObserver source ) + public void Update(IModule module, IModuleObserver source) { try { - if( source == this ) + if (source == this) { return; } this._module = module; this.PanelItemModuleLabel.Content = this._module.GetModuleName(); - var location = this._module.GetModuleLocation().Split( '\\' ); - this.PanelItemDetails.Content = location[ location.Length - 1 ]; - this.PanelItemImage.Source = Framework.Images.GetImage( "lgp" , "128x128" , 28 ).Source; + var location = this._module.GetModuleLocation().Split('\\'); + this.PanelItemDetails.Content = location[location.Length - 1]; + this.PanelItemImage.Source = Framework.Images.GetImage("lgp", "128x128", 28).Source; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -135,14 +135,14 @@ 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 { } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -151,14 +151,14 @@ public void Attach( IModuleObserver obj ) /// Detach objewcts that observer this module /// /// IModuleObserver - public void Detach( IModuleObserver obj ) + public void Detach(IModuleObserver obj) { try { } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -171,9 +171,9 @@ public void Notify() try { } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -182,17 +182,17 @@ public void Notify() /// Dispose this object and all the observers /// /// IModuleObserver - public void Dispose( IModuleObserver obj ) + public void Dispose(IModuleObserver obj) { try { - this._module.Detach( this ); + this._module.Detach(this); this._module = null; - var parent = ( StackPanel ) this.Parent; - parent.Children.Remove( this ); + var parent = (StackPanel)this.Parent; + parent.Children.Remove(this); } - catch( Exception ) + catch (Exception) { } } diff --git a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/Modals/Controls/DeleteModule.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/Modals/Controls/DeleteModule.xaml.cs index 5f96d87..7f4b0df 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/Modals/Controls/DeleteModule.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/Modals/Controls/DeleteModule.xaml.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Windows; using System.Windows.Controls; @@ -30,9 +30,9 @@ public DeleteModule() { this.InitializeComponent(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -42,7 +42,7 @@ public DeleteModule() /// Creator /// the parent window /// IModule - public DeleteModule( UserControl moduleList , IDialog popup , IModule module ) + public DeleteModule(UserControl moduleList, IDialog popup, IModule module) { try { @@ -51,48 +51,48 @@ public DeleteModule( UserControl moduleList , IDialog popup , IModule module ) this._popupWindow = popup; this._module = module; this.label3.Content = module.GetModuleName(); - this.image1.Source = Framework.Images.GetImage( "delete32" , "VS2010ImageLibrary" ).Source; + this.image1.Source = Framework.Images.GetImage("delete32", "VS2010ImageLibrary").Source; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void CancelButtonClick( object sender , RoutedEventArgs e ) + private void CancelButtonClick(object sender, RoutedEventArgs e) { try { this._popupWindow.CloseDialog(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void UserControlLoaded( object sender , RoutedEventArgs e ) + private void UserControlLoaded(object sender, RoutedEventArgs e) { try { - this._popupWindow.ResizePopup( ( int ) this.Width , ( int ) this.Height ); + this._popupWindow.ResizePopup((int)this.Width, (int)this.Height); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void DeleteButtonClick( object sender , RoutedEventArgs e ) + private void DeleteButtonClick(object sender, RoutedEventArgs e) { try { - ModuleHandler.DeleteModule( this._module ); + ModuleHandler.DeleteModule(this._module); this._popupWindow.CloseDialog(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } } diff --git a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/ModuleDocument.cs b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/ModuleDocument.cs index 430233a..22dda06 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/ModuleDocument.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Internal/ModuleDocument.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Collections.Generic; using System.ComponentModel; @@ -29,10 +29,10 @@ namespace LGP.Modules.ModuleEditor.Internal { /// /// - public class ModuleDocument : INotifyPropertyChanged , IModuleObserver + public class ModuleDocument : INotifyPropertyChanged, IModuleObserver { private static readonly BraceFoldingStrategy BraceFoldingStrategy; - private static List< string > _perlMethodNames; + private static List _perlMethodNames; private static IHighlightingDefinition _perlHighlighterDefintion; private readonly Label _col; private readonly TextEditor _editor1; @@ -48,7 +48,7 @@ public class ModuleDocument : INotifyPropertyChanged , IModuleObserver private FoldingManager _foldingManager2; private int _hashContents; private IModule _module; - private List< string > _perlVariables; + private List _perlVariables; static ModuleDocument() @@ -57,9 +57,9 @@ static ModuleDocument() { BraceFoldingStrategy = new BraceFoldingStrategy(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -71,7 +71,7 @@ static ModuleDocument() /// Document to bind /// TextEditor /// TextEditor - public ModuleDocument( IModule module , ModuleEditor parent , TextEditor avalon1 , TextEditor avalon2 ) + public ModuleDocument(IModule module, ModuleEditor parent, TextEditor avalon1, TextEditor avalon2) { try { @@ -79,27 +79,47 @@ public ModuleDocument( IModule module , ModuleEditor parent , TextEditor avalon1 this._editor1 = avalon1; this._editor2 = avalon2; this._module = module; - this._module.Attach( this ); + this._module.Attach(this); this._col = new Label { - Margin = new Thickness( 0 ) , Padding = new Thickness( 0 ) , FontSize = 12 , Height = 28 , Content = "0" + Margin = new Thickness(0), + Padding = new Thickness(0), + FontSize = 12, + Height = 28, + Content = "0" }; this._length = new Label { - Margin = new Thickness( 0 ) , Padding = new Thickness( 0 ) , FontSize = 12 , Height = 28 , Content = "0" + Margin = new Thickness(0), + Padding = new Thickness(0), + FontSize = 12, + Height = 28, + Content = "0" }; this._lines = new Label { - Margin = new Thickness( 0 ) , Padding = new Thickness( 0 ) , FontSize = 12 , Height = 28 , Content = "0" + Margin = new Thickness(0), + Padding = new Thickness(0), + FontSize = 12, + Height = 28, + Content = "0" }; this._row = new Label { - Margin = new Thickness( 0 ) , Padding = new Thickness( 0 ) , FontSize = 12 , Height = 28 , Content = "0" + Margin = new Thickness(0), + Padding = new Thickness(0), + FontSize = 12, + Height = 28, + Content = "0" }; this._selection = new Label { - Margin = new Thickness( 0 ) , Padding = new Thickness( 0 ) , FontSize = 12 , Height = 28 , Content = "0" + Margin = new Thickness(0), + Padding = new Thickness(0), + FontSize = 12, + Height = 28, + Content = "0" }; this.SetUpLookAndFeel(); @@ -112,9 +132,9 @@ public ModuleDocument( IModule module , ModuleEditor parent , TextEditor avalon1 this._document.UndoStack = new UndoStack(); this._hashContents = this._document.Text.GetHashCode(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -131,7 +151,7 @@ public TextDocument Document set { this._document = value; - this.OnPropertyChanged( "DocumentChanged" ); + this.OnPropertyChanged("DocumentChanged"); } } @@ -231,40 +251,40 @@ private void SetUpLookAndFeel() this._editor2.Options.ShowBoxForControlCharacters = true; this._editor2.Options.ShowTabs = true; - var myBinding = new Binding( "WordWrap" ) + var myBinding = new Binding("WordWrap") { Source = this._editor1 }; - this._editor2.SetBinding( TextEditor.WordWrapProperty , myBinding ); + this._editor2.SetBinding(TextEditor.WordWrapProperty, myBinding); - var myBinding2 = new Binding( "ShowLineNumbers" ) + var myBinding2 = new Binding("ShowLineNumbers") { Source = this._editor1 }; - this._editor2.SetBinding( TextEditor.ShowLineNumbersProperty , myBinding2 ); + this._editor2.SetBinding(TextEditor.ShowLineNumbersProperty, myBinding2); - this._editor1.TextArea.TextView.BackgroundRenderers.Add( new HighlightCurrentLineBackgroundRenderer( this._editor1 ) ); + this._editor1.TextArea.TextView.BackgroundRenderers.Add(new HighlightCurrentLineBackgroundRenderer(this._editor1)); this._editor1.TextArea.Caret.PositionChanged += this.CaretPositionChanged1; - this._editor2.TextArea.TextView.BackgroundRenderers.Add( new HighlightCurrentLineBackgroundRenderer( this._editor2 ) ); + this._editor2.TextArea.TextView.BackgroundRenderers.Add(new HighlightCurrentLineBackgroundRenderer(this._editor2)); this._editor2.TextArea.Caret.PositionChanged += this.CaretPositionChanged2; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void CaretPositionChanged1( object sender , EventArgs e ) + private void CaretPositionChanged1(object sender, EventArgs e) { - this.CaretChangedUpdater( this._editor1 ); + this.CaretChangedUpdater(this._editor1); } - private void CaretPositionChanged2( object sender , EventArgs e ) + private void CaretPositionChanged2(object sender, EventArgs e) { - this.CaretChangedUpdater( this._editor2 ); + this.CaretChangedUpdater(this._editor2); } @@ -272,35 +292,35 @@ private void PrepareFoldingStrategy() { try { - this._foldingManager1 = FoldingManager.Install( this._editor1.TextArea ); - BraceFoldingStrategy.UpdateFoldings( this._foldingManager1 , this._document ); + this._foldingManager1 = FoldingManager.Install(this._editor1.TextArea); + BraceFoldingStrategy.UpdateFoldings(this._foldingManager1, this._document); - this._foldingManager2 = FoldingManager.Install( this._editor2.TextArea ); - BraceFoldingStrategy.UpdateFoldings( this._foldingManager2 , this._document ); + this._foldingManager2 = FoldingManager.Install(this._editor2.TextArea); + BraceFoldingStrategy.UpdateFoldings(this._foldingManager2, this._document); var foldingUpdateTimer = new DispatcherTimer { - Interval = TimeSpan.FromSeconds( 3 ) + Interval = TimeSpan.FromSeconds(3) }; foldingUpdateTimer.Tick += this.BraceFoldingUpdateTimerTick; foldingUpdateTimer.Start(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void BraceFoldingUpdateTimerTick( object sender , EventArgs e ) + private void BraceFoldingUpdateTimerTick(object sender, EventArgs e) { try { - BraceFoldingStrategy.UpdateFoldings( this._foldingManager1 , this._document ); - BraceFoldingStrategy.UpdateFoldings( this._foldingManager2 , this._document ); + BraceFoldingStrategy.UpdateFoldings(this._foldingManager1, this._document); + BraceFoldingStrategy.UpdateFoldings(this._foldingManager2, this._document); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -308,37 +328,37 @@ private void Bind() { try { - var documentBinding = new Binding( "Document" ) + var documentBinding = new Binding("Document") { Source = this }; - BindingOperations.SetBinding( this._editor1 , TextEditor.DocumentProperty , documentBinding ); - BindingOperations.SetBinding( this._editor2 , TextEditor.DocumentProperty , documentBinding ); + BindingOperations.SetBinding(this._editor1, TextEditor.DocumentProperty, documentBinding); + BindingOperations.SetBinding(this._editor2, TextEditor.DocumentProperty, documentBinding); - BindingOperations.SetBinding( this._parent.FileLine , ContentControl.ContentProperty , new Binding( "CaretRow" ) + BindingOperations.SetBinding(this._parent.FileLine, ContentControl.ContentProperty, new Binding("CaretRow") { Source = this - } ); - BindingOperations.SetBinding( this._parent.FileColumn , ContentControl.ContentProperty , new Binding( "CaretCol" ) + }); + BindingOperations.SetBinding(this._parent.FileColumn, ContentControl.ContentProperty, new Binding("CaretCol") { Source = this - } ); - BindingOperations.SetBinding( this._parent.FileSelection , ContentControl.ContentProperty , new Binding( "SelectionLength" ) + }); + BindingOperations.SetBinding(this._parent.FileSelection, ContentControl.ContentProperty, new Binding("SelectionLength") { Source = this - } ); - BindingOperations.SetBinding( this._parent.FileLength , ContentControl.ContentProperty , new Binding( "FileLength" ) + }); + BindingOperations.SetBinding(this._parent.FileLength, ContentControl.ContentProperty, new Binding("FileLength") { Source = this - } ); - BindingOperations.SetBinding( this._parent.FileLines , ContentControl.ContentProperty , new Binding( "LineCount" ) + }); + BindingOperations.SetBinding(this._parent.FileLines, ContentControl.ContentProperty, new Binding("LineCount") { Source = this - } ); + }); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -355,43 +375,43 @@ private void SetHandlers() this._editor1.TextArea.TextEntered += this.TextAreaTextEntered1; this._editor2.TextArea.TextEntered += this.TextAreaTextEntered2; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void CaretChangedUpdater( TextEditor editor ) + private void CaretChangedUpdater(TextEditor editor) { try { - editor.TextArea.TextView.InvalidateLayer( KnownLayer.Background ); + editor.TextArea.TextView.InvalidateLayer(KnownLayer.Background); this._col.Content = editor.TextArea.Caret.Column; this._row.Content = editor.TextArea.Caret.Line; this._selection.Content = editor.SelectionLength; this._length.Content = editor.Text.Length; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void OnPropertyChanged( string info ) + private void OnPropertyChanged(string info) { try { var handler = this.PropertyChanged; - if( handler != null ) + if (handler != null) { - handler( this , new PropertyChangedEventArgs( info ) ); + handler(this, new PropertyChangedEventArgs(info)); } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -408,23 +428,23 @@ private void PrepareEditorContents() this._lines.Content = this.Document.LineCount; this._length.Content = this.Document.TextLength; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void DocumentTextChanged( object sender , EventArgs e ) + private void DocumentTextChanged(object sender, EventArgs e) { try { this._lines.Content = this.Document.LineCount; this._length.Content = this.Document.TextLength; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -433,14 +453,14 @@ private void LoadHighlighter() { try { - var extension = Path.GetExtension( this._module.GetModuleLocation() ); - if( extension != null ) + var extension = Path.GetExtension(this._module.GetModuleLocation()); + if (extension != null) { var ext = extension.ToLower(); - if( ext.CompareTo( ".pl" ) == 0 || ext.CompareTo( ".pm" ) == 0 ) + if (ext.CompareTo(".pl") == 0 || ext.CompareTo(".pm") == 0) { - if( _perlHighlighterDefintion == null ) + if (_perlHighlighterDefintion == null) { this.LoadPerlSyntaxHighlighter(); LoadPerlMethodNames(); @@ -453,14 +473,14 @@ private void LoadHighlighter() } else { - this._editor1.SyntaxHighlighting = HighlightingManager.Instance.GetDefinitionByExtension( extension ); - this._editor2.SyntaxHighlighting = HighlightingManager.Instance.GetDefinitionByExtension( extension ); + this._editor1.SyntaxHighlighting = HighlightingManager.Instance.GetDefinitionByExtension(extension); + this._editor2.SyntaxHighlighting = HighlightingManager.Instance.GetDefinitionByExtension(extension); } } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -468,23 +488,23 @@ private void ScanVariableNames() { try { - this._perlVariables = new List< string >(); + this._perlVariables = new List(); - var variableRegex = new Regex( "(\\${1,2}|\\$?@|\\$?%)([A-Za-z0-9_]+)" ); + var variableRegex = new Regex("(\\${1,2}|\\$?@|\\$?%)([A-Za-z0-9_]+)"); - var collection = variableRegex.Matches( this._document.Text ); + var collection = variableRegex.Matches(this._document.Text); - foreach( Match match in collection ) + foreach (Match match in collection) { - if( !this._perlVariables.Contains( match.ToString() ) ) + if (!this._perlVariables.Contains(match.ToString())) { - this._perlVariables.Add( match.ToString() ); + this._perlVariables.Add(match.ToString()); } } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -493,19 +513,19 @@ private static void LoadPerlMethodNames() { try { - if( _perlMethodNames == null ) + if (_perlMethodNames == null) { - var fileStream = new FileStream( "perl.xshd" , FileMode.Open , FileAccess.Read ); - var reader = new XmlTextReader( fileStream ); + var fileStream = new FileStream("perl.xshd", FileMode.Open, FileAccess.Read); + var reader = new XmlTextReader(fileStream); - _perlMethodNames = new List< string >(); + _perlMethodNames = new List(); - while( reader.Read() ) + while (reader.Read()) { - if( reader.NodeType == XmlNodeType.Element ) + if (reader.NodeType == XmlNodeType.Element) { reader.Read(); - _perlMethodNames.Add( reader.Value ); + _perlMethodNames.Add(reader.Value); } } @@ -513,9 +533,9 @@ private static void LoadPerlMethodNames() fileStream.Close(); } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -524,63 +544,65 @@ private void LoadPerlSyntaxHighlighter() { try { - if( _perlHighlighterDefintion == null ) + if (_perlHighlighterDefintion == null) { - var fileStream = new FileStream( "perl.xshd" , FileMode.Open , FileAccess.Read ); - var reader = new XmlTextReader( fileStream ); - _perlHighlighterDefintion = HighlightingLoader.Load( reader , HighlightingManager.Instance ); + var fileStream = new FileStream("perl.xshd", FileMode.Open, FileAccess.Read); + var reader = new XmlTextReader(fileStream); + _perlHighlighterDefintion = HighlightingLoader.Load(reader, HighlightingManager.Instance); reader.Close(); fileStream.Close(); } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void TextAreaTextEntered1( object sender , TextCompositionEventArgs e ) + private void TextAreaTextEntered1(object sender, TextCompositionEventArgs e) { - this.HandleTextEntered( this._editor1 ); + this.HandleTextEntered(this._editor1); } - private void TextAreaTextEntered2( object sender , TextCompositionEventArgs e ) + private void TextAreaTextEntered2(object sender, TextCompositionEventArgs e) { - this.HandleTextEntered( this._editor2 ); + this.HandleTextEntered(this._editor2); } - private void HandleTextEntered( TextEditor editor ) + private void HandleTextEntered(TextEditor editor) { try { - var currentline = editor.Document.GetLineByOffset( editor.CaretOffset ); + var currentline = editor.Document.GetLineByOffset(editor.CaretOffset); var startswith = ""; const char space = ' '; var currentPos = editor.CaretOffset; var i = currentPos - 1; - while( i > -1 && i > currentline.Offset - 1 ) + while (i > -1 && i > currentline.Offset - 1) { - var previousChar = this._document.GetCharAt( i ); - if( previousChar.CompareTo( space ) == 0 || previousChar.CompareTo( '\t' ) == 0 ) + var previousChar = this._document.GetCharAt(i); + if (previousChar.CompareTo(space) == 0 || previousChar.CompareTo('\t') == 0) { i = -2; } else { - startswith = this._document.GetCharAt( i ) + startswith; + startswith = this._document.GetCharAt(i) + startswith; i--; } } - if( startswith.Length > 0 ) + if (startswith.Length > 0) { - this._completionWindow = new CompletionWindow( editor.TextArea ) + this._completionWindow = new CompletionWindow(editor.TextArea) { - WindowStyle = WindowStyle.None , Background = null , AllowsTransparency = true + WindowStyle = WindowStyle.None, + Background = null, + AllowsTransparency = true }; this._completionWindow.Closed += delegate { @@ -589,23 +611,23 @@ private void HandleTextEntered( TextEditor editor ) var data = this._completionWindow.CompletionList.CompletionData; - for( var h = 0; h < _perlMethodNames.Count; h++ ) + for (var h = 0; h < _perlMethodNames.Count; h++) { - if( _perlMethodNames[ h ].StartsWith( startswith ) ) + if (_perlMethodNames[h].StartsWith(startswith)) { - data.Add( new CompletionData( _perlMethodNames[ h ] , startswith , 0 ) ); + data.Add(new CompletionData(_perlMethodNames[h], startswith, 0)); } } - for( var h = 0; h < this._perlVariables.Count; h++ ) + for (var h = 0; h < this._perlVariables.Count; h++) { - if( this._perlVariables[ h ].StartsWith( startswith ) ) + if (this._perlVariables[h].StartsWith(startswith)) { - data.Add( new CompletionData( this._perlVariables[ h ] , startswith , 1 ) ); + data.Add(new CompletionData(this._perlVariables[h], startswith, 1)); } } - if( data.Count > 0 ) + if (data.Count > 0) { this._completionWindow.Show(); } @@ -613,38 +635,38 @@ private void HandleTextEntered( TextEditor editor ) this._hashContents = this._document.Text.GetHashCode(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void TextAreaTextEntering1( object sender , TextCompositionEventArgs e ) + private void TextAreaTextEntering1(object sender, TextCompositionEventArgs e) { - this.TextEntering( e ); + this.TextEntering(e); } - private void TextAreaTextEntering2( object sender , TextCompositionEventArgs e ) + private void TextAreaTextEntering2(object sender, TextCompositionEventArgs e) { - this.TextEntering( e ); + this.TextEntering(e); } - private void TextEntering( TextCompositionEventArgs e ) + private void TextEntering(TextCompositionEventArgs e) { try { - if( e.Text.Length > 0 && this._completionWindow != null ) + if (e.Text.Length > 0 && this._completionWindow != null) { - if( !char.IsLetterOrDigit( e.Text[ 0 ] ) ) + if (!char.IsLetterOrDigit(e.Text[0])) { - this._completionWindow.CompletionList.RequestInsertion( e ); + this._completionWindow.CompletionList.RequestInsertion(e); } } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -652,17 +674,17 @@ private void TextEntering( TextCompositionEventArgs e ) /// /// /// - public void GoTo( string text ) + public void GoTo(string text) { try { - var location = this._document.GetLocation( this._document.Text.IndexOf( text ) ); - this._editor1.ScrollToLine( location.Line ); - this._editor2.ScrollToLine( location.Line ); + var location = this._document.GetLocation(this._document.Text.IndexOf(text)); + this._editor1.ScrollToLine(location.Line); + this._editor2.ScrollToLine(location.Line); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -683,25 +705,25 @@ public int GetHash() /// /// IModule /// IModuleObserver - public void Update( IModule module , IModuleObserver source ) + public void Update(IModule module, IModuleObserver source) { try { this._module = module; - var replacePackage = new Regex( "package\\s+([A-Za-z0-9_]+)(\\s+)?;" ); - var match = replacePackage.Match( this._document.Text ); + var replacePackage = new Regex("package\\s+([A-Za-z0-9_]+)(\\s+)?;"); + var match = replacePackage.Match(this._document.Text); - if( this._module.GetModuleName().CompareTo( match.Groups[ 1 ].ToString() ) != 0 ) + if (this._module.GetModuleName().CompareTo(match.Groups[1].ToString()) != 0) { - this._document.Text = this._document.Text.Replace( match.Groups[ 0 ].ToString() , "package " + this._module.GetModuleName() + ";" ); + this._document.Text = this._document.Text.Replace(match.Groups[0].ToString(), "package " + this._module.GetModuleName() + ";"); this._hashContents = this._document.Text.GetHashCode(); this._module.FileContents = this._document.Text; } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -709,14 +731,14 @@ 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 { } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -724,14 +746,14 @@ public void Attach( IModuleObserver obj ) /// Detach objewcts that observer this module /// /// IModuleObserver - public void Detach( IModuleObserver obj ) + public void Detach(IModuleObserver obj) { try { } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -743,9 +765,9 @@ public void Notify() try { } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -753,19 +775,19 @@ public void Notify() /// Dispose this object and all the observers /// /// IModuleObserver - public void Dispose( IModuleObserver obj ) + public void Dispose(IModuleObserver obj) { try { if (this._module != null) { - this._module.Detach( this ); + this._module.Detach(this); this._module = null; } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } diff --git a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/ModuleEditor.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/ModuleEditor.xaml.cs index 96c5866..d2551b6 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/ModuleEditor.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/ModuleEditor.xaml.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.ComponentModel; using System.Windows; @@ -23,7 +23,7 @@ namespace LGP.Modules.ModuleEditor /// /// Interaction logic for ModuleEditor.xaml /// - public partial class ModuleEditor : IUserControl , IModuleObserver + public partial class ModuleEditor : IUserControl, IModuleObserver { private readonly ModuleDocument _documentHandler; private readonly DispatcherTimer _editedCheckTimer; @@ -32,55 +32,55 @@ public partial class ModuleEditor : IUserControl , IModuleObserver /// /// Constructor for the module /// - public ModuleEditor( IModule module ) + public ModuleEditor(IModule module) { try { this.InitializeComponent(); this._module = module; - this._module.Attach( this ); - this._documentHandler = new ModuleDocument( this._module , this , this.textEditor1 , this.textEditor2 ); + this._module.Attach(this); + this._documentHandler = new ModuleDocument(this._module, this, this.textEditor1, this.textEditor2); this.Prepare(); this._editedCheckTimer = new DispatcherTimer { - Interval = TimeSpan.FromSeconds( 3 ) + Interval = TimeSpan.FromSeconds(3) }; this._editedCheckTimer.Tick += this.IsEditedTick; this._editedCheckTimer.Start(); - this.ModuleViewBorderContainer.Child = new ModulePane( this._module , this._documentHandler ); + this.ModuleViewBorderContainer.Child = new ModulePane(this._module, this._documentHandler); this.Tag = this._module.GetModuleName() + ".pm"; Framework.ShutDown += this.Terminate; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void Terminate( object sender , CancelEventArgs args ) + private void Terminate(object sender, CancelEventArgs args) { try { this.Dispose(); } - catch( Exception ) + catch (Exception) { } } - private void IsEditedTick( object sender , EventArgs e ) + private void IsEditedTick(object sender, EventArgs e) { try { - if( this._module == null ) + if (this._module == null) { return; } - if( this._documentHandler.GetHash() != this._module.GetHash() ) + if (this._documentHandler.GetHash() != this._module.GetHash()) { this.SaveButton.IsEnabled = true; this.SaveButton.Opacity = 1.0; @@ -91,9 +91,9 @@ private void IsEditedTick( object sender , EventArgs e ) this.SaveButton.Opacity = 0.3; } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -103,120 +103,120 @@ private void Prepare() { this.moduleNameLabel.Content = this._module.GetModuleName(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void MenuItemCopyClick( object sender , RoutedEventArgs e ) + private void MenuItemCopyClick(object sender, RoutedEventArgs e) { try { - Clipboard.SetText( this.textEditor1.SelectedText , TextDataFormat.Text ); + Clipboard.SetText(this.textEditor1.SelectedText, TextDataFormat.Text); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void MenuItemCutClick( object sender , RoutedEventArgs e ) + private void MenuItemCutClick(object sender, RoutedEventArgs e) { try { var text = this.textEditor1.SelectedText; this.textEditor1.SelectedText = ""; - Clipboard.SetText( text , TextDataFormat.Text ); + Clipboard.SetText(text, TextDataFormat.Text); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void MenuItemPasteClick( object sender , RoutedEventArgs e ) + private void MenuItemPasteClick(object sender, RoutedEventArgs e) { try { - if( Clipboard.ContainsText( TextDataFormat.Text ) ) + if (Clipboard.ContainsText(TextDataFormat.Text)) { - var text = Clipboard.GetText( TextDataFormat.Text ); - this.textEditor1.Document.Insert( this.textEditor1.CaretOffset , text ); - Clipboard.SetText( text , TextDataFormat.Text ); + var text = Clipboard.GetText(TextDataFormat.Text); + this.textEditor1.Document.Insert(this.textEditor1.CaretOffset, text); + Clipboard.SetText(text, TextDataFormat.Text); } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void GridViewSplitterChecked( object sender , RoutedEventArgs e ) + private void GridViewSplitterChecked(object sender, RoutedEventArgs e) { try { var checkbox = sender as CheckBox; var editorGridWidth = this.editorGrid.ActualWidth; - var editor1Column = this.editorGrid.ColumnDefinitions[ 0 ]; - var editor2Column = this.editorGrid.ColumnDefinitions[ 2 ]; + var editor1Column = this.editorGrid.ColumnDefinitions[0]; + var editor2Column = this.editorGrid.ColumnDefinitions[2]; - if( checkbox != null && checkbox.IsChecked.HasValue ) + if (checkbox != null && checkbox.IsChecked.HasValue) { - var checkedb = ( bool ) checkbox.GetValue( ToggleButton.IsCheckedProperty ); - if( checkedb ) + var checkedb = (bool)checkbox.GetValue(ToggleButton.IsCheckedProperty); + if (checkedb) { - editor1Column.Width = new GridLength( ( editorGridWidth / 2 ) - 1 , GridUnitType.Star ); - editor2Column.Width = new GridLength( ( editorGridWidth / 2 ) - 1 , GridUnitType.Star ); + editor1Column.Width = new GridLength((editorGridWidth / 2) - 1, GridUnitType.Star); + editor2Column.Width = new GridLength((editorGridWidth / 2) - 1, GridUnitType.Star); } else { - editor1Column.Width = new GridLength( editorGridWidth - 2 , GridUnitType.Star ); - editor2Column.Width = new GridLength( 0 , GridUnitType.Star ); + editor1Column.Width = new GridLength(editorGridWidth - 2, GridUnitType.Star); + editor2Column.Width = new GridLength(0, GridUnitType.Star); } } else { - editor1Column.Width = new GridLength( editorGridWidth - 2 , GridUnitType.Star ); - editor2Column.Width = new GridLength( 0 , GridUnitType.Star ); + editor1Column.Width = new GridLength(editorGridWidth - 2, GridUnitType.Star); + editor2Column.Width = new GridLength(0, GridUnitType.Star); } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void UserControlLoaded( object sender , RoutedEventArgs e ) + private void UserControlLoaded(object sender, RoutedEventArgs e) { try { - this.SplitViewImage.Source = Framework.Images.GetImage( "LayoutSelectColumn" , "VS2010ImageLibrary" , 16 ).Source; - this.ImageCopy.Source = Framework.Images.GetImage( "Copy" , "VS2010ImageLibrary" ).Source; - this.ImageCut.Source = Framework.Images.GetImage( "Cut" , "VS2010ImageLibrary" ).Source; - this.ImageDelete.Source = Framework.Images.GetImage( "Delete" , "VS2010ImageLibrary" ).Source; - this.ImagePaste.Source = Framework.Images.GetImage( "Paste" , "VS2010ImageLibrary" ).Source; - this.ImageRedo.Source = Framework.Images.GetImage( "Redo" , "VS2010ImageLibrary" ).Source; - this.ImageSave.Source = Framework.Images.GetImage( "Save" , "VS2010ImageLibrary" ).Source; - this.ImageUndo.Source = Framework.Images.GetImage( "Undo" , "VS2010ImageLibrary" ).Source; - this.ImageWrap.Source = Framework.Images.GetImage( "WordWrap" , "VS2010ImageLibrary" ).Source; - this.ModuleImage.Source = Framework.Images.GetImage( "lgp" , "128x128" , 28 ).Source; - this.DeleteMenuItem.Icon = Framework.Images.GetImage( "DeleteHS" , "VS2010ImageLibrary" , 12 ); - this.RenameMenuItem.Icon = Framework.Images.GetImage( "RenameFolderHS" , "VS2010ImageLibrary" , 12 ); + this.SplitViewImage.Source = Framework.Images.GetImage("LayoutSelectColumn", "VS2010ImageLibrary", 16).Source; + this.ImageCopy.Source = Framework.Images.GetImage("Copy", "VS2010ImageLibrary").Source; + this.ImageCut.Source = Framework.Images.GetImage("Cut", "VS2010ImageLibrary").Source; + this.ImageDelete.Source = Framework.Images.GetImage("Delete", "VS2010ImageLibrary").Source; + this.ImagePaste.Source = Framework.Images.GetImage("Paste", "VS2010ImageLibrary").Source; + this.ImageRedo.Source = Framework.Images.GetImage("Redo", "VS2010ImageLibrary").Source; + this.ImageSave.Source = Framework.Images.GetImage("Save", "VS2010ImageLibrary").Source; + this.ImageUndo.Source = Framework.Images.GetImage("Undo", "VS2010ImageLibrary").Source; + this.ImageWrap.Source = Framework.Images.GetImage("WordWrap", "VS2010ImageLibrary").Source; + this.ModuleImage.Source = Framework.Images.GetImage("lgp", "128x128", 28).Source; + this.DeleteMenuItem.Icon = Framework.Images.GetImage("DeleteHS", "VS2010ImageLibrary", 12); + this.RenameMenuItem.Icon = Framework.Images.GetImage("RenameFolderHS", "VS2010ImageLibrary", 12); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void RenameMenuItemClick( object sender , RoutedEventArgs e ) + private void RenameMenuItemClick(object sender, RoutedEventArgs e) { try { @@ -224,87 +224,87 @@ private void RenameMenuItemClick( object sender , RoutedEventArgs e ) this.moduleNameLabel.Visibility = Visibility.Hidden; this.ModuleLabelEditBox.Visibility = Visibility.Visible; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void DeleteMenuItemClick( object sender , RoutedEventArgs e ) + private void DeleteMenuItemClick(object sender, RoutedEventArgs e) { try { var popup = Framework.Dialog; - var cou = new DeleteModule( this , popup , this._module ); - popup.SetChild( cou ); + var cou = new DeleteModule(this, popup, this._module); + popup.SetChild(cou); popup.ShowBlocking(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void ModuleLabelEditBoxTextChanged( object sender , TextChangedEventArgs e ) + private void ModuleLabelEditBoxTextChanged(object sender, TextChangedEventArgs e) { try { - this.ModuleLabelEditBox.Text = Framework.Utils.CleanString( this.ModuleLabelEditBox.Text ); + this.ModuleLabelEditBox.Text = Framework.Utils.CleanString(this.ModuleLabelEditBox.Text); this.ModuleLabelEditBox.CaretIndex = this.ModuleLabelEditBox.Text.Length; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void ModuleEditBoxKeyUp( object sender , KeyEventArgs e ) + private void ModuleEditBoxKeyUp(object sender, KeyEventArgs e) { try { - if( e.Key == Key.Return && this.ModuleLabelEditBox.Text.Length > 0 ) + if (e.Key == Key.Return && this.ModuleLabelEditBox.Text.Length > 0) { this.ModuleLabelEditBox.Visibility = Visibility.Hidden; this.moduleNameLabel.Visibility = Visibility.Visible; - this._module.SetModuleName( this.ModuleLabelEditBox.Text ); + this._module.SetModuleName(this.ModuleLabelEditBox.Text); this.moduleNameLabel.Content = this._module.GetModuleName(); } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void SaveMenuItemClick( object sender , RoutedEventArgs e ) + private void SaveMenuItemClick(object sender, RoutedEventArgs e) { try { this._module.FileContents = this._documentHandler.Document.Text; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void ToolBarLoaded( object sender , RoutedEventArgs e ) + private void ToolBarLoaded(object sender, RoutedEventArgs e) { try { var toolBar = sender as ToolBar; - if( toolBar != null ) + if (toolBar != null) { - var overflowGrid = toolBar.Template.FindName( "OverflowGrid" , toolBar ) as FrameworkElement; - if( overflowGrid != null ) + var overflowGrid = toolBar.Template.FindName("OverflowGrid", toolBar) as FrameworkElement; + if (overflowGrid != null) { overflowGrid.Visibility = Visibility.Collapsed; } } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -317,15 +317,15 @@ public void Dispose() { try { - this._documentHandler.Dispose( this ); - this._module.Detach( this ); + this._documentHandler.Dispose(this); + this._module.Detach(this); this._editedCheckTimer.Stop(); this._module = null; - var pane = ( ModulePane ) this.ModuleViewBorderContainer.Child; - pane.Dispose( this ); + var pane = (ModulePane)this.ModuleViewBorderContainer.Child; + pane.Dispose(this); } - catch( Exception ) + catch (Exception) { } } @@ -346,7 +346,7 @@ public void Pause() try { } - catch( Exception ) + catch (Exception) { } } @@ -359,7 +359,7 @@ public void Resume() try { } - catch( Exception ) + catch (Exception) { } } @@ -373,11 +373,11 @@ public void Resume() /// /// IModule /// IModuleObserver - public void Update( IModule module , IModuleObserver source ) + public void Update(IModule module, IModuleObserver source) { try { - if( source == this ) + if (source == this) { return; } @@ -386,9 +386,9 @@ public void Update( IModule module , IModuleObserver source ) this.moduleNameLabel.Content = this._module.GetModuleName(); this.Tag = this._module.GetModuleName() + " Module"; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -396,14 +396,14 @@ 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 { } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -411,14 +411,14 @@ public void Attach( IModuleObserver obj ) /// Detach objewcts that observer this module /// /// IModuleObserver - public void Detach( IModuleObserver obj ) + public void Detach(IModuleObserver obj) { try { } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -430,9 +430,9 @@ public void Notify() try { } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -440,20 +440,20 @@ public void Notify() /// Dispose this object and all the observers /// /// IModuleObserver - public void Dispose( IModuleObserver obj ) + public void Dispose(IModuleObserver obj) { try { - this._documentHandler.Dispose( this ); - this._module.Detach( this ); + this._documentHandler.Dispose(this); + this._module.Detach(this); this._editedCheckTimer.Stop(); this._module = null; Framework.ShutDown -= this.Terminate; - Framework.Panels.RemoveMainComponent( this ); + Framework.Panels.RemoveMainComponent(this); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } diff --git a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/ModuleList.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/ModuleList.xaml.cs index 793a686..300df2f 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/ModuleList.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/ModuleList.xaml.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Windows; using System.Windows.Controls; @@ -27,7 +27,7 @@ public partial class ModuleList : IUserControl /// /// /// - public delegate void AddModuleDelegate( string moduleName , StackPanel panel ); + public delegate void AddModuleDelegate(string moduleName, StackPanel panel); #endregion @@ -49,31 +49,31 @@ public ModuleList() ModuleHandler.Panel = this.stackPanel1; - this.ImageNew.Source = Framework.Images.GetImage( "NewDocumentHS" , "VS2010ImageLibrary" ).Source; - this.ImageRefresh.Source = Framework.Images.GetImage( "RepeatHS" , "VS2010ImageLibrary" ).Source; + this.ImageNew.Source = Framework.Images.GetImage("NewDocumentHS", "VS2010ImageLibrary").Source; + this.ImageRefresh.Source = Framework.Images.GetImage("RepeatHS", "VS2010ImageLibrary").Source; this.Tag = Properties.Resources.Modules; _instance = this; - if( Framework.Database.IsConnected() == false ) + if (Framework.Database.IsConnected() == false) { - Framework.Notification.Display( Properties.Resources.DatabaseConnectionRequired , 5000 ); - Framework.EventBus.Publish( new PreferencesEvent( this , typeof( IDatabase ) ) ); + Framework.Notification.Display(Properties.Resources.DatabaseConnectionRequired, 5000); + Framework.EventBus.Publish(new PreferencesEvent(this, typeof(IDatabase))); return; } - if( ModuleHandler.GetClient() == null ) + if (ModuleHandler.GetClient() == null) { - Framework.Notification.Display( Properties.Resources.ServerConnectionRequired , 5000 ); - Framework.EventBus.Publish( new PreferencesEvent( this , typeof( INetwork ) ) ); + Framework.Notification.Display(Properties.Resources.ServerConnectionRequired, 5000); + Framework.EventBus.Publish(new PreferencesEvent(this, typeof(INetwork))); return; } ModuleHandler.RefreshModuleFiles(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -83,83 +83,83 @@ public ModuleList() /// public static ModuleList GetInstance() { - return _instance ?? ( _instance = new ModuleList() ); + return _instance ?? (_instance = new ModuleList()); } - private void NewMenuItemClick( object sender , RoutedEventArgs e ) + private void NewMenuItemClick(object sender, RoutedEventArgs e) { try { - if( Framework.Database.IsConnected() == false ) + if (Framework.Database.IsConnected() == false) { - Framework.Notification.Display( Properties.Resources.DatabaseConnectionRequired , 5000 ); - Framework.EventBus.Publish( new PreferencesEvent( this , typeof( IDatabase ) ) ); + Framework.Notification.Display(Properties.Resources.DatabaseConnectionRequired, 5000); + Framework.EventBus.Publish(new PreferencesEvent(this, typeof(IDatabase))); return; } - if( ModuleHandler.GetClient() == null ) + if (ModuleHandler.GetClient() == null) { - Framework.Notification.Display( Properties.Resources.ServerConnectionRequired , 5000 ); - Framework.EventBus.Publish( new PreferencesEvent( this , typeof( INetwork ) ) ); + Framework.Notification.Display(Properties.Resources.ServerConnectionRequired, 5000); + Framework.EventBus.Publish(new PreferencesEvent(this, typeof(INetwork))); return; } this.CallBackDelegate += ModuleHandler.CreateModule; var popup = Framework.Dialog; - var cou = new AddModule( this , popup ); - popup.SetChild( cou ); + var cou = new AddModule(this, popup); + popup.SetChild(cou); popup.ShowBlocking(); this.CallBackDelegate -= ModuleHandler.CreateModule; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void RefreshMenuItemClick( object sender , RoutedEventArgs e ) + private void RefreshMenuItemClick(object sender, RoutedEventArgs e) { try { - if( Framework.Database.IsConnected() == false ) + if (Framework.Database.IsConnected() == false) { - Framework.Notification.Display( Properties.Resources.DatabaseConnectionRequired , 5000 ); - Framework.EventBus.Publish( new PreferencesEvent( this , typeof( IDatabase ) ) ); + Framework.Notification.Display(Properties.Resources.DatabaseConnectionRequired, 5000); + Framework.EventBus.Publish(new PreferencesEvent(this, typeof(IDatabase))); return; } - if( ModuleHandler.GetClient() == null ) + if (ModuleHandler.GetClient() == null) { - Framework.Notification.Display( Properties.Resources.ServerConnectionRequired , 5000 ); - Framework.EventBus.Publish( new PreferencesEvent( this , typeof( INetwork ) ) ); + Framework.Notification.Display(Properties.Resources.ServerConnectionRequired, 5000); + Framework.EventBus.Publish(new PreferencesEvent(this, typeof(INetwork))); return; } ModuleHandler.RefreshModuleFiles(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void ToolBarLoaded( object sender , RoutedEventArgs e ) + private void ToolBarLoaded(object sender, RoutedEventArgs e) { try { var toolBar = sender as ToolBar; - if( toolBar != null ) + if (toolBar != null) { - var overflowGrid = toolBar.Template.FindName( "OverflowGrid" , toolBar ) as FrameworkElement; - if( overflowGrid != null ) + var overflowGrid = toolBar.Template.FindName("OverflowGrid", toolBar) as FrameworkElement; + if (overflowGrid != null) { overflowGrid.Visibility = Visibility.Collapsed; } } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -189,7 +189,7 @@ public void Pause() try { } - catch( Exception ) + catch (Exception) { } } @@ -202,7 +202,7 @@ public void Resume() try { } - catch( Exception ) + catch (Exception) { } } diff --git a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Plugin.cs b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Plugin.cs index 36c184e..62efd33 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Plugin.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Plugin.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Reflection; using System.Windows; @@ -55,31 +55,31 @@ public string GetName() /// Registers this components menu handlers /// /// The program main menu - public void RegisterMenuEntries( IMenu menu ) + public void RegisterMenuEntries(IMenu menu) { try { - var resource = Framework.Utils.LoadResource( Assembly.GetExecutingAssembly() , this , ".Internal.ContextMenuItems.ModuleEditor.xaml" ); + var resource = Framework.Utils.LoadResource(Assembly.GetExecutingAssembly(), this, ".Internal.ContextMenuItems.ModuleEditor.xaml"); - if( resource == null ) + if (resource == null) { return; } var moduleToolbarsItem = resource as MenuItem; - if( moduleToolbarsItem == null ) + if (moduleToolbarsItem == null) { return; } moduleToolbarsItem.Icon = this.GetIcon(); moduleToolbarsItem.Click += this.ModulesToolbarsItemClick; - menu.AddSubSubMenuItem( 2 , 2 , moduleToolbarsItem ); + menu.AddSubSubMenuItem(2, 2, moduleToolbarsItem); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -90,7 +90,7 @@ public void RegisterMenuEntries( IMenu menu ) /// An image public Image GetIcon() { - return Framework.Images.GetImage( "pencil" , "16X16" , 14 ); + return Framework.Images.GetImage("pencil", "16X16", 14); } @@ -151,12 +151,12 @@ public string GetComponentContentName() /// /// The menu item that was clicked /// The event details - private void ModulesToolbarsItemClick( object sender , RoutedEventArgs e ) + private void ModulesToolbarsItemClick(object sender, RoutedEventArgs e) { - Framework.Panels.AddSideComponent( this.GetSidebarControl() , this.GetComponentSideBarName() , this.GetIcon() ); + Framework.Panels.AddSideComponent(this.GetSidebarControl(), this.GetComponentSideBarName(), this.GetIcon()); - var eventDetails = new MenuEvent( sender , "new" ); - Framework.EventBus.Publish( eventDetails ); + var eventDetails = new MenuEvent(sender, "new"); + Framework.EventBus.Publish(eventDetails); } } } diff --git a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Preferences.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Preferences.xaml.cs index 980cedd..53b9cd5 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Preferences.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Preferences.xaml.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Windows; using System.Windows.Controls; @@ -29,11 +29,11 @@ public Preferences() { this.InitializeComponent(); var regedit = Framework.Registry; - this.ModulesFolderLocationTextBox.Text = regedit.ReadKey( "moduleslocation" ); + this.ModulesFolderLocationTextBox.Text = regedit.ReadKey("moduleslocation"); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -73,7 +73,7 @@ public void Save() /// /// /// string - public void Load( ISettings settingsParent ) + public void Load(ISettings settingsParent) { this._parent = settingsParent; } @@ -84,7 +84,7 @@ public void Load( ISettings settingsParent ) /// Type public Type GetControlType() { - return typeof( IModule ); + return typeof(IModule); } /// @@ -93,12 +93,12 @@ public Type GetControlType() /// public Image GetIcon() { - return Framework.Images.GetImage( "pencil" , "16X16" , 14 ); + return Framework.Images.GetImage("pencil", "16X16", 14); } #endregion - private void SelectFolderButtonClick( object sender , RoutedEventArgs e ) + private void SelectFolderButtonClick(object sender, RoutedEventArgs e) { try { @@ -108,15 +108,15 @@ private void SelectFolderButtonClick( object sender , RoutedEventArgs e ) }; var result = folderDialog.ShowDialog(); - if( result.ToString() == "OK" ) + if (result.ToString() == "OK") { - Framework.Registry.WriteKey( "moduleslocation" , folderDialog.SelectedPath ); + Framework.Registry.WriteKey("moduleslocation", folderDialog.SelectedPath); this.ModulesFolderLocationTextBox.Text = folderDialog.SelectedPath; } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } } diff --git a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Properties/AssemblyInfo.cs b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Properties/AssemblyInfo.cs index a010153..d9cfea7 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Properties/AssemblyInfo.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ModuleEditor/Properties/AssemblyInfo.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System.Reflection; using System.Runtime.InteropServices; using System.Windows; @@ -11,20 +11,20 @@ // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly:AssemblyTitle( "ModuleEditorComponent" )] -[assembly:AssemblyDescription( "" )] -[assembly:AssemblyConfiguration( "" )] -[assembly:AssemblyCompany( "" )] -[assembly:AssemblyProduct( "ModuleEditorComponent" )] -[assembly:AssemblyCopyright( "Copyright © 2011" )] -[assembly:AssemblyTrademark( "" )] -[assembly:AssemblyCulture( "" )] +[assembly: AssemblyTitle("ModuleEditorComponent")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ModuleEditorComponent")] +[assembly: AssemblyCopyright("Copyright © 2011")] +[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 @@ -36,12 +36,12 @@ //[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,7 +56,7 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly:AssemblyVersion( "1.0.3961.1438" )] -[assembly:AssemblyFileVersion( "1.0.3961.1438" )] +[assembly: AssemblyVersion("1.0.3961.1438")] +[assembly: AssemblyFileVersion("1.0.3961.1438")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("LGP.Test")] // jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/CustomControls/TreeViewOuElement.cs b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/CustomControls/TreeViewOuElement.cs index 75c1b01..d3ca41a 100644 --- a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/CustomControls/TreeViewOuElement.cs +++ b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/CustomControls/TreeViewOuElement.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Collections.Generic; using System.Reflection; @@ -16,11 +16,11 @@ namespace LGP.Modules.OrganizationUnitExplorer.Internal.CustomControls { - internal class TreeViewOuElement : TreeViewItem , IOuObserver + internal class TreeViewOuElement : TreeViewItem, IOuObserver { private static TreeViewOuElement RootNode; private static TreeView _parent; - private static readonly List< TreeViewOuElement > Nodes; + private static readonly List Nodes; private readonly bool _isRootNode; private readonly TreeView _parentTree; private Image _image; @@ -32,11 +32,11 @@ internal class TreeViewOuElement : TreeViewItem , IOuObserver static TreeViewOuElement() { - Nodes = new List< TreeViewOuElement >(); + Nodes = new List(); } - public TreeViewOuElement( TreeView tree ) + public TreeViewOuElement(TreeView tree) { try { @@ -45,35 +45,36 @@ public TreeViewOuElement( TreeView tree ) this._parentTree = tree; this.AllowDrop = true; - this._spacer = new TextBlock( new Run( " " ) ); - this._image = Framework.Images.GetImage( "workgroup" , "distros/32" ); + this._spacer = new TextBlock(new Run(" ")); + this._image = Framework.Images.GetImage("workgroup", "distros/32"); this._image.Width = 14; - this._text = new Run( Properties.Resources.Domain ); + this._text = new Run(Properties.Resources.Domain); - this._textBlock = new TextBlock( this._text ); + this._textBlock = new TextBlock(this._text); this._panel = new StackPanel { - Orientation = Orientation.Horizontal , Margin = new Thickness( 2 ) + Orientation = Orientation.Horizontal, + Margin = new Thickness(2) }; - this._panel.Children.Add( this._image ); - this._panel.Children.Add( this._spacer ); - this._panel.Children.Add( this._textBlock ); + this._panel.Children.Add(this._image); + this._panel.Children.Add(this._spacer); + this._panel.Children.Add(this._textBlock); this.Header = this._panel; RootNode = this; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - public TreeViewOuElement( IOu ou , TreeView tree ) + public TreeViewOuElement(IOu ou, TreeView tree) { try { @@ -85,19 +86,19 @@ public TreeViewOuElement( IOu ou , TreeView tree ) this._ou = ou; this.Prepare(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - public TreeViewOuElement( IOu ou , TreeView tree , bool enableActions ) + public TreeViewOuElement(IOu ou, TreeView tree, bool enableActions) { try { - Nodes.Add( this ); - ou.Attach( this ); + Nodes.Add(this); + ou.Attach(this); _parent = tree; @@ -109,34 +110,34 @@ public TreeViewOuElement( IOu ou , TreeView tree , bool enableActions ) this._ou = ou; this.Prepare(); - var resource = Framework.Utils.LoadResource( Assembly.GetExecutingAssembly() , "LGP.Modules.OrganizationUnitExplorer.Internal.ContextMenuItems.OuContextMenu.xaml" ); + var resource = Framework.Utils.LoadResource(Assembly.GetExecutingAssembly(), "LGP.Modules.OrganizationUnitExplorer.Internal.ContextMenuItems.OuContextMenu.xaml"); var menu = resource as ContextMenu; - if( menu != null ) + if (menu != null) { - var item = ( MenuItem ) menu.Items[ 0 ]; + var item = (MenuItem)menu.Items[0]; item.Click += this.AddOuMenuItemClick; - item.Icon = Framework.Images.GetImage( "workgroup" , "distros/32" , 12 ); + item.Icon = Framework.Images.GetImage("workgroup", "distros/32", 12); - item = ( MenuItem ) menu.Items[ 1 ]; + item = (MenuItem)menu.Items[1]; item.Click += this.RenameOuMenuItemClick; - item.Icon = Framework.Images.GetImage( "RenameFolderHS" , "VS2010ImageLibrary" , 12 ); + item.Icon = Framework.Images.GetImage("RenameFolderHS", "VS2010ImageLibrary", 12); - item = ( MenuItem ) menu.Items[ 2 ]; + item = (MenuItem)menu.Items[2]; item.Click += this.MoveOuMenuItemClick; - item.Icon = Framework.Images.GetImage( "Move" , "VS2010ImageLibrary" , 12 ); + item.Icon = Framework.Images.GetImage("Move", "VS2010ImageLibrary", 12); - item = ( MenuItem ) menu.Items[ 3 ]; + item = (MenuItem)menu.Items[3]; item.Click += this.DeleteOuMenuItemClick; - item.Icon = Framework.Images.GetImage( "DeleteHS" , "VS2010ImageLibrary" , 12 ); + item.Icon = Framework.Images.GetImage("DeleteHS", "VS2010ImageLibrary", 12); this.ContextMenu = menu; this.ContextMenuOpening += this.MenuContextMenuOpening; } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -147,11 +148,11 @@ public TreeViewOuElement( IOu ou , TreeView tree , bool enableActions ) /// /// Iou /// source observer - public void Update( IOu ou , IOuObserver source ) + public void Update(IOu ou, IOuObserver source) { try { - if( this == source || this._isRootNode ) + if (this == source || this._isRootNode) { return; } @@ -164,9 +165,9 @@ public void Update( IOu ou , IOuObserver source ) // moved this.Move(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -175,9 +176,9 @@ public void Update( IOu ou , IOuObserver source ) /// Attach objewcts that observer this IOu /// /// IOuObserver - public void Attach( IOuObserver obj ) + public void Attach(IOuObserver obj) { - if( this._isRootNode ) + if (this._isRootNode) { return; } @@ -188,9 +189,9 @@ public void Attach( IOuObserver obj ) /// Detach objewcts that observer this IOu /// /// IOuObserver - public void Detach( IOuObserver obj ) + public void Detach(IOuObserver obj) { - if( this._isRootNode ) + if (this._isRootNode) { return; } @@ -202,7 +203,7 @@ public void Detach( IOuObserver obj ) /// public void Notify() { - if( this._isRootNode ) + if (this._isRootNode) { return; } @@ -213,59 +214,59 @@ public void Notify() /// Dispose this object and all the observers /// /// IOuObserver - public void Dispose( IOuObserver ou ) + public void Dispose(IOuObserver ou) { - if( this._isRootNode ) + if (this._isRootNode) { return; } try { - Nodes.Remove( this ); - ou.Detach( this ); - var parent = ( TreeViewOuElement ) this.Parent; - parent.Items.Remove( this ); + Nodes.Remove(this); + ou.Detach(this); + var parent = (TreeViewOuElement)this.Parent; + parent.Items.Remove(this); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } #endregion - private void MenuContextMenuOpening( object sender , ContextMenuEventArgs e ) + private void MenuContextMenuOpening(object sender, ContextMenuEventArgs e) { - if( this != this._parentTree.SelectedItem ) + if (this != this._parentTree.SelectedItem) { return; } var menu = this.ContextMenu; - Framework.ContextMenus.AttachMenuItemRegistrations( ref menu , typeof( IOu ) , this.MenuItemClick ); + Framework.ContextMenus.AttachMenuItemRegistrations(ref menu, typeof(IOu), this.MenuItemClick); } private void Move() { - if( this._isRootNode ) + if (this._isRootNode) { return; } try { - var parent = ( TreeViewOuElement ) this.Parent; + var parent = (TreeViewOuElement)this.Parent; var parentOu = parent.GetOu(); - if( parentOu == null ) + if (parentOu == null) { - if( this._ou.GetOuId() != this._ou.GetParentOuId() ) + if (this._ou.GetOuId() != this._ou.GetParentOuId()) { - foreach( var ele in Nodes ) + foreach (var ele in Nodes) { - if( ele.GetOu().GetOuId() == this._ou.GetParentOuId() ) + if (ele.GetOu().GetOuId() == this._ou.GetParentOuId()) { - parent.Items.Remove( this ); - ele.Items.Add( this ); + parent.Items.Remove(this); + ele.Items.Add(this); } } } @@ -273,66 +274,67 @@ private void Move() return; } - if( this._ou.GetParentOuId() != parent.GetOu().GetOuId() ) + if (this._ou.GetParentOuId() != parent.GetOu().GetOuId()) { - if( this._ou.GetParentOuId() == this._ou.GetOuId() ) + if (this._ou.GetParentOuId() == this._ou.GetOuId()) { - parent.Items.Remove( this ); - ( ( TreeViewOuElement ) this._parentTree.Items[ 0 ] ).Items.Add( this ); + parent.Items.Remove(this); + ((TreeViewOuElement)this._parentTree.Items[0]).Items.Add(this); return; } - foreach( var ele in Nodes ) + foreach (var ele in Nodes) { - if( ele.GetOu().GetOuId() == this._ou.GetParentOuId() ) + if (ele.GetOu().GetOuId() == this._ou.GetParentOuId()) { - parent.Items.Remove( this ); - ele.Items.Add( this ); + parent.Items.Remove(this); + ele.Items.Add(this); } } } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } private void Prepare() { - if( this._isRootNode ) + if (this._isRootNode) { return; } try { - this._spacer = new TextBlock( new Run( " " ) ); - this._image = this._ou.GetOuImage( 16 ); + this._spacer = new TextBlock(new Run(" ")); + this._image = this._ou.GetOuImage(16); this._image.Width = 14; - this._text = new Run( this._ou.GetName() ); - this._textBlock = new TextBlock( this._text ); + this._text = new Run(this._ou.GetName()); + this._textBlock = new TextBlock(this._text); this._panel = new StackPanel { - Orientation = Orientation.Horizontal , Margin = new Thickness( 2 ) + Orientation = Orientation.Horizontal, + Margin = new Thickness(2) }; - this._panel.Children.Add( this._image ); - this._panel.Children.Add( this._spacer ); - this._panel.Children.Add( this._textBlock ); + this._panel.Children.Add(this._image); + this._panel.Children.Add(this._spacer); + this._panel.Children.Add(this._textBlock); this.Header = this._panel; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } public IOu GetOu() { - if( this._isRootNode ) + if (this._isRootNode) { return null; } @@ -342,7 +344,7 @@ public IOu GetOu() public void Redraw() { - if( this._isRootNode ) + if (this._isRootNode) { return; } @@ -354,11 +356,11 @@ public void Redraw() /// Invoked when an unhandled  routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event. /// /// The that contains the event data. The event data reports that the right mouse button was pressed. - protected override void OnMouseRightButtonDown( MouseButtonEventArgs e ) + protected override void OnMouseRightButtonDown(MouseButtonEventArgs e) { - base.OnMouseRightButtonDown( e ); + base.OnMouseRightButtonDown(e); - if( this != this._parentTree.SelectedItem ) + if (this != this._parentTree.SelectedItem) { return; } @@ -371,11 +373,11 @@ protected override void OnMouseRightButtonDown( MouseButtonEventArgs e ) /// Invoked when an unhandled  routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event. /// /// The that contains the event data. The event data reports that the right mouse button was pressed. - protected override void OnPreviewMouseRightButtonDown( MouseButtonEventArgs e ) + protected override void OnPreviewMouseRightButtonDown(MouseButtonEventArgs e) { - base.OnPreviewMouseRightButtonDown( e ); + base.OnPreviewMouseRightButtonDown(e); - if( this._text == e.OriginalSource || this._image == e.OriginalSource ) + if (this._text == e.OriginalSource || this._image == e.OriginalSource) { this.IsSelected = true; } @@ -386,150 +388,150 @@ protected override void OnPreviewMouseRightButtonDown( MouseButtonEventArgs e ) /// Raises the routed event. /// /// The event data. - protected override void OnMouseDoubleClick( MouseButtonEventArgs e ) + protected override void OnMouseDoubleClick(MouseButtonEventArgs e) { - base.OnMouseDoubleClick( e ); + base.OnMouseDoubleClick(e); try { - if( this._isRootNode ) + if (this._isRootNode) { return; } - if( this != this._parentTree.SelectedItem ) + if (this != this._parentTree.SelectedItem) { return; } try { - var ouViewer = new OuViewer( this._ou ); - Framework.Panels.AddMainComponent( ouViewer , ouViewer.Name ); + var ouViewer = new OuViewer(this._ou); + Framework.Panels.AddMainComponent(ouViewer, ouViewer.Name); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void AddOuMenuItemClick( object sender , RoutedEventArgs e ) + private void AddOuMenuItemClick(object sender, RoutedEventArgs e) { - if( this != this._parentTree.SelectedItem ) + if (this != this._parentTree.SelectedItem) { return; } try { var popup = Framework.Dialog; - var cou = new CreateOu( OuTreeView.GetInstance() , this._ou , popup ); - popup.SetChild( cou ); + var cou = new CreateOu(OuTreeView.GetInstance(), this._ou, popup); + popup.SetChild(cou); popup.ShowBlocking(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void DeleteOuMenuItemClick( object sender , RoutedEventArgs e ) + private void DeleteOuMenuItemClick(object sender, RoutedEventArgs e) { - if( this != this._parentTree.SelectedItem ) + if (this != this._parentTree.SelectedItem) { return; } try { var popup = Framework.Dialog; - var cou = new DeleteOu( OuTreeView.GetInstance() , this._ou , popup , false ); - popup.SetChild( cou ); + var cou = new DeleteOu(OuTreeView.GetInstance(), this._ou, popup, false); + popup.SetChild(cou); popup.ShowBlocking(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void RenameOuMenuItemClick( object sender , RoutedEventArgs e ) + private void RenameOuMenuItemClick(object sender, RoutedEventArgs e) { - if( this != this._parentTree.SelectedItem ) + if (this != this._parentTree.SelectedItem) { return; } try { var popup = Framework.Dialog; - var cou = new RenameOu( OuTreeView.GetInstance() , this._ou , popup ); - popup.SetChild( cou ); + var cou = new RenameOu(OuTreeView.GetInstance(), this._ou, popup); + popup.SetChild(cou); popup.ShowBlocking(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void MoveOuMenuItemClick( object sender , RoutedEventArgs e ) + private void MoveOuMenuItemClick(object sender, RoutedEventArgs e) { - if( this != this._parentTree.SelectedItem ) + if (this != this._parentTree.SelectedItem) { return; } try { var popup = Framework.Dialog; - var cou = new MoveOu( OuTreeView.GetInstance() , this._ou , popup ); - popup.SetChild( cou ); + var cou = new MoveOu(OuTreeView.GetInstance(), this._ou, popup); + popup.SetChild(cou); popup.ShowBlocking(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void MenuItemClick( object sender , RoutedEventArgs e ) + private void MenuItemClick(object sender, RoutedEventArgs e) { try { var menuitem = sender as MenuItem; - Framework.ContextMenus.CallBack( menuitem , this.GetOu() ); + Framework.ContextMenus.CallBack(menuitem, this.GetOu()); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - public static void CreateEntry( IOu ou ) + public static void CreateEntry(IOu ou) { try { - var newEle = new TreeViewOuElement( ou , ( ( OuTreeView ) OuTreeView.GetInstance() ).treeView1 , true ); + var newEle = new TreeViewOuElement(ou, ((OuTreeView)OuTreeView.GetInstance()).treeView1, true); - foreach( var ele in Nodes ) + foreach (var ele in Nodes) { - if( ele.GetOu().GetOuId() == newEle._ou.GetParentOuId() ) + if (ele.GetOu().GetOuId() == newEle._ou.GetParentOuId()) { - ele.Items.Add( newEle ); + ele.Items.Add(newEle); } } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -538,44 +540,44 @@ public static void CreateEntry( IOu ou ) /// Invoked when an unhandled  routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event. /// /// The that contains the event data. The event data reports that the left mouse button was pressed. - protected override void OnMouseLeftButtonDown( MouseButtonEventArgs e ) + protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) { - base.OnMouseLeftButtonDown( e ); + base.OnMouseLeftButtonDown(e); try { - if( this != this._parentTree.SelectedItem ) + if (this != this._parentTree.SelectedItem) { return; } - if( e.LeftButton == MouseButtonState.Pressed ) + if (e.LeftButton == MouseButtonState.Pressed) { - Framework.DragDrop.StartDrag( this , e ); + Framework.DragDrop.StartDrag(this, e); } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private bool CheckDropItemTargetIsNotLogicalChild( IOu dropitem , TreeViewOuElement targetitem ) + private bool CheckDropItemTargetIsNotLogicalChild(IOu dropitem, TreeViewOuElement targetitem) { var parentElement = targetitem.Parent as TreeViewOuElement; - if( parentElement == null ) + if (parentElement == null) { return false; } - if( parentElement.GetOu() == null ) + if (parentElement.GetOu() == null) { return false; } - return dropitem.GetOuId() == parentElement.GetOu().GetOuId() || this.CheckDropItemTargetIsNotLogicalChild( dropitem , parentElement ); + return dropitem.GetOuId() == parentElement.GetOu().GetOuId() || this.CheckDropItemTargetIsNotLogicalChild(dropitem, parentElement); } @@ -583,62 +585,62 @@ private bool CheckDropItemTargetIsNotLogicalChild( IOu dropitem , TreeViewOuElem /// Invoked when an unhandled  attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event. /// /// The that contains the event data. - protected override void OnDrop( DragEventArgs e ) + protected override void OnDrop(DragEventArgs e) { - base.OnDrop( e ); + base.OnDrop(e); try { - if( e.Source == this._text || e.Source == this._image ) + if (e.Source == this._text || e.Source == this._image) { - var ele1 = ( TreeViewOuElement ) e.Data.GetData( typeof( TreeViewOuElement ) ); - if( ele1 != null ) + var ele1 = (TreeViewOuElement)e.Data.GetData(typeof(TreeViewOuElement)); + if (ele1 != null) { - if( this._isRootNode ) + if (this._isRootNode) { - ele1.GetOu().SetParentOuId( ele1.GetOu().GetOuId() ); + ele1.GetOu().SetParentOuId(ele1.GetOu().GetOuId()); return; } - if( this._ou.GetOuId() == ele1.GetOu().GetOuId() || this.CheckDropItemTargetIsNotLogicalChild( ele1.GetOu() , this ) ) + if (this._ou.GetOuId() == ele1.GetOu().GetOuId() || this.CheckDropItemTargetIsNotLogicalChild(ele1.GetOu(), this)) { return; } - ele1.GetOu().SetParentOuId( this._ou.GetOuId() ); + ele1.GetOu().SetParentOuId(this._ou.GetOuId()); this._ou.Notify(); } - var ele2 = ( WrapPanelOuElement ) e.Data.GetData( typeof( WrapPanelOuElement ) ); - if( ele2 != null ) + var ele2 = (WrapPanelOuElement)e.Data.GetData(typeof(WrapPanelOuElement)); + if (ele2 != null) { - if( this._isRootNode ) + if (this._isRootNode) { - ele2.GetOu().SetParentOuId( ele2.GetOu().GetOuId() ); + ele2.GetOu().SetParentOuId(ele2.GetOu().GetOuId()); return; } - if( this._ou.GetOuId() == ele2.GetOu().GetOuId() || this.CheckDropItemTargetIsNotLogicalChild( ele2.GetOu() , this ) ) + if (this._ou.GetOuId() == ele2.GetOu().GetOuId() || this.CheckDropItemTargetIsNotLogicalChild(ele2.GetOu(), this)) { return; } - ele2.GetOu().SetParentOuId( this._ou.GetOuId() ); + ele2.GetOu().SetParentOuId(this._ou.GetOuId()); this._ou.Notify(); ele2.Update(); } - var ele3 = ( WrapPanelClientElement ) e.Data.GetData( typeof( WrapPanelClientElement ) ); - if( ele3 != null ) + var ele3 = (WrapPanelClientElement)e.Data.GetData(typeof(WrapPanelClientElement)); + if (ele3 != null) { - ele3.GetClient().Setouid( this._ou.GetOuId() ); + ele3.GetClient().Setouid(this._ou.GetOuId()); this._ou.Notify(); ele3.Update(); } } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -647,9 +649,9 @@ protected override void OnDrop( DragEventArgs e ) /// Invoked when an unhandled  attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event. /// /// The that contains the event data. - protected override void OnGiveFeedback( GiveFeedbackEventArgs e ) + protected override void OnGiveFeedback(GiveFeedbackEventArgs e) { - base.OnGiveFeedback( e ); + base.OnGiveFeedback(e); e.UseDefaultCursors = false; e.Handled = true; } @@ -659,11 +661,11 @@ protected override void OnGiveFeedback( GiveFeedbackEventArgs e ) /// Invoked when an unhandled  attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event. /// /// The that contains the event data. - protected override void OnDragEnter( DragEventArgs e ) + protected override void OnDragEnter(DragEventArgs e) { - base.OnDragEnter( e ); + base.OnDragEnter(e); - if( e.Source == this._text || e.Source == this._image || e.Source != this ) + if (e.Source == this._text || e.Source == this._image || e.Source != this) { return; } @@ -675,9 +677,9 @@ public static void Dispose() { var i = Nodes.Count - 1; - while( i > -1 ) + while (i > -1) { - Nodes[ i ].Dispose( Nodes[ i ].GetOu() ); + Nodes[i].Dispose(Nodes[i].GetOu()); i = Nodes.Count - 1; } } @@ -685,15 +687,15 @@ public static void Dispose() public void RefreshNode() { - if( !this._isRootNode ) + if (!this._isRootNode) { return; } - this._panel.Children.Remove( this._textBlock ); - this._text = new Run( Properties.Resources.Domain ); - this._textBlock = new TextBlock( this._text ); - this._panel.Children.Add( this._textBlock ); + this._panel.Children.Remove(this._textBlock); + this._text = new Run(Properties.Resources.Domain); + this._textBlock = new TextBlock(this._text); + this._panel.Children.Add(this._textBlock); } diff --git a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/CustomControls/WrapPanelClientElement.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/CustomControls/WrapPanelClientElement.xaml.cs index 554ce46..596ea0d 100644 --- a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/CustomControls/WrapPanelClientElement.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/CustomControls/WrapPanelClientElement.xaml.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Reflection; using System.Windows; @@ -40,20 +40,20 @@ public WrapPanelClientElement() /// /// /// - public WrapPanelClientElement( IClient client , int size , OuViewer parent ) + public WrapPanelClientElement(IClient client, int size, OuViewer parent) { try { this.InitializeComponent(); - client.Attach( this ); + client.Attach(this); this._client = client; this._size = size; this._parent = parent; this.Prepare(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -63,24 +63,24 @@ private void Prepare() { var fakeSize = 0; - if( this._size < 40 ) + if (this._size < 40) { fakeSize = 32; } - else if( this._size < 56 && this._size > 40 ) + else if (this._size < 56 && this._size > 40) { fakeSize = 48; } - else if( this._size < 90 && this._size >= 56 ) + else if (this._size < 90 && this._size >= 56) { fakeSize = 64; } - else if( this._size >= 90 ) + else if (this._size >= 90) { fakeSize = 128; } - this.ItemImage.Source = this._client.GetDistroImage( fakeSize ).Source; + this.ItemImage.Source = this._client.GetDistroImage(fakeSize).Source; this.ItemImage.Width = this._size; this.ItemImage.Height = this._size; this.Width = this._size + 58; @@ -88,31 +88,31 @@ private void Prepare() this.ItemLabel.Content = this._client.GetName(); this.ItemImage.MouseDown += this.EntityMouseDown; - var resource = Framework.Utils.LoadResource( Assembly.GetExecutingAssembly() , "LGP.Modules.OrganizationUnitExplorer.Internal.ContextMenuItems.ClientContextMenu.xaml" ); + var resource = Framework.Utils.LoadResource(Assembly.GetExecutingAssembly(), "LGP.Modules.OrganizationUnitExplorer.Internal.ContextMenuItems.ClientContextMenu.xaml"); var menu = resource as ContextMenu; - if( menu != null ) + if (menu != null) { - var item = ( MenuItem ) menu.Items[ 0 ]; + var item = (MenuItem)menu.Items[0]; item.Click += this.MoveClientMenuItemClick; - item.Icon = Framework.Images.GetImage( "Move" , "VS2010ImageLibrary" , 12 ); + item.Icon = Framework.Images.GetImage("Move", "VS2010ImageLibrary", 12); - item = ( MenuItem ) menu.Items[ 1 ]; + item = (MenuItem)menu.Items[1]; item.Click += this.DeleteClientMenuItemClick; - item.Icon = Framework.Images.GetImage( "DeleteHS" , "VS2010ImageLibrary" , 12 ); + item.Icon = Framework.Images.GetImage("DeleteHS", "VS2010ImageLibrary", 12); this.ItemImage.ContextMenu = menu; this.ItemImage.ContextMenuOpening += this.MenuContextMenuOpening; } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void MenuContextMenuOpening( object sender , ContextMenuEventArgs e ) + private void MenuContextMenuOpening(object sender, ContextMenuEventArgs e) { } @@ -140,7 +140,7 @@ public bool IsSelected() /// public void Select() { - if( _selectedElement != null && _selectedElement != this ) + if (_selectedElement != null && _selectedElement != this) { _selectedElement.DeSelect(); } @@ -150,9 +150,9 @@ public void Select() _selectedElement = this; this._selected = true; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -167,9 +167,9 @@ public void DeSelect() _selectedElement = null; this._selected = false; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -177,62 +177,62 @@ public void DeSelect() /// /// /// - public void Resize( int resize ) + public void Resize(int resize) { try { var fakeSize = 0; - if( resize < 40 ) + if (resize < 40) { fakeSize = 32; } - else if( resize < 56 && resize > 40 ) + else if (resize < 56 && resize > 40) { fakeSize = 48; } - else if( resize < 90 && resize >= 56 ) + else if (resize < 90 && resize >= 56) { fakeSize = 64; } - else if( resize >= 90 ) + else if (resize >= 90) { fakeSize = 128; } this.ItemImage.Width = resize; this.ItemImage.Height = resize; - this.ItemImage.Source = this._client.GetDistroImage( fakeSize ).Source; + this.ItemImage.Source = this._client.GetDistroImage(fakeSize).Source; this.Width = resize + 58; this.Height = resize + 48; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void EntityMouseDown( object sender , MouseButtonEventArgs e ) + private void EntityMouseDown(object sender, MouseButtonEventArgs e) { try { this.Select(); - this._parent.SetDetailsPane( new ClientPane( this._client ) ); + this._parent.SetDetailsPane(new ClientPane(this._client)); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void MoveClientMenuItemClick( object sender , RoutedEventArgs e ) + private void MoveClientMenuItemClick(object sender, RoutedEventArgs e) { this._parent.Update(); } - private void DeleteClientMenuItemClick( object sender , RoutedEventArgs e ) + private void DeleteClientMenuItemClick(object sender, RoutedEventArgs e) { this._parent.Update(); } @@ -249,21 +249,21 @@ public void Update() /// Invoked when an unhandled  attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event. /// /// The that contains the event data. - protected override void OnPreviewMouseMove( MouseEventArgs e ) + protected override void OnPreviewMouseMove(MouseEventArgs e) { - base.OnPreviewMouseMove( e ); + base.OnPreviewMouseMove(e); - if( this != _selectedElement ) + if (this != _selectedElement) { return; } try { - Framework.DragDrop.StartDrag( this , e ); + Framework.DragDrop.StartDrag(this, e); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -274,9 +274,9 @@ protected override void OnPreviewMouseMove( MouseEventArgs e ) /// /// IClient /// source observer - public void Update( IClient client , IClientObserver source ) + public void Update(IClient client, IClientObserver source) { - if( this == source ) + if (this == source) { return; } @@ -287,9 +287,9 @@ public void Update( IClient client , IClientObserver source ) this.ItemLabel.Content = this._client.GetName(); this._parent.Update(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -297,14 +297,14 @@ public void Update( IClient client , IClientObserver source ) /// Attach objewcts that observer this client /// /// IOuObserver - public void Attach( IClientObserver obj ) + public void Attach(IClientObserver obj) { try { } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -312,14 +312,14 @@ public void Attach( IClientObserver obj ) /// Detach objewcts that observer this client /// /// IOuObserver - public void Detach( IClientObserver obj ) + public void Detach(IClientObserver obj) { try { } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -331,9 +331,9 @@ public void Notify() try { } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -341,17 +341,17 @@ public void Notify() /// Dispose this object and all the observers /// /// IOuObserver - public void Dispose( IClientObserver obj ) + public void Dispose(IClientObserver obj) { try { - obj.Detach( this ); - var parent = ( WrapPanel ) this.Parent; - parent.Children.Remove( this ); + obj.Detach(this); + var parent = (WrapPanel)this.Parent; + parent.Children.Remove(this); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } diff --git a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/CustomControls/WrapPanelOuElement.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/CustomControls/WrapPanelOuElement.xaml.cs index 2f0fe63..e9b4534 100644 --- a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/CustomControls/WrapPanelOuElement.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/CustomControls/WrapPanelOuElement.xaml.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Reflection; using System.Windows; @@ -35,9 +35,9 @@ public WrapPanelOuElement() { this.InitializeComponent(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -46,21 +46,21 @@ public WrapPanelOuElement() /// /// /// - public WrapPanelOuElement( IOu ou , int size , OuViewer parent ) + public WrapPanelOuElement(IOu ou, int size, OuViewer parent) { try { this.InitializeComponent(); - ou.Attach( this ); + ou.Attach(this); this._ou = ou; this._parent = parent; this._size = size; this.AllowDrop = true; this.Prepare(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -71,9 +71,9 @@ public WrapPanelOuElement( IOu ou , int size , OuViewer parent ) /// /// Iou /// source observer - public void Update( IOu ou , IOuObserver source ) + public void Update(IOu ou, IOuObserver source) { - if( this == source ) + if (this == source) { return; } @@ -82,9 +82,9 @@ public void Update( IOu ou , IOuObserver source ) this._ou = ou; this.ItemLabel.Content = this._ou.GetName(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -93,14 +93,14 @@ 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 { } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -109,14 +109,14 @@ public void Attach( IOuObserver obj ) /// Detach objewcts that observer this IOu /// /// IOuObserver - public void Detach( IOuObserver obj ) + public void Detach(IOuObserver obj) { try { } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -129,9 +129,9 @@ public void Notify() try { } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -140,17 +140,17 @@ public void Notify() /// Dispose this object and all the observers /// /// IOuObserver - public void Dispose( IOuObserver obj ) + public void Dispose(IOuObserver obj) { try { - obj.Detach( this ); - var parent = ( WrapPanel ) this.Parent; - parent.Children.Remove( this ); + obj.Detach(this); + var parent = (WrapPanel)this.Parent; + parent.Children.Remove(this); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -162,82 +162,82 @@ private void Prepare() { var fakeSize = 0; - if( this._size < 40 ) + if (this._size < 40) { fakeSize = 32; } - else if( this._size < 56 && this._size > 40 ) + else if (this._size < 56 && this._size > 40) { fakeSize = 48; } - else if( this._size < 90 && this._size >= 56 ) + else if (this._size < 90 && this._size >= 56) { fakeSize = 64; } - else if( this._size >= 90 ) + else if (this._size >= 90) { fakeSize = 128; } - this.ItemImage.Source = this._ou.GetOuImage( fakeSize ).Source; + this.ItemImage.Source = this._ou.GetOuImage(fakeSize).Source; this.ItemImage.Width = this._size; this.ItemImage.Height = this._size; this.Width = this._size + 58; this.Height = this._size + 48; - this.ItemImage.Source = this._ou.GetOuImage( fakeSize ).Source; + this.ItemImage.Source = this._ou.GetOuImage(fakeSize).Source; this.ItemLabel.Content = this._ou.GetName(); this.ItemLabel.AllowDrop = true; this.ItemImage.MouseDown += this.EntityMouseDown; this.ItemImage.AllowDrop = true; - var resource = Framework.Utils.LoadResource( Assembly.GetExecutingAssembly() , "LGP.Modules.OrganizationUnitExplorer.Internal.ContextMenuItems.OuContextMenu.xaml" ); + var resource = Framework.Utils.LoadResource(Assembly.GetExecutingAssembly(), "LGP.Modules.OrganizationUnitExplorer.Internal.ContextMenuItems.OuContextMenu.xaml"); var menu = resource as ContextMenu; - if( menu != null ) + if (menu != null) { - var item = ( MenuItem ) menu.Items[ 0 ]; + var item = (MenuItem)menu.Items[0]; item.Click += this.AddOuMenuItemClick; - item.Icon = Framework.Images.GetImage( "workgroup" , "distros/32" , 12 ); + item.Icon = Framework.Images.GetImage("workgroup", "distros/32", 12); - item = ( MenuItem ) menu.Items[ 1 ]; + item = (MenuItem)menu.Items[1]; item.Click += this.RenameOuMenuItemClick; - item.Icon = Framework.Images.GetImage( "RenameFolderHS" , "VS2010ImageLibrary" , 12 ); + item.Icon = Framework.Images.GetImage("RenameFolderHS", "VS2010ImageLibrary", 12); - item = ( MenuItem ) menu.Items[ 2 ]; + item = (MenuItem)menu.Items[2]; item.Click += this.MoveOuMenuItemClick; - item.Icon = Framework.Images.GetImage( "Move" , "VS2010ImageLibrary" , 12 ); + item.Icon = Framework.Images.GetImage("Move", "VS2010ImageLibrary", 12); - item = ( MenuItem ) menu.Items[ 3 ]; + item = (MenuItem)menu.Items[3]; item.Click += this.DeleteOuMenuItemClick; - item.Icon = Framework.Images.GetImage( "DeleteHS" , "VS2010ImageLibrary" , 12 ); + item.Icon = Framework.Images.GetImage("DeleteHS", "VS2010ImageLibrary", 12); this.ItemImage.ContextMenu = menu; this.ItemImage.ContextMenuOpening += this.MenuContextMenuOpening; } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void MenuContextMenuOpening( object sender , ContextMenuEventArgs e ) + private void MenuContextMenuOpening(object sender, ContextMenuEventArgs e) { var menu = this.ItemImage.ContextMenu; - Framework.ContextMenus.AttachMenuItemRegistrations( ref menu , typeof( IOu ) , this.MenuItemClick ); + Framework.ContextMenus.AttachMenuItemRegistrations(ref menu, typeof(IOu), this.MenuItemClick); } - private void MenuItemClick( object sender , RoutedEventArgs e ) + private void MenuItemClick(object sender, RoutedEventArgs e) { try { var menuitem = sender as MenuItem; - Framework.ContextMenus.CallBack( menuitem , this.GetOu() ); + Framework.ContextMenus.CallBack(menuitem, this.GetOu()); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -265,7 +265,7 @@ public bool IsSelected() /// public void Select() { - if( _selectedElement != null && _selectedElement != this ) + if (_selectedElement != null && _selectedElement != this) { _selectedElement.DeSelect(); } @@ -275,9 +275,9 @@ public void Select() _selectedElement = this; this._selected = true; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -292,9 +292,9 @@ public void DeSelect() _selectedElement = null; this._selected = false; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -302,126 +302,126 @@ public void DeSelect() /// /// /// - public void Resize( int resize ) + public void Resize(int resize) { try { var fakeSize = 0; - if( resize < 40 ) + if (resize < 40) { fakeSize = 32; } - else if( resize < 56 && resize > 40 ) + else if (resize < 56 && resize > 40) { fakeSize = 48; } - else if( resize < 90 && resize >= 56 ) + else if (resize < 90 && resize >= 56) { fakeSize = 64; } - else if( resize >= 90 ) + else if (resize >= 90) { fakeSize = 128; } this.ItemImage.Width = resize; this.ItemImage.Height = resize; - this.ItemImage.Source = this._ou.GetOuImage( fakeSize ).Source; + this.ItemImage.Source = this._ou.GetOuImage(fakeSize).Source; this.Width = resize + 58; this.Height = resize + 48; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void EntityMouseDown( object sender , MouseButtonEventArgs e ) + private void EntityMouseDown(object sender, MouseButtonEventArgs e) { try { this.Select(); - this._parent.SetDetailsPane( new OuPane( this._ou ) ); + this._parent.SetDetailsPane(new OuPane(this._ou)); - if( e.ClickCount == 2 ) + if (e.ClickCount == 2) { - var ouViewer = new OuViewer( this._ou ); - Framework.Panels.AddMainComponent( ouViewer , ouViewer.Name ); + var ouViewer = new OuViewer(this._ou); + Framework.Panels.AddMainComponent(ouViewer, ouViewer.Name); } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void AddOuMenuItemClick( object sender , RoutedEventArgs e ) + private void AddOuMenuItemClick(object sender, RoutedEventArgs e) { try { var popup = Framework.Dialog; - var cou = new CreateOu( this._parent , this._ou , popup ); - popup.SetChild( cou ); + var cou = new CreateOu(this._parent, this._ou, popup); + popup.SetChild(cou); popup.ShowBlocking(); this._parent.Update(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void RenameOuMenuItemClick( object sender , RoutedEventArgs e ) + private void RenameOuMenuItemClick(object sender, RoutedEventArgs e) { try { var popup = Framework.Dialog; - var cou = new RenameOu( this._parent , this._ou , popup ); - popup.SetChild( cou ); + var cou = new RenameOu(this._parent, this._ou, popup); + popup.SetChild(cou); popup.ShowBlocking(); this._parent.Update(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void MoveOuMenuItemClick( object sender , RoutedEventArgs e ) + private void MoveOuMenuItemClick(object sender, RoutedEventArgs e) { try { var popup = Framework.Dialog; - var cou = new MoveOu( this._parent , this._ou , popup ); - popup.SetChild( cou ); + var cou = new MoveOu(this._parent, this._ou, popup); + popup.SetChild(cou); popup.ShowBlocking(); this._parent.Update(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void DeleteOuMenuItemClick( object sender , RoutedEventArgs e ) + private void DeleteOuMenuItemClick(object sender, RoutedEventArgs e) { try { var popup = Framework.Dialog; - var cou = new DeleteOu( this._parent , this._ou , popup , false ); - popup.SetChild( cou ); + var cou = new DeleteOu(this._parent, this._ou, popup, false); + popup.SetChild(cou); popup.ShowBlocking(); this._parent.Update(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -430,41 +430,41 @@ private void DeleteOuMenuItemClick( object sender , RoutedEventArgs e ) /// Invoked when an unhandled  attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event. /// /// The that contains the event data. - protected override void OnDrop( DragEventArgs e ) + protected override void OnDrop(DragEventArgs e) { - base.OnDrop( e ); + base.OnDrop(e); try { - if( e.Source == this || e.Source == this.ItemImage || e.Source == this.ItemLabel ) + if (e.Source == this || e.Source == this.ItemImage || e.Source == this.ItemLabel) { - var ele1 = ( TreeViewOuElement ) e.Data.GetData( typeof( TreeViewOuElement ) ); - if( ele1 != null ) + var ele1 = (TreeViewOuElement)e.Data.GetData(typeof(TreeViewOuElement)); + if (ele1 != null) { - ele1.GetOu().SetParentOuId( this._ou.GetOuId() ); + ele1.GetOu().SetParentOuId(this._ou.GetOuId()); this._ou.Notify(); } - var ele2 = ( WrapPanelOuElement ) e.Data.GetData( typeof( WrapPanelOuElement ) ); - if( ele2 != null ) + var ele2 = (WrapPanelOuElement)e.Data.GetData(typeof(WrapPanelOuElement)); + if (ele2 != null) { - ele2.GetOu().SetParentOuId( this._ou.GetOuId() ); + ele2.GetOu().SetParentOuId(this._ou.GetOuId()); this._ou.Notify(); } - var ele3 = ( WrapPanelClientElement ) e.Data.GetData( typeof( WrapPanelClientElement ) ); - if( ele3 != null ) + var ele3 = (WrapPanelClientElement)e.Data.GetData(typeof(WrapPanelClientElement)); + if (ele3 != null) { - ele3.GetClient().Setouid( this._ou.GetOuId() ); + ele3.GetClient().Setouid(this._ou.GetOuId()); this._ou.Notify(); } this._parent.Update(); } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -473,21 +473,21 @@ protected override void OnDrop( DragEventArgs e ) /// Invoked when an unhandled  attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event. /// /// The that contains the event data. - protected override void OnPreviewMouseMove( MouseEventArgs e ) + protected override void OnPreviewMouseMove(MouseEventArgs e) { - base.OnPreviewMouseMove( e ); + base.OnPreviewMouseMove(e); - if( this != _selectedElement ) + if (this != _selectedElement) { return; } try { - Framework.DragDrop.StartDrag( this , e ); + Framework.DragDrop.StartDrag(this, e); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } diff --git a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/Modals/Controls/CreateOu.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/Modals/Controls/CreateOu.xaml.cs index 4b913a0..8e3894f 100644 --- a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/Modals/Controls/CreateOu.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/Modals/Controls/CreateOu.xaml.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Windows; using System.Windows.Controls; @@ -31,9 +31,9 @@ public CreateOu() { this.InitializeComponent(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -44,7 +44,7 @@ public CreateOu() /// the parent control /// IOu /// parent window - public CreateOu( UserControl parent , IOu ou , IDialog window ) + public CreateOu(UserControl parent, IOu ou, IDialog window) { try { @@ -54,9 +54,9 @@ public CreateOu( UserControl parent , IOu ou , IDialog window ) this._parentControl = parent; this.Prepare(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -65,69 +65,69 @@ private void Prepare() { try { - this.image1.Source = this._ou.GetOuImage( 32 ).Source; + this.image1.Source = this._ou.GetOuImage(32).Source; this.ParentOuLabel.Content = this._ou.GetName(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void CancelButtonClick( object sender , RoutedEventArgs e ) + private void CancelButtonClick(object sender, RoutedEventArgs e) { try { this._popupWindow.CloseDialog(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void CreateButtonClick( object sender , RoutedEventArgs e ) + private void CreateButtonClick(object sender, RoutedEventArgs e) { try { - if( this.OuNameTextBox.Text.Length > 0 ) + if (this.OuNameTextBox.Text.Length > 0) { - var ou = OuHelper.OuGateway.CreateOu( this.OuNameTextBox.Text , this._ou.GetOuId() ); - TreeViewOuElement.CreateEntry( ou ); + var ou = OuHelper.OuGateway.CreateOu(this.OuNameTextBox.Text, this._ou.GetOuId()); + TreeViewOuElement.CreateEntry(ou); this._ou.Notify(); this._popupWindow.CloseDialog(); } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void UserControlLoaded( object sender , RoutedEventArgs e ) + private void UserControlLoaded(object sender, RoutedEventArgs e) { try { - this._popupWindow.ResizePopup( ( int ) this.Width , ( int ) this.Height ); + this._popupWindow.ResizePopup((int)this.Width, (int)this.Height); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void OuNameTextBoxTextChanged( object sender , TextChangedEventArgs e ) + private void OuNameTextBoxTextChanged(object sender, TextChangedEventArgs e) { try { - this.OuNameTextBox.Text = Framework.Utils.CleanString( this.OuNameTextBox.Text ); + this.OuNameTextBox.Text = Framework.Utils.CleanString(this.OuNameTextBox.Text); this.OuNameTextBox.CaretIndex = this.OuNameTextBox.Text.Length; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } } diff --git a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/Modals/Controls/RenameOu.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/Modals/Controls/RenameOu.xaml.cs index 2bd8d04..59e0482 100644 --- a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/Modals/Controls/RenameOu.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Internal/Modals/Controls/RenameOu.xaml.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Windows; using System.Windows.Controls; @@ -31,9 +31,9 @@ public RenameOu() { this.InitializeComponent(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -41,7 +41,7 @@ public RenameOu() /// /// Constructor /// - public RenameOu( UserControl parent , IOu ou , IDialog window ) + public RenameOu(UserControl parent, IOu ou, IDialog window) { try { @@ -51,9 +51,9 @@ public RenameOu( UserControl parent , IOu ou , IDialog window ) this._parentControl = parent; this.Prepare(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -62,69 +62,69 @@ private void Prepare() { try { - this.image1.Source = this._ou.GetOuImage( 32 ).Source; + this.image1.Source = this._ou.GetOuImage(32).Source; this.OuNameTextBox.Text = this._ou.GetName(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void RenameButtonClick( object sender , RoutedEventArgs e ) + private void RenameButtonClick(object sender, RoutedEventArgs e) { try { - if( this.OuNameTextBox.Text.Length > 0 ) + if (this.OuNameTextBox.Text.Length > 0) { - this._ou.SetName( this.OuNameTextBox.Text ); + this._ou.SetName(this.OuNameTextBox.Text); this._popupWindow.CloseDialog(); } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void CancelButtonClick( object sender , RoutedEventArgs e ) + private void CancelButtonClick(object sender, RoutedEventArgs e) { try { this._popupWindow.CloseDialog(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void UserControlLoaded( object sender , RoutedEventArgs e ) + private void UserControlLoaded(object sender, RoutedEventArgs e) { try { - this._popupWindow.ResizePopup( ( int ) this.Width , ( int ) this.Height ); + this._popupWindow.ResizePopup((int)this.Width, (int)this.Height); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void OuNameTextBoxTextChanged( object sender , TextChangedEventArgs e ) + private void OuNameTextBoxTextChanged(object sender, TextChangedEventArgs e) { try { - this.OuNameTextBox.Text = Framework.Utils.CleanString( this.OuNameTextBox.Text ); + this.OuNameTextBox.Text = Framework.Utils.CleanString(this.OuNameTextBox.Text); this.OuNameTextBox.CaretIndex = this.OuNameTextBox.Text.Length; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } } diff --git a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/OuViewer.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/OuViewer.xaml.cs index d743171..91c15c7 100644 --- a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/OuViewer.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/OuViewer.xaml.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Reflection; using System.Windows; @@ -21,7 +21,7 @@ namespace LGP.Modules.OrganizationUnitExplorer /// /// Interaction logic for OuViewer.xaml /// - public partial class OuViewer : IOuObserver , IUserControl + public partial class OuViewer : IOuObserver, IUserControl { private IOu _ou; private int _viewType1; @@ -36,9 +36,9 @@ public OuViewer() { this.InitializeComponent(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -46,7 +46,7 @@ public OuViewer() /// /// Constructor /// - public OuViewer( IOu ou ) + public OuViewer(IOu ou) { try { @@ -54,7 +54,7 @@ public OuViewer( IOu ou ) OuHelper.ClientGateway.Refresh(); - ou.Attach( this ); + ou.Attach(this); this.Name = ou.GetName(); this.Tag = ou.GetName(); @@ -63,50 +63,50 @@ public OuViewer( IOu ou ) this._viewType1 = 1; this._viewType2 = 1; - this.GridViewImage1.Source = Framework.Images.GetImage( "graphic-design" , "16x16" , 12 ).Source; - this.ListViewImage1.Source = Framework.Images.GetImage( "attibutes" , "16x16" , 12 ).Source; // codespell:ignore attibutes - this.GridViewImage2.Source = Framework.Images.GetImage( "graphic-design" , "16x16" , 12 ).Source; - this.ListViewImage2.Source = Framework.Images.GetImage( "attibutes" , "16x16" , 12 ).Source; // codespell:ignore attibutes - this.ImageMinusZoom.Source = Framework.Images.GetImage( "zoomout" , "VS2010ImageLibrary" , 12 ).Source; - this.ImagePlusZoom.Source = Framework.Images.GetImage( "zoomin" , "VS2010ImageLibrary" , 12 ).Source; - this.OuImage.Source = this._ou.GetOuImage( 16 ).Source; + this.GridViewImage1.Source = Framework.Images.GetImage("graphic-design", "16x16", 12).Source; + this.ListViewImage1.Source = Framework.Images.GetImage("attibutes", "16x16", 12).Source; // codespell:ignore attibutes + this.GridViewImage2.Source = Framework.Images.GetImage("graphic-design", "16x16", 12).Source; + this.ListViewImage2.Source = Framework.Images.GetImage("attibutes", "16x16", 12).Source; // codespell:ignore attibutes + this.ImageMinusZoom.Source = Framework.Images.GetImage("zoomout", "VS2010ImageLibrary", 12).Source; + this.ImagePlusZoom.Source = Framework.Images.GetImage("zoomin", "VS2010ImageLibrary", 12).Source; + this.OuImage.Source = this._ou.GetOuImage(16).Source; - var resource = Framework.Utils.LoadResource( Assembly.GetExecutingAssembly() , "LGP.Modules.OrganizationUnitExplorer.Internal.ContextMenuItems.OuContextMenu.xaml" ); + var resource = Framework.Utils.LoadResource(Assembly.GetExecutingAssembly(), "LGP.Modules.OrganizationUnitExplorer.Internal.ContextMenuItems.OuContextMenu.xaml"); var menu = resource as ContextMenu; - if( menu != null ) + if (menu != null) { - var item = ( MenuItem ) menu.Items[ 0 ]; + var item = (MenuItem)menu.Items[0]; item.Click += this.AddMenuItemClick; - item.Icon = Framework.Images.GetImage( "workgroup" , "distros/32" , 12 ); - menu.Items.Remove( item ); - this.OuImageMenu.Items.Add( item ); + item.Icon = Framework.Images.GetImage("workgroup", "distros/32", 12); + menu.Items.Remove(item); + this.OuImageMenu.Items.Add(item); - item = ( MenuItem ) menu.Items[ 0 ]; + item = (MenuItem)menu.Items[0]; item.Click += this.RenameMenuItemClick; - item.Icon = Framework.Images.GetImage( "RenameFolderHS" , "VS2010ImageLibrary" , 12 ); - menu.Items.Remove( item ); - this.OuImageMenu.Items.Add( item ); + item.Icon = Framework.Images.GetImage("RenameFolderHS", "VS2010ImageLibrary", 12); + menu.Items.Remove(item); + this.OuImageMenu.Items.Add(item); - item = ( MenuItem ) menu.Items[ 0 ]; + item = (MenuItem)menu.Items[0]; item.Click += this.MoveMenuItemClick; - item.Icon = Framework.Images.GetImage( "Move" , "VS2010ImageLibrary" , 12 ); - menu.Items.Remove( item ); - this.OuImageMenu.Items.Add( item ); + item.Icon = Framework.Images.GetImage("Move", "VS2010ImageLibrary", 12); + menu.Items.Remove(item); + this.OuImageMenu.Items.Add(item); - item = ( MenuItem ) menu.Items[ 0 ]; + item = (MenuItem)menu.Items[0]; item.Click += this.DeleteMenuItemClick; - item.Icon = Framework.Images.GetImage( "DeleteHS" , "VS2010ImageLibrary" , 12 ); - menu.Items.Remove( item ); - this.OuImageMenu.Items.Add( item ); + item.Icon = Framework.Images.GetImage("DeleteHS", "VS2010ImageLibrary", 12); + menu.Items.Remove(item); + this.OuImageMenu.Items.Add(item); } this.OuLabel.Content = this._ou.GetName(); - this.ShowOrganizationalUnit( 64 ); + this.ShowOrganizationalUnit(64); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -117,9 +117,9 @@ public OuViewer( IOu ou ) /// /// Iou /// source observer - public void Update( IOu ou , IOuObserver source ) + public void Update(IOu ou, IOuObserver source) { - if( this == source ) + if (this == source) { return; } @@ -131,11 +131,11 @@ public void Update( IOu ou , IOuObserver source ) this.OuLabel.Content = this._ou.GetName(); this.Tag = this._ou.GetName(); Framework.Panels.UpdateTabNames(); - this.ShowOrganizationalUnit( ( ( int ) this.progressBar1.Value ) + 32 ); + this.ShowOrganizationalUnit(((int)this.progressBar1.Value) + 32); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -144,14 +144,14 @@ 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 { } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -160,14 +160,14 @@ public void Attach( IOuObserver obj ) /// Detach objewcts that observer this IOu /// /// IOuObserver - public void Detach( IOuObserver obj ) + public void Detach(IOuObserver obj) { try { } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -180,9 +180,9 @@ public void Notify() try { } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -191,108 +191,108 @@ public void Notify() /// Dispose this object and all the observers /// /// IOuObserver - public void Dispose( IOuObserver obj ) + public void Dispose(IOuObserver obj) { try { - obj.Detach( this ); - Framework.Panels.RemoveMainComponent( this ); + obj.Detach(this); + Framework.Panels.RemoveMainComponent(this); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } #endregion - private void MenuItemClick( object sender , RoutedEventArgs e ) + private void MenuItemClick(object sender, RoutedEventArgs e) { try { var menuitem = sender as MenuItem; - Framework.ContextMenus.CallBack( menuitem , this._ou ); + Framework.ContextMenus.CallBack(menuitem, this._ou); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void ShowOrganizationalUnit( int size ) + private void ShowOrganizationalUnit(int size) { try { - if( this.viewer1.Children != null ) + if (this.viewer1.Children != null) { - foreach( WrapPanelOuElement item in this.viewer1.Children ) + foreach (WrapPanelOuElement item in this.viewer1.Children) { - item.GetOu().Detach( item ); + item.GetOu().Detach(item); } this.viewer1.Children.Clear(); } - if( this.viewer2.Children != null ) + if (this.viewer2.Children != null) { - foreach( WrapPanelClientElement item in this.viewer2.Children ) + foreach (WrapPanelClientElement item in this.viewer2.Children) { - item.GetClient().Detach( item ); + item.GetClient().Detach(item); } this.viewer2.Children.Clear(); } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } try { - var ous = OuHelper.OuGateway.GetChildren( this._ou.GetOuId() ); + var ous = OuHelper.OuGateway.GetChildren(this._ou.GetOuId()); - if( ous != null ) + if (ous != null) { - for( var y = 0; y < ous.Count; y++ ) + for (var y = 0; y < ous.Count; y++) { - var ele = new WrapPanelOuElement( ous[ y ] , size , this ); - this.viewer1.Children.Add( ele ); + var ele = new WrapPanelOuElement(ous[y], size, this); + this.viewer1.Children.Add(ele); } - this.mainGrid.RowDefinitions[ 2 ].Height = new GridLength( 140 , GridUnitType.Star ); + this.mainGrid.RowDefinitions[2].Height = new GridLength(140, GridUnitType.Star); } else { - this.mainGrid.RowDefinitions[ 2 ].Height = new GridLength( 22 , GridUnitType.Star ); + this.mainGrid.RowDefinitions[2].Height = new GridLength(22, GridUnitType.Star); } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } try { - var clients = OuHelper.ClientGateway.GetOuClients( this._ou.GetOuId() ); + var clients = OuHelper.ClientGateway.GetOuClients(this._ou.GetOuId()); - if( clients != null ) + if (clients != null) { - for( var y = 0; y < clients.Count; y++ ) + for (var y = 0; y < clients.Count; y++) { - var ele = new WrapPanelClientElement( clients[ y ] , size , this ); - this.viewer2.Children.Add( ele ); + var ele = new WrapPanelClientElement(clients[y], size, this); + this.viewer2.Children.Add(ele); } - this.mainGrid.RowDefinitions[ 4 ].Height = new GridLength( 140 , GridUnitType.Star ); + this.mainGrid.RowDefinitions[4].Height = new GridLength(140, GridUnitType.Star); } else { - this.mainGrid.RowDefinitions[ 4 ].Height = new GridLength( 22 , GridUnitType.Star ); + this.mainGrid.RowDefinitions[4].Height = new GridLength(22, GridUnitType.Star); } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -300,282 +300,282 @@ private void ShowOrganizationalUnit( int size ) /// /// /// - public void SetDetailsPane( UserControl pane ) + public void SetDetailsPane(UserControl pane) { try { - if( this.ClientViewBorderContainer.Child != null ) + if (this.ClientViewBorderContainer.Child != null) { - if( this.ClientViewBorderContainer.Child.GetType() == typeof( ClientPane ) ) + if (this.ClientViewBorderContainer.Child.GetType() == typeof(ClientPane)) { - var client = ( ClientPane ) this.ClientViewBorderContainer.Child; - client.GetClient().Detach( client ); + var client = (ClientPane)this.ClientViewBorderContainer.Child; + client.GetClient().Detach(client); } - if( this.ClientViewBorderContainer.Child.GetType() == typeof( OuPane ) ) + if (this.ClientViewBorderContainer.Child.GetType() == typeof(OuPane)) { - var ou = ( OuPane ) this.ClientViewBorderContainer.Child; - ou.GetOu().Detach( ou ); + var ou = (OuPane)this.ClientViewBorderContainer.Child; + ou.GetOu().Detach(ou); } } this.ClientViewBorderContainer.Child = pane; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void GridViewImageMouseDown1( object sender , MouseButtonEventArgs e ) + private void GridViewImageMouseDown1(object sender, MouseButtonEventArgs e) { this._viewType1 = 1; this.ListViewImage1.Opacity = 0.2; } - private void ListViewImageMouseDown1( object sender , MouseButtonEventArgs e ) + private void ListViewImageMouseDown1(object sender, MouseButtonEventArgs e) { this._viewType1 = 0; this.GridViewImage1.Opacity = 0.2; } - private void ImageMouseEnter1( object sender , MouseEventArgs e ) + private void ImageMouseEnter1(object sender, MouseEventArgs e) { try { - var image = ( Image ) sender; + var image = (Image)sender; image.Opacity = 0.8; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void ImageMouseLeave1( object sender , MouseEventArgs e ) + private void ImageMouseLeave1(object sender, MouseEventArgs e) { try { - var image = ( Image ) sender; + var image = (Image)sender; - if( this._viewType1 == 1 && image.Tag.ToString().CompareTo( "ListView" ) == 0 ) + if (this._viewType1 == 1 && image.Tag.ToString().CompareTo("ListView") == 0) { image.Opacity = 0.2; } - else if( this._viewType1 == 0 && image.Tag.ToString().CompareTo( "GridView" ) == 0 ) + else if (this._viewType1 == 0 && image.Tag.ToString().CompareTo("GridView") == 0) { image.Opacity = 0.2; } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void GridViewImageMouseDown2( object sender , MouseButtonEventArgs e ) + private void GridViewImageMouseDown2(object sender, MouseButtonEventArgs e) { this._viewType2 = 1; this.ListViewImage2.Opacity = 0.2; } - private void ListViewImageMouseDown2( object sender , MouseButtonEventArgs e ) + private void ListViewImageMouseDown2(object sender, MouseButtonEventArgs e) { this._viewType2 = 0; this.GridViewImage2.Opacity = 0.2; } - private void ImageMouseEnter2( object sender , MouseEventArgs e ) + private void ImageMouseEnter2(object sender, MouseEventArgs e) { try { - var image = ( Image ) sender; + var image = (Image)sender; image.Opacity = 0.8; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void ImageMouseLeave2( object sender , MouseEventArgs e ) + private void ImageMouseLeave2(object sender, MouseEventArgs e) { try { - var image = ( Image ) sender; + var image = (Image)sender; - if( this._viewType2 == 1 && image.Tag.ToString().CompareTo( "ListView" ) == 0 ) + if (this._viewType2 == 1 && image.Tag.ToString().CompareTo("ListView") == 0) { image.Opacity = 0.2; } - else if( this._viewType2 == 0 && image.Tag.ToString().CompareTo( "GridView" ) == 0 ) + else if (this._viewType2 == 0 && image.Tag.ToString().CompareTo("GridView") == 0) { image.Opacity = 0.2; } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void ResizeOrganizationalUnits( int pos ) + private void ResizeOrganizationalUnits(int pos) { try { - foreach( UIElement ele in this.viewer1.Children ) + foreach (UIElement ele in this.viewer1.Children) { - ( ( WrapPanelOuElement ) ele ).Resize( pos ); + ((WrapPanelOuElement)ele).Resize(pos); } - foreach( UIElement ele in this.viewer2.Children ) + foreach (UIElement ele in this.viewer2.Children) { - ( ( WrapPanelClientElement ) ele ).Resize( pos ); + ((WrapPanelClientElement)ele).Resize(pos); } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void ProgressBar1MouseMove( object sender , MouseEventArgs e ) + private void ProgressBar1MouseMove(object sender, MouseEventArgs e) { try { - if( e.LeftButton == MouseButtonState.Pressed ) + if (e.LeftButton == MouseButtonState.Pressed) { - var pos = ( ( decimal ) e.GetPosition( this.progressBar1 ).X / ( decimal ) this.progressBar1.Width ) * 100; - this.progressBar1.Value = Convert.ToInt32( pos ); - pos = Convert.ToInt32( pos ) + 32; + var pos = ((decimal)e.GetPosition(this.progressBar1).X / (decimal)this.progressBar1.Width) * 100; + this.progressBar1.Value = Convert.ToInt32(pos); + pos = Convert.ToInt32(pos) + 32; - if( pos > 128 ) + if (pos > 128) { pos = 128; } - this.ResizeOrganizationalUnits( ( int ) pos ); + this.ResizeOrganizationalUnits((int)pos); } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void ProgressBar1MouseLeftButtonDown( object sender , MouseButtonEventArgs e ) + private void ProgressBar1MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { try { - if( e.LeftButton == MouseButtonState.Pressed ) + if (e.LeftButton == MouseButtonState.Pressed) { - var pos = ( ( decimal ) e.GetPosition( this.progressBar1 ).X / ( decimal ) this.progressBar1.Width ) * 100; - this.progressBar1.Value = Convert.ToInt32( pos ); - pos = Convert.ToInt32( pos ) + 32; + var pos = ((decimal)e.GetPosition(this.progressBar1).X / (decimal)this.progressBar1.Width) * 100; + this.progressBar1.Value = Convert.ToInt32(pos); + pos = Convert.ToInt32(pos) + 32; - if( pos > 128 ) + if (pos > 128) { pos = 128; } - this.ResizeOrganizationalUnits( ( int ) pos ); + this.ResizeOrganizationalUnits((int)pos); } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void AddMenuItemClick( object sender , RoutedEventArgs e ) + private void AddMenuItemClick(object sender, RoutedEventArgs e) { try { var popup = Framework.Dialog; - var cou = new CreateOu( this , this._ou , popup ); - popup.SetChild( cou ); + var cou = new CreateOu(this, this._ou, popup); + popup.SetChild(cou); popup.ShowBlocking(); - this.ShowOrganizationalUnit( ( ( int ) this.progressBar1.Value ) + 32 ); + this.ShowOrganizationalUnit(((int)this.progressBar1.Value) + 32); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void RenameMenuItemClick( object sender , RoutedEventArgs e ) + private void RenameMenuItemClick(object sender, RoutedEventArgs e) { try { this.OuLabelEditBox.Text = this.OuLabel.Content.ToString(); this.OuLabel.Visibility = Visibility.Hidden; this.OuLabelEditBox.Visibility = Visibility.Visible; - this.ShowOrganizationalUnit( ( ( int ) this.progressBar1.Value ) + 32 ); + this.ShowOrganizationalUnit(((int)this.progressBar1.Value) + 32); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void MoveMenuItemClick( object sender , RoutedEventArgs e ) + private void MoveMenuItemClick(object sender, RoutedEventArgs e) { try { var popup = Framework.Dialog; - var cou = new MoveOu( this , this._ou , popup ); - popup.SetChild( cou ); + var cou = new MoveOu(this, this._ou, popup); + popup.SetChild(cou); popup.ShowBlocking(); - this.ShowOrganizationalUnit( ( ( int ) this.progressBar1.Value ) + 32 ); + this.ShowOrganizationalUnit(((int)this.progressBar1.Value) + 32); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void DeleteMenuItemClick( object sender , RoutedEventArgs e ) + private void DeleteMenuItemClick(object sender, RoutedEventArgs e) { try { var popup = Framework.Dialog; - var cou = new DeleteOu( this , this._ou , popup , true ); - popup.SetChild( cou ); + var cou = new DeleteOu(this, this._ou, popup, true); + popup.SetChild(cou); popup.ShowBlocking(); - this.ShowOrganizationalUnit( ( ( int ) this.progressBar1.Value ) + 32 ); + this.ShowOrganizationalUnit(((int)this.progressBar1.Value) + 32); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void OuEditBoxKeyUp( object sender , KeyEventArgs e ) + private void OuEditBoxKeyUp(object sender, KeyEventArgs e) { try { - if( e.Key == Key.Return && this.OuLabelEditBox.Text.Length > 0 ) + if (e.Key == Key.Return && this.OuLabelEditBox.Text.Length > 0) { this.OuLabelEditBox.Visibility = Visibility.Hidden; this.OuLabel.Visibility = Visibility.Visible; - this._ou.SetName( this.OuLabelEditBox.Text ); + this._ou.SetName(this.OuLabelEditBox.Text); this.OuLabel.Content = this._ou.GetName(); this.Tag = this._ou.GetName(); } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -585,20 +585,20 @@ private void OuEditBoxKeyUp( object sender , KeyEventArgs e ) /// public void Update() { - this.Update( this._ou , null ); + this.Update(this._ou, null); } - private void OuLabelEditBoxTextChanged( object sender , TextChangedEventArgs e ) + private void OuLabelEditBoxTextChanged(object sender, TextChangedEventArgs e) { - this.OuLabelEditBox.Text = Framework.Utils.CleanString( this.OuLabelEditBox.Text ); + this.OuLabelEditBox.Text = Framework.Utils.CleanString(this.OuLabelEditBox.Text); this.OuLabelEditBox.CaretIndex = this.OuLabelEditBox.Text.Length; } - private void OuImageMenuSubmenuOpened( object sender , RoutedEventArgs e ) + private void OuImageMenuSubmenuOpened(object sender, RoutedEventArgs e) { var menu = this.OuImageMenu; - Framework.ContextMenus.AttachMenuItemRegistrations( ref menu , typeof( IOu ) , this.MenuItemClick ); + Framework.ContextMenus.AttachMenuItemRegistrations(ref menu, typeof(IOu), this.MenuItemClick); } #region Implementation of IUserControl @@ -610,46 +610,46 @@ public void Dispose() { try { - if( this.viewer1.Children != null ) + if (this.viewer1.Children != null) { - foreach( WrapPanelOuElement item in this.viewer1.Children ) + foreach (WrapPanelOuElement item in this.viewer1.Children) { - item.GetOu().Detach( item ); + item.GetOu().Detach(item); } this.viewer1.Children.Clear(); } - if( this.viewer2.Children != null ) + if (this.viewer2.Children != null) { - foreach( WrapPanelClientElement item in this.viewer2.Children ) + foreach (WrapPanelClientElement item in this.viewer2.Children) { - item.GetClient().Detach( item ); + item.GetClient().Detach(item); } this.viewer2.Children.Clear(); } - if( this.ClientViewBorderContainer.Child != null ) + if (this.ClientViewBorderContainer.Child != null) { - if( this.ClientViewBorderContainer.Child.GetType() == typeof( ClientPane ) ) + if (this.ClientViewBorderContainer.Child.GetType() == typeof(ClientPane)) { - var client = ( ClientPane ) this.ClientViewBorderContainer.Child; - client.GetClient().Detach( client ); + var client = (ClientPane)this.ClientViewBorderContainer.Child; + client.GetClient().Detach(client); } - if( this.ClientViewBorderContainer.Child.GetType() == typeof( OuPane ) ) + if (this.ClientViewBorderContainer.Child.GetType() == typeof(OuPane)) { - var ou = ( OuPane ) this.ClientViewBorderContainer.Child; - ou.GetOu().Detach( ou ); + var ou = (OuPane)this.ClientViewBorderContainer.Child; + ou.GetOu().Detach(ou); } } - this._ou.Detach( this ); + this._ou.Detach(this); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -669,7 +669,7 @@ public void Pause() try { } - catch( Exception ) + catch (Exception) { } } @@ -682,7 +682,7 @@ public void Resume() try { } - catch( Exception ) + catch (Exception) { } } diff --git a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Preferences.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Preferences.xaml.cs index ae23cc2..f3474bf 100644 --- a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Preferences.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Preferences.xaml.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Windows.Controls; using LGP.Components.Factory; @@ -27,9 +27,9 @@ public Preferences() { this.InitializeComponent(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -69,7 +69,7 @@ public void Save() /// /// /// string - public void Load( ISettings settingsParent ) + public void Load(ISettings settingsParent) { this._parent = settingsParent; } @@ -80,7 +80,7 @@ public void Load( ISettings settingsParent ) /// Type public Type GetControlType() { - return typeof( IModule ); + return typeof(IModule); } /// @@ -89,7 +89,7 @@ public Type GetControlType() /// public Image GetIcon() { - return Framework.Images.GetImage( "category-2" , "16X16" , 14 ); + return Framework.Images.GetImage("category-2", "16X16", 14); } #endregion diff --git a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Properties/AssemblyInfo.cs b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Properties/AssemblyInfo.cs index 7825d3e..cafd2ae 100644 --- a/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Properties/AssemblyInfo.cs +++ b/csharp/Linux Group Policy/LGP.Modules.OrganizationUnitExplorer/Properties/AssemblyInfo.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System.Reflection; using System.Runtime.InteropServices; using System.Windows; @@ -11,20 +11,20 @@ // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly:AssemblyTitle( "OrganizationUnitExplorer" )] -[assembly:AssemblyDescription( "" )] -[assembly:AssemblyConfiguration( "" )] -[assembly:AssemblyCompany( "" )] -[assembly:AssemblyProduct( "OrganizationUnitExplorer" )] -[assembly:AssemblyCopyright( "Copyright © 2011" )] -[assembly:AssemblyTrademark( "" )] -[assembly:AssemblyCulture( "" )] +[assembly: AssemblyTitle("OrganizationUnitExplorer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OrganizationUnitExplorer")] +[assembly: AssemblyCopyright("Copyright © 2011")] +[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 @@ -36,12 +36,12 @@ //[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,7 +56,7 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly:AssemblyVersion( "1.0.4165.1438" )] -[assembly:AssemblyFileVersion( "1.0.4165.1438" )] +[assembly: AssemblyVersion("1.0.4165.1438")] +[assembly: AssemblyFileVersion("1.0.4165.1438")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("LGP.Test")] // jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.PolicyEditor/PolicyEditor.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.PolicyEditor/PolicyEditor.xaml.cs index 96d8dfa..aedffa1 100644 --- a/csharp/Linux Group Policy/LGP.Modules.PolicyEditor/PolicyEditor.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.PolicyEditor/PolicyEditor.xaml.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.IO; using System.Windows; @@ -19,7 +19,7 @@ namespace LGP.Modules.PolicyEditor /// /// Interaction logic for PolicyEditor.xaml /// - public partial class PolicyEditor : IUserControl , IOuObserver + public partial class PolicyEditor : IUserControl, IOuObserver { private readonly IPolicy _policy; private readonly PolicyHandler _policyHandler; @@ -35,9 +35,9 @@ public PolicyEditor() this.InitializeComponent(); this.Prepare(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -45,34 +45,34 @@ public PolicyEditor() /// Constructor /// /// - public PolicyEditor( IOu ou ) + public PolicyEditor(IOu ou) { try { this.InitializeComponent(); this._ou = ou; - this._ou.Attach( this ); - this.PolicyOverviewContainer.Child = new OuPolicyPane( this._ou ); + this._ou.Attach(this); + this.PolicyOverviewContainer.Child = new OuPolicyPane(this._ou); var pgw = Framework.Database.CreatePolicyGateway(); - this._policy = pgw.GetPolicyByOu( this._ou ); - if( this._policy == null ) + this._policy = pgw.GetPolicyByOu(this._ou); + if (this._policy == null) { - var policy = File.ReadAllText( "PolicyTemplate.txt" ); - this._policy = pgw.CreatePolicy( this._ou , policy ); + var policy = File.ReadAllText("PolicyTemplate.txt"); + this._policy = pgw.CreatePolicy(this._ou, policy); } - this._policyHandler = new PolicyHandler( this , this.PolicyDSLEditor1 , this._policy ); - this.VPEditor.SetPolicy( this._policy , this , this._policyHandler ); + this._policyHandler = new PolicyHandler(this, this.PolicyDSLEditor1, this._policy); + this.VPEditor.SetPolicy(this._policy, this, this._policyHandler); this.Prepare(); this.Tag = this._ou.GetName() + " " + Properties.Resources.Policy; - this.PolicyOverviewContainer.Child = new OuPolicyPane( this._ou ); + this.PolicyOverviewContainer.Child = new OuPolicyPane(this._ou); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -80,71 +80,71 @@ private void Prepare() { try { - this.ImageCopy.Source = Framework.Images.GetImage( "Copy" , "VS2010ImageLibrary" ).Source; - this.ImageCut.Source = Framework.Images.GetImage( "Cut" , "VS2010ImageLibrary" ).Source; - this.ImageDelete.Source = Framework.Images.GetImage( "Delete" , "VS2010ImageLibrary" ).Source; - this.ImagePaste.Source = Framework.Images.GetImage( "Paste" , "VS2010ImageLibrary" ).Source; - this.ImageRedo.Source = Framework.Images.GetImage( "Redo" , "VS2010ImageLibrary" ).Source; - this.ImageSave.Source = Framework.Images.GetImage( "Save" , "VS2010ImageLibrary" ).Source; - this.ImageSave1.Source = Framework.Images.GetImage( "Save" , "VS2010ImageLibrary" ).Source; - this.ImageUndo.Source = Framework.Images.GetImage( "Undo" , "VS2010ImageLibrary" ).Source; - this.ImageWrap.Source = Framework.Images.GetImage( "WordWrap" , "VS2010ImageLibrary" ).Source; - this.ImageDeleteRule.Source = Framework.Images.GetImage( "Delete-PermissionHH" , "VS2010ImageLibrary" ).Source; - this.ImageAddRule.Source = Framework.Images.GetImage( "New-Permission" , "VS2010ImageLibrary" ).Source; + this.ImageCopy.Source = Framework.Images.GetImage("Copy", "VS2010ImageLibrary").Source; + this.ImageCut.Source = Framework.Images.GetImage("Cut", "VS2010ImageLibrary").Source; + this.ImageDelete.Source = Framework.Images.GetImage("Delete", "VS2010ImageLibrary").Source; + this.ImagePaste.Source = Framework.Images.GetImage("Paste", "VS2010ImageLibrary").Source; + this.ImageRedo.Source = Framework.Images.GetImage("Redo", "VS2010ImageLibrary").Source; + this.ImageSave.Source = Framework.Images.GetImage("Save", "VS2010ImageLibrary").Source; + this.ImageSave1.Source = Framework.Images.GetImage("Save", "VS2010ImageLibrary").Source; + this.ImageUndo.Source = Framework.Images.GetImage("Undo", "VS2010ImageLibrary").Source; + this.ImageWrap.Source = Framework.Images.GetImage("WordWrap", "VS2010ImageLibrary").Source; + this.ImageDeleteRule.Source = Framework.Images.GetImage("Delete-PermissionHH", "VS2010ImageLibrary").Source; + this.ImageAddRule.Source = Framework.Images.GetImage("New-Permission", "VS2010ImageLibrary").Source; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void SaveMenuItemClick( object sender , RoutedEventArgs e ) + private void SaveMenuItemClick(object sender, RoutedEventArgs e) { try { - this._policy.SetDsl( this._policyHandler.Document.Text ); + this._policy.SetDsl(this._policyHandler.Document.Text); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void ToolBarLoaded( object sender , RoutedEventArgs e ) + private void ToolBarLoaded(object sender, RoutedEventArgs e) { try { var toolBar = sender as ToolBar; - if( toolBar != null ) + if (toolBar != null) { - var overflowGrid = toolBar.Template.FindName( "OverflowGrid" , toolBar ) as FrameworkElement; - if( overflowGrid != null ) + var overflowGrid = toolBar.Template.FindName("OverflowGrid", toolBar) as FrameworkElement; + if (overflowGrid != null) { overflowGrid.Visibility = Visibility.Collapsed; } } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void AddRowButtonClick( object sender , RoutedEventArgs e ) + private void AddRowButtonClick(object sender, RoutedEventArgs e) { this.VPEditor.AddRow(); } - private void DeleteRowButtonClick( object sender , RoutedEventArgs e ) + private void DeleteRowButtonClick(object sender, RoutedEventArgs e) { this.VPEditor.DeleteSelectedRows(); } - private void PolicyDslEditor1KeyUp( object sender , KeyEventArgs e ) + private void PolicyDslEditor1KeyUp(object sender, KeyEventArgs e) { - if( e.Key == Key.Return ) + if (e.Key == Key.Return) { - this.VPEditor.Update( this._policy , null ); + this.VPEditor.Update(this._policy, null); } } @@ -157,13 +157,13 @@ public void Dispose() { try { - this._ou.Detach( this ); - this._policyHandler.Detach( this._policyHandler ); - this.VPEditor.Detach( this.VPEditor ); + this._ou.Detach(this); + this._policyHandler.Detach(this._policyHandler); + this.VPEditor.Detach(this.VPEditor); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -183,7 +183,7 @@ public void Pause() try { } - catch( Exception ) + catch (Exception) { } } @@ -196,7 +196,7 @@ public void Resume() try { } - catch( Exception ) + catch (Exception) { } } @@ -210,16 +210,16 @@ public void Resume() /// /// Iou /// source observer - public void Update( IOu ou , IOuObserver source ) + public void Update(IOu ou, IOuObserver source) { try { this._ou = ou; this.Tag = this._ou.GetName() + " Policy"; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -227,14 +227,14 @@ 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 { } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -242,14 +242,14 @@ public void Attach( IOuObserver obj ) /// Detach objewcts that observer this IOu /// /// IOuObserver - public void Detach( IOuObserver obj ) + public void Detach(IOuObserver obj) { try { } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -261,9 +261,9 @@ public void Notify() try { } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -271,14 +271,14 @@ public void Notify() /// Dispose this object and all the observers /// /// IOuObserver - public void Dispose( IOuObserver obj ) + public void Dispose(IOuObserver obj) { try { } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } diff --git a/csharp/Linux Group Policy/LGP.Modules.PolicyEditor/Preferences.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.PolicyEditor/Preferences.xaml.cs index ef65ccf..e1e4be0 100644 --- a/csharp/Linux Group Policy/LGP.Modules.PolicyEditor/Preferences.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.PolicyEditor/Preferences.xaml.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Windows.Controls; using LGP.Components.Factory; @@ -27,9 +27,9 @@ public Preferences() { this.InitializeComponent(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -69,7 +69,7 @@ public void Save() /// /// /// string - public void Load( ISettings settingsParent ) + public void Load(ISettings settingsParent) { this._parent = settingsParent; } @@ -80,7 +80,7 @@ public void Load( ISettings settingsParent ) /// Type public Type GetControlType() { - return typeof( IModule ); + return typeof(IModule); } /// @@ -89,7 +89,7 @@ public Type GetControlType() /// public Image GetIcon() { - return Framework.Images.GetImage( "config" , "16X16" , 14 ); + return Framework.Images.GetImage("config", "16X16", 14); } #endregion diff --git a/csharp/Linux Group Policy/LGP.Modules.PolicyEditor/Properties/AssemblyInfo.cs b/csharp/Linux Group Policy/LGP.Modules.PolicyEditor/Properties/AssemblyInfo.cs index 9b07397..8ea3496 100644 --- a/csharp/Linux Group Policy/LGP.Modules.PolicyEditor/Properties/AssemblyInfo.cs +++ b/csharp/Linux Group Policy/LGP.Modules.PolicyEditor/Properties/AssemblyInfo.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System.Reflection; using System.Runtime.InteropServices; using System.Windows; @@ -11,20 +11,20 @@ // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly:AssemblyTitle( "PolicyEditor" )] -[assembly:AssemblyDescription( "" )] -[assembly:AssemblyConfiguration( "" )] -[assembly:AssemblyCompany( "" )] -[assembly:AssemblyProduct( "PolicyEditor" )] -[assembly:AssemblyCopyright( "Copyright © 2011" )] -[assembly:AssemblyTrademark( "" )] -[assembly:AssemblyCulture( "" )] +[assembly: AssemblyTitle("PolicyEditor")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("PolicyEditor")] +[assembly: AssemblyCopyright("Copyright © 2011")] +[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 @@ -36,12 +36,12 @@ //[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,7 +56,7 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly:AssemblyVersion( "1.0.4163.1438" )] -[assembly:AssemblyFileVersion( "1.0.4163.1438" )] +[assembly: AssemblyVersion("1.0.4163.1438")] +[assembly: AssemblyFileVersion("1.0.4163.1438")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("LGP.Test")] // jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.ServerControl/ConnectionController.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.ServerControl/ConnectionController.xaml.cs index 129c9ce..2d90054 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ServerControl/ConnectionController.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ServerControl/ConnectionController.xaml.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Collections.Generic; using System.ComponentModel; @@ -24,7 +24,7 @@ public partial class ConnectionController : IUserControl { private static ConnectionController _instance; private readonly Timer _refreshTicker; - private readonly List< IServerInfo > _serverList; + private readonly List _serverList; /// /// Constructor @@ -37,9 +37,9 @@ public ConnectionController() this.Tag = Properties.Resources.ServerControl; - this.ServerImage.Source = Framework.Images.GetImage( "Networkgroup" , "VS2010ImageLibrary" ).Source; + this.ServerImage.Source = Framework.Images.GetImage("Networkgroup", "VS2010ImageLibrary").Source; - this._serverList = new List< IServerInfo >(); + this._serverList = new List(); this._refreshTicker = new Timer { Enabled = true @@ -51,20 +51,20 @@ public ConnectionController() Framework.ShutDown += this.Shutdown; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void Shutdown( object sender , CancelEventArgs e ) + private void Shutdown(object sender, CancelEventArgs e) { try { - if( this.ConnectionViewerContainer.Child != null ) + if (this.ConnectionViewerContainer.Child != null) { var connectionViewer = this.ConnectionViewerContainer.Child as ConnectionViewer; - if( connectionViewer != null ) + if (connectionViewer != null) { connectionViewer.StopStressTester(); } @@ -72,34 +72,34 @@ private void Shutdown( object sender , CancelEventArgs e ) this._refreshTicker.Stop(); } - catch( Exception ) + catch (Exception) { } } - private bool InspectItems( string server ) + private bool InspectItems(string server) { try { - foreach( var t in this._serverList ) + foreach (var t in this._serverList) { - if( t.ServerAddress.CompareTo( server ) == 0 ) + if (t.ServerAddress.CompareTo(server) == 0) { return true; } } return false; } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); return false; } } - private void RefreshTickerElapsed( object sender , ElapsedEventArgs e ) + private void RefreshTickerElapsed(object sender, ElapsedEventArgs e) { try { @@ -107,37 +107,37 @@ private void RefreshTickerElapsed( object sender , ElapsedEventArgs e ) var servers = Framework.Network.GetServers(); - foreach( var t in servers ) + foreach (var t in servers) { - if( this.InspectItems( t.ServerAddress ) == false ) + if (this.InspectItems(t.ServerAddress) == false) { update = true; } } - this.ServerListBox.Dispatcher.BeginInvoke( DispatcherPriority.Normal , ( Action ) ( delegate + this.ServerListBox.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (Action)(delegate { - if( update ) + if (update) { this._serverList.Clear(); - foreach( var t in servers ) + foreach (var t in servers) { var n = new ServerInfo { - LastSeen = t.LastSeen , + LastSeen = t.LastSeen, ServerAddress = t.ServerAddress }; - this._serverList.Add( n ); + this._serverList.Add(n); } this.ServerListBox.DataContext = this._serverList; } - } ) ); + })); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -147,55 +147,55 @@ private void RefreshTickerElapsed( object sender , ElapsedEventArgs e ) /// ConnectionController public static ConnectionController GetInstance() { - return _instance ?? ( _instance = new ConnectionController() ); + return _instance ?? (_instance = new ConnectionController()); } - private void ConnectServerButtonClick( object sender , RoutedEventArgs e ) + private void ConnectServerButtonClick(object sender, RoutedEventArgs e) { try { - if( this.textBox1.Text.CompareTo( "" ) != 0 ) + if (this.textBox1.Text.CompareTo("") != 0) { - Framework.Network.SetServerAddress( this.textBox1.Text ); + Framework.Network.SetServerAddress(this.textBox1.Text); this.ConnectionViewerContainer.Child = new ConnectionViewer(); } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void SelectServerButtonClick( object sender , RoutedEventArgs e ) + private void SelectServerButtonClick(object sender, RoutedEventArgs e) { try { - if( this.ServerListBox.SelectedItem != null ) + if (this.ServerListBox.SelectedItem != null) { - Framework.Network.SetServerAddress( this.ServerListBox.SelectedItem.ToString() ); + Framework.Network.SetServerAddress(this.ServerListBox.SelectedItem.ToString()); this.ConnectionViewerContainer.Child = new ConnectionViewer(); } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void ServerListNodeDoubleClick( object sender , MouseButtonEventArgs e ) + private void ServerListNodeDoubleClick(object sender, MouseButtonEventArgs e) { try { - if( this.ServerListBox.SelectedIndex != -1 ) + if (this.ServerListBox.SelectedIndex != -1) { - Framework.Network.SetServerAddress( this.ServerListBox.SelectedItem.ToString() ); + Framework.Network.SetServerAddress(this.ServerListBox.SelectedItem.ToString()); this.ConnectionViewerContainer.Child = new ConnectionViewer(); } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -210,9 +210,9 @@ public void Dispose() { this._refreshTicker.Stop(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -233,7 +233,7 @@ public void Pause() try { } - catch( Exception ) + catch (Exception) { } } @@ -246,7 +246,7 @@ public void Resume() try { } - catch( Exception ) + catch (Exception) { } } diff --git a/csharp/Linux Group Policy/LGP.Modules.ServerControl/Plugin.cs b/csharp/Linux Group Policy/LGP.Modules.ServerControl/Plugin.cs index a566857..384610e 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ServerControl/Plugin.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ServerControl/Plugin.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Reflection; using System.Windows; @@ -35,44 +35,44 @@ public string GetName() /// An image public Image GetIcon() { - return Framework.Images.GetImage( "config" , "16X16" , 14 ); + return Framework.Images.GetImage("config", "16X16", 14); } /// /// Asks the component to register is menu components /// /// The program main menu - public void RegisterMenuEntries( IMenu menu ) + public void RegisterMenuEntries(IMenu menu) { try { - var resource = Framework.Utils.LoadResource( Assembly.GetExecutingAssembly() , this , ".Internal.ContextMenuItems.ServerControl.xaml" ); + var resource = Framework.Utils.LoadResource(Assembly.GetExecutingAssembly(), this, ".Internal.ContextMenuItems.ServerControl.xaml"); - if( resource == null ) + if (resource == null) { return; } var serverToolbarsItem = resource as MenuItem; - if( serverToolbarsItem == null ) + if (serverToolbarsItem == null) { return; } serverToolbarsItem.Icon = this.GetIcon(); serverToolbarsItem.Click += this.SeverControlClick; - menu.AddSubSubMenuItem( 2 , 2 , serverToolbarsItem ); + menu.AddSubSubMenuItem(2, 2, serverToolbarsItem); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void SeverControlClick( object sender , RoutedEventArgs e ) + private void SeverControlClick(object sender, RoutedEventArgs e) { - Framework.Panels.AddMainComponent( this.GetMainControl() , this.GetName() ); + Framework.Panels.AddMainComponent(this.GetMainControl(), this.GetName()); } #endregion diff --git a/csharp/Linux Group Policy/LGP.Modules.ServerControl/Preferences.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.ServerControl/Preferences.xaml.cs index 29fc8ec..ef75c5c 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ServerControl/Preferences.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ServerControl/Preferences.xaml.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Windows.Controls; using LGP.Components.Factory; @@ -60,7 +60,7 @@ public void Save() /// /// /// string - public void Load( ISettings settingsParent ) + public void Load(ISettings settingsParent) { this._parent = settingsParent; } @@ -71,7 +71,7 @@ public void Load( ISettings settingsParent ) /// Type public Type GetControlType() { - return typeof( IModule ); + return typeof(IModule); } /// @@ -80,7 +80,7 @@ public Type GetControlType() /// public Image GetIcon() { - return Framework.Images.GetImage( "config" , "16X16" , 14 ); + return Framework.Images.GetImage("config", "16X16", 14); } #endregion diff --git a/csharp/Linux Group Policy/LGP.Modules.ServerControl/Properties/AssemblyInfo.cs b/csharp/Linux Group Policy/LGP.Modules.ServerControl/Properties/AssemblyInfo.cs index 056fb6d..e0ac45d 100644 --- a/csharp/Linux Group Policy/LGP.Modules.ServerControl/Properties/AssemblyInfo.cs +++ b/csharp/Linux Group Policy/LGP.Modules.ServerControl/Properties/AssemblyInfo.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System.Reflection; using System.Runtime.InteropServices; using System.Windows; @@ -11,20 +11,20 @@ // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly:AssemblyTitle( "LGP.Modules.ServerControl" )] -[assembly:AssemblyDescription( "" )] -[assembly:AssemblyConfiguration( "" )] -[assembly:AssemblyCompany( "" )] -[assembly:AssemblyProduct( "LGP.Modules.ServerControl" )] -[assembly:AssemblyCopyright( "Copyright © 2012" )] -[assembly:AssemblyTrademark( "" )] -[assembly:AssemblyCulture( "" )] +[assembly: AssemblyTitle("LGP.Modules.ServerControl")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("LGP.Modules.ServerControl")] +[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 @@ -36,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) )] @@ -57,7 +57,7 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly:AssemblyVersion( "1.0.0.0" )] -[assembly:AssemblyFileVersion( "1.0.0.0" )] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("LGP.Test")] // jscpd:ignore-end diff --git a/csharp/Linux Group Policy/LGP.Modules.Statistics/Plugin.cs b/csharp/Linux Group Policy/LGP.Modules.Statistics/Plugin.cs index 443305e..7baf4ea 100644 --- a/csharp/Linux Group Policy/LGP.Modules.Statistics/Plugin.cs +++ b/csharp/Linux Group Policy/LGP.Modules.Statistics/Plugin.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Reflection; using System.Windows; @@ -54,31 +54,31 @@ public string GetName() /// Registers this components menu handlers /// /// The program main menu - public void RegisterMenuEntries( IMenu menu ) + public void RegisterMenuEntries(IMenu menu) { try { - var resource = Framework.Utils.LoadResource( Assembly.GetExecutingAssembly() , this , ".Internal.ContextMenuItems.Statistics.xaml" ); + var resource = Framework.Utils.LoadResource(Assembly.GetExecutingAssembly(), this, ".Internal.ContextMenuItems.Statistics.xaml"); - if( resource == null ) + if (resource == null) { return; } var statisticsToolbarsItem = resource as MenuItem; - if( statisticsToolbarsItem == null ) + if (statisticsToolbarsItem == null) { return; } statisticsToolbarsItem.Icon = this.GetIcon(); statisticsToolbarsItem.Click += this.StatisticsViewerToolbarItemClick; - menu.AddSubSubMenuItem( 2 , 2 , statisticsToolbarsItem ); + menu.AddSubSubMenuItem(2, 2, statisticsToolbarsItem); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -89,7 +89,7 @@ public void RegisterMenuEntries( IMenu menu ) /// public Image GetIcon() { - return Framework.Images.GetImage( "config" , "16X16" , 14 ); + return Framework.Images.GetImage("config", "16X16", 14); } @@ -149,9 +149,9 @@ public string GetComponentContentName() /// /// The menu item that was clicked /// The event details - private void StatisticsViewerToolbarItemClick( object sender , RoutedEventArgs e ) + private void StatisticsViewerToolbarItemClick(object sender, RoutedEventArgs e) { - Framework.Panels.AddMainComponent( this.GetMainControl() , this.GetName() ); + Framework.Panels.AddMainComponent(this.GetMainControl(), this.GetName()); } } } diff --git a/csharp/Linux Group Policy/LGP.Modules.Statistics/Preferences.xaml.cs b/csharp/Linux Group Policy/LGP.Modules.Statistics/Preferences.xaml.cs index 5ecf325..7b93967 100644 --- a/csharp/Linux Group Policy/LGP.Modules.Statistics/Preferences.xaml.cs +++ b/csharp/Linux Group Policy/LGP.Modules.Statistics/Preferences.xaml.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Windows.Controls; using LGP.Components.Factory; @@ -59,7 +59,7 @@ public void Save() /// /// /// string - public void Load( ISettings settingsParent ) + public void Load(ISettings settingsParent) { this._parent = settingsParent; } @@ -70,7 +70,7 @@ public void Load( ISettings settingsParent ) /// Type public Type GetControlType() { - return typeof( IModule ); + return typeof(IModule); } /// @@ -79,7 +79,7 @@ public Type GetControlType() /// public Image GetIcon() { - return Framework.Images.GetImage( "config" , "16X16" , 14 ); + return Framework.Images.GetImage("config", "16X16", 14); } #endregion diff --git a/csharp/Linux Group Policy/LGP/Controls/Settings.xaml.cs b/csharp/Linux Group Policy/LGP/Controls/Settings.xaml.cs index 87fde8e..7b6274a 100644 --- a/csharp/Linux Group Policy/LGP/Controls/Settings.xaml.cs +++ b/csharp/Linux Group Policy/LGP/Controls/Settings.xaml.cs @@ -1,6 +1,6 @@ -// jscpd:ignore-start -#region - +// jscpd:ignore-start +#region + using System; using System.Collections.Generic; using System.Windows; @@ -22,8 +22,8 @@ namespace LGP.Controls /// public partial class Settings : ISettings { - private List< UserControl > _controls; - private List< TreeViewItem > _items; + private List _controls; + private List _items; /// /// Constructor @@ -35,9 +35,9 @@ public Settings() this.InitializeComponent(); this.Prepare(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -46,39 +46,39 @@ public Settings() /// Constructor /// /// PreferencesEvent - public Settings( PreferencesEvent tevent ) + public Settings(PreferencesEvent tevent) { try { this.InitializeComponent(); this.Prepare(); - this.SelectPreferencesControl( tevent ); + this.SelectPreferencesControl(tevent); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void SelectPreferencesControl( PreferencesEvent tevent ) + private void SelectPreferencesControl(PreferencesEvent tevent) { try { - foreach( var control in this._controls ) + foreach (var control in this._controls) { - var controltype = ( ( IPreferences ) control ).GetControlType(); + var controltype = ((IPreferences)control).GetControlType(); - if( controltype != tevent.Type ) + if (controltype != tevent.Type) { continue; } - foreach( var item in this._items ) + foreach (var item in this._items) { var ns = control.GetType().Namespace; - if( ns == null || ns.CompareTo( item.Tag.ToString() ) != 0 ) + if (ns == null || ns.CompareTo(item.Tag.ToString()) != 0) { continue; } @@ -88,9 +88,9 @@ private void SelectPreferencesControl( PreferencesEvent tevent ) } } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -101,57 +101,60 @@ private void Prepare() { var color = new Color { - A = 100 , B = 255 , G = 255 , R = 255 + A = 100, + B = 255, + G = 255, + R = 255 }; - this.Background = new SolidColorBrush( color ); - this._items = new List< TreeViewItem >(); - this._controls = new List< UserControl >(); + this.Background = new SolidColorBrush(color); + this._items = new List(); + this._controls = new List(); this.treeView1.Items.Clear(); this.dragBar.PreviewMouseLeftButtonDown += this.ChromeLessWindowSpaceMouseLeftButtonDown; - foreach( var pVisual in Framework.PreferencesPanes ) + foreach (var pVisual in Framework.PreferencesPanes) { try { - var module = ( IPreferences ) Framework.LibraryHandler.CreateObject( pVisual ); - this._controls.Add( ( UserControl ) module ); - this.AddOption( module ); + var module = (IPreferences)Framework.LibraryHandler.CreateObject(pVisual); + this._controls.Add((UserControl)module); + this.AddOption(module); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } var thisprefs = new Preferences(); - this._controls.Add( thisprefs ); - this.AddOption( thisprefs , thisprefs.GetType().Namespace , thisprefs.GetName() , Framework.Images.ConvertBitmapToImage( Properties.Images.lgpico1 , 14 ) ); + this._controls.Add(thisprefs); + this.AddOption(thisprefs, thisprefs.GetType().Namespace, thisprefs.GetName(), Framework.Images.ConvertBitmapToImage(Properties.Images.lgpico1, 14)); this.OrganizeNodes(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void CloseButtonClick( object sender , RoutedEventArgs e ) + private void CloseButtonClick(object sender, RoutedEventArgs e) { try { - foreach( var control in this._controls ) + foreach (var control in this._controls) { - var prefs = ( IPreferences ) control; + var prefs = (IPreferences)control; prefs.Save(); } this.Close(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } @@ -161,16 +164,16 @@ private void CloseButtonClick( object sender , RoutedEventArgs e ) /// /// The object that raised the click event /// Event arguments associated with the event - private void ChromeLessWindowSpaceMouseLeftButtonDown( object sender , MouseButtonEventArgs e ) + private void ChromeLessWindowSpaceMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { try { this.Cursor = Cursors.SizeAll; this.DragMove(); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } this.Cursor = Cursors.Arrow; } @@ -181,13 +184,13 @@ private void OrganizeNodes() var start = 0; var end = this._items.Count; - while( start < end ) + while (start < end) { - var tag = this._items[ start ].Tag.ToString(); + var tag = this._items[start].Tag.ToString(); - if( tag.Contains( "." ) ) + if (tag.Contains(".")) { - this.CheckParents( tag ); + this.CheckParents(tag); } end = this._items.Count; @@ -198,24 +201,24 @@ private void OrganizeNodes() start = 0; end = this._items.Count; - while( start < end ) + while (start < end) { - var item = this._items[ start ]; + var item = this._items[start]; item.IsExpanded = true; var itemTag = item.Tag.ToString(); - if( itemTag.Contains( "." ) ) + if (itemTag.Contains(".")) { - itemTag = itemTag.Substring( 0 , itemTag.LastIndexOf( "." ) ); + itemTag = itemTag.Substring(0, itemTag.LastIndexOf(".")); - for( var j = 0; j < end; j++ ) + for (var j = 0; j < end; j++) { - var iteritem = this._items[ j ]; + var iteritem = this._items[j]; var iteritemTag = iteritem.Tag.ToString(); - if( itemTag.CompareTo( iteritemTag ) == 0 ) + if (itemTag.CompareTo(iteritemTag) == 0) { - iteritem.Items.Add( item ); + iteritem.Items.Add(item); } } } @@ -226,13 +229,13 @@ private void OrganizeNodes() start = 0; end = this._items.Count; - while( start < end ) + while (start < end) { - var tag = this._items[ start ].Tag.ToString(); + var tag = this._items[start].Tag.ToString(); - if( !tag.Contains( "." ) ) + if (!tag.Contains(".")) { - this.treeView1.Items.Add( this._items[ start ] ); + this.treeView1.Items.Add(this._items[start]); } start++; @@ -240,16 +243,16 @@ private void OrganizeNodes() } - private void CheckParents( string tag ) + private void CheckParents(string tag) { - var parent = tag.Substring( 0 , tag.LastIndexOf( "." ) ); + var parent = tag.Substring(0, tag.LastIndexOf(".")); - if( parent.Contains( "." ) ) + if (parent.Contains(".")) { - this.CheckParents( parent ); + this.CheckParents(parent); } - if( this.Exists( parent ) == false ) + if (this.Exists(parent) == false) { var item = new TreeViewItem { @@ -259,33 +262,33 @@ private void CheckParents( string tag ) var panel = new StackPanel { - Orientation = Orientation.Horizontal , - Margin = new Thickness( 2 ) + Orientation = Orientation.Horizontal, + Margin = new Thickness(2) }; - var block = new TextBlock( new Run( " " + parent.Substring( parent.IndexOf( "." ) + 1 ) ) ); + var block = new TextBlock(new Run(" " + parent.Substring(parent.IndexOf(".") + 1))); - var img = Framework.Images.ConvertBitmapToImage( Properties.Images.lgpico1 , 14 ); + var img = Framework.Images.ConvertBitmapToImage(Properties.Images.lgpico1, 14); img.MaxHeight = 14; img.MaxWidth = 14; - panel.Children.Add( img ); - panel.Children.Add( block ); + panel.Children.Add(img); + panel.Children.Add(block); item.Header = panel; - this._items.Add( item ); + this._items.Add(item); } } - private bool Exists( string name ) + private bool Exists(string name) { - for( var y = 0; y < this._items.Count; y++ ) + for (var y = 0; y < this._items.Count; y++) { - var tag = this._items[ y ].Tag.ToString(); + var tag = this._items[y].Tag.ToString(); - if( tag.CompareTo( name ) == 0 ) + if (tag.CompareTo(name) == 0) { return true; } @@ -295,7 +298,7 @@ private bool Exists( string name ) } - private void AddOption( IPreferences module ) + private void AddOption(IPreferences module) { try { @@ -307,31 +310,31 @@ private void AddOption( IPreferences module ) var panel = new StackPanel { - Orientation = Orientation.Horizontal , - Margin = new Thickness( 2 ) + Orientation = Orientation.Horizontal, + Margin = new Thickness(2) }; - var block = new TextBlock( new Run( " " + module.GetName() ) ); + var block = new TextBlock(new Run(" " + module.GetName())); var img = module.GetIcon(); img.MaxHeight = 14; img.MaxWidth = 14; - panel.Children.Add( img ); - panel.Children.Add( block ); + panel.Children.Add(img); + panel.Children.Add(block); item.Header = panel; - this._items.Add( item ); + this._items.Add(item); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void AddOption( IPreferences module , string mnamespace , string name , Image img ) + private void AddOption(IPreferences module, string mnamespace, string name, Image img) { try { @@ -343,59 +346,59 @@ private void AddOption( IPreferences module , string mnamespace , string name , var panel = new StackPanel { - Orientation = Orientation.Horizontal , - Margin = new Thickness( 2 ) + Orientation = Orientation.Horizontal, + Margin = new Thickness(2) }; - var block = new TextBlock( new Run( " " + name ) ); + var block = new TextBlock(new Run(" " + name)); img.MaxHeight = 14; img.MaxWidth = 14; - panel.Children.Add( img ); - panel.Children.Add( block ); + panel.Children.Add(img); + panel.Children.Add(block); item.Header = panel; - this._items.Add( item ); + this._items.Add(item); } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } } - private void TreeView1SelectedItemChanged( object sender , RoutedPropertyChangedEventArgs< object > e ) + private void TreeView1SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs e) { try { var treeviewitem = this.treeView1.SelectedItem as TreeViewItem; - if( treeviewitem != null ) + if (treeviewitem != null) { var tag = treeviewitem.Tag.ToString(); - foreach( var control in this._controls ) + foreach (var control in this._controls) { var s = control.GetType().Namespace; - if( s != null && s.CompareTo( tag ) == 0 ) + if (s != null && s.CompareTo(tag) == 0) { control.Background = Brushes.Transparent; this.prefsName.Content = tag; control.VerticalAlignment = VerticalAlignment.Top; - ( ( IPreferences ) control ).Load( this ); + ((IPreferences)control).Load(this); - if( this.paneContainer.Content != null ) + if (this.paneContainer.Content != null) { - ( ( IPreferences ) this.paneContainer.Content ).Save(); + ((IPreferences)this.paneContainer.Content).Save(); } this.paneContainer.Content = control; } } } } - catch( Exception error ) + catch (Exception error) { - Framework.EventBus.Publish( error ); + Framework.EventBus.Publish(error); } }