From f6e5116b6082a205df78eb3fcfd7582b30e47d61 Mon Sep 17 00:00:00 2001 From: Teoman Soygul Date: Fri, 19 Jul 2013 15:10:20 +0200 Subject: [PATCH] Reformatted code via StyleCop --- .nuget/NuGet.Config | 7 +- .../AzureBlobStorage.cs | 20 +- .../AzureBlobStorageFactory.cs | 19 +- .../Properties/AssemblyInfo.cs | 15 +- .../packages.config | 11 +- Documentation/html/index.html | 12 +- Documentation/html/toc.html | 12 +- Examples/NBug.Examples.Console/Program.cs | 21 +- .../Properties/AssemblyInfo.cs | 13 +- Examples/NBug.Examples.Console/app.config | 6 +- Examples/NBug.Examples.WPF/App.xaml | 8 +- Examples/NBug.Examples.WPF/App.xaml.cs | 25 +- Examples/NBug.Examples.WPF/MainWindow.xaml | 25 +- Examples/NBug.Examples.WPF/MainWindow.xaml.cs | 40 +- .../Properties/AssemblyInfo.cs | 25 +- .../Properties/Settings.settings | 9 +- Examples/NBug.Examples.WPF/app.config | 9 +- Examples/NBug.Examples.WinForms/MainForm.cs | 51 +- Examples/NBug.Examples.WinForms/Normal.cs | 92 +-- Examples/NBug.Examples.WinForms/Program.cs | 19 +- .../Properties/AssemblyInfo.cs | 13 +- .../Properties/Settings.settings | 5 +- Examples/NBug.Examples.WinForms/app.config | 9 +- GlobalAssemblyInfo.cs | 7 +- NBug.Configurator/AboutBox.cs | 37 +- NBug.Configurator/CustomPreviewForm.cs | 89 +-- NBug.Configurator/MainForm.cs | 388 ++++++------ NBug.Configurator/NBug.Configurator.csproj | 1 + NBug.Configurator/PreviewForm.cs | 17 +- NBug.Configurator/Program.cs | 4 +- NBug.Configurator/Properties/AssemblyInfo.cs | 12 +- .../Properties/Settings.settings | 11 +- .../SubmitPanels/ISubmitPanel.cs | 4 +- NBug.Configurator/SubmitPanels/PanelLoader.cs | 52 +- .../SubmitPanels/Tracker/Redmine.cs | 32 +- NBug.Configurator/SubmitPanels/Web/Ftp.cs | 14 +- NBug.Configurator/SubmitPanels/Web/Http.cs | 9 +- NBug.Configurator/SubmitPanels/Web/Mail.cs | 69 +-- NBug.Configurator/app.config | 1 + NBug.Tests/Functional/DeveloperUITests.cs | 21 +- NBug.Tests/Functional/SettingsUITests.cs | 112 ++-- NBug.Tests/Functional/WinFormsUITests.cs | 12 +- NBug.Tests/Integration/BugReportTests.cs | 10 +- NBug.Tests/Integration/DispatcherTests.cs | 12 +- NBug.Tests/Integration/HandlerTests.cs | 19 +- NBug.Tests/Integration/SettingsTests.cs | 97 +-- NBug.Tests/Properties/AssemblyInfo.cs | 5 +- NBug.Tests/Tools/Extensions/UIAttribute.cs | 9 +- NBug.Tests/Tools/Fixtures/ReportFixture.cs | 7 +- NBug.Tests/Tools/Fixtures/SettingsFixture.cs | 26 +- NBug.Tests/Tools/Fixtures/UIFixture.cs | 6 +- .../Tools/Stubs/DummyArgumentException.cs | 11 +- .../Tools/Stubs/DummySerializableException.cs | 6 +- NBug.Tests/Unit/BugReportTests.cs | 6 +- NBug.Tests/packages.config | 7 +- NBug/Core/Reporting/BugReport.cs | 174 +++--- NBug/Core/Reporting/Feedback.cs | 7 +- NBug/Core/Reporting/Info/AssemblyInfo.cs | 4 +- NBug/Core/Reporting/Info/ConfigurationInfo.cs | 4 +- NBug/Core/Reporting/Info/GeneralInfo.cs | 7 +- NBug/Core/Reporting/Info/Report.cs | 17 +- NBug/Core/Reporting/Info/SystemInfo.cs | 4 +- NBug/Core/Reporting/MiniDump/DumpTypeFlag.cs | 68 ++- NBug/Core/Reporting/MiniDump/DumpWriter.cs | 64 +- .../Reporting/MiniDump/ExceptionFilters.cs | 186 +++--- NBug/Core/Submission/Custom/Custom.cs | 94 +-- NBug/Core/Submission/Database/Ado.cs | 8 +- NBug/Core/Submission/Database/MsSql.cs | 8 +- NBug/Core/Submission/Database/MySql.cs | 8 +- NBug/Core/Submission/Dispatcher.cs | 98 +-- NBug/Core/Submission/IProtocol.cs | 23 +- NBug/Core/Submission/IProtocolFactory.cs | 12 +- NBug/Core/Submission/ProtocolBase.cs | 42 +- NBug/Core/Submission/Tracker/BugNet.cs | 10 +- NBug/Core/Submission/Tracker/Bugzilla.cs | 4 +- NBug/Core/Submission/Tracker/GitHub.cs | 4 +- NBug/Core/Submission/Tracker/GoogleCode.cs | 4 +- NBug/Core/Submission/Tracker/Redmine.cs | 58 +- NBug/Core/Submission/Tracker/Trac.cs | 11 +- NBug/Core/Submission/Web/Ftp.cs | 30 +- NBug/Core/Submission/Web/Http.cs | 30 +- NBug/Core/Submission/Web/Mail.cs | 63 +- NBug/Core/UI/Console/ConsoleUI.cs | 7 +- NBug/Core/UI/Custom/CustomUI.cs | 67 +-- .../UI/Developer/InternalExceptionViewer.cs | 26 +- NBug/Core/UI/Developer/InternalLogViewer.cs | 52 +- NBug/Core/UI/UIDialogResult.cs | 12 +- NBug/Core/UI/UISelector.cs | 10 +- NBug/Core/UI/WPF/WPFUI.cs | 4 +- NBug/Core/UI/WinForms/Feedback.cs | 14 +- NBug/Core/UI/WinForms/Full.cs | 31 +- NBug/Core/UI/WinForms/Minimal.cs | 15 +- NBug/Core/UI/WinForms/Normal.cs | 14 +- .../UI/WinForms/Panels/ExceptionDetailView.cs | 4 +- .../UI/WinForms/Panels/ExceptionDetails.cs | 52 +- NBug/Core/UI/WinForms/WinFormsUI.cs | 4 +- NBug/Core/Util/ConnectionStringParser.cs | 18 +- NBug/Core/Util/ExceptionThread.cs | 17 +- .../Exceptions/NBugConfigurationException.cs | 4 +- NBug/Core/Util/Exceptions/NBugException.cs | 4 +- .../Util/Exceptions/NBugRuntimeException.cs | 4 +- NBug/Core/Util/Logging/Logger.cs | 44 +- NBug/Core/Util/ProtectedConfiguration.cs | 8 +- NBug/Core/Util/PublicResources.cs | 142 ++--- .../Serialization/SerializableDictionary.cs | 5 +- .../Serialization/SerializableException.cs | 49 +- NBug/Core/Util/Storage/StoragePath.cs | 5 +- NBug/Core/Util/Storage/StoredItemFile.cs | 18 +- NBug/Core/Util/Storage/Storer.cs | 49 +- NBug/Core/Util/Web/StreamUpload.cs | 153 ++--- NBug/Enums/LoggerCategory.cs | 10 +- NBug/Enums/MiniDumpType.cs | 10 +- NBug/Enums/StoragePath.cs | 10 +- NBug/Enums/UIMode.cs | 12 +- NBug/Enums/UIProvider.cs | 12 +- NBug/Events/CustomSubmissionEventArgs.cs | 63 +- NBug/Events/CustomUIEventArgs.cs | 59 +- NBug/Exceptions.cs | 33 +- NBug/Handler.cs | 123 ++-- NBug/Properties/AssemblyInfo.cs | 18 +- NBug/Properties/Settings.settings | 178 +++--- NBug/Properties/SettingsOverride.cs | 4 +- NBug/Settings.cs | 558 ++++++++++-------- NBug/app.config | 8 +- 124 files changed, 2501 insertions(+), 2050 deletions(-) diff --git a/.nuget/NuGet.Config b/.nuget/NuGet.Config index 6a318ad..8ec4187 100644 --- a/.nuget/NuGet.Config +++ b/.nuget/NuGet.Config @@ -1,6 +1,7 @@  + - - - + + + \ No newline at end of file diff --git a/Destinations/NBug.Destinations.AzureBlobStorage/AzureBlobStorage.cs b/Destinations/NBug.Destinations.AzureBlobStorage/AzureBlobStorage.cs index 9cb8b2c..96f60a5 100644 --- a/Destinations/NBug.Destinations.AzureBlobStorage/AzureBlobStorage.cs +++ b/Destinations/NBug.Destinations.AzureBlobStorage/AzureBlobStorage.cs @@ -1,14 +1,21 @@ -namespace NBug.Destinations.AzureBlobStorage +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright (c) 2011 - 2013 Teoman Soygul. Licensed under MIT license. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace NBug.Destinations.AzureBlobStorage { using System; using System.IO; + using Microsoft.WindowsAzure.Storage.Auth; using Microsoft.WindowsAzure.Storage.Blob; using NBug.Core.Reporting.Info; using NBug.Core.Submission; using NBug.Core.Util.Serialization; - + public class AzureBlobStorage : ProtocolBase { public AzureBlobStorage(string connectionString) @@ -17,9 +24,11 @@ public AzureBlobStorage(string connectionString) } public string AccountName { get; set; } - public string SharedAccessSignature { get; set; } + public string ContainerName { get; set; } + public string SharedAccessSignature { get; set; } + // Connection string format (single line) // Warning: There should be no semicolon (;) or equals sign (=) used in any field except for password. // Warning: No field value value should contain the phrase 'password=' @@ -30,12 +39,11 @@ public AzureBlobStorage(string connectionString) * ContainerName=yourcontainername; * SharedAccessSignature=sr%3Dc%26si%3D16dacb22-asdf-asdf-asdf-e58fasdff3ed%26se%3D2098-12-31T23%253A00%253A00Z%26sig%3asdfIWtlasdfb98q0Kidp%252BasdffJcRm1ulFIjyks4E%253D */ - public override bool Send(string fileName, Stream file, Report report, SerializableException exception) { - var cred = new StorageCredentials(Uri.UnescapeDataString(SharedAccessSignature)); + var cred = new StorageCredentials(Uri.UnescapeDataString(this.SharedAccessSignature)); - var blobUrl = new Uri(string.Format("https://{0}.blob.core.windows.net/{1}", AccountName, ContainerName)); + var blobUrl = new Uri(string.Format("https://{0}.blob.core.windows.net/{1}", this.AccountName, this.ContainerName)); var container = new CloudBlobContainer(blobUrl, cred); var blob = container.GetBlockBlobReference(fileName); diff --git a/Destinations/NBug.Destinations.AzureBlobStorage/AzureBlobStorageFactory.cs b/Destinations/NBug.Destinations.AzureBlobStorage/AzureBlobStorageFactory.cs index ef38018..c280257 100644 --- a/Destinations/NBug.Destinations.AzureBlobStorage/AzureBlobStorageFactory.cs +++ b/Destinations/NBug.Destinations.AzureBlobStorage/AzureBlobStorageFactory.cs @@ -1,17 +1,26 @@ -namespace NBug.Destinations.AzureBlobStorage +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright (c) 2011 - 2013 Teoman Soygul. Licensed under MIT license. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace NBug.Destinations.AzureBlobStorage { using NBug.Core.Submission; public class AzureBlobStorageFactory : IProtocolFactory { - public IProtocol FromConnectionString(string connectionString) + public string SupportedType { - return new AzureBlobStorage(connectionString); + get + { + return "AzureBlobStorage"; + } } - public string SupportedType + public IProtocol FromConnectionString(string connectionString) { - get { return "AzureBlobStorage"; } + return new AzureBlobStorage(connectionString); } } } \ No newline at end of file diff --git a/Destinations/NBug.Destinations.AzureBlobStorage/Properties/AssemblyInfo.cs b/Destinations/NBug.Destinations.AzureBlobStorage/Properties/AssemblyInfo.cs index 457dc6a..400ed2a 100644 --- a/Destinations/NBug.Destinations.AzureBlobStorage/Properties/AssemblyInfo.cs +++ b/Destinations/NBug.Destinations.AzureBlobStorage/Properties/AssemblyInfo.cs @@ -1,5 +1,12 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright (c) 2011 - 2013 Teoman Soygul. Licensed under MIT license. +// +// -------------------------------------------------------------------------------------------------------------------- + + + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following @@ -23,14 +30,12 @@ [assembly: Guid("76a52bbd-f3e7-4a18-9ca8-f506e6e4e9c4")] // Version information for an assembly consists of the following four values: -// // Major Version // Minor Version // Build Number // Revision -// // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/Destinations/NBug.Destinations.AzureBlobStorage/packages.config b/Destinations/NBug.Destinations.AzureBlobStorage/packages.config index badaaa1..40db6df 100644 --- a/Destinations/NBug.Destinations.AzureBlobStorage/packages.config +++ b/Destinations/NBug.Destinations.AzureBlobStorage/packages.config @@ -1,8 +1,9 @@  + - - - - - + + + + + \ No newline at end of file diff --git a/Documentation/html/index.html b/Documentation/html/index.html index c0666d0..f43c647 100644 --- a/Documentation/html/index.html +++ b/Documentation/html/index.html @@ -1,9 +1,9 @@  - - NBug Documentation - - + + NBug Documentation + + - - + + \ No newline at end of file diff --git a/Documentation/html/toc.html b/Documentation/html/toc.html index 2b4ec2c..228d889 100644 --- a/Documentation/html/toc.html +++ b/Documentation/html/toc.html @@ -1,9 +1,9 @@  - - Untitled Page - - + + Untitled Page + + - - + + \ No newline at end of file diff --git a/Examples/NBug.Examples.Console/Program.cs b/Examples/NBug.Examples.Console/Program.cs index 4a5e856..463487c 100644 --- a/Examples/NBug.Examples.Console/Program.cs +++ b/Examples/NBug.Examples.Console/Program.cs @@ -1,7 +1,16 @@ -namespace NBug.Examples.Console +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright (c) 2011 - 2013 Teoman Soygul. Licensed under MIT license. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace NBug.Examples.Console { using System; using System.IO; + using System.Threading.Tasks; + + using NBug.Properties; public class Program { @@ -10,13 +19,13 @@ public static void Main(string[] args) // Check to see if test application is initialized by the configurator tool if (args.Length > 0) { - FileStream stream = new FileStream(args[0], FileMode.Open, FileAccess.Read, FileShare.ReadWrite); - NBug.Properties.SettingsOverride.LoadCustomSettings(stream); + var stream = new FileStream(args[0], FileMode.Open, FileAccess.Read, FileShare.ReadWrite); + SettingsOverride.LoadCustomSettings(stream); } // Sample NBug configuration for console applications - AppDomain.CurrentDomain.UnhandledException += NBug.Handler.UnhandledException; - System.Threading.Tasks.TaskScheduler.UnobservedTaskException += NBug.Handler.UnobservedTaskException; + AppDomain.CurrentDomain.UnhandledException += Handler.UnhandledException; + TaskScheduler.UnobservedTaskException += Handler.UnobservedTaskException; Console.WriteLine("NBug now auto-handles: AppDomain.CurrentDomain.UnhandledException"); Console.WriteLine("NBug now auto-handles: Threading.Tasks.TaskScheduler.UnobservedTaskException"); @@ -29,4 +38,4 @@ public static void Main(string[] args) } } } -} +} \ No newline at end of file diff --git a/Examples/NBug.Examples.Console/Properties/AssemblyInfo.cs b/Examples/NBug.Examples.Console/Properties/AssemblyInfo.cs index 14ae91a..202996f 100644 --- a/Examples/NBug.Examples.Console/Properties/AssemblyInfo.cs +++ b/Examples/NBug.Examples.Console/Properties/AssemblyInfo.cs @@ -1,5 +1,12 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright (c) 2011 - 2013 Teoman Soygul. Licensed under MIT license. +// +// -------------------------------------------------------------------------------------------------------------------- + + + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following @@ -18,12 +25,10 @@ [assembly: Guid("9e72b2e3-590a-4ffe-8de5-ffa37efc9dd6")] // Version information for an assembly consists of the following four values: -// // Major Version // Minor Version // Build Number // Revision -// // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] \ No newline at end of file diff --git a/Examples/NBug.Examples.Console/app.config b/Examples/NBug.Examples.Console/app.config index f76deb9..3a3ac88 100644 --- a/Examples/NBug.Examples.Console/app.config +++ b/Examples/NBug.Examples.Console/app.config @@ -1,3 +1,7 @@ + - + + + + \ No newline at end of file diff --git a/Examples/NBug.Examples.WPF/App.xaml b/Examples/NBug.Examples.WPF/App.xaml index 0793102..ce69b80 100644 --- a/Examples/NBug.Examples.WPF/App.xaml +++ b/Examples/NBug.Examples.WPF/App.xaml @@ -2,7 +2,7 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> - - - - + + + + \ No newline at end of file diff --git a/Examples/NBug.Examples.WPF/App.xaml.cs b/Examples/NBug.Examples.WPF/App.xaml.cs index f32bde0..6f9c3e2 100644 --- a/Examples/NBug.Examples.WPF/App.xaml.cs +++ b/Examples/NBug.Examples.WPF/App.xaml.cs @@ -1,10 +1,19 @@ -namespace NBug.Examples.WPF +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright (c) 2011 - 2013 Teoman Soygul. Licensed under MIT license. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace NBug.Examples.WPF { using System; using System.IO; using System.Linq; + using System.Threading.Tasks; using System.Windows; + using NBug.Properties; + /// /// Interaction logic for App.xaml /// @@ -15,17 +24,17 @@ public App() // Check to see if test application is initialized by the configurator tool if (Environment.GetCommandLineArgs().Count() > 1) { - FileStream stream = new FileStream(Environment.GetCommandLineArgs()[1], FileMode.Open, FileAccess.Read, FileShare.ReadWrite); - NBug.Properties.SettingsOverride.LoadCustomSettings(stream); + var stream = new FileStream(Environment.GetCommandLineArgs()[1], FileMode.Open, FileAccess.Read, FileShare.ReadWrite); + SettingsOverride.LoadCustomSettings(stream); } // For demonstrational purposes only, normally this should be left with it's default value as false! - NBug.Settings.HandleProcessCorruptedStateExceptions = true; + Settings.HandleProcessCorruptedStateExceptions = true; // Sample NBug configuration for WPF applications - AppDomain.CurrentDomain.UnhandledException += NBug.Handler.UnhandledException; - Application.Current.DispatcherUnhandledException += NBug.Handler.DispatcherUnhandledException; - System.Threading.Tasks.TaskScheduler.UnobservedTaskException += NBug.Handler.UnobservedTaskException; + AppDomain.CurrentDomain.UnhandledException += Handler.UnhandledException; + Current.DispatcherUnhandledException += Handler.DispatcherUnhandledException; + TaskScheduler.UnobservedTaskException += Handler.UnobservedTaskException; } } -} +} \ No newline at end of file diff --git a/Examples/NBug.Examples.WPF/MainWindow.xaml b/Examples/NBug.Examples.WPF/MainWindow.xaml index 653bf1b..173eb5e 100644 --- a/Examples/NBug.Examples.WPF/MainWindow.xaml +++ b/Examples/NBug.Examples.WPF/MainWindow.xaml @@ -2,14 +2,17 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="NBug - WPF Test Application" Height="150" Width="384" WindowStartupLocation="CenterScreen"> - -