├── .gitattributes
├── .github
└── FUNDING.yml
├── .gitignore
├── Build - Release.bat
├── CHANGELOG.md
├── LICENSE.md
├── README.md
├── Signing.snk
├── UpdateFromOrigin.bat
├── appveyor.yml
└── src
├── .nuget
├── ErrorControlSystem.nuspec
├── NuGet.Config
├── NuGet.exe
├── NuGet.targets
└── nupack.bat
├── Documentation
├── ArchitectModeling
│ ├── Activity Diagram.xps
│ ├── ArchitectModeling.csproj
│ ├── DatabaseModel.dbml
│ ├── DatabaseModel.dbml.layout
│ ├── DatabaseModel.designer.cs
│ ├── ErrorControlSystem-1.png
│ ├── ErrorControlSystem-2.png
│ ├── ExceptionDetails.xls
│ ├── Properties
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ └── Using a .NET 4 Based DLL From a .NET 2 Based Application.docx
└── Readme
│ ├── Readme.html
│ ├── images
│ ├── Error Control System.png
│ ├── body-bg.png
│ ├── highlight-bg.jpg
│ ├── hr.png
│ ├── octocat-icon.png
│ ├── tar-gz-icon.png
│ └── zip-icon.png
│ ├── javascripts
│ └── main.js
│ ├── params.json
│ └── stylesheets
│ ├── print.css
│ ├── pygment_trac.css
│ └── stylesheet.css
├── Error Control System
├── ErrorControlSystem
│ ├── CacheErrors
│ │ ├── CacheController.cs
│ │ ├── SqlCompactEditionManager.cs
│ │ ├── StoragePaths.cs
│ │ └── StorageRouter.cs
│ ├── DbConnectionManager
│ │ ├── CMClassDiagram.cd
│ │ ├── Connection.cs
│ │ ├── ConnectionCollection.cs
│ │ ├── ConnectionManager.cs
│ │ └── StringCipher.cs
│ ├── EHEClassDiagram.cd
│ ├── Engine.cs
│ ├── ErrorControlSystem.csproj
│ ├── ErrorHandlingOption.cs
│ ├── ErrorHandlingOptions.cs
│ ├── ExceptionHandler.cs
│ ├── Filter.cs
│ ├── Fonts
│ │ ├── consola.ttf
│ │ ├── consolab.ttf
│ │ ├── consolai.ttf
│ │ ├── consolaz.ttf
│ │ └── simpfxo.ttf
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── GlobalAssemblyInfo.cs
│ │ ├── Localization.Designer.cs
│ │ ├── Localization.ar.Designer.cs
│ │ ├── Localization.ar.resx
│ │ ├── Localization.az.Designer.cs
│ │ ├── Localization.az.resx
│ │ ├── Localization.de.Designer.cs
│ │ ├── Localization.de.resx
│ │ ├── Localization.fa-IR.Designer.cs
│ │ ├── Localization.fa-IR.resx
│ │ ├── Localization.fr-FR.Designer.cs
│ │ ├── Localization.fr-FR.resx
│ │ ├── Localization.he.Designer.cs
│ │ ├── Localization.he.resx
│ │ ├── Localization.resx
│ │ ├── Localization.ru-RU.Designer.cs
│ │ ├── Localization.ru-RU.resx
│ │ ├── Localization.tr-TR.Designer.cs
│ │ ├── Localization.tr-TR.resx
│ │ ├── Localization.zh-CN.Designer.cs
│ │ ├── Localization.zh-CN.resx
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── Resources
│ │ ├── EmbeddedAssembly.cs
│ │ └── ErrorControlSystem.ico
│ ├── ServerController
│ │ ├── DatabaseCreatorQuery.sql
│ │ ├── ServerTransmitter.cs
│ │ ├── SqlServerManager.cs
│ │ └── TablesAndSPsCreatorQuery.sql
│ ├── Shared
│ │ ├── CodeMapEventArgs.cs
│ │ ├── CodeScope.cs
│ │ ├── CurrentProcesses.cs
│ │ ├── Error.cs
│ │ ├── IError.cs
│ │ ├── NetworkHelper.cs
│ │ ├── OperationSystem.cs
│ │ ├── OperationSystemInfo.cs
│ │ ├── ProcessFlow.cs
│ │ ├── ProxyError.cs
│ │ ├── ScreenCapture.cs
│ │ └── UI
│ │ │ ├── Developer
│ │ │ ├── ExceptionViewer.xaml
│ │ │ └── ExceptionViewer.xaml.cs
│ │ │ └── ExceptionMapper
│ │ │ ├── MessageBlock.xaml
│ │ │ ├── MessageBlock.xaml.cs
│ │ │ ├── StackFrameBlock.xaml
│ │ │ ├── StackFrameBlock.xaml.cs
│ │ │ ├── StackTraceBlock.cs
│ │ │ ├── TreeMap.xaml
│ │ │ ├── TreeMap.xaml.cs
│ │ │ ├── TreeMapItem.cs
│ │ │ └── TreeMapItemMode.cs
│ ├── UnhandledErrorEventArgs.cs
│ ├── app.config
│ └── packages.config
└── ErrorControlSystemAdapter
│ ├── ErrorControlSystemAdapter.csproj
│ ├── ErrorHandlerAdapter.cs
│ ├── IErrorHandlerAdapter.cs
│ └── app.manifest
├── Error Log Analyzer
├── ErrorLogAnalyzer
│ ├── BaseForm.cs
│ ├── DataGridViewHelper.cs
│ ├── DatabaseConfigurationForm.Designer.cs
│ ├── DatabaseConfigurationForm.cs
│ ├── DatabaseConfigurationForm.resx
│ ├── ErrorDataGridView.cs
│ ├── ErrorLogAnalyzer.csproj
│ ├── LogReader.Designer.cs
│ ├── LogReader.cs
│ ├── LogReader.resx
│ ├── Program.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ └── Resources.resx
│ └── Resources
│ │ ├── Disable.png
│ │ ├── Enable.png
│ │ ├── MicrosoftSQLServerLogo.png
│ │ └── null.gif
├── Windows.Forms.HintTextBox
│ ├── HintTextBox.cs
│ ├── MathParser.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── Windows.Forms.HintTextBox.csproj
├── Windows.Forms.ImageBox
│ ├── BehzadPublic.snk
│ ├── ImageBox.bmp
│ ├── ImageBox.cs
│ ├── ImageBoxActionSources.cs
│ ├── ImageBoxBorderStyle.cs
│ ├── ImageBoxCancelEventArgs.cs
│ ├── ImageBoxGridDisplayMode.cs
│ ├── ImageBoxGridScale.cs
│ ├── ImageBoxNativeMethods.cs
│ ├── ImageBoxSelectionMode.cs
│ ├── ImageBoxSizeMode.cs
│ ├── ImageBoxZoomActions.cs
│ ├── ImageBoxZoomEventArgs.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── ScrollControl.cs
│ ├── ScrollProperties.cs
│ ├── VirtualScrollableControl.cs
│ ├── Windows.Forms.ImageBox.csproj
│ └── ZoomLevelCollection.cs
├── Windows.Forms.ProcessBar
│ ├── ProcessBar.cs
│ ├── ProgressBarDisplayText.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── Windows.Forms.ProcessBar.csproj
└── Windows.WpfAnimatedWaitSplash
│ ├── AnimationCache.cs
│ ├── Decoding
│ ├── GifApplicationExtension.cs
│ ├── GifBlock.cs
│ ├── GifBlockKind.cs
│ ├── GifColor.cs
│ ├── GifCommentExtension.cs
│ ├── GifDecoderException.cs
│ ├── GifExtension.cs
│ ├── GifFile.cs
│ ├── GifFrame.cs
│ ├── GifGraphicControlExtension.cs
│ ├── GifHeader.cs
│ ├── GifHelpers.cs
│ ├── GifImageData.cs
│ ├── GifImageDescriptor.cs
│ ├── GifLogicalScreenDescriptor.cs
│ ├── GifPlainTextExtension.cs
│ └── GifTrailer.cs
│ ├── Fonts
│ ├── digital-7 (italic).ttf
│ └── digital-7.ttf
│ ├── ImageAnimationController.cs
│ ├── ImageBehavior.cs
│ ├── Properties
│ └── AssemblyInfo.cs
│ ├── WaitSplash
│ ├── Splash.xaml
│ ├── Splash.xaml.cs
│ ├── ajax_loader_metal_300.gif
│ └── loader.gif
│ └── Windows.WpfAnimatedWaitSplash.csproj
├── ErrorControlSystem.sln
├── Examples
├── ErrorControlSystem.Examples.Console
│ ├── App.config
│ ├── ErrorControlSystem.Examples.Console.csproj
│ ├── Program.cs
│ └── Properties
│ │ └── AssemblyInfo.cs
├── ErrorControlSystem.Examples.VisualBasicWinForms
│ ├── App.config
│ ├── ErrorControlSystem.Examples.VisualBasicWinForms.vbproj
│ ├── Form1.Designer.vb
│ ├── Form1.vb
│ ├── MainModule.vb
│ └── My Project
│ │ ├── Application.Designer.vb
│ │ ├── Application.myapp
│ │ ├── AssemblyInfo.vb
│ │ ├── Resources.Designer.vb
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.vb
│ │ ├── Settings.settings
│ │ └── app.manifest
├── ErrorControlSystem.Examples.WPF
│ ├── App.config
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── ErrorControlSystem.Examples.WPF.csproj
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ └── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
├── ErrorControlSystem.Examples.WinForms
│ ├── App.config
│ ├── ErrorControlSystem.Examples.WinForms.csproj
│ ├── Program.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Settings.Designer.cs
│ │ ├── Settings.settings
│ │ └── app.manifest
│ └── SomeNamespace
│ │ ├── FormTest.Designer.cs
│ │ ├── FormTest.cs
│ │ └── FormTest.resx
└── ErrorControlSystem.Examples.WinFormsDotNet2
│ ├── ErrorControlSystem.Examples.WinFormsDotNet2.csproj
│ ├── Form1.Designer.cs
│ ├── Form1.cs
│ ├── Program.cs
│ ├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
│ ├── app.config
│ └── app.manifest
└── Tests
├── ErrorControlSystem.Shared.UI.ExceptionMapper.Tests
├── App.config
├── App.xaml
├── App.xaml.cs
├── ErrorControlSystem.Shared.UI.ExceptionMapper.Tests.csproj
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── TestClassA.cs
├── TestClassB.cs
├── TestClassC.cs
├── TestClassD.cs
├── TestClassE.cs
└── TestClassF.cs
└── ErrorControlSystem.Tests
├── DbConnectionManager
└── UnitTest.cs
├── ErrorControlSystem.Tests.csproj
├── Properties
└── AssemblyInfo.cs
├── Shared
└── ScreenCaptureUnitTest.cs
└── TestTools.cs
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4 | patreon: # Replace with a single Patreon username
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: # Replace with a single Ko-fi username
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
13 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.sln.docstates
8 |
9 | # Build results
10 |
11 | [Dd]ebug/
12 | [Rr]elease/
13 | x64/
14 | build/
15 | [Bb]in/
16 | [Oo]bj/
17 | [Oo]ut/
18 | [Nn]uGetPackages/
19 |
20 |
21 | # Disable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
22 | [Pp]ackages/
23 |
24 | # MSTest test Results
25 | [Tt]est[Rr]esult*/
26 | [Bb]uild[Ll]og.*
27 |
28 | *_i.c
29 | *_p.c
30 | *.ilk
31 | *.meta
32 | *.obj
33 | *.pch
34 | *.pdb
35 | *.pgc
36 | *.pgd
37 | *.rsp
38 | *.sbr
39 | *.tlb
40 | *.tli
41 | *.tlh
42 | *.tmp
43 | *.tmp_proj
44 | *.log
45 | *.vspscc
46 | *.vssscc
47 | .builds
48 | *.pidb
49 | *.log
50 | *.scc
51 |
52 | # Visual C++ cache files
53 | ipch/
54 | *.aps
55 | *.ncb
56 | *.opensdf
57 | *.sdf
58 | *.cachefile
59 |
60 | # Visual Studio profiler
61 | *.psess
62 | *.vsp
63 | *.vspx
64 |
65 | # Guidance Automation Toolkit
66 | *.gpState
67 |
68 | # ReSharper is a .NET coding add-in
69 | _ReSharper*/
70 | *.[Rr]e[Ss]harper
71 |
72 | # TeamCity is a build add-in
73 | _TeamCity*
74 |
75 | # DotCover is a Code Coverage Tool
76 | *.dotCover
77 |
78 | # NCrunch
79 | *.ncrunch*
80 | .*crunch*.local.xml
81 |
82 | # Installshield output folder
83 | [Ee]xpress/
84 |
85 | # DocProject is a documentation generator add-in
86 | DocProject/buildhelp/
87 | DocProject/Help/*.HxT
88 | DocProject/Help/*.HxC
89 | DocProject/Help/*.hhc
90 | DocProject/Help/*.hhk
91 | DocProject/Help/*.hhp
92 | DocProject/Help/Html2
93 | DocProject/Help/html
94 |
95 | # Click-Once directory
96 | publish/
97 |
98 | # Publish Web Output
99 | *.Publish.xml
100 |
101 | # NuGet Packages Directory
102 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line
103 | #packages/
104 |
105 | # Windows Azure Build Output
106 | csx
107 | *.build.csdef
108 |
109 | # Windows Store app package directory
110 | AppPackages/
111 |
112 | # Others
113 | sql/
114 | *.Cache
115 | ClientBin/
116 | [Ss]tyle[Cc]op.*
117 | ~$*
118 | *~
119 | *.dbmdl
120 | *.[Pp]ublish.xml
121 | *.pfx
122 | *.publishsettings
123 |
124 | # RIA/Silverlight projects
125 | Generated_Code/
126 |
127 | # Backup & report files from converting an old project file to a newer
128 | # Visual Studio version. Backup files are not needed, because we have git ;-)
129 | _UpgradeReport_Files/
130 | Backup*/
131 | UpgradeLog*.XML
132 | UpgradeLog*.htm
133 |
134 | # SQL Server files
135 | App_Data/*.mdf
136 | App_Data/*.ldf
137 |
138 |
139 | #LightSwitch generated files
140 | GeneratedArtifacts/
141 | _Pvt_Extensions/
142 | ModelManifest.xml
143 |
144 | # =========================
145 | # Windows detritus
146 | # =========================
147 |
148 | # Windows image file caches
149 | Thumbs.db
150 | ehthumbs.db
151 |
152 | # Folder config file
153 | Desktop.ini
154 |
155 | # Recycle Bin used on file shares
156 | $RECYCLE.BIN/
157 |
158 | # Mac desktop service store files
159 | .DS_Store
160 |
161 | # UnitTest fakes assembly
162 | *.Fakes.dll
163 | *.Fakes.fakesconfig
164 | *.Fakes.messages
165 | *.Fakes.xml
166 |
--------------------------------------------------------------------------------
/Build - Release.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | IF NOT "%VS110COMNTOOLS%" == "" (call "%VS110COMNTOOLS%vsvars32.bat")
4 | IF NOT "%VS120COMNTOOLS%" == "" (call "%VS120COMNTOOLS%vsvars32.bat")
5 | IF NOT "%VS130COMNTOOLS%" == "" (call "%VS130COMNTOOLS%vsvars32.bat")
6 | IF NOT "%VS140COMNTOOLS%" == "" (call "%VS140COMNTOOLS%vsvars32.bat")
7 |
8 | for /F %%A in ('dir /b src\*.sln') do call devenv src\%%A /Rebuild "Release"
9 | pause
--------------------------------------------------------------------------------
/Signing.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/Signing.snk
--------------------------------------------------------------------------------
/UpdateFromOrigin.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | Echo Start Updating ...
3 |
4 | git checkout master
5 | git fetch
6 | git status
7 | git pull
8 |
9 | Echo Update Completed.
10 |
11 | Echo ---------------------------------------------
12 |
13 | Echo Start Building Project ...
14 |
15 | IF NOT "%VS110COMNTOOLS%" == "" (call "%VS110COMNTOOLS%vsvars32.bat")
16 | IF NOT "%VS120COMNTOOLS%" == "" (call "%VS120COMNTOOLS%vsvars32.bat")
17 | IF NOT "%VS130COMNTOOLS%" == "" (call "%VS130COMNTOOLS%vsvars32.bat")
18 | IF NOT "%VS140COMNTOOLS%" == "" (call "%VS140COMNTOOLS%vsvars32.bat")
19 |
20 | for /F %%A in ('dir /b src\*.sln') do call devenv src\%%A /Rebuild "Release"
21 |
22 | Echo ---------------------------------------------
23 | pause
--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
1 | image: Visual Studio 2017
2 | configuration: Release
3 | platform: Any CPU
4 | before_build:
5 | - cmd: nuget restore .\src\
6 | build:
7 | verbosity: normal
--------------------------------------------------------------------------------
/src/.nuget/NuGet.Config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/.nuget/NuGet.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/.nuget/NuGet.exe
--------------------------------------------------------------------------------
/src/.nuget/nupack.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | Echo ---------------------- Build Start -------------------------------------
3 |
4 | IF NOT "%VS110COMNTOOLS%" == "" (call "%VS110COMNTOOLS%vsvars32.bat")
5 | IF NOT "%VS120COMNTOOLS%" == "" (call "%VS120COMNTOOLS%vsvars32.bat")
6 | IF NOT "%VS130COMNTOOLS%" == "" (call "%VS130COMNTOOLS%vsvars32.bat")
7 | IF NOT "%VS140COMNTOOLS%" == "" (call "%VS140COMNTOOLS%vsvars32.bat")
8 |
9 | for /F %%A in ('dir /b ..\*.sln') do call devenv ..\%%A /Rebuild "Release"
10 |
11 | Echo ------------------------------------------------------------------------
12 |
13 | Echo ---------------------- Nuget Packaging ---------------------------------
14 |
15 | mkdir ..\..\NuGetPackages 2> NUL
16 | nuget pack -OutputDirectory ..\..\NuGetPackages ErrorControlSystem.nuspec
17 |
18 | pause
--------------------------------------------------------------------------------
/src/Documentation/ArchitectModeling/Activity Diagram.xps:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Documentation/ArchitectModeling/Activity Diagram.xps
--------------------------------------------------------------------------------
/src/Documentation/ArchitectModeling/DatabaseModel.dbml.layout:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/Documentation/ArchitectModeling/ErrorControlSystem-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Documentation/ArchitectModeling/ErrorControlSystem-1.png
--------------------------------------------------------------------------------
/src/Documentation/ArchitectModeling/ErrorControlSystem-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Documentation/ArchitectModeling/ErrorControlSystem-2.png
--------------------------------------------------------------------------------
/src/Documentation/ArchitectModeling/ExceptionDetails.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Documentation/ArchitectModeling/ExceptionDetails.xls
--------------------------------------------------------------------------------
/src/Documentation/ArchitectModeling/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.34014
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ArchitectModeling.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 |
26 | [global::System.Configuration.ApplicationScopedSettingAttribute()]
27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28 | [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
29 | [global::System.Configuration.DefaultSettingValueAttribute("Data Source=.;Initial Catalog=UsersManagements;Integrated Security=True")]
30 | public string UsersManagementsConnectionString {
31 | get {
32 | return ((string)(this["UsersManagementsConnectionString"]));
33 | }
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/Documentation/ArchitectModeling/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | <?xml version="1.0" encoding="utf-16"?>
7 | <SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
8 | <ConnectionString>Data Source=.;Initial Catalog=UsersManagements;Integrated Security=True</ConnectionString>
9 | <ProviderName>System.Data.SqlClient</ProviderName>
10 | </SerializableConnectionString>
11 | Data Source=.;Initial Catalog=UsersManagements;Integrated Security=True
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/Documentation/ArchitectModeling/Using a .NET 4 Based DLL From a .NET 2 Based Application.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Documentation/ArchitectModeling/Using a .NET 4 Based DLL From a .NET 2 Based Application.docx
--------------------------------------------------------------------------------
/src/Documentation/Readme/images/Error Control System.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Documentation/Readme/images/Error Control System.png
--------------------------------------------------------------------------------
/src/Documentation/Readme/images/body-bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Documentation/Readme/images/body-bg.png
--------------------------------------------------------------------------------
/src/Documentation/Readme/images/highlight-bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Documentation/Readme/images/highlight-bg.jpg
--------------------------------------------------------------------------------
/src/Documentation/Readme/images/hr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Documentation/Readme/images/hr.png
--------------------------------------------------------------------------------
/src/Documentation/Readme/images/octocat-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Documentation/Readme/images/octocat-icon.png
--------------------------------------------------------------------------------
/src/Documentation/Readme/images/tar-gz-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Documentation/Readme/images/tar-gz-icon.png
--------------------------------------------------------------------------------
/src/Documentation/Readme/images/zip-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Documentation/Readme/images/zip-icon.png
--------------------------------------------------------------------------------
/src/Documentation/Readme/javascripts/main.js:
--------------------------------------------------------------------------------
1 | console.log('This would be the main JS file.');
2 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/CacheErrors/StoragePaths.cs:
--------------------------------------------------------------------------------
1 | namespace ErrorControlSystem.CacheErrors
2 | {
3 | public enum StoragePaths
4 | {
5 | ///
6 | /// %Temp% directory is the default storage. Usually set to 'C:\Documents and Settings\Username\AppData\Local\AppName AppVersion'.
7 | ///
8 | LocalApplicationData,
9 |
10 | ///
11 | /// %Temp% directory is the default storage. Usually set to 'C:\Documents and Settings\Username\Local Settings\Temp\AppName AppVersion'.
12 | ///
13 | WindowsTemp,
14 |
15 | ///
16 | /// Initial working directory, i.e. where the executing assembly (MyProduct.exe) is located.
17 | ///
18 | CurrentDirectory,
19 |
20 | ///
21 | /// Custom path should be a full path like 'C:\Documents and Settings\MyUser\Local Settings\Temp'.
22 | ///
23 | /// Path should not have a trailing slash. If the directory doesn't exist, it is created first.
24 | Custom,
25 |
26 | ///
27 | /// The internet cache path
28 | ///
29 | InternetCache
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/DbConnectionManager/CMClassDiagram.cd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | ACAiAAAAAAAgGAYEQAQAAAwAAACACAAGCCEAohIVABA=
40 | DbConnectionManager\Connection.cs
41 |
42 |
43 |
44 |
45 |
46 |
47 | ACIAAABAACAACgAACAAABAQAAAAIAAAAAAAAAABQIAA=
48 | DbConnectionManager\ConnectionCollection.cs
49 |
50 |
51 |
52 |
53 |
54 |
55 | AAKQAAAJACCAICFQYBAEBWQAAAAsAADTCCAAJACEASA=
56 | DbConnectionManager\ConnectionManager.cs
57 |
58 |
59 |
60 |
61 |
62 |
63 | AQAAAAAAAIAAAAAYACAAIAAAAAAAAAAAAAAAAAAAAAA=
64 | DbConnectionManager\StringCipher.cs
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/DbConnectionManager/StringCipher.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Security.Cryptography;
4 | using System.Text;
5 |
6 | namespace ErrorControlSystem.DbConnectionManager
7 | {
8 | public static class StringCipher
9 | {
10 | // ReSharper disable once InconsistentNaming
11 | private const string SALT_PASSWORD = @"C#1989Behzad3Kh9";
12 |
13 | public static string PublicPassword = @"H\,g,d@13";
14 |
15 | // This constant string is used as a "salt" value for the PasswordDeriveBytes function calls.
16 | // This size of the IV (in bytes) must = (key-size / 8). Default key-size is 256, so the IV must be
17 | // 32 bytes long. Using a 16 character string here gives us 32 bytes when converted to a byte array.
18 | private static readonly byte[] InitVectorBytes = Encoding.ASCII.GetBytes(SALT_PASSWORD);
19 |
20 | // This constant is used to determine the key-size of the encryption algorithm.
21 | private const int KeySize = 256;
22 |
23 | public static string Encrypt(this string plainText, string passPhrase)
24 | {
25 | var plainTextBytes = Encoding.UTF8.GetBytes(plainText);
26 | using (var password = new PasswordDeriveBytes(passPhrase, null))
27 | {
28 | #pragma warning disable 618
29 | var keyBytes = password.GetBytes(KeySize / 8);
30 | #pragma warning restore 618
31 | using (var symmetricKey = new RijndaelManaged { Mode = CipherMode.CBC })
32 | using (var encryptor = symmetricKey.CreateEncryptor(keyBytes, InitVectorBytes))
33 | using (var memoryStream = new MemoryStream())
34 | using (var cryptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Write))
35 | {
36 | cryptoStream.Write(plainTextBytes, 0, plainTextBytes.Length);
37 | cryptoStream.FlushFinalBlock();
38 | var cipherTextBytes = memoryStream.ToArray();
39 | return Convert.ToBase64String(cipherTextBytes);
40 | }
41 | }
42 | }
43 |
44 | public static string Decrypt(this string cipherText, string passPhrase)
45 | {
46 | var cipherTextBytes = Convert.FromBase64String(cipherText);
47 | using (var password = new PasswordDeriveBytes(passPhrase, null))
48 | {
49 | #pragma warning disable 618
50 | var keyBytes = password.GetBytes(KeySize / 8);
51 | #pragma warning restore 618
52 | using (var symmetricKey = new RijndaelManaged { Mode = CipherMode.CBC })
53 | using (var decryptor = symmetricKey.CreateDecryptor(keyBytes, InitVectorBytes))
54 | using (var memoryStream = new MemoryStream(cipherTextBytes))
55 | using (var cryptoStream = new CryptoStream(memoryStream, decryptor, CryptoStreamMode.Read))
56 | {
57 | var plainTextBytes = new byte[cipherTextBytes.Length];
58 | var decryptedByteCount = cryptoStream.Read(plainTextBytes, 0, plainTextBytes.Length);
59 | return Encoding.UTF8.GetString(plainTextBytes, 0, decryptedByteCount);
60 | }
61 | }
62 | }
63 |
64 | public static string Encrypt(this string plainText)
65 | {
66 | return plainText.Encrypt(PublicPassword);
67 | }
68 |
69 | public static string Decrypt(this string cipherText)
70 | {
71 | return cipherText.Decrypt(PublicPassword);
72 | }
73 | }
74 | }
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/ErrorHandlingOptions.cs:
--------------------------------------------------------------------------------
1 | namespace ErrorControlSystem
2 | {
3 | using System;
4 | using System.Runtime.InteropServices;
5 |
6 |
7 | ///
8 | /// Specifies the application elements on which it is valid to apply an attribute.
9 | ///
10 | /// 2
11 | [ComVisible(true)]
12 | [Flags]
13 | [Serializable]
14 | public enum ErrorHandlingOptions
15 | {
16 | None = 0,
17 | All = 0xFFFF, // Combined value of all
18 |
19 | DisplayUnhandledExceptions = 1,
20 | ReportHandledExceptions = 2,
21 | Snapshot = 4,
22 | FetchServerDateTime = 8,
23 | ResizeSnapshots = 16,
24 | EnableNetworkSending = 32,
25 | FilterExceptions = 64,
26 | ExitApplicationImmediately = 128,
27 | HandleProcessCorruptedStateExceptions = 256,
28 | DisplayDeveloperUI = 512,
29 | LogOnTheFly = 1024, // log without caching
30 |
31 |
32 | Default = All & ~ExitApplicationImmediately & ~HandleProcessCorruptedStateExceptions
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Filter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Linq;
5 | using ErrorControlSystem.Shared;
6 |
7 | namespace ErrorControlSystem
8 | {
9 | public static partial class ExceptionHandler
10 | {
11 | public static class Filter
12 | {
13 | #region Properties
14 |
15 | ///
16 | /// List of exceptions that happen but not logs.
17 | ///
18 | public static List ExemptedExceptionTypes = new List();
19 |
20 | ///
21 | /// List of the exception types that do not have a screen capture.
22 | ///
23 | public static List NonSnapshotExceptionTypes = new List();
24 |
25 | ///
26 | /// Dictionary of key/value data that will be stored in exceptions as additional data.
27 | ///
28 | public static Dictionary AttachExtraData = Error.DicExtraData;
29 |
30 | ///
31 | /// List of exempted code places to do not raise error logs
32 | ///
33 | public static List ExemptedCodeScopes = new List();
34 |
35 | ///
36 | /// The just raise error from these code scope collection.
37 | /// Do not raise any exception in other code places.
38 | ///
39 | public static List JustRaiseErrorCodeScopes = new List();
40 |
41 | #endregion
42 |
43 | ///
44 | /// Determines whether the specified exp is filtering.
45 | ///
46 | /// The exp.
47 | /// array
48 | /// has snapshot or not?
49 | ///
50 | public static bool IsFiltering(Exception exp, StackFrame[] callStackFrames, out bool snapshot)
51 | {
52 | snapshot = ErrorHandlingOption.Snapshot;
53 |
54 | if (ErrorHandlingOption.FilterExceptions)
55 | {
56 | //
57 | // Find exception type:
58 | var expType = exp.GetType();
59 | //
60 | // Is exception within non-snapshot list? (yes => remove snapshot option)
61 | if (NonSnapshotExceptionTypes.Any(x => x == expType))
62 | snapshot = false;
63 | //
64 | // Is exception in exempted list?
65 | if (ExemptedExceptionTypes.Any(x => x == expType) ||
66 | ExemptedCodeScopes.Any(x => x.IsCallFromThisPlace(callStackFrames)))
67 | return true;
68 | //
69 | // Must be exception occurred from these code scopes to that raised by handler.
70 | if (JustRaiseErrorCodeScopes.Count > 0 &&
71 | !JustRaiseErrorCodeScopes.Any(x => x.IsCallFromThisPlace(callStackFrames)))
72 | return true;
73 | }
74 |
75 | if (ErrorHandlingOption.CacheCodeScope.IsCallFromThisPlace(callStackFrames))
76 | return true;
77 |
78 | return false;
79 | }
80 | }
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Fonts/consola.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Error Control System/ErrorControlSystem/Fonts/consola.ttf
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Fonts/consolab.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Error Control System/ErrorControlSystem/Fonts/consolab.ttf
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Fonts/consolai.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Error Control System/ErrorControlSystem/Fonts/consolai.ttf
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Fonts/consolaz.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Error Control System/ErrorControlSystem/Fonts/consolaz.ttf
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Fonts/simpfxo.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Error Control System/ErrorControlSystem/Fonts/simpfxo.ttf
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("ErrorControlSystem")]
8 | [assembly: AssemblyDescription("Error Control System Created by [Mr. Behzad Khosravifar](mailto:Behzad.Khosravifar@gmail.com)")]
9 | [assembly: AssemblyCulture("")]
10 |
11 | // Setting ComVisible to false makes the types in this assembly not visible
12 | // to COM components. If you need to access a type in this assembly from
13 | // COM, set the ComVisible attribute to true on that type.
14 | [assembly: ComVisible(true)]
15 |
16 | // The following GUID is for the ID of the typelib if this project is exposed to COM
17 | [assembly: Guid("8afb3bd9-eb63-4651-8bc3-003d6d83b5b0")]
18 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Properties/GlobalAssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2014 - 2015 Behzad Khosravifar. Licensed under GNU General Public License, Version 3.0. .
4 | //
5 | // --------------------------------------------------------------------------------------------------------------------
6 |
7 | using System;
8 | using System.Reflection;
9 |
10 | // General Information about an assembly is controlled through the following
11 | // set of attributes. Change these attribute values to modify the information
12 | // associated with an assembly.
13 | [assembly: AssemblyCompany("Mr.Behzad Khosravifar")]
14 | [assembly: AssemblyProduct("ErrorControlSystem")]
15 | [assembly: AssemblyCopyright("Copyright © 2014-2015 Behzad Khosravifar Corporation.")]
16 | [assembly: AssemblyTrademark("B.B")]
17 |
18 | #if DEBUG
19 | [assembly: AssemblyConfiguration("Debug")]
20 | #else
21 | [assembly: AssemblyConfiguration("Release")]
22 | #endif
23 |
24 | /*
25 | * Basic rules to become CLS compilant is below:
26 | * 1. Unsigned types should not be part of the public interface of the class. What this means is public fields should not
27 | * have unsigned types like uint or ulong, public methods should not return unsigned types, parameters passed to public
28 | * function should not have unsigned types. However unsigned types can be part of private members.
29 | * 2. Unsafe types like pointers should not be used with public members. However they can be used with private members.
30 | * 3. Class names and member names should not differ only based on their case. For example we cannot have two methods
31 | * named MyMethod and MYMETHOD.
32 | * 4. Only properties and methods may be overloaded, Operators should not be overloaded.
33 | */
34 | //[assembly: CLSCompliant(true)]
35 |
36 | // Version information for an assembly consists of the following four values:
37 | // Major Version
38 | // Minor Version
39 | // Build Number
40 | // Revision
41 | // You can specify all the values or you can default the Build and Revision Numbers
42 | // by using the '*' as shown below:
43 | // [assembly: AssemblyVersion("1.0.*")]
44 | [assembly: System.Reflection.AssemblyVersion("4.2.3")]
45 |
46 | // This is also assigned to 'AssemblyInformationalVersion' which is the product version
47 | // Standard Way: [major].[minor].[bugfix].[build]
48 | // .NET Convention: Third digit is the auto-incremented build version. Fourth digit is revision, which is service pack no
49 | [assembly: System.Reflection.AssemblyFileVersion("4.2.3")]
50 | /*
51 | * AssemblyVersion should only be changed for major changes or breaking changes since any change to the
52 | * AssemblyVersion would force every .NET application referencing the assembly to re-compile against the
53 | * new version!
54 | *
55 | * Do not change the AssemblyVersion for a servicing release which is intended to be backwards compatible.
56 | * Do change the AssemblyVersion for a release that you know has breaking changes.
57 | *
58 | * Remember that it’s the AssemblyFileVersion that contains all the interesting servicing information
59 | * (it’s the Revision part of this version that tells you what Service Pack you’re on)
60 | */
61 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Properties/Localization.ar.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Error Control System/ErrorControlSystem/Properties/Localization.ar.Designer.cs
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Properties/Localization.az.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Error Control System/ErrorControlSystem/Properties/Localization.az.Designer.cs
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Properties/Localization.de.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Error Control System/ErrorControlSystem/Properties/Localization.de.Designer.cs
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Properties/Localization.fa-IR.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Error Control System/ErrorControlSystem/Properties/Localization.fa-IR.Designer.cs
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Properties/Localization.fr-FR.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Error Control System/ErrorControlSystem/Properties/Localization.fr-FR.Designer.cs
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Properties/Localization.he.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Error Control System/ErrorControlSystem/Properties/Localization.he.Designer.cs
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Properties/Localization.ru-RU.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Error Control System/ErrorControlSystem/Properties/Localization.ru-RU.Designer.cs
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Properties/Localization.tr-TR.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Error Control System/ErrorControlSystem/Properties/Localization.tr-TR.Designer.cs
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Properties/Localization.zh-CN.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Error Control System/ErrorControlSystem/Properties/Localization.zh-CN.Designer.cs
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.34014
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ErrorControlSystem.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ErrorControlSystem.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
65 | ///
66 | internal static System.Drawing.Icon error_control_system {
67 | get {
68 | object obj = ResourceManager.GetObject("error_control_system", resourceCulture);
69 | return ((System.Drawing.Icon)(obj));
70 | }
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 4194304
10 |
11 |
12 | LocalApplicationData
13 |
14 |
15 | True
16 |
17 |
18 | False
19 |
20 |
21 | Continue
22 |
23 |
24 | True
25 |
26 |
27 | True
28 |
29 |
30 |
31 |
32 |
33 | True
34 |
35 |
36 | True
37 |
38 |
39 | True
40 |
41 |
42 | True
43 |
44 |
45 | True
46 |
47 |
48 | False
49 |
50 |
51 | 500
52 |
53 |
54 | 100
55 |
56 |
57 | False
58 |
59 |
60 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Resources/ErrorControlSystem.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Error Control System/ErrorControlSystem/Resources/ErrorControlSystem.ico
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/ServerController/DatabaseCreatorQuery.sql:
--------------------------------------------------------------------------------
1 | Declare @logPath nvarchar(256),
2 | @dataPath nvarchar(256),
3 | @dbName nvarchar(256);
4 |
5 | SET @dbName = '#DatabaseName'
6 |
7 | SET @logPath = (select
8 | LEFT(physical_name, LEN(physical_name) - CHARINDEX('\', REVERSE(physical_name)) + 1)
9 | from sys.master_files
10 | where name = 'modellog') + @dbName + '.ldf'
11 |
12 | SET @dataPath = (select
13 | LEFT(physical_name, LEN(physical_name) - CHARINDEX('\', REVERSE(physical_name)) + 1)
14 | from sys.master_files
15 | where name = 'modeldev') + @dbName + '_log.mdf'
16 |
17 |
18 | IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = @dbName)
19 | BEGIN
20 | DECLARE @createDatabase NVARCHAR(MAX)
21 | SET @createDatabase = 'CREATE DATABASE [' + @dbName + '] ON PRIMARY
22 | ( NAME = N''' + @dbName + ''', FILENAME = N''' + @dataPath + ''', SIZE = 51200KB , FILEGROWTH = 10240KB )
23 | LOG ON
24 | ( NAME = N''' + @dbName + '' + '_log'' , FILENAME = N''' + @logPath + ''' , SIZE = 5120KB , FILEGROWTH = 5120KB )'
25 |
26 | EXEC sp_executesql @createDatabase
27 | END
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Shared/CodeMapEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace ErrorControlSystem.Shared
9 | {
10 | public delegate void CodeMapEventHandler(Object sender, CodeMapEventArgs e);
11 |
12 |
13 | [Serializable]
14 | public class CodeMapEventArgs : EventArgs
15 | {
16 | public CodeMapEventArgs(CodeScope address)
17 | {
18 | CodeAddress = address;
19 | }
20 |
21 |
22 | #region Properties
23 |
24 | public CodeScope CodeAddress { get; set; }
25 |
26 | public bool HasCodeFile
27 | {
28 | get
29 | {
30 | return CodeAddress != null &&
31 | !String.IsNullOrEmpty(CodeAddress.FilePath) &&
32 | File.Exists(CodeAddress.FilePath);
33 | }
34 | }
35 |
36 | #endregion
37 |
38 | #region Methods
39 |
40 | public async Task> GetCodesAsync()
41 | {
42 | return HasCodeFile ? await ReadAllLinesAsync(CodeAddress.FilePath, Encoding.UTF8, true) : null;
43 | }
44 |
45 |
46 |
47 | public static async Task> ReadAllLinesAsync(string path, Encoding encoding, bool byLineNo = false)
48 | {
49 | var lines = new List();
50 |
51 | using (var reader = new StreamReader(path, encoding))
52 | {
53 | string line;
54 | var index = 0;
55 | while ((line = await reader.ReadLineAsync()) != null)
56 | {
57 | lines.Add(string.Format("{0}{1}",
58 | byLineNo ? ++index + "\t" : "", line));
59 | }
60 | }
61 |
62 | return lines;
63 | }
64 |
65 | #endregion
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Shared/IError.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Drawing;
4 |
5 | namespace ErrorControlSystem.Shared
6 | {
7 | public interface IError : IEquatable
8 | {
9 | int Id { set; get; }
10 | Boolean IsHandled { get; set; }
11 | DateTime ErrorDateTime { get; set; }
12 | DateTime ServerDateTime { get; set; }
13 | int HResult { get; set; }
14 | String AppName { get; set; }
15 | String ClrVersion { get; set; }
16 | String CurrentCulture { get; set; }
17 | String ErrorType { get; set; }
18 | String Host { get; set; }
19 | String IPv4Address { get; set; }
20 | String MacAddress { get; set; }
21 | String MemberType { get; set; }
22 | String Message { get; set; }
23 | String Method { get; set; }
24 | String ModuleName { get; set; }
25 | string OS { get; set; }
26 | string Processes { get; set; }
27 | String Source { get; set; }
28 | String StackTrace { get; set; }
29 | String User { get; set; }
30 | CodeScope LineColumn { get; set; }
31 | int Duplicate { get; set; }
32 | String Data { get; set; }
33 | System.Drawing.Image Snapshot { get; }
34 | }
35 | }
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Shared/NetworkHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Data;
4 | using System.Data.Sql;
5 | using System.Linq;
6 | using System.Net;
7 | using System.Net.NetworkInformation;
8 | using System.Threading.Tasks;
9 | using ErrorControlSystem.DbConnectionManager;
10 | using ErrorControlSystem.ServerController;
11 |
12 | namespace ErrorControlSystem.Shared
13 | {
14 | public static class NetworkHelper
15 | {
16 | #region Get Current PC MAC Address
17 | ///
18 | /// Gets the MAC address of the current PC.
19 | ///
20 | ///
21 | public static string GetMacAddress()
22 | {
23 | // only recognizes changes related to Internet adapters
24 | if (IsNetworkAvailable())
25 | {
26 | foreach (var nic in NetworkInterface.GetAllNetworkInterfaces())
27 | {
28 | // Only consider Ethernet network interfaces
29 | if (nic.NetworkInterfaceType == NetworkInterfaceType.Ethernet &&
30 | nic.OperationalStatus == OperationalStatus.Up)
31 | {
32 | return nic.GetPhysicalAddress().ToString();
33 | }
34 | }
35 | }
36 |
37 | return "Network Not Available";
38 | }
39 | #endregion
40 |
41 | #region Get Current PC IP Address
42 | ///
43 | /// Gets the IP address of the current PC.
44 | ///
45 | ///
46 | public static string GetIpAddress()
47 | {
48 | if (!IsNetworkAvailable()) return "Network Not Available";
49 |
50 | var host = Dns.GetHostEntry(Dns.GetHostName());
51 |
52 | return host.AddressList.Last(ip => ip.AddressFamily.ToString() == "InterNetwork").ToString();
53 | }
54 | #endregion
55 |
56 | #region Check Network Availability
57 |
58 | ///
59 | /// Indicates whether any network connection is available
60 | ///
61 | ///
62 | /// true if a network connection is available; otherwise, false.
63 | ///
64 | public static bool IsNetworkAvailable()
65 | {
66 | // only recognizes changes related to Internet adapters
67 | if (NetworkInterface.GetIsNetworkAvailable())
68 | {
69 | // however, this will include all adapters
70 | return
71 | NetworkInterface.GetAllNetworkInterfaces().
72 | Where(face => face.OperationalStatus == OperationalStatus.Up).
73 | Any(face =>
74 | (face.NetworkInterfaceType != NetworkInterfaceType.Tunnel) &&
75 | (face.NetworkInterfaceType != NetworkInterfaceType.Loopback));
76 | }
77 |
78 | return false;
79 | }
80 |
81 | #endregion
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Shared/OperationSystemInfo.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace ErrorControlSystem.Shared
3 | {
4 | public class OperationSystemInfo
5 | {
6 | public string Name { get; set; }
7 | public string Edition { get; set; }
8 | public string ServicePack { get; set; }
9 | public string Version { get; set; }
10 | public string ProcessorBits { get; set; }
11 | public string OsBits { get; set; }
12 | public string ProgramBits { get; set; }
13 |
14 | public OperationSystemInfo(bool currentSystem = false)
15 | {
16 | if (currentSystem)
17 | {
18 | Name = OperationSystem.Name;
19 | Edition = OperationSystem.Edition;
20 | ServicePack = OperationSystem.ServicePack;
21 | Version = OperationSystem.VersionString;
22 | ProcessorBits = OperationSystem.ProcessorBits.ToString();
23 | OsBits = OperationSystem.OsBits.ToString();
24 | ProgramBits = OperationSystem.ProgramBits.ToString();
25 | }
26 | }
27 |
28 | public override string ToString()
29 | {
30 | var sp = ServicePack != "";
31 | return string.Format("{0}{1}{2} {3}Bit v{4} - {5}Bit Processor Architect - {6}Bit Application",
32 | Name,
33 | sp ? "SP" : "",
34 | sp ? ServicePack : "",
35 | OsBits.Replace("Bit", ""),
36 | Version,
37 | ProcessorBits.Replace("Bit", ""),
38 | ProgramBits.Replace("Bit", ""));
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Shared/ProcessFlow.cs:
--------------------------------------------------------------------------------
1 | namespace ErrorControlSystem.Shared
2 | {
3 | public enum ProcessFlow
4 | {
5 | ///
6 | /// This will handle all unhandled exceptions to be able to continue execution.
7 | ///
8 | Continue,
9 |
10 | ///
11 | /// This will handle all unhandled exceptions and exit the application.
12 | ///
13 | Exit,
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Shared/UI/Developer/ExceptionViewer.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
18 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Shared/UI/Developer/ExceptionViewer.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows;
3 |
4 | namespace ErrorControlSystem.Shared.UI.Developer
5 | {
6 | ///
7 | /// Interaction logic for ExceptionViewer.xaml
8 | ///
9 | public partial class ExceptionViewer : Window
10 | {
11 | public ExceptionViewer()
12 | {
13 | InitializeComponent();
14 |
15 | BtnContinue.Content = Properties.Localization.BtnContinue;
16 | BtnExit.Content = Properties.Localization.BtnExit;
17 | }
18 |
19 | private void btnExit_Click(object sender, System.Windows.RoutedEventArgs e)
20 | {
21 | this.DialogResult = false;
22 | Close();
23 | }
24 |
25 | private void btnContinue_Click(object sender, System.Windows.RoutedEventArgs e)
26 | {
27 | this.DialogResult = true;
28 | Close();
29 | }
30 |
31 |
32 | public ProcessFlow ShowDialog(Exception exp)
33 | {
34 | ExpMapper.Add(exp);
35 |
36 | var dialogResult = this.ShowDialog();
37 | return (dialogResult != null && (bool)dialogResult) ? ProcessFlow.Continue : ProcessFlow.Exit;
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Shared/UI/ExceptionMapper/MessageBlock.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
27 |
28 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Shared/UI/ExceptionMapper/MessageBlock.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.Windows.Controls;
4 |
5 | namespace ErrorControlSystem.Shared.UI.ExceptionMapper
6 | {
7 | ///
8 | /// Interaction logic for MessageBlock.xaml
9 | ///
10 | public partial class MessageBlock : UserControl
11 | {
12 | public MessageBlock()
13 | {
14 | this.InitializeComponent();
15 |
16 | this.DataContext = this;
17 | LayoutRoot.DataContext = this;
18 | }
19 |
20 | #region Properties
21 |
22 | #region Text
23 |
24 | [Browsable(true), EditorBrowsable(EditorBrowsableState.Always)]
25 | [Bindable(true), Category("Common"), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
26 | public String Text
27 | {
28 | get { return lblText.Text; }
29 | set { lblText.Text = value; }
30 | }
31 |
32 | #endregion
33 |
34 | #endregion
35 | }
36 | }
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Shared/UI/ExceptionMapper/StackFrameBlock.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Shared/UI/ExceptionMapper/StackFrameBlock.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.Windows.Controls;
4 | using System.Windows.Input;
5 |
6 | namespace ErrorControlSystem.Shared.UI.ExceptionMapper
7 | {
8 | ///
9 | /// Interaction logic for StackFrame.xaml
10 | ///
11 | public partial class StackFrameBlock : UserControl
12 | {
13 | #region Fields
14 |
15 | private CodeScope _frameCodeScope;
16 |
17 | #endregion
18 |
19 | #region Constructors
20 |
21 | public StackFrameBlock()
22 | {
23 | this.InitializeComponent();
24 |
25 | this.DataContext = this;
26 | LayoutRoot.DataContext = this;
27 | }
28 |
29 | #endregion
30 |
31 | #region Properties
32 |
33 | [Browsable(true), EditorBrowsable(EditorBrowsableState.Always)]
34 | [Bindable(true), Category("Common"), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
35 | public String Text
36 | {
37 | get { return lblText.Text; }
38 | set { lblText.Text = value; }
39 | }
40 |
41 |
42 | public CodeScope FrameCodeScope
43 | {
44 | get { return _frameCodeScope; }
45 | set
46 | {
47 | _frameCodeScope = value;
48 |
49 | Text = value.ToString(CodeScopeStringFormat.Normal);
50 |
51 | if (!String.IsNullOrEmpty(value.FilePath))
52 | {
53 | ToolTip = string.Format("Click on frame to go to exception location in {0} {1}",
54 | value.FilePath, value.ToString(CodeScopeStringFormat.JustLineColumn));
55 |
56 | this.Cursor = Cursors.Hand;
57 | }
58 | }
59 | }
60 |
61 |
62 |
63 | #endregion
64 |
65 | #region Events
66 |
67 | public CodeMapEventHandler Clicked = delegate(object sender, CodeMapEventArgs args) { };
68 |
69 | #endregion
70 |
71 | #region Methods
72 |
73 | public void RaiseClick()
74 | {
75 | Clicked(this, new CodeMapEventArgs(FrameCodeScope));
76 | }
77 |
78 | #endregion
79 | }
80 | }
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Shared/UI/ExceptionMapper/StackTraceBlock.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Diagnostics;
3 | using System.Linq;
4 | using System.Windows.Controls;
5 | using System.Windows.Media;
6 |
7 | namespace ErrorControlSystem.Shared.UI.ExceptionMapper
8 | {
9 | public class StackTraceBlock : TreeViewItem
10 | {
11 | public List ExceptionStackFrames { get; set; }
12 |
13 | public StackTraceBlock(System.Exception exp)
14 | {
15 | this.Header = new MessageBlock() { Text = "StackTrace", OpacityMask = Brushes.Aquamarine };
16 |
17 | ExceptionStackFrames = new List();
18 |
19 | var stackTrace = new StackTrace(exp, true);
20 | var stackFrames = stackTrace.GetFrames();
21 |
22 | if (stackFrames == null) return;
23 |
24 | foreach (var expStackFrame in stackFrames.Select(frame => new StackFrameBlock() { FrameCodeScope = new CodeScope(frame) }))
25 | {
26 | expStackFrame.Clicked += (s, e) => ExceptionStackFrameSelectedChanged(s, e);
27 | ExceptionStackFrames.Add(expStackFrame);
28 | Items.Add(expStackFrame);
29 | }
30 | }
31 |
32 | public CodeMapEventHandler ExceptionStackFrameSelectedChanged = delegate(object sender, CodeMapEventArgs args) { };
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Shared/UI/ExceptionMapper/TreeMap.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Shared/UI/ExceptionMapper/TreeMapItem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Controls;
3 |
4 | namespace ErrorControlSystem.Shared.UI.ExceptionMapper
5 | {
6 | public class TreeMapItem : TreeViewItem
7 | {
8 | #region Properties
9 |
10 | public MessageBlock MessageBlock { get; protected set; }
11 |
12 | public StackTraceBlock StackTrace { get; protected set; }
13 |
14 | public TreeMapItem InnerException { get; protected set; }
15 |
16 | #endregion
17 |
18 | public CodeMapEventHandler OnShowCodeMapEventHandler = delegate(object sender, CodeMapEventArgs args) { };
19 |
20 | public TreeMapItem(Exception exp, TreeMapItemMode mode = TreeMapItemMode.Exception)
21 | {
22 | //
23 | // Create MessageBlock for Header
24 | var expType = exp.GetType().ToString();
25 | Header = new MessageBlock()
26 | {
27 | Text = string.Format("{0} {1}: {2}",
28 | mode == TreeMapItemMode.InnerException ? "Inner" : "",
29 | expType.Substring(expType.LastIndexOf('.') + 1),
30 | exp.Message)
31 | };
32 |
33 | Items.Add(MessageBlock);
34 |
35 | //
36 | // Create StackTrace
37 | if (exp.StackTrace != null)
38 | {
39 | StackTrace = new StackTraceBlock(exp);
40 | StackTrace.ExceptionStackFrameSelectedChanged += (s, e) => OnShowCodeMapEventHandler(s, e);
41 | Items.Add(StackTrace);
42 | }
43 | //
44 | // Create InnerException
45 | if (exp.InnerException != null)
46 | {
47 | InnerException = new TreeMapItem(exp.InnerException, TreeMapItemMode.InnerException);
48 | InnerException.OnShowCodeMapEventHandler += (s, e) => this.OnShowCodeMapEventHandler(s, e);
49 | Items.Add(InnerException);
50 | }
51 | }
52 |
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/Shared/UI/ExceptionMapper/TreeMapItemMode.cs:
--------------------------------------------------------------------------------
1 |
2 |
3 | namespace ErrorControlSystem.Shared.UI.ExceptionMapper
4 | {
5 | public enum TreeMapItemMode
6 | {
7 | Exception,
8 | InnerException
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/UnhandledErrorEventArgs.cs:
--------------------------------------------------------------------------------
1 |
2 | using System;
3 | using ErrorControlSystem.Shared;
4 | using System.Runtime.ConstrainedExecution;
5 |
6 | namespace ErrorControlSystem
7 | {
8 | [Serializable]
9 | [System.Runtime.InteropServices.ComVisible(true)]
10 | public class UnhandledErrorEventArgs : EventArgs
11 | {
12 | private readonly Error _exception;
13 |
14 | public UnhandledErrorEventArgs(Error exception)
15 | {
16 | _exception = exception;
17 | }
18 |
19 | public Error ErrorObject
20 | {
21 | [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
22 | get { return _exception; }
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | 4194304
15 |
16 |
17 | LocalApplicationData
18 |
19 |
20 | True
21 |
22 |
23 | False
24 |
25 |
26 | Continue
27 |
28 |
29 | True
30 |
31 |
32 | True
33 |
34 |
35 |
36 |
37 |
38 | True
39 |
40 |
41 | True
42 |
43 |
44 | True
45 |
46 |
47 | True
48 |
49 |
50 | True
51 |
52 |
53 | False
54 |
55 |
56 | 500
57 |
58 |
59 | 100
60 |
61 |
62 | False
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystem/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystemAdapter/ErrorControlSystemAdapter.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {1D83C547-23E7-4CDB-9D08-5590283FDEC7}
8 | Library
9 | Properties
10 | ErrorControlSystem
11 | ErrorControlSystemAdapter
12 | v4.5
13 | 512
14 |
15 |
16 | true
17 | full
18 | true
19 | ..\..\..\out\ErrorControlSystem\Adapter\
20 | DEBUG;TRACE
21 | prompt
22 | 4
23 | ..\..\..\out\ErrorControlSystem\Adapter\ErrorControlSystemAdapter.XML
24 | 1607, 1591
25 |
26 |
27 | pdbonly
28 | true
29 | ..\..\..\out\ErrorControlSystem\Adapter\
30 | TRACE
31 | prompt
32 | 4
33 | ..\..\..\out\ErrorControlSystem\Adapter\ErrorControlSystemAdapter.XML
34 | 1607, 1591
35 | true
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | Properties\AssemblyInfo.cs
48 |
49 |
50 | Properties\GlobalAssemblyInfo.cs
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 | {515c50e8-a9a0-4ac0-8591-7369c1a31dc8}
61 | ErrorControlSystem
62 |
63 |
64 |
65 |
72 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystemAdapter/ErrorHandlerAdapter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace ErrorControlSystem
5 | {
6 | [Serializable]
7 | [ComVisible(true)]
8 | [Guid("11BE9CF0-218D-45C6-A9AD-55C891F936F0")]
9 | public class ErrorHandlerAdapter : IErrorHandlerAdapter
10 | {
11 |
12 | public void Raise(Exception exp, bool isHandled = true, bool alertError = false, bool screenCapture = true)
13 | {
14 | exp.RaiseLog(isHandled);
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystemAdapter/IErrorHandlerAdapter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace ErrorControlSystem
5 | {
6 | [ComVisible(true)]
7 | [Guid("2A9A506F-FB51-406C-9D2F-026AD54E2B60")]
8 | public interface IErrorHandlerAdapter
9 | {
10 | void Raise(Exception exp, bool isHandled = true, bool alarmError = false, bool screenCapture = true);
11 | }
12 | }
--------------------------------------------------------------------------------
/src/Error Control System/ErrorControlSystemAdapter/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
14 |
15 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/ErrorLogAnalyzer/BaseForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 | using System.Threading.Tasks;
4 | using System.Windows.Forms;
5 | using WaitSplash;
6 |
7 | namespace ErrorLogAnalyzer
8 | {
9 | public class BaseForm : Form
10 | {
11 | #region Designer
12 | ///
13 | /// Required designer variable.
14 | ///
15 | private System.ComponentModel.IContainer components = null;
16 |
17 | ///
18 | /// Clean up any resources being used.
19 | ///
20 | /// true if managed resources should be disposed; otherwise, false.
21 | protected override void Dispose(bool disposing)
22 | {
23 | if (disposing && (components != null))
24 | {
25 | components.Dispose();
26 | }
27 | base.Dispose(disposing);
28 | }
29 |
30 | #region Windows Form Designer generated code
31 |
32 | ///
33 | /// Required method for Designer support - do not modify
34 | /// the contents of this method with the code editor.
35 | ///
36 | private void InitializeComponent()
37 | {
38 | this.SuspendLayout();
39 | //
40 | // BaseForm
41 | //
42 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
43 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
44 | this.ClientSize = new System.Drawing.Size(340, 210);
45 | this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
46 | this.Name = "BaseForm";
47 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
48 | this.Text = "BaseForm";
49 | this.ResumeLayout(false);
50 |
51 | }
52 |
53 | #endregion
54 | #endregion
55 |
56 |
57 | #region Properties
58 |
59 | public Splash WaitSplash;
60 |
61 | #endregion
62 |
63 |
64 | #region Methods
65 |
66 | public BaseForm()
67 | {
68 | InitializeComponent();
69 |
70 | CheckForIllegalCrossThreadCalls = false;
71 |
72 | WaitSplash = new Splash(this);
73 |
74 | Application.Idle += Application_Idle;
75 | }
76 |
77 | async void Application_Idle(object sender, EventArgs e)
78 | {
79 | Application.Idle -= Application_Idle;
80 |
81 | await InvokeAsync(OnFormLoad);
82 | }
83 |
84 | public async Task InvokeAsync(Action doSomething)
85 | {
86 | WaitSplash.Start();
87 |
88 | if (doSomething != null)
89 | {
90 | await Task.Run(() =>
91 | {
92 | var invokeThread = new Thread(new ThreadStart(doSomething));
93 | invokeThread.SetApartmentState(ApartmentState.STA);
94 | invokeThread.Start();
95 | invokeThread.Join();
96 | });
97 | }
98 |
99 | WaitSplash.Stop();
100 |
101 | this.Focus();
102 | }
103 |
104 | public virtual void OnFormLoad()
105 | {
106 |
107 | }
108 | #endregion
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/ErrorLogAnalyzer/DataGridViewHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Text.RegularExpressions;
4 | using System.Windows.Forms;
5 |
6 | namespace ErrorLogAnalyzer
7 | {
8 | internal static class DataGridViewHelper
9 | where TCol : class, IEquatable
10 | where TRow : class, IEquatable
11 | {
12 |
13 | public static void CreateColumns(DataGridView dgv)
14 | {
15 |
16 | foreach (var property in typeof(TCol).GetProperties())
17 | {
18 | dgv.Columns[dgv.Columns.Add(property.Name, GetHeaderNameFromColName(property.Name))].DataPropertyName
19 | =
20 | property.Name;
21 | }
22 | }
23 |
24 | public static void AddRow(DataGridView dgv, TRow row)
25 | {
26 | var index = dgv.Rows.Add();
27 |
28 | foreach (DataGridViewColumn col in dgv.Columns)
29 | {
30 | dgv.Rows[index].Cells[col.Name].Value = row.GetType().GetProperty(col.DataPropertyName).GetValue(row) ?? "";
31 | }
32 | }
33 |
34 | public static void RemoveRow(DataGridView dgv, TRow rowObj)
35 | {
36 | foreach (DataGridViewRow row in dgv.Rows)
37 | {
38 | if (GetRowataBoundItem(row).Equals(rowObj))
39 | {
40 | dgv.Rows.Remove(row);
41 | break;
42 | }
43 | }
44 | dgv.Refresh();
45 | }
46 |
47 | public static void UpdateRow(DataGridView dgv, TRow rowObj)
48 | {
49 | foreach (DataGridViewRow row in dgv.Rows)
50 | {
51 | if (GetRowataBoundItem(row).Equals(rowObj))
52 | {
53 | foreach (DataGridViewColumn col in dgv.Columns)
54 | {
55 | row.Cells[col.Name].Value = rowObj.GetType().GetProperty(col.DataPropertyName).GetValue(rowObj) ?? "";
56 | }
57 | }
58 | }
59 | }
60 |
61 | public static TRow GetCurrentRow(DataGridView dgv)
62 | {
63 | if (dgv.CurrentRow != null)
64 | return ((TRow)GetRowataBoundItem(dgv.CurrentRow));
65 |
66 | return null;
67 | }
68 |
69 |
70 | public static TRow GetRowataBoundItem(DataGridViewRow row)
71 | {
72 | var tInstance = Activator.CreateInstance(typeof(TRow));
73 |
74 | foreach (var cell in row.Cells.Cast())
75 | {
76 | typeof(TRow).GetProperty(cell.OwningColumn.DataPropertyName).SetValue(tInstance, cell.Value);
77 | }
78 |
79 | return (TRow)tInstance;
80 | }
81 |
82 | private static string GetHeaderNameFromColName(string columnName)
83 | {
84 | var header = Regex.Replace(columnName, "([a-z])([A-Z])", "$1 $2");
85 |
86 | return header;
87 | }
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/ErrorLogAnalyzer/ErrorDataGridView.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.Windows.Forms;
4 | using ErrorControlSystem.Shared;
5 |
6 | namespace ErrorLogAnalyzer
7 | {
8 | public class ErrorDataGridView : DataGridView
9 | {
10 | public ErrorDataGridView()
11 | {
12 | CreateColumns();
13 | }
14 |
15 | public void CreateColumns()
16 | {
17 | if (System.ComponentModel.LicenseManager.UsageMode == LicenseUsageMode.Designtime ||
18 | this.DesignMode ||
19 | System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv") return;
20 |
21 | DataGridViewHelper.CreateColumns(this);
22 | }
23 |
24 | public void AddRow(ProxyError row)
25 | {
26 | DataGridViewHelper.AddRow(this, row);
27 | }
28 |
29 | public void RemoveRow(ProxyError rowObj)
30 | {
31 | DataGridViewHelper.RemoveRow(this, rowObj);
32 | }
33 |
34 | public void UpdateRow(ProxyError rowObj)
35 | {
36 | DataGridViewHelper.UpdateRow(this, rowObj);
37 | }
38 |
39 | public ProxyError GetCurrentRow()
40 | {
41 | return DataGridViewHelper.GetCurrentRow(this);
42 | }
43 | }
44 | }
--------------------------------------------------------------------------------
/src/Error Log Analyzer/ErrorLogAnalyzer/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 | using System.Windows.Forms;
4 | using ErrorControlSystem;
5 |
6 | namespace ErrorLogAnalyzer
7 | {
8 | static class Program
9 | {
10 | ///
11 | /// The main entry point for the application.
12 | ///
13 | [STAThread]
14 | private static void Main()
15 | {
16 | Thread.Sleep(2000); // First Open Example Apps then this app
17 |
18 | ExceptionHandler.Engine.Start();
19 |
20 | Application.EnableVisualStyles();
21 | Application.SetCompatibleTextRenderingDefault(false);
22 | Application.Run(new LogReader());
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/ErrorLogAnalyzer/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("ErrorLogAnalyzer")]
8 | [assembly: AssemblyDescription("Error Log Analyzer Created by [Mr. Behzad Khosravifar](mailto:Behzad.Khosravifar@gmail.com)")]
9 | [assembly: AssemblyCulture("")]
10 |
11 | // Setting ComVisible to false makes the types in this assembly not visible
12 | // to COM components. If you need to access a type in this assembly from
13 | // COM, set the ComVisible attribute to true on that type.
14 | [assembly: ComVisible(false)]
15 |
16 | // The following GUID is for the ID of the typelib if this project is exposed to COM
17 | [assembly: Guid("f8f8f849-d15e-438a-afda-f3c4372fc94b")]
18 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/ErrorLogAnalyzer/Resources/Disable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Error Log Analyzer/ErrorLogAnalyzer/Resources/Disable.png
--------------------------------------------------------------------------------
/src/Error Log Analyzer/ErrorLogAnalyzer/Resources/Enable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Error Log Analyzer/ErrorLogAnalyzer/Resources/Enable.png
--------------------------------------------------------------------------------
/src/Error Log Analyzer/ErrorLogAnalyzer/Resources/MicrosoftSQLServerLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Error Log Analyzer/ErrorLogAnalyzer/Resources/MicrosoftSQLServerLogo.png
--------------------------------------------------------------------------------
/src/Error Log Analyzer/ErrorLogAnalyzer/Resources/null.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Error Log Analyzer/ErrorLogAnalyzer/Resources/null.gif
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.Forms.HintTextBox/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Windows.Forms.HintTextBox")]
9 | [assembly: AssemblyDescription("Created by Mr. Behzad Khosravifar")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Windows.Forms.HintTextBox")]
13 | [assembly: AssemblyCopyright("Copyright © 2014-2015 Behzad Khosravifar")]
14 | [assembly: AssemblyTrademark("B.B")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("9cf8bfbd-380b-46b6-a71d-61ac2cab58d7")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.1")]
36 | [assembly: AssemblyFileVersion("1.0.0.1")]
37 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.Forms.HintTextBox/Windows.Forms.HintTextBox.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {CD5DA55B-C69B-45C7-AEFE-C9F4990CD873}
8 | Library
9 | Properties
10 | Windows.Forms
11 | Windows.Forms.HintTextBox
12 | v4.0
13 | 512
14 |
15 |
16 | true
17 | full
18 | true
19 | ..\..\..\out\ErrorLogAnalyzer\
20 | DEBUG;TRACE
21 | prompt
22 | 4
23 | 1607
24 |
25 |
26 | none
27 | true
28 | ..\..\..\out\ErrorLogAnalyzer\
29 | TRACE
30 | prompt
31 | 4
32 | 1607
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | Component
45 |
46 |
47 |
48 |
49 |
50 |
57 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.Forms.ImageBox/BehzadPublic.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Error Log Analyzer/Windows.Forms.ImageBox/BehzadPublic.snk
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.Forms.ImageBox/ImageBox.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Error Log Analyzer/Windows.Forms.ImageBox/ImageBox.bmp
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.Forms.ImageBox/ImageBoxActionSources.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Windows.Forms
4 | {
5 | // Shoniz ImageBox
6 | // Copyright (c) 2010-2014
7 | // http://com
8 | // http://com/blog/tag/imagebox
9 |
10 | // Licensed under the MIT License. See imagebox-license.txt for the full text.
11 |
12 | // If you use this control in your applications, attribution, donations or contributions are welcome.
13 |
14 | ///
15 | /// Specifies the source of an action being performed.
16 | ///
17 | [Flags]
18 | public enum ImageBoxActionSources
19 | {
20 | ///
21 | /// Unknown source.
22 | ///
23 | Unknown = 0,
24 |
25 | ///
26 | /// A user initialized the action.
27 | ///
28 | User = 1
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.Forms.ImageBox/ImageBoxBorderStyle.cs:
--------------------------------------------------------------------------------
1 | namespace Windows.Forms
2 | {
3 | // Shoniz ImageBox
4 | // Copyright (c) 2010-2014
5 | // http://com
6 | // http://com/blog/tag/imagebox
7 |
8 | // Licensed under the MIT License. See imagebox-license.txt for the full text.
9 |
10 | // If you use this control in your applications, attribution, donations or contributions are welcome.
11 |
12 | ///
13 | /// Specifies the border styles of an image
14 | ///
15 | public enum ImageBoxBorderStyle
16 | {
17 | ///
18 | /// No border.
19 | ///
20 | None,
21 |
22 | ///
23 | /// A fixed, single-line border.
24 | ///
25 | FixedSingle,
26 |
27 | ///
28 | /// A fixed, single-line border with a solid drop shadow.
29 | ///
30 | FixedSingleDropShadow,
31 |
32 | ///
33 | /// A fixed, single-line border with a soft outer glow.
34 | ///
35 | FixedSingleGlowShadow
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.Forms.ImageBox/ImageBoxCancelEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 | using System.Drawing;
3 |
4 | namespace Windows.Forms
5 | {
6 | // Shoniz ImageBox
7 | // Copyright (c) 2010-2014
8 | // http://com
9 | // http://com/blog/tag/imagebox
10 |
11 | // Licensed under the MIT License. See imagebox-license.txt for the full text.
12 |
13 | // If you use this control in your applications, attribution, donations or contributions are welcome.
14 |
15 | ///
16 | /// Provides data for a cancelable event.
17 | ///
18 | public class ImageBoxCancelEventArgs : CancelEventArgs
19 | {
20 | #region Public Constructors
21 |
22 | ///
23 | /// Initializes a new instance of the class.
24 | ///
25 | /// The location of the action being performed.
26 | public ImageBoxCancelEventArgs(Point location)
27 | : this()
28 | {
29 | this.Location = location;
30 | }
31 |
32 | #endregion
33 |
34 | #region Protected Constructors
35 |
36 | ///
37 | /// Initializes a new instance of the class.
38 | ///
39 | protected ImageBoxCancelEventArgs()
40 | { }
41 |
42 | #endregion
43 |
44 | #region Public Properties
45 |
46 | ///
47 | /// Gets or sets the location of the action being performed.
48 | ///
49 | /// The location of the action being performed.
50 | public Point Location { get; protected set; }
51 |
52 | #endregion
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.Forms.ImageBox/ImageBoxGridDisplayMode.cs:
--------------------------------------------------------------------------------
1 | namespace Windows.Forms
2 | {
3 | // Shoniz ImageBox
4 | // Copyright (c) 2010-2014
5 | // http://com
6 | // http://com/blog/tag/imagebox
7 |
8 | // Licensed under the MIT License. See imagebox-license.txt for the full text.
9 |
10 | // If you use this control in your applications, attribution, donations or contributions are welcome.
11 |
12 | ///
13 | /// Specifies the display styles for the background texture grid
14 | ///
15 | public enum ImageBoxGridDisplayMode
16 | {
17 | ///
18 | /// No background.
19 | ///
20 | None,
21 |
22 | ///
23 | /// Background is displayed in the control's client area.
24 | ///
25 | Client,
26 |
27 | ///
28 | /// Background is displayed only in the image region.
29 | ///
30 | Image
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.Forms.ImageBox/ImageBoxGridScale.cs:
--------------------------------------------------------------------------------
1 | namespace Windows.Forms
2 | {
3 | // Shoniz ImageBox
4 | // Copyright (c) 2010-2014
5 | // http://com
6 | // http://com/blog/tag/imagebox
7 |
8 | // Licensed under the MIT License. See imagebox-license.txt for the full text.
9 |
10 | // If you use this control in your applications, attribution, donations or contributions are welcome.
11 |
12 | ///
13 | /// Specifies the size of the background texture grid.
14 | ///
15 | public enum ImageBoxGridScale
16 | {
17 | ///
18 | /// Displays a solid color
19 | ///
20 | None,
21 |
22 | ///
23 | /// Half of the default size.
24 | ///
25 | Tiny,
26 |
27 | ///
28 | /// Default size.
29 | ///
30 | Small,
31 |
32 | ///
33 | /// 50% increase of default size.
34 | ///
35 | Medium,
36 |
37 | ///
38 | /// 100% increase of default size.
39 | ///
40 | Large
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.Forms.ImageBox/ImageBoxSelectionMode.cs:
--------------------------------------------------------------------------------
1 | namespace Windows.Forms
2 | {
3 | // Shoniz ImageBox
4 | // Copyright (c) 2010-2014
5 | // http://com
6 | // http://com/blog/tag/imagebox
7 |
8 | // Licensed under the MIT License. See imagebox-license.txt for the full text.
9 |
10 | // If you use this control in your applications, attribution, donations or contributions are welcome.
11 |
12 | ///
13 | /// Specifies the selection mode.
14 | ///
15 | public enum ImageBoxSelectionMode
16 | {
17 | ///
18 | /// No selection.
19 | ///
20 | None,
21 |
22 | ///
23 | /// Rectangle selection.
24 | ///
25 | Rectangle,
26 |
27 | ///
28 | /// Zoom selection.
29 | ///
30 | Zoom
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.Forms.ImageBox/ImageBoxSizeMode.cs:
--------------------------------------------------------------------------------
1 | namespace Windows.Forms
2 | {
3 | // Shoniz ImageBox
4 | // Copyright (c) 2010-2014
5 | // http://com
6 | // http://com/blog/tag/imagebox
7 |
8 | // Licensed under the MIT License. See imagebox-license.txt for the full text.
9 |
10 | // If you use this control in your applications, attribution, donations or contributions are welcome.
11 |
12 | ///
13 | /// Determines the sizing mode of an image hosted in an control.
14 | ///
15 | public enum ImageBoxSizeMode
16 | {
17 | ///
18 | /// The image is disiplayed according to current zoom and scroll properties.
19 | ///
20 | Normal,
21 |
22 | ///
23 | /// The image is stretched to fill the client area of the control.
24 | ///
25 | Stretch,
26 |
27 | ///
28 | /// The image is stretched to fill as much of the client area of the control as possible, whilst retaining the same aspect ratio for the width and height.
29 | ///
30 | Fit
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.Forms.ImageBox/ImageBoxZoomActions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Windows.Forms
4 | {
5 | // Shoniz ImageBox
6 | // Copyright (c) 2010-2014
7 | // http://com
8 | // http://com/blog/tag/imagebox
9 |
10 | // Licensed under the MIT License. See imagebox-license.txt for the full text.
11 |
12 | // If you use this control in your applications, attribution, donations or contributions are welcome.
13 |
14 | ///
15 | /// Describes the zoom action occuring
16 | ///
17 | [Flags]
18 | public enum ImageBoxZoomActions
19 | {
20 | ///
21 | /// No action.
22 | ///
23 | None = 0,
24 |
25 | ///
26 | /// The control is increasing the zoom.
27 | ///
28 | ZoomIn = 1,
29 |
30 | ///
31 | /// The control is decreasing the zoom.
32 | ///
33 | ZoomOut = 2,
34 |
35 | ///
36 | /// The control zoom was reset.
37 | ///
38 | ActualSize = 4
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.Forms.ImageBox/ImageBoxZoomEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Windows.Forms
4 | {
5 | // Shoniz ImageBox
6 | // Copyright (c) 2010-2014
7 | // http://com
8 | // http://com/blog/tag/imagebox
9 |
10 | // Licensed under the MIT License. See imagebox-license.txt for the full text.
11 |
12 | // If you use this control in your applications, attribution, donations or contributions are welcome.
13 |
14 | ///
15 | /// Contains event data for the event.
16 | ///
17 | public class ImageBoxZoomEventArgs : EventArgs
18 | {
19 | #region Public Constructors
20 |
21 | ///
22 | /// Initializes a new instance of the class.
23 | ///
24 | /// The zoom operation being performed.
25 | /// The source of the operation.
26 | /// The old zoom level.
27 | /// The new zoom level.
28 | public ImageBoxZoomEventArgs(ImageBoxZoomActions actions, ImageBoxActionSources source, int oldZoom, int newZoom)
29 | : this()
30 | {
31 | this.Actions = actions;
32 | this.Source = source;
33 | this.OldZoom = oldZoom;
34 | this.NewZoom = newZoom;
35 | }
36 |
37 | #endregion
38 |
39 | #region Protected Constructors
40 |
41 | ///
42 | /// Initializes a new instance of the class.
43 | ///
44 | protected ImageBoxZoomEventArgs()
45 | { }
46 |
47 | #endregion
48 |
49 | #region Public Properties
50 |
51 | ///
52 | /// Gets or sets the actions that occured.
53 | ///
54 | /// The zoom operation.
55 | public ImageBoxZoomActions Actions { get; protected set; }
56 |
57 | ///
58 | /// Gets or sets the new zoom level.
59 | ///
60 | /// The new zoom level.
61 | public int NewZoom { get; protected set; }
62 |
63 | ///
64 | /// Gets or sets the old zoom level.
65 | ///
66 | /// The old zoom level.
67 | public int OldZoom { get; protected set; }
68 |
69 | ///
70 | /// Gets or sets the source of the operation..
71 | ///
72 | /// The source.
73 | public ImageBoxActionSources Source { get; protected set; }
74 |
75 | #endregion
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.Forms.ImageBox/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 | using System.Runtime.InteropServices;
4 |
5 | [assembly: AssemblyTitle("Shoniz ImageBox Control")]
6 | [assembly: AssemblyDescription("")]
7 | [assembly: AssemblyConfiguration("")]
8 | [assembly: AssemblyCompany("Shoniz")]
9 | [assembly: AssemblyProduct("Shoniz ImageBox Control")]
10 | [assembly: AssemblyCopyright("Copyright © 2010-2014 Behzad Khosravifar")]
11 | [assembly: AssemblyTrademark("")]
12 | [assembly: AssemblyCulture("")]
13 | [assembly: ComVisible(false)]
14 | [assembly: Guid("d812a438-008c-47f9-926f-8415490cdda1")]
15 | [assembly: CLSCompliant(true)]
16 | [assembly: AssemblyVersion("1.1.4.2")]
17 | [assembly: AssemblyFileVersion("1.1.4.2")]
18 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.Forms.ProcessBar/ProgressBarDisplayText.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Windows.Forms
6 | {
7 | public enum ProgressBarDisplayText
8 | {
9 | Percentage,
10 | CustomText
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.Forms.ProcessBar/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Windows.Forms.ProcessBar")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("Windows.Forms.ProcessBar")]
12 | [assembly: AssemblyTrademark("")]
13 | [assembly: AssemblyDescription("Windows.Forms.ProcessBar Created by [Mr. Behzad Khosravifar](mailto:Behzad.Khosravifar@gmail.com)")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("4c59e64e-1378-4741-ba89-62cc85a3d01c")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | #pragma warning disable 1607
35 | [assembly: AssemblyVersion("1.0.1.0")]
36 | [assembly: AssemblyFileVersion("1.0.1.0")]
37 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.Forms.ProcessBar/Windows.Forms.ProcessBar.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {EBD48B8C-EFD1-42CB-A980-BAEAEF8A60E1}
8 | Library
9 | Properties
10 | Windows.Forms
11 | Windows.Forms.ProcessBar
12 | v2.0
13 | 512
14 |
15 |
16 | true
17 | full
18 | false
19 | ..\..\..\out\ErrorLogAnalyzer\
20 | DEBUG;TRACE
21 | prompt
22 | 4
23 | 1607
24 |
25 |
26 | none
27 | true
28 | ..\..\..\out\ErrorLogAnalyzer\
29 | TRACE
30 | prompt
31 | 4
32 | 1607
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | Component
42 |
43 |
44 |
45 |
46 |
47 |
54 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/Decoding/GifApplicationExtension.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Text;
4 |
5 | namespace Windows.WpfAnimatedWaitSplash.Decoding
6 | {
7 | // label 0xFF
8 | internal class GifApplicationExtension : GifExtension
9 | {
10 | internal const int ExtensionLabel = 0xFF;
11 |
12 | public int BlockSize { get; private set; }
13 | public string ApplicationIdentifier { get; private set; }
14 | public byte[] AuthenticationCode { get; private set; }
15 | public byte[] Data { get; private set; }
16 |
17 | private GifApplicationExtension()
18 | {
19 | }
20 |
21 | internal override GifBlockKind Kind
22 | {
23 | get { return GifBlockKind.SpecialPurpose; }
24 | }
25 |
26 | internal static GifApplicationExtension ReadApplication(Stream stream)
27 | {
28 | var ext = new GifApplicationExtension();
29 | ext.Read(stream);
30 | return ext;
31 | }
32 |
33 | private void Read(Stream stream)
34 | {
35 | // Note: at this point, the label (0xFF) has already been read
36 |
37 | byte[] bytes = new byte[12];
38 | stream.ReadAll(bytes, 0, bytes.Length);
39 | BlockSize = bytes[0]; // should always be 11
40 | if (BlockSize != 11)
41 | throw GifHelpers.InvalidBlockSizeException("Application Extension", 11, BlockSize);
42 |
43 | ApplicationIdentifier = Encoding.ASCII.GetString(bytes, 1, 8);
44 | byte[] authCode = new byte[3];
45 | Array.Copy(bytes, 9, authCode, 0, 3);
46 | AuthenticationCode = authCode;
47 | Data = GifHelpers.ReadDataBlocks(stream, false);
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/Decoding/GifBlock.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.IO;
3 |
4 | namespace Windows.WpfAnimatedWaitSplash.Decoding
5 | {
6 | internal abstract class GifBlock
7 | {
8 | internal static GifBlock ReadBlock(Stream stream, IEnumerable controlExtensions, bool metadataOnly)
9 | {
10 | int blockId = stream.ReadByte();
11 | if (blockId < 0)
12 | throw GifHelpers.UnexpectedEndOfStreamException();
13 | switch (blockId)
14 | {
15 | case GifExtension.ExtensionIntroducer:
16 | return GifExtension.ReadExtension(stream, controlExtensions, metadataOnly);
17 | case GifFrame.ImageSeparator:
18 | return GifFrame.ReadFrame(stream, controlExtensions, metadataOnly);
19 | case GifTrailer.TrailerByte:
20 | return GifTrailer.ReadTrailer();
21 | default:
22 | throw GifHelpers.UnknownBlockTypeException(blockId);
23 | }
24 | }
25 |
26 | internal abstract GifBlockKind Kind { get; }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/Decoding/GifBlockKind.cs:
--------------------------------------------------------------------------------
1 | namespace Windows.WpfAnimatedWaitSplash.Decoding
2 | {
3 | internal enum GifBlockKind
4 | {
5 | Control,
6 | GraphicRendering,
7 | SpecialPurpose,
8 | Other
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/Decoding/GifColor.cs:
--------------------------------------------------------------------------------
1 | namespace Windows.WpfAnimatedWaitSplash.Decoding
2 | {
3 | internal struct GifColor
4 | {
5 | private readonly byte _r;
6 | private readonly byte _g;
7 | private readonly byte _b;
8 |
9 | internal GifColor(byte r, byte g, byte b)
10 | {
11 | _r = r;
12 | _g = g;
13 | _b = b;
14 | }
15 |
16 | public byte R { get { return _r; } }
17 | public byte G { get { return _g; } }
18 | public byte B { get { return _b; } }
19 |
20 | public override string ToString()
21 | {
22 | return string.Format("#{0:x2}{1:x2}{2:x2}", _r, _g, _b);
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/Decoding/GifCommentExtension.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using System.Text;
3 |
4 | namespace Windows.WpfAnimatedWaitSplash.Decoding
5 | {
6 | internal class GifCommentExtension : GifExtension
7 | {
8 | internal const int ExtensionLabel = 0xFE;
9 |
10 | public string Text { get; private set; }
11 |
12 | private GifCommentExtension()
13 | {
14 | }
15 |
16 | internal override GifBlockKind Kind
17 | {
18 | get { return GifBlockKind.SpecialPurpose; }
19 | }
20 |
21 | internal static GifCommentExtension ReadComment(Stream stream)
22 | {
23 | var comment = new GifCommentExtension();
24 | comment.Read(stream);
25 | return comment;
26 | }
27 |
28 | private void Read(Stream stream)
29 | {
30 | // Note: at this point, the label (0xFE) has already been read
31 |
32 | var bytes = GifHelpers.ReadDataBlocks(stream, false);
33 | if (bytes != null)
34 | Text = Encoding.ASCII.GetString(bytes);
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/Decoding/GifDecoderException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Windows.WpfAnimatedWaitSplash.Decoding
4 | {
5 | [Serializable]
6 | internal class GifDecoderException : Exception
7 | {
8 | internal GifDecoderException() { }
9 | internal GifDecoderException(string message) : base(message) { }
10 | internal GifDecoderException(string message, Exception inner) : base(message, inner) { }
11 | protected GifDecoderException(
12 | System.Runtime.Serialization.SerializationInfo info,
13 | System.Runtime.Serialization.StreamingContext context)
14 | : base(info, context) { }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/Decoding/GifExtension.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.IO;
3 |
4 | namespace Windows.WpfAnimatedWaitSplash.Decoding
5 | {
6 | internal abstract class GifExtension : GifBlock
7 | {
8 | internal const int ExtensionIntroducer = 0x21;
9 |
10 | internal static GifExtension ReadExtension(Stream stream, IEnumerable controlExtensions, bool metadataOnly)
11 | {
12 | // Note: at this point, the Extension Introducer (0x21) has already been read
13 |
14 | int label = stream.ReadByte();
15 | if (label < 0)
16 | throw GifHelpers.UnexpectedEndOfStreamException();
17 | switch (label)
18 | {
19 | case GifGraphicControlExtension.ExtensionLabel:
20 | return GifGraphicControlExtension.ReadGraphicsControl(stream);
21 | case GifCommentExtension.ExtensionLabel:
22 | return GifCommentExtension.ReadComment(stream);
23 | case GifPlainTextExtension.ExtensionLabel:
24 | return GifPlainTextExtension.ReadPlainText(stream, controlExtensions, metadataOnly);
25 | case GifApplicationExtension.ExtensionLabel:
26 | return GifApplicationExtension.ReadApplication(stream);
27 | default:
28 | throw GifHelpers.UnknownExtensionTypeException(label);
29 | }
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/Decoding/GifFile.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.IO;
3 | using System.Linq;
4 |
5 | namespace Windows.WpfAnimatedWaitSplash.Decoding
6 | {
7 | internal class GifFile
8 | {
9 | public GifHeader Header { get; private set; }
10 | public GifColor[] GlobalColorTable { get; set; }
11 | public IList Frames { get; set; }
12 | public IList Extensions { get; set; }
13 | public ushort RepeatCount { get; set; }
14 |
15 | private GifFile()
16 | {
17 | }
18 |
19 | internal static GifFile ReadGifFile(Stream stream, bool metadataOnly)
20 | {
21 | var file = new GifFile();
22 | file.Read(stream, metadataOnly);
23 | return file;
24 | }
25 |
26 | private void Read(Stream stream, bool metadataOnly)
27 | {
28 | Header = GifHeader.ReadHeader(stream);
29 |
30 | if (Header.LogicalScreenDescriptor.HasGlobalColorTable)
31 | {
32 | GlobalColorTable = GifHelpers.ReadColorTable(stream, Header.LogicalScreenDescriptor.GlobalColorTableSize);
33 | }
34 | ReadFrames(stream, metadataOnly);
35 |
36 | var netscapeExtension =
37 | Extensions
38 | .OfType()
39 | .FirstOrDefault(GifHelpers.IsNetscapeExtension);
40 |
41 | if (netscapeExtension != null)
42 | RepeatCount = GifHelpers.GetRepeatCount(netscapeExtension);
43 | else
44 | RepeatCount = 1;
45 | }
46 |
47 | private void ReadFrames(Stream stream, bool metadataOnly)
48 | {
49 | List frames = new List();
50 | List controlExtensions = new List();
51 | List specialExtensions = new List();
52 | while (true)
53 | {
54 | var block = GifBlock.ReadBlock(stream, controlExtensions, metadataOnly);
55 |
56 | if (block.Kind == GifBlockKind.GraphicRendering)
57 | controlExtensions = new List();
58 |
59 | if (block is GifFrame)
60 | {
61 | frames.Add((GifFrame)block);
62 | }
63 | else if (block is GifExtension)
64 | {
65 | var extension = (GifExtension)block;
66 | switch (extension.Kind)
67 | {
68 | case GifBlockKind.Control:
69 | controlExtensions.Add(extension);
70 | break;
71 | case GifBlockKind.SpecialPurpose:
72 | specialExtensions.Add(extension);
73 | break;
74 | }
75 | }
76 | else if (block is GifTrailer)
77 | {
78 | break;
79 | }
80 | }
81 |
82 | this.Frames = frames.AsReadOnly();
83 | this.Extensions = specialExtensions.AsReadOnly();
84 | }
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/Decoding/GifFrame.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.IO;
3 | using System.Linq;
4 |
5 | namespace Windows.WpfAnimatedWaitSplash.Decoding
6 | {
7 | internal class GifFrame : GifBlock
8 | {
9 | internal const int ImageSeparator = 0x2C;
10 |
11 | public GifImageDescriptor Descriptor { get; private set; }
12 | public GifColor[] LocalColorTable { get; private set; }
13 | public IList Extensions { get; private set; }
14 | public GifImageData ImageData { get; private set; }
15 |
16 | private GifFrame()
17 | {
18 | }
19 |
20 | internal override GifBlockKind Kind
21 | {
22 | get { return GifBlockKind.GraphicRendering; }
23 | }
24 |
25 | internal static GifFrame ReadFrame(Stream stream, IEnumerable controlExtensions, bool metadataOnly)
26 | {
27 | var frame = new GifFrame();
28 |
29 | frame.Read(stream, controlExtensions, metadataOnly);
30 |
31 | return frame;
32 | }
33 |
34 | private void Read(Stream stream, IEnumerable controlExtensions, bool metadataOnly)
35 | {
36 | // Note: at this point, the Image Separator (0x2C) has already been read
37 |
38 | Descriptor = GifImageDescriptor.ReadImageDescriptor(stream);
39 | if (Descriptor.HasLocalColorTable)
40 | {
41 | LocalColorTable = GifHelpers.ReadColorTable(stream, Descriptor.LocalColorTableSize);
42 | }
43 | ImageData = GifImageData.ReadImageData(stream, metadataOnly);
44 | Extensions = controlExtensions.ToList().AsReadOnly();
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/Decoding/GifGraphicControlExtension.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 |
4 | namespace Windows.WpfAnimatedWaitSplash.Decoding
5 | {
6 | // label 0xF9
7 | internal class GifGraphicControlExtension : GifExtension
8 | {
9 | internal const int ExtensionLabel = 0xF9;
10 |
11 | public int BlockSize { get; private set; }
12 | public int DisposalMethod { get; private set; }
13 | public bool UserInput { get; private set; }
14 | public bool HasTransparency { get; private set; }
15 | public int Delay { get; private set; }
16 | public int TransparencyIndex { get; private set; }
17 |
18 | private GifGraphicControlExtension()
19 | {
20 |
21 | }
22 |
23 | internal override GifBlockKind Kind
24 | {
25 | get { return GifBlockKind.Control; }
26 | }
27 |
28 | internal static GifGraphicControlExtension ReadGraphicsControl(Stream stream)
29 | {
30 | var ext = new GifGraphicControlExtension();
31 | ext.Read(stream);
32 | return ext;
33 | }
34 |
35 | private void Read(Stream stream)
36 | {
37 | // Note: at this point, the label (0xF9) has already been read
38 |
39 | byte[] bytes = new byte[6];
40 | stream.ReadAll(bytes, 0, bytes.Length);
41 | BlockSize = bytes[0]; // should always be 4
42 | if (BlockSize != 4)
43 | throw GifHelpers.InvalidBlockSizeException("Graphic Control Extension", 4, BlockSize);
44 | byte packedFields = bytes[1];
45 | DisposalMethod = (packedFields & 0x1C) >> 2;
46 | UserInput = (packedFields & 0x02) != 0;
47 | HasTransparency = (packedFields & 0x01) != 0;
48 | Delay = BitConverter.ToUInt16(bytes, 2) * 10; // milliseconds
49 | TransparencyIndex = bytes[4];
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/Decoding/GifHeader.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 |
3 | namespace Windows.WpfAnimatedWaitSplash.Decoding
4 | {
5 | internal class GifHeader : GifBlock
6 | {
7 | public string Signature { get; private set; }
8 | public string Version { get; private set; }
9 | public GifLogicalScreenDescriptor LogicalScreenDescriptor { get; private set; }
10 |
11 | private GifHeader()
12 | {
13 | }
14 |
15 | internal override GifBlockKind Kind
16 | {
17 | get { return GifBlockKind.Other; }
18 | }
19 |
20 | internal static GifHeader ReadHeader(Stream stream)
21 | {
22 | var header = new GifHeader();
23 | header.Read(stream);
24 | return header;
25 | }
26 |
27 | private void Read(Stream stream)
28 | {
29 | Signature = GifHelpers.ReadString(stream, 3);
30 | if (Signature != "GIF")
31 | throw GifHelpers.InvalidSignatureException(Signature);
32 | Version = GifHelpers.ReadString(stream, 3);
33 | if (Version != "87a" && Version != "89a")
34 | throw GifHelpers.UnsupportedVersionException(Version);
35 | LogicalScreenDescriptor = GifLogicalScreenDescriptor.ReadLogicalScreenDescriptor(stream);
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/Decoding/GifImageData.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 |
3 | namespace Windows.WpfAnimatedWaitSplash.Decoding
4 | {
5 | internal class GifImageData
6 | {
7 | public byte LzwMinimumCodeSize { get; set; }
8 | public byte[] CompressedData { get; set; }
9 |
10 | private GifImageData()
11 | {
12 | }
13 |
14 | internal static GifImageData ReadImageData(Stream stream, bool metadataOnly)
15 | {
16 | var imgData = new GifImageData();
17 | imgData.Read(stream, metadataOnly);
18 | return imgData;
19 | }
20 |
21 | private void Read(Stream stream, bool metadataOnly)
22 | {
23 | LzwMinimumCodeSize = (byte)stream.ReadByte();
24 | CompressedData = GifHelpers.ReadDataBlocks(stream, metadataOnly);
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/Decoding/GifImageDescriptor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 |
4 | namespace Windows.WpfAnimatedWaitSplash.Decoding
5 | {
6 | internal class GifImageDescriptor
7 | {
8 | public int Left { get; private set; }
9 | public int Top { get; private set; }
10 | public int Width { get; private set; }
11 | public int Height { get; private set; }
12 | public bool HasLocalColorTable { get; private set; }
13 | public bool Interlace { get; private set; }
14 | public bool IsLocalColorTableSorted { get; private set; }
15 | public int LocalColorTableSize { get; private set; }
16 |
17 | private GifImageDescriptor()
18 | {
19 | }
20 |
21 | internal static GifImageDescriptor ReadImageDescriptor(Stream stream)
22 | {
23 | var descriptor = new GifImageDescriptor();
24 | descriptor.Read(stream);
25 | return descriptor;
26 | }
27 |
28 | private void Read(Stream stream)
29 | {
30 | byte[] bytes = new byte[9];
31 | stream.ReadAll(bytes, 0, bytes.Length);
32 | Left = BitConverter.ToUInt16(bytes, 0);
33 | Top = BitConverter.ToUInt16(bytes, 2);
34 | Width = BitConverter.ToUInt16(bytes, 4);
35 | Height = BitConverter.ToUInt16(bytes, 6);
36 | byte packedFields = bytes[8];
37 | HasLocalColorTable = (packedFields & 0x80) != 0;
38 | Interlace = (packedFields & 0x40) != 0;
39 | IsLocalColorTableSorted = (packedFields & 0x20) != 0;
40 | LocalColorTableSize = 1 << ((packedFields & 0x07) + 1);
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/Decoding/GifLogicalScreenDescriptor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 |
4 | namespace Windows.WpfAnimatedWaitSplash.Decoding
5 | {
6 | internal class GifLogicalScreenDescriptor
7 | {
8 | public int Width { get; private set; }
9 | public int Height { get; private set; }
10 | public bool HasGlobalColorTable { get; private set; }
11 | public int ColorResolution { get; private set; }
12 | public bool IsGlobalColorTableSorted { get; private set; }
13 | public int GlobalColorTableSize { get; private set; }
14 | public int BackgroundColorIndex { get; private set; }
15 | public double PixelAspectRatio { get; private set; }
16 |
17 | internal static GifLogicalScreenDescriptor ReadLogicalScreenDescriptor(Stream stream)
18 | {
19 | var descriptor = new GifLogicalScreenDescriptor();
20 | descriptor.Read(stream);
21 | return descriptor;
22 | }
23 |
24 | private void Read(Stream stream)
25 | {
26 | byte[] bytes = new byte[7];
27 | stream.ReadAll(bytes, 0, bytes.Length);
28 |
29 | Width = BitConverter.ToUInt16(bytes, 0);
30 | Height = BitConverter.ToUInt16(bytes, 2);
31 | byte packedFields = bytes[4];
32 | HasGlobalColorTable = (packedFields & 0x80) != 0;
33 | ColorResolution = ((packedFields & 0x70) >> 4) + 1;
34 | IsGlobalColorTableSorted = (packedFields & 0x08) != 0;
35 | GlobalColorTableSize = 1 << ((packedFields & 0x07) + 1);
36 | BackgroundColorIndex = bytes[5];
37 | PixelAspectRatio =
38 | bytes[5] == 0
39 | ? 0.0
40 | : (15 + bytes[5]) / 64.0;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/Decoding/GifPlainTextExtension.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace Windows.WpfAnimatedWaitSplash.Decoding
8 | {
9 | // label 0x01
10 | internal class GifPlainTextExtension : GifExtension
11 | {
12 | internal const int ExtensionLabel = 0x01;
13 |
14 | public int BlockSize { get; private set; }
15 | public int Left { get; private set; }
16 | public int Top { get; private set; }
17 | public int Width { get; private set; }
18 | public int Height { get; private set; }
19 | public int CellWidth { get; private set; }
20 | public int CellHeight { get; private set; }
21 | public int ForegroundColorIndex { get; private set; }
22 | public int BackgroundColorIndex { get; private set; }
23 | public string Text { get; private set; }
24 |
25 | public IList Extensions { get; private set; }
26 |
27 | private GifPlainTextExtension()
28 | {
29 | }
30 |
31 | internal override GifBlockKind Kind
32 | {
33 | get { return GifBlockKind.GraphicRendering; }
34 | }
35 |
36 | internal static GifPlainTextExtension ReadPlainText(Stream stream, IEnumerable controlExtensions, bool metadataOnly)
37 | {
38 | var plainText = new GifPlainTextExtension();
39 | plainText.Read(stream, controlExtensions, metadataOnly);
40 | return plainText;
41 | }
42 |
43 | private void Read(Stream stream, IEnumerable controlExtensions, bool metadataOnly)
44 | {
45 | // Note: at this point, the label (0x01) has already been read
46 |
47 | byte[] bytes = new byte[13];
48 | stream.ReadAll(bytes,0, bytes.Length);
49 |
50 | BlockSize = bytes[0];
51 | if (BlockSize != 12)
52 | throw GifHelpers.InvalidBlockSizeException("Plain Text Extension", 12, BlockSize);
53 |
54 | Left = BitConverter.ToUInt16(bytes, 1);
55 | Top = BitConverter.ToUInt16(bytes, 3);
56 | Width = BitConverter.ToUInt16(bytes, 5);
57 | Height = BitConverter.ToUInt16(bytes, 7);
58 | CellWidth = bytes[9];
59 | CellHeight = bytes[10];
60 | ForegroundColorIndex = bytes[11];
61 | BackgroundColorIndex = bytes[12];
62 |
63 | var dataBytes = GifHelpers.ReadDataBlocks(stream, metadataOnly);
64 | Text = Encoding.ASCII.GetString(dataBytes);
65 | Extensions = controlExtensions.ToList().AsReadOnly();
66 | }
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/Decoding/GifTrailer.cs:
--------------------------------------------------------------------------------
1 | namespace Windows.WpfAnimatedWaitSplash.Decoding
2 | {
3 | internal class GifTrailer : GifBlock
4 | {
5 | internal const int TrailerByte = 0x3B;
6 |
7 | private GifTrailer()
8 | {
9 | }
10 |
11 | internal override GifBlockKind Kind
12 | {
13 | get { return GifBlockKind.Other; }
14 | }
15 |
16 | internal static GifTrailer ReadTrailer()
17 | {
18 | return new GifTrailer();
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/Fonts/digital-7 (italic).ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/Fonts/digital-7 (italic).ttf
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/Fonts/digital-7.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/Fonts/digital-7.ttf
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using System.Windows.Markup;
5 | using Windows.WpfAnimatedWaitSplash.Properties;
6 |
7 | [assembly: AssemblyTitle("WpfAnimatedGif")]
8 | [assembly: AssemblyDescription("A library to display animated GIF images in WPF")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("Behzad Khosravifar")]
11 | [assembly: AssemblyProduct("WpfAnimatedGif")]
12 | [assembly: AssemblyCopyright("Copyright © 2014")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | [assembly: ComVisible(false)]
17 |
18 | [assembly: Guid("a985ebe7-753b-4d73-b363-4b63d87f98b7")]
19 |
20 | [assembly: AssemblyVersion(VersionInfo.VersionString)]
21 | [assembly: AssemblyFileVersion(VersionInfo.VersionString)]
22 | [assembly: AssemblyInformationalVersion(VersionInfo.VersionString)]
23 |
24 | [assembly: XmlnsDefinition("http://wpfanimatedgif.codeplex.com", "WpfAnimatedGif")]
25 | [assembly: XmlnsPrefix("http://wpfanimatedgif.codeplex.com", "gif")]
26 |
27 | [assembly: InternalsVisibleTo("WpfAnimatedGif.Demo")]
28 |
29 | namespace Windows.WpfAnimatedWaitSplash.Properties
30 | {
31 | class VersionInfo
32 | {
33 | ///
34 | /// Single place to define version
35 | ///
36 | public const string VersionString = "1.4.12";
37 | }
38 | }
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/WaitSplash/Splash.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/WaitSplash/ajax_loader_metal_300.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/WaitSplash/ajax_loader_metal_300.gif
--------------------------------------------------------------------------------
/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/WaitSplash/loader.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezzad/ErrorControlSystem/8fea9ca56bf9dd9760fb2526e7c05317ebf4e6fe/src/Error Log Analyzer/Windows.WpfAnimatedWaitSplash/WaitSplash/loader.gif
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.Console/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.Console/ErrorControlSystem.Examples.Console.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {D5777125-5D95-4A23-AFCB-84475B0E341E}
8 | Exe
9 | Properties
10 | ErrorControlSystem.Examples.Console
11 | ErrorControlSystem.Examples.Console
12 | v4.5
13 | 512
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | true
20 | ..\..\..\out\Examples\Console\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | none
28 | true
29 | ..\..\..\out\Examples\Console\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | {515c50e8-a9a0-4ac0-8591-7369c1a31dc8}
57 | ErrorControlSystem
58 |
59 |
60 |
61 |
68 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.Console/Program.cs:
--------------------------------------------------------------------------------
1 | namespace ErrorControlSystem.Examples.Console
2 | {
3 | using System;
4 |
5 | using ErrorControlSystem;
6 |
7 | class Program
8 | {
9 | static void Main(string[] args)
10 | {
11 | // Start ErrorControlSystem Engine for console applications
12 | ExceptionHandler.Engine.Start(".", "UsersManagements");
13 |
14 | //
15 | // Throw Test Exception
16 | Console.Write("Throw a System.Exception (y/n): ");
17 |
18 | if (Console.ReadKey().Key == ConsoleKey.Y)
19 | {
20 | throw new Exception("This is an exception thrown from console sample application.");
21 | }
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.Console/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("ErrorControlSystem.Examples.Console")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("ErrorControlSystem.Examples.Console")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("8d414454-8523-4923-86e1-dca430acf0b6")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.VisualBasicWinForms/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.VisualBasicWinForms/Form1.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class Form1
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form overrides dispose to clean up the component list.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Required by the Windows Form Designer
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTE: The following procedure is required by the Windows Form Designer
21 | 'It can be modified using the Windows Form Designer.
22 | 'Do not modify it using the code editor.
23 | _
24 | Private Sub InitializeComponent()
25 | Me.btnThrowHandledExps = New System.Windows.Forms.Button()
26 | Me.btnThrowUnHandledExps = New System.Windows.Forms.Button()
27 | Me.SuspendLayout()
28 | '
29 | 'btnThrowHandledExps
30 | '
31 | Me.btnThrowHandledExps.Font = New System.Drawing.Font("Microsoft Sans Serif", 18.0!)
32 | Me.btnThrowHandledExps.Location = New System.Drawing.Point(12, 12)
33 | Me.btnThrowHandledExps.Name = "btnThrowHandledExps"
34 | Me.btnThrowHandledExps.Size = New System.Drawing.Size(381, 133)
35 | Me.btnThrowHandledExps.TabIndex = 0
36 | Me.btnThrowHandledExps.Text = "Throw Handled Exps"
37 | Me.btnThrowHandledExps.UseVisualStyleBackColor = True
38 | '
39 | 'btnThrowUnHandledExps
40 | '
41 | Me.btnThrowUnHandledExps.Font = New System.Drawing.Font("Microsoft Sans Serif", 18.0!)
42 | Me.btnThrowUnHandledExps.Location = New System.Drawing.Point(12, 177)
43 | Me.btnThrowUnHandledExps.Name = "btnThrowUnHandledExps"
44 | Me.btnThrowUnHandledExps.Size = New System.Drawing.Size(381, 133)
45 | Me.btnThrowUnHandledExps.TabIndex = 0
46 | Me.btnThrowUnHandledExps.Text = "Throw UnHandled Exps"
47 | Me.btnThrowUnHandledExps.UseVisualStyleBackColor = True
48 | '
49 | 'Form1
50 | '
51 | Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!)
52 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
53 | Me.ClientSize = New System.Drawing.Size(404, 374)
54 | Me.Controls.Add(Me.btnThrowUnHandledExps)
55 | Me.Controls.Add(Me.btnThrowHandledExps)
56 | Me.Name = "Form1"
57 | Me.Text = "Form1"
58 | Me.ResumeLayout(False)
59 |
60 | End Sub
61 | Friend WithEvents btnThrowHandledExps As System.Windows.Forms.Button
62 | Friend WithEvents btnThrowUnHandledExps As System.Windows.Forms.Button
63 |
64 | End Class
65 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.VisualBasicWinForms/MainModule.vb:
--------------------------------------------------------------------------------
1 | Imports ErrorControlSystem
2 |
3 | Module MainModule
4 | Sub Main()
5 |
6 | ' ------------------ Initial Error Control System --------------------------------
7 | ExceptionHandler.Engine.Start("localhost", "UsersManagements")
8 |
9 | 'Except 'NotImplementedException' from raise log
10 | ExceptionHandler.Filter.ExemptedExceptionTypes.Add(GetType(NotImplementedException))
11 |
12 | 'Filter 'Exception' type from Snapshot capturing
13 | ExceptionHandler.Filter.NonSnapshotExceptionTypes.Add(GetType(FormatException))
14 |
15 | 'Add extra data for labeling exceptions
16 | ExceptionHandler.Filter.AttachExtraData.Add("VBWinForms v3.7", "beta version")
17 |
18 | ' ---------------------------------------------------------------------------------
19 |
20 | Application.Run(New Form1())
21 | End Sub
22 | End Module
23 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.VisualBasicWinForms/My Project/Application.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' This code was generated by a tool.
4 | ' Runtime Version:4.0.30319.34014
5 | '
6 | ' Changes to this file may cause incorrect behavior and will be lost if
7 | ' the code is regenerated.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 |
15 | Namespace My
16 |
17 | 'NOTE: This file is auto-generated; do not modify it directly. To make changes,
18 | ' or if you encounter build errors in this file, go to the Project Designer
19 | ' (go to Project Properties or double-click the My Project node in
20 | ' Solution Explorer), and make changes on the Application tab.
21 | '
22 | Partial Friend Class MyApplication
23 |
24 | _
25 | Public Sub New()
26 | MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
27 | Me.IsSingleInstance = True
28 | Me.EnableVisualStyles = True
29 | Me.SaveMySettingsOnExit = True
30 | Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
31 | End Sub
32 |
33 | _
34 | Protected Overrides Sub OnCreateMainForm()
35 | Me.MainForm = Global.ErrorControlSystem.Examples.VisualBasicWinForms.Form1
36 | End Sub
37 |
38 |
39 | Private Sub MyApplication_Startup(sender As Object, e As ApplicationServices.StartupEventArgs) Handles Me.Startup
40 | ' ------------------ Initial Error Control System --------------------------------
41 | ExceptionHandler.Engine.Start("localhost", "UsersManagements")
42 | ' ---------------------------------------------------------------------------------
43 | End Sub
44 | End Class
45 | End Namespace
46 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.VisualBasicWinForms/My Project/Application.myapp:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 | Form1
5 | true
6 | 0
7 | true
8 | 0
9 | true
10 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.VisualBasicWinForms/My Project/AssemblyInfo.vb:
--------------------------------------------------------------------------------
1 | Imports System
2 | Imports System.Reflection
3 | Imports System.Runtime.InteropServices
4 |
5 | ' General Information about an assembly is controlled through the following
6 | ' set of attributes. Change these attribute values to modify the information
7 | ' associated with an assembly.
8 |
9 | ' Review the values of the assembly attributes
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | 'The following GUID is for the ID of the typelib if this project is exposed to COM
21 |
22 |
23 | ' Version information for an assembly consists of the following four values:
24 | '
25 | ' Major Version
26 | ' Minor Version
27 | ' Build Number
28 | ' Revision
29 | '
30 | ' You can specify all the values or you can default the Build and Revision Numbers
31 | ' by using the '*' as shown below:
32 | '
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.VisualBasicWinForms/My Project/Resources.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' This code was generated by a tool.
4 | ' Runtime Version:4.0.30319.34014
5 | '
6 | ' Changes to this file may cause incorrect behavior and will be lost if
7 | ' the code is regenerated.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 | Imports System
15 |
16 | Namespace My.Resources
17 |
18 | 'This class was auto-generated by the StronglyTypedResourceBuilder
19 | 'class via a tool like ResGen or Visual Studio.
20 | 'To add or remove a member, edit your .ResX file then rerun ResGen
21 | 'with the /str option, or rebuild your VS project.
22 | '''
23 | ''' A strongly-typed resource class, for looking up localized strings, etc.
24 | '''
25 | _
29 | Friend Module Resources
30 |
31 | Private resourceMan As Global.System.Resources.ResourceManager
32 |
33 | Private resourceCulture As Global.System.Globalization.CultureInfo
34 |
35 | '''
36 | ''' Returns the cached ResourceManager instance used by this class.
37 | '''
38 | _
39 | Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
40 | Get
41 | If Object.ReferenceEquals(resourceMan, Nothing) Then
42 | Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("ErrorControlSystem.Examples.VisualBasicWinForms.Resources", GetType(Resources).Assembly)
43 | resourceMan = temp
44 | End If
45 | Return resourceMan
46 | End Get
47 | End Property
48 |
49 | '''
50 | ''' Overrides the current thread's CurrentUICulture property for all
51 | ''' resource lookups using this strongly typed resource class.
52 | '''
53 | _
54 | Friend Property Culture() As Global.System.Globalization.CultureInfo
55 | Get
56 | Return resourceCulture
57 | End Get
58 | Set
59 | resourceCulture = value
60 | End Set
61 | End Property
62 | End Module
63 | End Namespace
64 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.VisualBasicWinForms/My Project/Settings.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' This code was generated by a tool.
4 | ' Runtime Version:4.0.30319.34014
5 | '
6 | ' Changes to this file may cause incorrect behavior and will be lost if
7 | ' the code is regenerated.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 |
15 | Namespace My
16 |
17 | _
20 | Partial Friend NotInheritable Class MySettings
21 | Inherits Global.System.Configuration.ApplicationSettingsBase
22 |
23 | Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
24 |
25 | #Region "My.Settings Auto-Save Functionality"
26 | #If _MyType = "WindowsForms" Then
27 | Private Shared addedHandler As Boolean
28 |
29 | Private Shared addedHandlerLockObject As New Object
30 |
31 | _
32 | Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
33 | If My.Application.SaveMySettingsOnExit Then
34 | My.Settings.Save()
35 | End If
36 | End Sub
37 | #End If
38 | #End Region
39 |
40 | Public Shared ReadOnly Property [Default]() As MySettings
41 | Get
42 |
43 | #If _MyType = "WindowsForms" Then
44 | If Not addedHandler Then
45 | SyncLock addedHandlerLockObject
46 | If Not addedHandler Then
47 | AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
48 | addedHandler = True
49 | End If
50 | End SyncLock
51 | End If
52 | #End If
53 | Return defaultInstance
54 | End Get
55 | End Property
56 | End Class
57 | End Namespace
58 |
59 | Namespace My
60 |
61 | _
64 | Friend Module MySettingsProperty
65 |
66 | _
67 | Friend ReadOnly Property Settings() As Global.ErrorControlSystem.Examples.VisualBasicWinForms.My.MySettings
68 | Get
69 | Return Global.ErrorControlSystem.Examples.VisualBasicWinForms.My.MySettings.Default
70 | End Get
71 | End Property
72 | End Module
73 | End Namespace
74 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.VisualBasicWinForms/My Project/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.VisualBasicWinForms/My Project/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.WPF/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.WPF/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.WPF/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using ErrorControlSystem;
3 |
4 | namespace ErrorControlSystem.Examples.WPF
5 | {
6 | ///
7 | /// Interaction logic for App.xaml
8 | ///
9 | public partial class App : Application
10 | {
11 | public App()
12 | {
13 | ExceptionHandler.Engine.Start(".", "UsersManagements");
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.WPF/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.WPF/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("ErrorControlSystem.Examples.WPF")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("")]
14 | [assembly: AssemblyProduct("ErrorControlSystem.Examples.WPF")]
15 | [assembly: AssemblyCopyright("Copyright © 2015")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.0.0.0")]
55 | [assembly: AssemblyFileVersion("1.0.0.0")]
56 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.WPF/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.34014
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ErrorControlSystem.Examples.WPF.Properties
12 | {
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// Returns the cached ResourceManager instance used by this class.
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ErrorControlSystem.Examples.WPF.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// Overrides the current thread's CurrentUICulture property for all
56 | /// resource lookups using this strongly typed resource class.
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.WPF/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.34014
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ErrorControlSystem.Examples.WPF.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.WPF/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.WinForms/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.WinForms/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 | using ErrorControlSystem.Examples.WinForms.SomeNamespace;
4 | using ErrorControlSystem.Shared;
5 |
6 | namespace ErrorControlSystem.Examples.WinForms
7 | {
8 | static class Program
9 | {
10 | ///
11 | /// The main entry point for the application.
12 | ///
13 | [STAThread]
14 | private static void Main()
15 | {
16 | //
17 | // ------------------ Initial Error Control System --------------------------------
18 | //
19 | ExceptionHandler.Engine.Start("localhost", "UsersManagements", "sa", "123",
20 | ErrorHandlingOptions.Default &
21 | ~ErrorHandlingOptions.ResizeSnapshots);
22 |
23 | // Or Set Option this way:
24 | ErrorHandlingOption.ResizeSnapshots = false;
25 | ErrorHandlingOption.ReportHandledExceptions = true;
26 | ErrorHandlingOption.LogOnTheFly = true; // don't cache
27 |
28 | //
29 | // Some of the optional configuration items.
30 | //
31 | // Except 'NotImplementedException' from raise log
32 | ExceptionHandler.Filter.ExemptedExceptionTypes.Add(typeof(NotImplementedException));
33 |
34 | // Filter 'Exception' type from Snapshot capturing
35 | ExceptionHandler.Filter.NonSnapshotExceptionTypes.Add(typeof(FormatException));
36 |
37 | // Add extra data for labeling exceptions
38 | ExceptionHandler.Filter.AttachExtraData.Add("WinForms v3", "beta version");
39 |
40 | // Filter a method of a specific class in my assembly from raise unhanded exceptions log
41 | ExceptionHandler.Filter.ExemptedCodeScopes.Add(
42 | new CodeScope("Assembly", "Namespace", "Class", "Method"));
43 |
44 | // Filter a method of a specific class in my assembly from raise unhanded exceptions log
45 | ExceptionHandler.Filter.ExemptedCodeScopes.Add(
46 | new CodeScope("", "", "ExpThrower", ""));
47 |
48 | // Do not raise any exception in other code places.
49 | //ExceptionHandler.Filter.JustRaiseErrorCodeScopes.Add(
50 | // new CodeScope("Assembly", "Namespace", "Class", "Method"));
51 | //
52 | // Show unhandled exception message customized mode.
53 | //ExceptionHandler.OnShowUnhandledError += AlertUnhandledErrors;
54 | //
55 | // ---------------------------------------------------------------------------------
56 | //
57 |
58 | Application.EnableVisualStyles();
59 | Application.SetCompatibleTextRenderingDefault(false);
60 | Application.Run(new FormTest());
61 | }
62 |
63 | ///
64 | /// Show unhandled exception message customized mode.
65 | ///
66 | /// Raw exception object
67 | /// Compiled error object
68 | public static void AlertUnhandledErrors(object sender, UnhandledErrorEventArgs e)
69 | {
70 | MessageBox.Show(e.ErrorObject.Message);
71 | }
72 |
73 | public static void Exp()
74 | {
75 | throw new Exception("Test UnHandled MainThread Exception");
76 | }
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.WinForms/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("ErrorControlSystem.Examples.WinForms")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("ErrorControlSystem.Examples.WinForms")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("21ce6d42-c904-48cb-a1a5-df8f2bb154c8")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("2.0.0.0")]
36 | [assembly: AssemblyFileVersion("2.0.0.0")]
37 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.WinForms/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.34014
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ErrorControlSystem.Examples.WinForms.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.WinForms/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.WinForms/Properties/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
54 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.WinFormsDotNet2/Form1.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace ErrorControlSystem.Examples.WinFormsDotNet2
2 | {
3 | partial class Form1
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.btnThrowExp = new System.Windows.Forms.Button();
32 | this.SuspendLayout();
33 | //
34 | // btnThrowExp
35 | //
36 | this.btnThrowExp.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
37 | | System.Windows.Forms.AnchorStyles.Left)
38 | | System.Windows.Forms.AnchorStyles.Right)));
39 | this.btnThrowExp.Cursor = System.Windows.Forms.Cursors.Hand;
40 | this.btnThrowExp.Location = new System.Drawing.Point(12, 12);
41 | this.btnThrowExp.Name = "btnThrowExp";
42 | this.btnThrowExp.Size = new System.Drawing.Size(309, 103);
43 | this.btnThrowExp.TabIndex = 0;
44 | this.btnThrowExp.Text = "Throw new random exception";
45 | this.btnThrowExp.UseVisualStyleBackColor = true;
46 | this.btnThrowExp.Click += new System.EventHandler(this.btnThrowExp_Click);
47 | //
48 | // Form1
49 | //
50 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
51 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
52 | this.ClientSize = new System.Drawing.Size(335, 123);
53 | this.Controls.Add(this.btnThrowExp);
54 | this.Name = "Form1";
55 | this.Text = "Test Error Handler";
56 | this.ResumeLayout(false);
57 |
58 | }
59 |
60 | #endregion
61 |
62 | private System.Windows.Forms.Button btnThrowExp;
63 | }
64 | }
65 |
66 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.WinFormsDotNet2/Form1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace ErrorControlSystem.Examples.WinFormsDotNet2
5 | {
6 | public partial class Form1 : Form
7 | {
8 | public Form1()
9 | {
10 | InitializeComponent();
11 | }
12 |
13 | private void btnThrowExp_Click(object sender, EventArgs e)
14 | {
15 |
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.WinFormsDotNet2/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 | using System.Windows.Forms;
4 |
5 | using ErrorControlSystem;
6 |
7 | namespace ErrorControlSystem.Examples.WinFormsDotNet2
8 | {
9 | static class Program
10 | {
11 | private static IErrorHandlerAdapter iErrorHandler;
12 |
13 | ///
14 | /// The main entry point for the application.
15 | ///
16 | [STAThread]
17 | static void Main()
18 | {
19 | //Type myClassAdapterType = Type.GetTypeFromProgID("ErrorControlSystemAdapter.ErrorHandlerAdapter");
20 | var myClassAdapterType = Type.GetTypeFromCLSID(new Guid("11BE9CF0-218D-45C6-A9AD-55C891F936F0"));
21 | var myClassAdapterInstance = Activator.CreateInstance(myClassAdapterType);
22 | iErrorHandler = (IErrorHandlerAdapter)myClassAdapterInstance;
23 |
24 |
25 |
26 | //Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
27 |
28 | // Catch all unhandled exceptions.
29 | Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
30 |
31 | // Catch all unhandled exceptions in all threads.
32 | AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
33 |
34 | // Catch all handled exceptions in managed code, before the runtime searches the Call Stack
35 | // AppDomain.CurrentDomain.FirstChanceException += CurrentDomain_FirstChanceException;
36 |
37 |
38 | Application.EnableVisualStyles();
39 | Application.SetCompatibleTextRenderingDefault(false);
40 | Application.Run(new Form1());
41 | }
42 |
43 | static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
44 | {
45 | iErrorHandler.Raise(e.Exception);
46 | }
47 |
48 | static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
49 | {
50 | MessageBox.Show(e.ExceptionObject.ToString());
51 | iErrorHandler.Raise((Exception)e.ExceptionObject);
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.WinFormsDotNet2/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("ErrorControlSystem.Examples.WinFormsDotNet2")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("ErrorControlSystem.Examples.WinFormsDotNet2")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("5a09fba4-4998-49dc-a6f6-dd8c24236371")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.WinFormsDotNet2/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.34014
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ErrorControlSystem.Examples.WinFormsDotNet2.Properties
12 | {
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// Returns the cached ResourceManager instance used by this class.
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ErrorControlSystem.Examples.WinFormsDotNet2.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// Overrides the current thread's CurrentUICulture property for all
56 | /// resource lookups using this strongly typed resource class.
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.WinFormsDotNet2/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.34014
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ErrorControlSystem.Examples.WinFormsDotNet2.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.WinFormsDotNet2/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.WinFormsDotNet2/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/Examples/ErrorControlSystem.Examples.WinFormsDotNet2/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
5 |
10 |
11 |
12 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/src/Tests/ErrorControlSystem.Shared.UI.ExceptionMapper.Tests/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/Tests/ErrorControlSystem.Shared.UI.ExceptionMapper.Tests/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/Tests/ErrorControlSystem.Shared.UI.ExceptionMapper.Tests/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Threading.Tasks;
5 | using System.Windows;
6 |
7 | namespace ErrorControlSystem.Shared.UI.ExceptionMapper.Tests
8 | {
9 | ///
10 | /// Interaction logic for App.xaml
11 | ///
12 | public partial class App : Application
13 | {
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Tests/ErrorControlSystem.Shared.UI.ExceptionMapper.Tests/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/Tests/ErrorControlSystem.Shared.UI.ExceptionMapper.Tests/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows;
3 |
4 | namespace ErrorControlSystem.Shared.UI.ExceptionMapper.Tests
5 | {
6 | ///
7 | /// Interaction logic for MainWindow.xaml
8 | ///
9 | public partial class MainWindow : Window
10 | {
11 | public MainWindow()
12 | {
13 | InitializeComponent();
14 | }
15 |
16 | private void BtnThrowException_OnClick(object sender, RoutedEventArgs e)
17 | {
18 | try
19 | {
20 | TestClassA.A1();
21 | }
22 | catch (Exception exp)
23 | {
24 | ExceptionViewer.Add(exp);
25 | }
26 | }
27 | }
28 |
29 |
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/Tests/ErrorControlSystem.Shared.UI.ExceptionMapper.Tests/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("ErrorControlSystem.Shared.UI.ExceptionMapper.Tests")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("")]
14 | [assembly: AssemblyProduct("ErrorControlSystem.Shared.UI.ExceptionMapper.Tests")]
15 | [assembly: AssemblyCopyright("Copyright © 2015")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.0.0.0")]
55 | [assembly: AssemblyFileVersion("1.0.0.0")]
56 |
--------------------------------------------------------------------------------
/src/Tests/ErrorControlSystem.Shared.UI.ExceptionMapper.Tests/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.34014
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ErrorControlSystem.Shared.UI.ExceptionMapper.Tests.Properties
12 | {
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// Returns the cached ResourceManager instance used by this class.
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ErrorControlSystem.Shared.UI.ExceptionMapper.Tests.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// Overrides the current thread's CurrentUICulture property for all
56 | /// resource lookups using this strongly typed resource class.
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/src/Tests/ErrorControlSystem.Shared.UI.ExceptionMapper.Tests/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.34014
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ErrorControlSystem.Shared.UI.ExceptionMapper.Tests.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/Tests/ErrorControlSystem.Shared.UI.ExceptionMapper.Tests/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Tests/ErrorControlSystem.Shared.UI.ExceptionMapper.Tests/TestClassA.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace ErrorControlSystem.Shared.UI.ExceptionMapper.Tests
4 | {
5 | public static class TestClassA
6 | {
7 | public static void A1()
8 | {
9 | try
10 | {
11 | TestClassB.B1();
12 | }
13 | catch (Exception exp)
14 | {
15 | throw new Exception("Test Inner Exception Thrown...", exp);
16 | }
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Tests/ErrorControlSystem.Shared.UI.ExceptionMapper.Tests/TestClassB.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace ErrorControlSystem.Shared.UI.ExceptionMapper.Tests
4 | {
5 | public static class TestClassB
6 | {
7 | public static void B1()
8 | {
9 | try
10 | {
11 | TestClassC.C1();
12 | }
13 | catch (Exception exp)
14 | {
15 | throw new AggregateException(exp);
16 | }
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Tests/ErrorControlSystem.Shared.UI.ExceptionMapper.Tests/TestClassC.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 |
4 | namespace ErrorControlSystem.Shared.UI.ExceptionMapper.Tests
5 | {
6 | public static class TestClassC
7 | {
8 | public static void C1()
9 | {
10 | try
11 | {
12 | TestClassD.D1();
13 | }
14 | catch (Exception exp)
15 | {
16 | throw new TaskSchedulerException(exp);
17 | }
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/Tests/ErrorControlSystem.Shared.UI.ExceptionMapper.Tests/TestClassD.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 |
4 | namespace ErrorControlSystem.Shared.UI.ExceptionMapper.Tests
5 | {
6 | public static class TestClassD
7 | {
8 | public static void D1()
9 | {
10 | try
11 | {
12 | var value = Task.Run(() => TestClassE.E1()).Result;
13 | }
14 | catch (Exception exp)
15 | {
16 | throw new AggregateException(exp);
17 | }
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/Tests/ErrorControlSystem.Shared.UI.ExceptionMapper.Tests/TestClassE.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace ErrorControlSystem.Shared.UI.ExceptionMapper.Tests
4 | {
5 | public static class TestClassE
6 | {
7 | public static string E1()
8 | {
9 | try
10 | {
11 | return TestClassF.F1("0").ToString();
12 | }
13 | catch (Exception exp)
14 | {
15 | throw new InvalidCastException("Cannot to get integer value", exp);
16 | }
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Tests/ErrorControlSystem.Shared.UI.ExceptionMapper.Tests/TestClassF.cs:
--------------------------------------------------------------------------------
1 | namespace ErrorControlSystem.Shared.UI.ExceptionMapper.Tests
2 | {
3 | public static class TestClassF
4 | {
5 | public static int F1(string value)
6 | {
7 | return F2(int.Parse(value), 0xB);
8 | }
9 |
10 |
11 | public static int F2(int a, int b)
12 | {
13 | //
14 | // Throw new divide by zero exception for test
15 | return b / a;
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Tests/ErrorControlSystem.Tests/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("ErrorControlSystem.Tests")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("ErrorControlSystem.Tests")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("3db0bb15-0e40-4195-ab37-d3afa523d388")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/src/Tests/ErrorControlSystem.Tests/TestTools.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 |
4 | namespace ErrorControlSystem.Tests
5 | {
6 | public static class TestTools
7 | {
8 | public static void ExpectException(Action action) where T : Exception
9 | {
10 | try
11 | {
12 | action();
13 | Assert.Fail("Expected exception " + typeof(T));
14 | }
15 | catch (T)
16 | {
17 | // Expected
18 | }
19 | }
20 |
21 | public static void ExceptException(Action action) where T : Exception
22 | {
23 | try
24 | {
25 | action();
26 | }
27 | catch (Exception ex)
28 | {
29 | if (!(ex is T))
30 | Assert.Fail("{0} occurred", ex.GetType());
31 | }
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------