diff --git a/.gitignore b/.gitignore index 22dd47f2..308bc974 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,607 @@ +# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,visualstudio,csharp,powershell +# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,visualstudio,csharp,powershell + +### Csharp ### +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore + +# User-specific files +*.rsuser *.suo -obj/ -bin/ +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml + +### PowerShell ### +# Exclude packaged modules +*.zip + +# Exclude .NET assemblies from source +*.dll + +### VisualStudioCode ### +!.vscode/*.code-snippets + +# Local History for Visual Studio Code + +# Built Visual Studio Code Extensions +*.vsix + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +### VisualStudio ### + +# User-specific files + +# User-specific files (MonoDevelop/Xamarin Studio) + +# Mono auto generated files + +# Build results + +# Visual Studio 2015/2017 cache/options directory +# Uncomment if you have tasks that create the project's static files in wwwroot + +# Visual Studio 2017 auto generated files + +# MSTest test Results + +# NUnit + +# Build Results of an ATL Project + +# Benchmark Results + +# .NET Core + +# ASP.NET Scaffolding + +# StyleCop + +# Files built by Visual Studio + +# Chutzpah Test files + +# Visual C++ cache files + +# Visual Studio profiler + +# Visual Studio Trace Files + +# TFS 2012 Local Workspace + +# Guidance Automation Toolkit + +# ReSharper is a .NET coding add-in + +# TeamCity is a build add-in + +# DotCover is a Code Coverage Tool + +# AxoCover is a Code Coverage Tool + +# Coverlet is a free, cross platform Code Coverage Tool + +# Visual Studio code coverage results + +# NCrunch + +# MightyMoose + +# Web workbench (sass) + +# Installshield output folder + +# DocProject is a documentation generator add-in + +# Click-Once directory + +# Publish Web Output +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted + +# NuGet Packages +# NuGet Symbol Packages +# The packages folder can be ignored because of Package Restore +# except build/, which is used as an MSBuild target. +# Uncomment if necessary however generally it will be regenerated when needed +# NuGet v3's project.json files produces more ignorable files + +# Microsoft Azure Build Output + +# Microsoft Azure Emulator + +# Windows Store app package directories and files + +# Visual Studio cache files +# files ending in .cache can be ignored +# but keep track of directories ending in .cache + +# Others + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) + +# RIA/Silverlight projects + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) + +# SQL Server files + +# Business Intelligence projects + +# Microsoft Fakes + +# GhostDoc plugin setting file + +# Node.js Tools for Visual Studio + +# Visual Studio 6 build log + +# Visual Studio 6 workspace options file + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) + +# Visual Studio 6 technical files + +# Visual Studio LightSwitch build output + +# Paket dependency manager + +# FAKE - F# Make + +# CodeRush personal settings + +# Python Tools for Visual Studio (PTVS) + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio + +# Telerik's JustMock configuration file + +# BizTalk build output + +# OpenCover UI analysis results + +# Azure Stream Analytics local run output + +# MSBuild Binary and Structured Log + +# NVidia Nsight GPU debugger configuration file + +# MFractors (Xamarin productivity tool) working folder + +# Local History for Visual Studio + +# Visual Studio History (VSHistory) files + +# BeatPulse healthcheck temp database + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 + +# Ionide (cross platform F# VS Code tools) working folder + +# Fody - auto-generated XML schema + +# VS Code files for those working on multiple tools + +# Local History for Visual Studio Code + +# Windows Installer files from build outputs + +# JetBrains Rider + +### VisualStudio Patch ### +# Additional files built by Visual Studio + +# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,visualstudio,csharp,powershell + packages/ *.user *.csproj.user diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index 95b01a04..ed98cf7e 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -1,190 +1,295 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/build", - "title": "Build Schema", - "definitions": { - "build": { - "type": "object", - "properties": { - "ChocolateyApiKey": { - "type": "string", - "description": "Chocolatey api key" - }, - "Configuration": { - "type": "string", - "description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)", - "enum": [ - "Debug", - "Release" - ] - }, - "Continue": { - "type": "boolean", - "description": "Indicates to continue a previously failed build attempt" - }, - "ExcludeDirectoryGlob": { - "type": "array", - "description": "Exlcude directory glob", - "items": { - "type": "string" - } - }, - "ExcludeFileGlob": { - "type": "array", - "description": "Exclude file globs", - "items": { - "type": "string" - } - }, - "GitHubApiKey": { - "type": "string", - "description": "GitHub Api key" - }, - "Help": { - "type": "boolean", - "description": "Shows the help text for this build assembly" - }, - "Host": { - "type": "string", - "description": "Host for execution. Default is 'automatic'", - "enum": [ - "AppVeyor", - "AzurePipelines", - "Bamboo", - "Bitbucket", - "Bitrise", - "GitHubActions", - "GitLab", - "Jenkins", - "Rider", - "SpaceAutomation", - "TeamCity", - "Terminal", - "TravisCI", - "VisualStudio", - "VSCode" - ] - }, - "my_variable": { - "type": "string", - "description": "My variable" - }, - "NoLogo": { - "type": "boolean", - "description": "Disables displaying the NUKE logo" - }, - "NugetApiKey": { - "type": "string", - "description": "Nuget api key" - }, - "Partition": { - "type": "string", - "description": "Partition to use on CI" - }, - "Plan": { - "type": "boolean", - "description": "Shows the execution plan (HTML)" - }, - "Profile": { - "type": "array", - "description": "Defines the profiles to load", - "items": { - "type": "string" - } - }, - "Root": { - "type": "string", - "description": "Root directory during build execution" - }, - "Skip": { - "type": "array", - "description": "List of targets to be skipped. Empty list skips all dependencies", - "items": { - "type": "string", - "enum": [ - "BuildChocolateyPackage", - "ChangeVersionNumber", - "Clean", - "CleanPackage", - "CleanupAppDataLogExpert", - "CleanupDocumentsLogExpert", - "ColumnizerLibCreateNuget", - "Compile", - "CopyFilesForSetup", - "CopyOutputForChocolatey", - "CreatePackage", - "CreateSetup", - "Pack", - "PackageSftpFileSystem", - "PrepareChocolateyTemplates", - "Publish", - "PublishChocolatey", - "PublishColumnizerNuget", - "PublishGithub", - "PublishToAppveyor", - "Restore", - "Test" - ] - } - }, - "Solution": { - "type": "string", - "description": "Path to a solution file that is automatically loaded" - }, - "Target": { - "type": "array", - "description": "List of targets to be invoked. Default is '{default_target}'", - "items": { - "type": "string", - "enum": [ - "BuildChocolateyPackage", - "ChangeVersionNumber", - "Clean", - "CleanPackage", - "CleanupAppDataLogExpert", - "CleanupDocumentsLogExpert", - "ColumnizerLibCreateNuget", - "Compile", - "CopyFilesForSetup", - "CopyOutputForChocolatey", - "CreatePackage", - "CreateSetup", - "Pack", - "PackageSftpFileSystem", - "PrepareChocolateyTemplates", - "Publish", - "PublishChocolatey", - "PublishColumnizerNuget", - "PublishGithub", - "PublishToAppveyor", - "Restore", - "Test" - ] - } - }, - "Verbosity": { - "type": "string", - "description": "Logging verbosity during build execution. Default is 'Normal'", - "enum": [ - "Minimal", - "Normal", - "Quiet", - "Verbose" - ] - }, - "VersionFileString": { - "type": "string", - "description": "Version file string" - }, - "VersionInformationString": { - "type": "string", - "description": "Version Information string" - }, - "VersionString": { - "type": "string", - "description": "Version string" - } - } - } - } -} +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/build", + "title": "Build Schema", + "definitions": { + "Host": { + "type": "string", + "enum": [ + "AppVeyor", + "AzurePipelines", + "Bamboo", + "Bitbucket", + "Bitrise", + "GitHubActions", + "GitLab", + "Jenkins", + "Rider", + "SpaceAutomation", + "TeamCity", + "Terminal", + "TravisCI", + "VisualStudio", + "VSCode" + ] + }, + "ExecutableTarget": { + "type": "string", + "enum": [ + "BuildChocolateyPackage", + "ChangeVersionNumber", + "Clean", + "CleanPackage", + "CleanupAppDataLogExpert", + "CleanupDocumentsLogExpert", + "ColumnizerLibCreate", + "ColumnizerLibCreateNuget", + "Compile", + "CopyFilesForSetup", + "CopyOutputForChocolatey", + "CreatePackage", + "CreateSetup", + "Pack", + "PackageSftpFileSystem", + "PrepareChocolateyTemplates", + "Publish", + "PublishChocolatey", + "PublishColumnizerNuget", + "PublishGithub", + "PublishToAppveyor", + "Restore", + "Test" + ] + }, + "Verbosity": { + "type": "string", + "description": "", + "enum": [ + "Verbose", + "Normal", + "Minimal", + "Quiet" + ] + }, + "NukeBuild": { + "properties": { + "ChocolateyApiKey": { + "type": "string", + "description": "Chocolatey api key" + }, + "Configuration": { + "type": "string", + "description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)", + "enum": [ + "Debug", + "Release" + ] + }, + "Continue": { + "type": "boolean", + "description": "Indicates to continue a previously failed build attempt" + }, + "ExcludeDirectoryGlob": { + "type": "array", + "description": "Exlcude directory glob", + "items": { + "type": "string" + } + }, + "ExcludeFileGlob": { + "type": "array", + "description": "Exclude file globs", + "items": { + "type": "string" + } + }, + "GitHubApiKey": { + "type": "string", + "description": "GitHub Api key" + }, + "Help": { + "type": "boolean", + "description": "Shows the help text for this build assembly" + }, + "Host": { + "type": "string", + "description": "Host for execution. Default is 'automatic'", + "enum": [ + "AppVeyor", + "AzurePipelines", + "Bamboo", + "Bitbucket", + "Bitrise", + "GitHubActions", + "GitLab", + "Jenkins", + "Rider", + "SpaceAutomation", + "TeamCity", + "Terminal", + "TravisCI", + "VisualStudio", + "VSCode" + ] + }, + "my_variable": { + "type": "string", + "description": "My variable" + }, + "NoLogo": { + "type": "boolean", + "description": "Disables displaying the NUKE logo" + }, + "NugetApiKey": { + "type": "string", + "description": "Nuget api key" + }, + "Partition": { + "type": "string", + "description": "Partition to use on CI" + }, + "Plan": { + "type": "boolean", + "description": "Shows the execution plan (HTML)" + }, + "Profile": { + "type": "array", + "description": "Defines the profiles to load", + "items": { + "type": "string" + } + }, + "Root": { + "type": "string", + "description": "Root directory during build execution" + }, + "Skip": { + "type": "array", + "description": "List of targets to be skipped. Empty list skips all dependencies", + "items": { + "type": "string", + "enum": [ + "BuildChocolateyPackage", + "ChangeVersionNumber", + "Clean", + "CleanPackage", + "CleanupAppDataLogExpert", + "CleanupDocumentsLogExpert", + "ColumnizerLibCreateNuget", + "Compile", + "CopyFilesForSetup", + "CopyOutputForChocolatey", + "CreatePackage", + "CreateSetup", + "Pack", + "PackageSftpFileSystem", + "PrepareChocolateyTemplates", + "Publish", + "PublishChocolatey", + "PublishColumnizerNuget", + "PublishGithub", + "PublishToAppveyor", + "Restore", + "Test" + ] + } + }, + "Solution": { + "type": "string", + "description": "Path to a solution file that is automatically loaded" + }, + "Target": { + "type": "array", + "description": "List of targets to be invoked. Default is '{default_target}'", + "items": { + "type": "string", + "enum": [ + "BuildChocolateyPackage", + "ChangeVersionNumber", + "Clean", + "CleanPackage", + "CleanupAppDataLogExpert", + "CleanupDocumentsLogExpert", + "ColumnizerLibCreateNuget", + "Compile", + "CopyFilesForSetup", + "CopyOutputForChocolatey", + "CreatePackage", + "CreateSetup", + "Pack", + "PackageSftpFileSystem", + "PrepareChocolateyTemplates", + "Publish", + "PublishChocolatey", + "PublishColumnizerNuget", + "PublishGithub", + "PublishToAppveyor", + "Restore", + "Test" + ] + } + }, + "Verbosity": { + "type": "string", + "description": "Logging verbosity during build execution. Default is 'Normal'", + "$ref": "#/definitions/Verbosity" + } + } + } + }, + "allOf": [ + { + "properties": { + "ChocolateyApiKey": { + "type": "string", + "description": "Chocolatey api key" + }, + "Configuration": { + "type": "string", + "description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)", + "enum": [ + "Minimal", + "Normal", + "Quiet", + "Verbose" + ] + }, + "ExcludeDirectoryGlob": { + "type": "array", + "description": "Exlcude directory glob", + "items": { + "type": "string" + } + }, + "ExcludeFileGlob": { + "type": "array", + "description": "Exclude file globs", + "items": { + "type": "string" + } + }, + "GitHubApiKey": { + "type": "string", + "description": "GitHub Api key" + }, + "my_variable": { + "type": "string", + "description": "My variable" + }, + "NugetApiKey": { + "type": "string", + "description": "Nuget api key" + }, + "Solution": { + "type": "string", + "description": "Path to a solution file that is automatically loaded" + }, + "VersionFileString": { + "type": "string", + "description": "Version file string" + }, + "VersionInformationString": { + "type": "string", + "description": "Version Information string" + }, + "VersionString": { + "type": "string", + "description": "Version string" + } + } + }, + { + "$ref": "#/definitions/NukeBuild" + } + } +} diff --git a/.nuke/parameters.json b/.nuke/parameters.json index 90094ade..969e7748 100644 --- a/.nuke/parameters.json +++ b/.nuke/parameters.json @@ -1,4 +1,4 @@ -{ - "$schema": "./build.schema.json", - "Solution": "src/LogExpert.sln" -} +{ + "$schema": "./build.schema.json", + "Solution": "src/LogExpert.sln" +} diff --git a/appveyor-release.yml b/appveyor-release.yml index b97387a3..ee46b73e 100644 --- a/appveyor-release.yml +++ b/appveyor-release.yml @@ -1,9 +1,18 @@ -version: 1.8.{build} +version: 1.10.{build} branches: only: - master -image: Visual Studio 2017 + +install: +- ps: dotnet tool restore +- ps: dotnet restore --use-current-runtime +- ps: dotnet build --no-restore + +build: + project: LogExpert.sln + environment: + DOTNET_CLI_TELEMETRY_OPTOUT: 1 my_variable: secure: Qpq/4cyuTUzmt/r4HsQxioG6WXrZSK3mzVq5iUJC2RI= NugetApiKey: @@ -12,6 +21,5 @@ environment: secure: mXmzLqgFyDEjGRcE4UpqwqOXmdiCm9HwJ2V3LzSAz06GL1OaBDoTzidw7Rly+UHk GitHubApiKey: secure: N83nQZ/QQVqpRnl0D6F/xSbKjn062y07JdskpUpbWryMY2JDo4Be9lUXmob+xcOO -build_script: -- cmd: PowerShell.exe -NoProfile -ExecutionPolicy Bypass -Command "& '.\build.ps1' --target Clean Pack Publish CreateSetup PublishToAppveyor ChangeVersionNumber --Configuration Release" + test: off diff --git a/appveyor.yml b/appveyor.yml index 3dcc7637..fd9ffe65 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,5 @@ version: 0.0.{build} -image: Visual Studio 2019 +image: Visual Studio 2022 environment: my_variable: secure: Qpq/4cyuTUzmt/r4HsQxioG6WXrZSK3mzVq5iUJC2RI= diff --git a/build.cmd b/build.cmd new file mode 100644 index 00000000..b08cc590 --- /dev/null +++ b/build.cmd @@ -0,0 +1,7 @@ +:; set -eo pipefail +:; SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) +:; ${SCRIPT_DIR}/build.sh "$@" +:; exit $? + +@ECHO OFF +powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0build.ps1" %* diff --git a/build.ps1 b/build.ps1 index 381a7bec..0a004c8d 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,74 +1,78 @@ -[CmdletBinding()] -Param( - [Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)] - [string[]]$BuildArguments -) - -Write-Output "PowerShell $($PSVersionTable.PSEdition) version $($PSVersionTable.PSVersion)" - -Set-StrictMode -Version 2.0; $ErrorActionPreference = "Stop"; $ConfirmPreference = "None"; trap { Write-Error $_ -ErrorAction Continue; exit 1 } -$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent - -########################################################################### -# CONFIGURATION -########################################################################### - -$BuildProjectFile = "$PSScriptRoot\build\_build.csproj" -$TempDirectory = "$PSScriptRoot\\.nuke\temp" - -$DotNetGlobalFile = "$PSScriptRoot\\global.json" -$DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1" -$DotNetChannel = "STS" - -$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1 -$env:DOTNET_NOLOGO = 1 - -########################################################################### -# EXECUTION -########################################################################### - -function ExecSafe([scriptblock] $cmd) { - & $cmd - if ($LASTEXITCODE) { exit $LASTEXITCODE } -} - -# If dotnet CLI is installed globally and it matches requested version, use for execution -if ($null -ne (Get-Command "dotnet" -ErrorAction SilentlyContinue) -and ` - $(dotnet --version) -and $LASTEXITCODE -eq 0) { - $env:DOTNET_EXE = (Get-Command "dotnet").Path -} -else { - # Download install script - $DotNetInstallFile = "$TempDirectory\dotnet-install.ps1" - New-Item -ItemType Directory -Path $TempDirectory -Force | Out-Null - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 - (New-Object System.Net.WebClient).DownloadFile($DotNetInstallUrl, $DotNetInstallFile) - - # If global.json exists, load expected version - if (Test-Path $DotNetGlobalFile) { - $DotNetGlobal = $(Get-Content $DotNetGlobalFile | Out-String | ConvertFrom-Json) - if ($DotNetGlobal.PSObject.Properties["sdk"] -and $DotNetGlobal.sdk.PSObject.Properties["version"]) { - $DotNetVersion = $DotNetGlobal.sdk.version - } - } - - # Install by channel or version - $DotNetDirectory = "$TempDirectory\dotnet-win" - if (!(Test-Path variable:DotNetVersion)) { - ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Channel $DotNetChannel -NoPath } - } else { - ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath } - } - $env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe" - $env:PATH = "$DotNetDirectory;$env:PATH" -} - -Write-Output "Microsoft (R) .NET SDK version $(& $env:DOTNET_EXE --version)" - -if (Test-Path env:NUKE_ENTERPRISE_TOKEN) { - & $env:DOTNET_EXE nuget remove source "nuke-enterprise" > $null - & $env:DOTNET_EXE nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password $env:NUKE_ENTERPRISE_TOKEN > $null -} - -ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet } -ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile --no-build -- $BuildArguments } +[CmdletBinding()] +Param( + [Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)] + [string[]]$BuildArguments +) + +Write-Output "PowerShell $($PSVersionTable.PSEdition) version $($PSVersionTable.PSVersion)" + +Set-StrictMode -Version 2.0; $ErrorActionPreference = "Stop"; $ConfirmPreference = "None"; trap { Write-Error $_ -ErrorAction Continue; exit 1 } +$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent + +########################################################################### +# CONFIGURATION +########################################################################### + +$BuildProjectFile = "$PSScriptRoot\build\_build.csproj" +$TempDirectory = "$PSScriptRoot\\.nuke\temp" + +$DotNetGlobalFile = "$PSScriptRoot\\global.json" +$DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1" +$DotNetChannel = "STS" + +$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1 +$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1 +$env:DOTNET_NOLOGO = 1 + +########################################################################### +# EXECUTION +########################################################################### + +function ExecSafe([scriptblock] $cmd) { + & $cmd + if ($LASTEXITCODE) { exit $LASTEXITCODE } +} + +# If dotnet CLI is installed globally and it matches requested version, use for execution +if ($null -ne (Get-Command "dotnet" -ErrorAction SilentlyContinue) -and ` + $(dotnet --version) -and $LASTEXITCODE -eq 0) { + $env:DOTNET_EXE = (Get-Command "dotnet").Path +} +else { + $DotNetDirectory = "$TempDirectory\dotnet-win" + $env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe" + + # Download install script + $DotNetInstallFile = "$TempDirectory\dotnet-install.ps1" + New-Item -ItemType Directory -Path $TempDirectory -Force | Out-Null + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + (New-Object System.Net.WebClient).DownloadFile($DotNetInstallUrl, $DotNetInstallFile) + + # If global.json exists, load expected version + if (Test-Path $DotNetGlobalFile) { + $DotNetGlobal = $(Get-Content $DotNetGlobalFile | Out-String | ConvertFrom-Json) + if ($DotNetGlobal.PSObject.Properties["sdk"] -and $DotNetGlobal.sdk.PSObject.Properties["version"]) { + $DotNetVersion = $DotNetGlobal.sdk.version + } + } + + # Install by channel or version + $DotNetDirectory = "$TempDirectory\dotnet-win" + if (!(Test-Path variable:DotNetVersion)) { + ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Channel $DotNetChannel -NoPath } + } else { + ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath } + } + $env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe" + $env:PATH = "$DotNetDirectory;$env:PATH" +} + +Write-Output "Microsoft (R) .NET SDK version $(& $env:DOTNET_EXE --version)" + +if (Test-Path env:NUKE_ENTERPRISE_TOKEN) { + & $env:DOTNET_EXE nuget remove source "nuke-enterprise" > $null + & $env:DOTNET_EXE nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password $env:NUKE_ENTERPRISE_TOKEN > $null +} + +ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet } +ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile --no-build -- $BuildArguments } diff --git a/build/Build.cs b/build/Build.cs index af71d4b9..ad732392 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -1,9 +1,3 @@ -using System; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Text.RegularExpressions; -using System.Threading.Tasks; using Nuke.Common; using Nuke.Common.CI.AppVeyor; using Nuke.Common.Execution; @@ -11,23 +5,27 @@ using Nuke.Common.IO; using Nuke.Common.ProjectModel; using Nuke.Common.Tooling; -using Nuke.Common.Tools.MSBuild; using Nuke.Common.Tools.DotNet; using Nuke.Common.Tools.GitVersion; +using Nuke.Common.Tools.MSBuild; using Nuke.Common.Tools.NuGet; using Nuke.Common.Utilities.Collections; using Nuke.GitHub; + using Serilog; + +using System; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text.RegularExpressions; +using System.Threading.Tasks; + using static Nuke.Common.EnvironmentInfo; -using static Nuke.Common.IO.FileSystemTasks; -using static Nuke.Common.Tools.MSBuild.MSBuildTasks; using static Nuke.Common.Tools.DotNet.DotNetTasks; -using static Nuke.Common.IO.TextTasks; -using static Nuke.Common.IO.CompressionTasks; +using static Nuke.Common.Tools.MSBuild.MSBuildTasks; using static Nuke.GitHub.GitHubTasks; -using static Nuke.Common.Assert; -//[CheckBuildProjectConfigurations] [UnsetVisualStudioEnvironmentVariables] class Build : NukeBuild { @@ -38,12 +36,13 @@ class Build : NukeBuild /// - Microsoft VSCode https://nuke.build/vscode public static int Main() => Execute(x => x.Test); - [Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")] + [Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")] readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release; + [Solution] readonly Solution Solution; [GitRepository] readonly GitRepository GitRepository; - [GitVersion(UpdateBuildNumber = true)] + [GitVersion(UpdateBuildNumber = true)] readonly Nuke.Common.Tools.GitVersion.GitVersion GitVersion; AbsolutePath SourceDirectory => RootDirectory / "src"; @@ -59,6 +58,7 @@ class Build : NukeBuild AbsolutePath ChocolateyTemplateFiles => RootDirectory / "chocolatey"; AbsolutePath SftpFileSystemPackagex86 => BinDirectory / "SftpFileSystemx86/"; + AbsolutePath SftpFileSystemPackagex64 => BinDirectory / "SftpFileSystemx64/"; AbsolutePath SetupDirectory => BinDirectory / "SetupFiles"; @@ -78,7 +78,7 @@ Version Version patch = AppVeyor.Instance.BuildNumber; } - return new Version(1, 9, 1, patch); + return new Version(1, 10, 0, patch); } } @@ -93,12 +93,12 @@ Version Version string VersionFileString => $"{Version.Major}.{Version.Minor}.0"; [Parameter("Exclude file globs")] - string[] ExcludeFileGlob => new[] {"**/*.xml", "**/*.XML", "**/*.pdb", "**/ChilkatDotNet4.dll", "**/ChilkatDotNet47.dll", "**/SftpFileSystem.dll"}; + string[] ExcludeFileGlob => ["**/*.xml", "**/*.XML", "**/*.pdb"]; [PathVariable("choco.exe")] readonly Tool Chocolatey; [Parameter("Exlcude directory glob")] - string[] ExcludeDirectoryGlob => new[] {"**/pluginsx86"}; + string[] ExcludeDirectoryGlob => ["**/pluginsx86"]; [Parameter("My variable", Name = "my_variable")] string MyVariable = null; @@ -108,8 +108,8 @@ Version Version [Parameter("GitHub Api key")] string GitHubApiKey = null; - AbsolutePath[] AppveyorArtifacts => new[] - { + AbsolutePath[] AppveyorArtifacts => + [ (BinDirectory / $"LogExpert-Setup-{VersionString}.exe"), BinDirectory / $"LogExpert-CI-{VersionString}.zip", BinDirectory / $"LogExpert.{VersionString}.zip", @@ -117,7 +117,7 @@ Version Version BinDirectory / $"SftpFileSystem.x64.{VersionString}.zip", BinDirectory / $"SftpFileSystem.x86.{VersionString}.zip", ChocolateyDirectory / $"logexpert.{VersionString}.nupkg" - }; + ]; protected override void OnBuildInitialized() { @@ -130,41 +130,38 @@ protected override void OnBuildInitialized() .Before(Compile, Restore) .Executes(() => { - SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(x => x.DeleteDirectory()); + SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(dir => dir.DeleteDirectory()); - var path = AbsolutePath.Create(BinDirectory); - if (path.DirectoryExists()) + if (BinDirectory.DirectoryExists()) { - BinDirectory.GlobFiles("*", "*.*", ".*").ForEach(x => x.DeleteFile()); - BinDirectory.GlobDirectories("*").ForEach(x => x.DeleteDirectory()); + BinDirectory.GlobFiles("*", "*.*", ".*").ForEach(file => file.DeleteFile()); + BinDirectory.GlobDirectories("*").ForEach(dir => dir.DeleteDirectory()); - path.DeleteDirectory(); + BinDirectory.DeleteDirectory(); - path.CreateOrCleanDirectory(); + BinDirectory.CreateOrCleanDirectory(); } }); Target CleanPackage => _ => _ .Before(Compile, Restore) - .OnlyWhenDynamic(() => AbsolutePath.Create(BinDirectory).DirectoryExists()) + .OnlyWhenDynamic(() => BinDirectory.DirectoryExists()) .Executes(() => { - BinDirectory.GlobFiles("**/*.zip", "**/*.nupkg").ForEach(x => x.DeleteFile()); + BinDirectory.GlobFiles("**/*.zip", "**/*.nupkg").ForEach(file => file.DeleteFile()); - var path = AbsolutePath.Create(PackageDirectory); - if (path.DirectoryExists()) + if (PackageDirectory.DirectoryExists()) { - path.DeleteDirectory(); + PackageDirectory.DeleteDirectory(); - path.CreateOrCleanDirectory(); + PackageDirectory.CreateOrCleanDirectory(); } - path = AbsolutePath.Create(ChocolateyDirectory); - if (path.DirectoryExists()) + if (ChocolateyDirectory.DirectoryExists()) { - path.DeleteDirectory(); + ChocolateyDirectory.DeleteDirectory(); - path.CreateOrCleanDirectory(); + ChocolateyDirectory.CreateOrCleanDirectory(); } }); @@ -180,7 +177,8 @@ protected override void OnBuildInitialized() .DependsOn(Restore) .Executes(() => { - Serilog.Log.Information($"Version: '{VersionString}'"); + + Log.Information($"Version: '{VersionString}'"); MSBuild(s => s .SetTargetPath(Solution) @@ -196,10 +194,10 @@ protected override void OnBuildInitialized() .DependsOn(Compile) .Executes(() => { - DotNetTest(c =>c + DotNetTest(c => c .SetConfiguration(Configuration) .EnableNoBuild() - .CombineWith(SourceDirectory.GlobFiles("**/*Tests.csproj"), (settings, path) => + .CombineWith(SourceDirectory.GlobFiles("**/*Tests.csproj"), (settings, path) => settings.SetProjectFile(path)), degreeOfParallelism: 4, completeOnFailure: true); }); @@ -207,7 +205,7 @@ protected override void OnBuildInitialized() .DependsOn(CleanPackage) .Executes(() => { - CopyDirectoryRecursively(ChocolateyTemplateFiles, ChocolateyDirectory, DirectoryExistsPolicy.Merge); + ChocolateyTemplateFiles.Copy(ChocolateyDirectory, ExistsPolicy.MergeAndOverwriteIfNewer); ChocolateyDirectory.GlobFiles("**/*.template").ForEach(path => TransformTemplateFile(path, true)); }); @@ -216,9 +214,10 @@ protected override void OnBuildInitialized() .DependsOn(Compile, Test) .Executes(() => { - CopyDirectoryRecursively(OutputDirectory, ChocolateyDirectory / "tools", DirectoryExistsPolicy.Merge); - ChocolateyDirectory.GlobFiles(ExcludeFileGlob).ForEach(x => x.DeleteFile()); - ChocolateyDirectory.GlobDirectories(ExcludeDirectoryGlob).ForEach(x => x.DeleteDirectory()); + + OutputDirectory.Copy(ChocolateyDirectory / "tools", ExistsPolicy.MergeAndOverwriteIfNewer); + ChocolateyDirectory.GlobFiles(ExcludeFileGlob).ForEach(file => file.DeleteFile()); + ChocolateyDirectory.GlobDirectories(ExcludeDirectoryGlob).ForEach(dir => dir.DeleteDirectory()); }); Target BuildChocolateyPackage => _ => _ @@ -232,12 +231,12 @@ protected override void OnBuildInitialized() .DependsOn(Compile, Test) .Executes(() => { - CopyDirectoryRecursively(OutputDirectory, PackageDirectory, DirectoryExistsPolicy.Merge); - PackageDirectory.GlobFiles(ExcludeFileGlob).ForEach(x => x.DeleteFile()); + OutputDirectory.Copy(PackageDirectory, ExistsPolicy.MergeAndOverwriteIfNewer); + PackageDirectory.GlobFiles(ExcludeFileGlob).ForEach(file => file.DeleteFile()); - PackageDirectory.GlobDirectories(ExcludeDirectoryGlob).ForEach(x => x.DeleteDirectory()); + PackageDirectory.GlobDirectories(ExcludeDirectoryGlob).ForEach(dir => dir.DeleteDirectory()); - PackageDirectory.CompressTo(BinDirectory / $"LogExpert.{VersionString}.zip"); + CompressionExtensions.ZipTo(PackageDirectory, BinDirectory / $"LogExpert.{VersionString}.zip"); }); Target ChangeVersionNumber => _ => _ @@ -248,7 +247,7 @@ protected override void OnBuildInitialized() AbsolutePath assemblyVersion = SourceDirectory / "Solution Items" / "AssemblyVersion.cs"; - string text = AbsolutePath.Create(assemblyVersion).ReadAllText(); + string text = assemblyVersion.ReadAllText(); Regex configurationRegex = new Regex(@"(\[assembly: AssemblyConfiguration\()(""[^""]*"")(\)\])"); Regex assemblyVersionRegex = new Regex(@"(\[assembly: AssemblyVersion\("")([^""]*)(""\)\])"); Regex assemblyFileVersionRegex = new Regex(@"(\[assembly: AssemblyFileVersion\("")([^""]*)(""\)\])"); @@ -288,13 +287,24 @@ protected override void OnBuildInitialized() .DependsOn(Compile, Test) .Executes(() => { - string[] files = new[] {"SftpFileSystem.dll", "ChilkatDotNet4.dll", "ChilkatDotNet47.dll" }; + string[] files = ["SftpFileSystem.dll", "Renci.SshNet.dll"]; + + OutputDirectory.GlobFiles(files.Select(a => $"plugins/{a}").ToArray()).ForEach(file => file.CopyToDirectory(SftpFileSystemPackagex64, ExistsPolicy.FileOverwrite)); + OutputDirectory.GlobFiles(files.Select(a => $"pluginsx86/{a}").ToArray()).ForEach(file => file.CopyToDirectory(SftpFileSystemPackagex86, ExistsPolicy.FileOverwrite)); - OutputDirectory.GlobFiles(files.Select(a => $"plugins/{a}").ToArray()).ForEach(file => CopyFileToDirectory(file, SftpFileSystemPackagex64, FileExistsPolicy.Overwrite)); - OutputDirectory.GlobFiles(files.Select(a => $"pluginsx86/{a}").ToArray()).ForEach(file => CopyFileToDirectory(file, SftpFileSystemPackagex86, FileExistsPolicy.Overwrite)); + CompressionExtensions.ZipTo(SftpFileSystemPackagex64, BinDirectory / $"SftpFileSystem.x64.{VersionString}.zip"); + CompressionExtensions.ZipTo(SftpFileSystemPackagex86, BinDirectory / $"SftpFileSystem.x86.{VersionString}.zip"); + }); - SftpFileSystemPackagex64.CompressTo(BinDirectory / $"SftpFileSystem.x64.{VersionString}.zip"); - SftpFileSystemPackagex86.CompressTo(BinDirectory / $"SftpFileSystem.x86.{VersionString}.zip"); + Target ColumnizerLibCreate => _ => _.DependsOn(Compile, Test) + .Executes(() => + { + var columnizerFolder = SourceDirectory / "ColumnizerLib"; + DotNetPack(s => s + .SetProject(columnizerFolder / "ColumnizerLib.csproj") + .SetConfiguration(Configuration) + .SetOutputDirectory(BinDirectory) + .SetVersion(VersionString)); }); Target ColumnizerLibCreateNuget => _ => _ @@ -306,7 +316,7 @@ protected override void OnBuildInitialized() NuGetTasks.NuGetPack(s => { s = s.SetTargetPath(columnizerFolder / "ColumnizerLib.csproj") - .DisableBuild() + .EnableBuild() .SetConfiguration(Configuration) .SetProperty("version", VersionString) .SetOutputDirectory(BinDirectory); @@ -316,28 +326,28 @@ protected override void OnBuildInitialized() }); Target Pack => _ => _ - .DependsOn(BuildChocolateyPackage, CreatePackage, PackageSftpFileSystem, ColumnizerLibCreateNuget); + .DependsOn(BuildChocolateyPackage, CreatePackage, PackageSftpFileSystem, ColumnizerLibCreate); Target CopyFilesForSetup => _ => _ .DependsOn(Compile) .After(Test) .Executes(() => { - CopyDirectoryRecursively(OutputDirectory, SetupDirectory, DirectoryExistsPolicy.Merge); - SetupDirectory.GlobFiles(ExcludeFileGlob).ForEach(x => x.DeleteFile()); + OutputDirectory.Copy(SetupDirectory, ExistsPolicy.DirectoryMerge); + SetupDirectory.GlobFiles(ExcludeFileGlob).ForEach(file => file.DeleteFile()); - SetupDirectory.GlobDirectories(ExcludeDirectoryGlob).ForEach(x => x.DeleteDirectory()); + SetupDirectory.GlobDirectories(ExcludeDirectoryGlob).ForEach(dir => dir.DeleteDirectory()); }); Target CreateSetup => _ => _ - .DependsOn(CopyFilesForSetup) + .DependsOn(CopyFilesForSetup, ChangeVersionNumber) .Before(Publish) .OnlyWhenStatic(() => Configuration == "Release") .Executes(() => { var publishCombinations = - from framework in new[] {(AbsolutePath) SpecialFolder(SpecialFolders.ProgramFilesX86), (AbsolutePath) SpecialFolder(SpecialFolders.LocalApplicationData) / "Programs"} - from version in new[] {"5", "6"} + from framework in new[] { SpecialFolder(SpecialFolders.ProgramFilesX86), SpecialFolder(SpecialFolders.LocalApplicationData) / "Programs" } + from version in new[] { "5", "6" } select framework / $"Inno Setup {version}" / "iscc.exe"; bool executed = false; foreach (var setupCombinations in publishCombinations) @@ -355,12 +365,13 @@ protected override void OnBuildInitialized() if (!executed) { - Fail("Inno setup was not found"); + Assert.True(true, "Inno setup was not found"); } }); Target PublishColumnizerNuget => _ => _ - .DependsOn(ColumnizerLibCreateNuget) + .DependsOn(ColumnizerLibCreate) + //.DependsOn(ColumnizerLibCreateNuget) .Requires(() => NugetApiKey) //.OnlyWhenDynamic(() => GitVersion.BranchName.Equals("master") || GitVersion.BranchName.Equals("origin/master")) .Executes(() => @@ -428,7 +439,7 @@ protected override void OnBuildInitialized() .OnlyWhenDynamic(() => AppVeyor.Instance != null) .Executes(() => { - AbsolutePath.Create(BinDirectory / Configuration).CompressTo(BinDirectory / $"LogExpert-CI-{VersionString}.zip"); + CompressionExtensions.ZipTo(BinDirectory / Configuration, BinDirectory / $"LogExpert-CI-{VersionString}.zip"); AppveyorArtifacts.ForEach((artifact) => { @@ -436,14 +447,14 @@ protected override void OnBuildInitialized() proc.StartInfo = new ProcessStartInfo("appveyor", $"PushArtifact \"{artifact}\""); if (!proc.Start()) { - Fail("Failed to start appveyor pushartifact"); + Assert.True(true, "Failed to start appveyor pushartifact"); } proc.WaitForExit(); if (proc.ExitCode != 0) { - Fail($"Exit code is {proc.ExitCode}"); + Assert.True(true, $"Exit code is {proc.ExitCode}"); } }); }); @@ -451,7 +462,7 @@ protected override void OnBuildInitialized() Target CleanupAppDataLogExpert => _ => _ .Executes(() => { - AbsolutePath logExpertApplicationData = ((AbsolutePath) SpecialFolder(SpecialFolders.ApplicationData)) / "LogExpert"; + AbsolutePath logExpertApplicationData = SpecialFolder(SpecialFolders.ApplicationData) / "LogExpert"; DirectoryInfo info = new DirectoryInfo(logExpertApplicationData); info.GetDirectories().ForEach(a => a.Delete(true)); @@ -461,7 +472,7 @@ protected override void OnBuildInitialized() Target CleanupDocumentsLogExpert => _ => _ .Executes(() => { - AbsolutePath logExpertDocuments = (AbsolutePath) SpecialFolder(SpecialFolders.UserProfile) / "Documents" / "LogExpert"; + AbsolutePath logExpertDocuments = SpecialFolder(SpecialFolders.UserProfile) / "Documents" / "LogExpert"; DirectoryInfo info = new DirectoryInfo(logExpertDocuments); info.GetDirectories().ForEach(a => a.Delete(true)); @@ -477,7 +488,7 @@ private void ExecuteInnoSetup(AbsolutePath innoPath) proc.StartInfo = new ProcessStartInfo(innoPath, $"{SetupCommandLineParameter} \"{InnoSetupScript}\""); if (!proc.Start()) { - Fail($"Failed to start {innoPath} with \"{SetupCommandLineParameter}\" \"{InnoSetupScript}\""); + Assert.True(true, $"Failed to start {innoPath} with \"{SetupCommandLineParameter}\" \"{InnoSetupScript}\""); } proc.WaitForExit(); @@ -486,7 +497,7 @@ private void ExecuteInnoSetup(AbsolutePath innoPath) if (proc.ExitCode != 0) { - Fail($"Error during execution of {innoPath}, exitcode {proc.ExitCode}"); + Nuke.Common.Assert.True(true, $"Error during execution of {innoPath}, exitcode {proc.ExitCode}"); } } @@ -500,7 +511,8 @@ private void TransformTemplateFile(AbsolutePath path, bool deleteTemplate) string text = path.ReadAllText(); text = text.Replace("##version##", VersionString); - AbsolutePath.Create($"{Regex.Replace(path, "\\.template$", "")}").WriteAllText(text); + AbsolutePath template = $"{Regex.Replace(path, "\\.template$", "")}"; + template.WriteAllText(text); if (deleteTemplate) { path.DeleteFile(); diff --git a/build/_build.csproj b/build/_build.csproj index 5bc0bdfb..c875927d 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -3,7 +3,6 @@ Exe net8.0 - false False @@ -12,29 +11,43 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers - - - + + + + + + + + + + + + + + + + + + - diff --git a/build/_build.csproj.DotSettings b/build/_build.csproj.DotSettings index 9aac7d8e..28494fb0 100644 --- a/build/_build.csproj.DotSettings +++ b/build/_build.csproj.DotSettings @@ -13,6 +13,8 @@ False <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy><Descriptor Staticness="Instance" AccessRightKinds="Private" Description="Instance fields (private)"><ElementKinds><Kind Name="FIELD" /><Kind Name="READONLY_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></Policy> + <Policy><Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static fields (private)"><ElementKinds><Kind Name="FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></Policy> True True True @@ -21,4 +23,5 @@ True True True - True + True + True diff --git a/global.json b/global.json new file mode 100644 index 00000000..b6b5c9f5 --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "9.0.101" + } +} diff --git a/src/AutoColumnizer/AutoColumnizer.csproj b/src/AutoColumnizer/AutoColumnizer.csproj index fd9c2400..dc8b8316 100644 --- a/src/AutoColumnizer/AutoColumnizer.csproj +++ b/src/AutoColumnizer/AutoColumnizer.csproj @@ -1,71 +1,35 @@ - - - + - Debug - AnyCPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E} + net8.0-windows Library - Properties - AutoColumnizer - AutoColumnizer - v4.8.1 - 512 - true - - - - true - full - false - ..\..\bin\Debug\plugins\ - DEBUG;TRACE - prompt - 4 - false - - - pdbonly - true - ..\..\bin\Release\plugins\ - TRACE - prompt - 4 - false - - + false + AutoColumnizer true - - ..\Solution Items\Key.snk + false + $(SolutionDir)..\bin\$(Configuration)\plugins - - - - - - - - - - + + False + + + True + + Properties\AssemblyVersion.cs - - - - - - {e72c2bb1-34de-4d66-a830-9647c3837833} - ColumnizerLib - + Key.snk - - \ No newline at end of file + + + + + + diff --git a/src/AutoColumnizer/Properties/AssemblyInfo.cs b/src/AutoColumnizer/Properties/AssemblyInfo.cs index 9a39f247..59b88e6a 100644 --- a/src/AutoColumnizer/Properties/AssemblyInfo.cs +++ b/src/AutoColumnizer/Properties/AssemblyInfo.cs @@ -2,11 +2,5 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("AutoColumnizer")] -[assembly: AssemblyDescription("")] - // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("b57259a3-4ed7-4f8b-a252-29e799a56b9e")] \ No newline at end of file diff --git a/src/ColumnizerLib.UnitTests/ColumnTests.cs b/src/ColumnizerLib.UnitTests/ColumnTests.cs index 449074fb..e61e57c5 100644 --- a/src/ColumnizerLib.UnitTests/ColumnTests.cs +++ b/src/ColumnizerLib.UnitTests/ColumnTests.cs @@ -1,9 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using LogExpert; +using LogExpert; using NUnit.Framework; +using System; +using System.Text; namespace ColumnizerLib.UnitTests { @@ -13,9 +11,9 @@ public class ColumnTests [Test] public void Column_LineCutOf() { - Column column = new Column(); + Column column = new(); - StringBuilder builder = new StringBuilder(); + StringBuilder builder = new(); for (int i = 0; i < 4675; i++) { @@ -34,9 +32,9 @@ public void Column_LineCutOf() [Test] public void Column_NoLineCutOf() { - Column column = new Column(); + Column column = new(); - StringBuilder builder = new StringBuilder(); + StringBuilder builder = new(); for (int i = 0; i < 4675; i++) { @@ -54,7 +52,7 @@ public void Column_NoLineCutOf() [Test] public void Column_NullCharReplacement() { - Column column = new Column(); + Column column = new(); column.FullValue = "asdf\0"; @@ -76,7 +74,7 @@ public void Column_NullCharReplacement() [Test] public void Column_TabReplacement() { - Column column = new Column(); + Column column = new(); column.FullValue = "asdf\t"; diff --git a/src/ColumnizerLib.UnitTests/ColumnizerLib.UnitTests.csproj b/src/ColumnizerLib.UnitTests/ColumnizerLib.UnitTests.csproj index e43b0638..68ad9cfc 100644 --- a/src/ColumnizerLib.UnitTests/ColumnizerLib.UnitTests.csproj +++ b/src/ColumnizerLib.UnitTests/ColumnizerLib.UnitTests.csproj @@ -1,70 +1,24 @@ - - - + - Debug - AnyCPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496} + net8.0-windows Library - Properties - ColumnizerLib.UnitTests - ColumnizerLib.UnitTests - v4.8.1 - 512 - - true - + false + ColumnizerLib.UnitTests + Microsoft + ColumnizerLib.UnitTests + Copyright © Microsoft 2018 + 1.0.0.0 + 1.0.0.0 + false + bin\$(Configuration) - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - - - - - - - - - - - - - - - {e72c2bb1-34de-4d66-a830-9647c3837833} - ColumnizerLib - - - + - - 4.1.0 - - - 4.5.0 - + + + - - \ No newline at end of file + diff --git a/src/ColumnizerLib.UnitTests/Properties/AssemblyInfo.cs b/src/ColumnizerLib.UnitTests/Properties/AssemblyInfo.cs index 4abdd301..5496df04 100644 --- a/src/ColumnizerLib.UnitTests/Properties/AssemblyInfo.cs +++ b/src/ColumnizerLib.UnitTests/Properties/AssemblyInfo.cs @@ -1,16 +1,6 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ColumnizerLib.UnitTests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("ColumnizerLib.UnitTests")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -21,16 +11,3 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("0dbbcbef-4a91-4031-aeab-b7eee802f496")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/ColumnizerLib/ColumnizedLogLine.cs b/src/ColumnizerLib/ColumnizedLogLine.cs index f0cecb7e..41a14e6f 100644 --- a/src/ColumnizerLib/ColumnizedLogLine.cs +++ b/src/ColumnizerLib/ColumnizedLogLine.cs @@ -1,15 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace LogExpert +namespace LogExpert { public class ColumnizedLogLine : IColumnizedLogLine { #region Properties public ILogLine LogLine { get; set; } + public IColumn[] ColumnValues { get; set; } #endregion diff --git a/src/ColumnizerLib/ColumnizerLib.csproj b/src/ColumnizerLib/ColumnizerLib.csproj index 1cd71c22..5695fc9f 100644 --- a/src/ColumnizerLib/ColumnizerLib.csproj +++ b/src/ColumnizerLib/ColumnizerLib.csproj @@ -1,43 +1,23 @@ - - + - Debug - AnyCPU - 9.0.21022 - 2.0 - {E72C2BB1-34DE-4D66-A830-9647C3837833} + net8.0-windows + true Library Properties LogExpert - ColumnizerLib - v4.8.1 - 512 - - - - - 3.5 - + false + true + true + $(SolutionDir)..\bin\Docs\ColumnizerLib.xml + false + $(SolutionDir)..\bin\$(Configuration) + CS1591; - - true - full - false - ..\..\bin\Debug\ - DEBUG;TRACE - prompt - 4 - ..\..\bin\Debug\ColumnizerLib.XML - false + + False - - pdbonly - true - ..\..\bin\Release\ - TRACE - prompt - 4 - false + + True true @@ -45,57 +25,14 @@ ..\Solution Items\Key.snk - - - - - - Properties\AssemblyVersion.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - Key.snk - - - - \ No newline at end of file + diff --git a/src/ColumnizerLib/IColumnizerConfigurator.cs b/src/ColumnizerLib/IColumnizerConfigurator.cs index c2875c21..a9a953e2 100644 --- a/src/ColumnizerLib/IColumnizerConfigurator.cs +++ b/src/ColumnizerLib/IColumnizerConfigurator.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - + namespace LogExpert { /// diff --git a/src/ColumnizerLib/ILogLineColumnizer.cs b/src/ColumnizerLib/ILogLineColumnizer.cs index 56014f99..e12988ac 100644 --- a/src/ColumnizerLib/ILogLineColumnizer.cs +++ b/src/ColumnizerLib/ILogLineColumnizer.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; namespace LogExpert { diff --git a/src/ColumnizerLib/ILogLineColumnizerCallback.cs b/src/ColumnizerLib/ILogLineColumnizerCallback.cs index 4fcdea4d..1b72fb2b 100644 --- a/src/ColumnizerLib/ILogLineColumnizerCallback.cs +++ b/src/ColumnizerLib/ILogLineColumnizerCallback.cs @@ -24,7 +24,7 @@ public interface ILogLineColumnizerCallback /// This function returns the current line number. That is the line number of the log line /// a ILogLineColumnizer function is called for (e.g. the line that has to be painted). /// - /// The current line number + /// The current line number starting at 0 int GetLineNum(); /// diff --git a/src/ColumnizerLib/Properties/AssemblyInfo.cs b/src/ColumnizerLib/Properties/AssemblyInfo.cs deleted file mode 100644 index 5459327d..00000000 --- a/src/ColumnizerLib/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ColumnizerLib")] -[assembly: AssemblyDescription("")] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("8abc0511-b3dc-42a7-b310-215428386d33")] \ No newline at end of file diff --git a/src/CsvColumnizer/CsvColumnizer.cs b/src/CsvColumnizer/CsvColumnizer.cs index f2664317..1b06162b 100644 --- a/src/CsvColumnizer/CsvColumnizer.cs +++ b/src/CsvColumnizer/CsvColumnizer.cs @@ -1,12 +1,12 @@ -using System; -using System.Collections.Generic; +using CsvHelper; using LogExpert; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; using System.Windows.Forms; -using CsvHelper; -using Newtonsoft.Json; namespace CsvColumnizer { @@ -212,10 +212,9 @@ public void Configure(ILogLineColumnizerCallback callback, string configDir) public void LoadConfig(string configDir) { - string configPath = configDir + "\\" + _configFileName; - FileSystemInfo fileInfo = new FileInfo(configPath); + string configPath = Path.Combine(configDir, _configFileName); - if (fileInfo.Exists == false) + if (!File.Exists(configPath)) { _config = new CsvColumnizerConfig(); _config.InitDefaults(); @@ -224,7 +223,7 @@ public void LoadConfig(string configDir) { try { - _config = JsonConvert.DeserializeObject(File.ReadAllText($"{fileInfo.FullName}")); + _config = JsonConvert.DeserializeObject(File.ReadAllText(configPath)); _config.ConfigureReaderConfiguration(); } catch (Exception e) diff --git a/src/CsvColumnizer/CsvColumnizer.csproj b/src/CsvColumnizer/CsvColumnizer.csproj index 5db8c8ec..0b5bf3db 100644 --- a/src/CsvColumnizer/CsvColumnizer.csproj +++ b/src/CsvColumnizer/CsvColumnizer.csproj @@ -1,42 +1,21 @@ - - + - Debug - AnyCPU - 9.0.21022 - 2.0 - {2563526E-4566-40CB-AA27-587B904FD25B} + net8.0-windows + true Library - Properties - CsvColumnizer - CsvColumnizer - v4.8.1 - 512 - - - - - 3.5 - + false + true + true + false + $(SolutionDir)..\bin\$(Configuration)\plugins + true + CA1416; - - true - full - false - ..\..\bin\Debug\plugins\ - DEBUG;TRACE - prompt - 4 - false + + False - - pdbonly - true - ..\..\bin\Release\plugins\ - TRACE - prompt - 4 - false + + True true @@ -44,41 +23,13 @@ ..\Solution Items\Key.snk - - - - - - - Properties\AssemblyVersion.cs - - - - - Form - - - CsvColumnizerConfigDlg.cs - - - - - - - CsvColumnizerConfigDlg.cs - Designer - - - {e72c2bb1-34de-4d66-a830-9647c3837833} - ColumnizerLib - True - + @@ -86,23 +37,10 @@ - - 31.0.0 - - - 13.0.3 - + + - - - - + CsvColumnizer - \ No newline at end of file + diff --git a/src/CsvColumnizer/CsvColumnizerConfigDlg.Designer.cs b/src/CsvColumnizer/CsvColumnizerConfigDlg.Designer.cs index b890c24f..7b6aa0f8 100644 --- a/src/CsvColumnizer/CsvColumnizerConfigDlg.Designer.cs +++ b/src/CsvColumnizer/CsvColumnizerConfigDlg.Designer.cs @@ -185,8 +185,6 @@ private void InitializeComponent() // // CsvColumnizerConfigDlg // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(316, 237); this.ControlBox = false; this.Controls.Add(this.label6); diff --git a/src/CsvColumnizer/Properties/AssemblyInfo.cs b/src/CsvColumnizer/Properties/AssemblyInfo.cs index c05d68d6..d689fe35 100644 --- a/src/CsvColumnizer/Properties/AssemblyInfo.cs +++ b/src/CsvColumnizer/Properties/AssemblyInfo.cs @@ -2,11 +2,5 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("CsvColumnizer")] -[assembly: AssemblyDescription("")] - // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("d939a82b-591f-4403-9c9b-7d1f54043019")] \ No newline at end of file diff --git a/src/DefaultPlugins/DefaultPlugins.csproj b/src/DefaultPlugins/DefaultPlugins.csproj index b21a656f..72705236 100644 --- a/src/DefaultPlugins/DefaultPlugins.csproj +++ b/src/DefaultPlugins/DefaultPlugins.csproj @@ -1,42 +1,21 @@ - - + - Debug - AnyCPU - 9.0.21022 - 2.0 - {00ED9F5D-742B-441C-B48B-16940B070B77} + net8.0-windows + true Library - Properties LogExpert - DefaultPlugins - v4.8.1 - 512 - - - - - 3.5 - + false + true + true + false + $(SolutionDir)..\bin\$(Configuration)\plugins + CA1416; - - true - full - false - ..\..\bin\Debug\plugins\ - DEBUG;TRACE - prompt - 4 - false + + False - - pdbonly - true - ..\..\bin\Release\plugins\ - TRACE - prompt - 4 - false + + True true @@ -44,57 +23,20 @@ ..\Solution Items\Key.snk - - - - - - - - Properties\AssemblyVersion.cs - - - - Form - - - EminusConfigDlg.cs - - - - - - - EminusConfigDlg.cs - Designer - - - {e72c2bb1-34de-4d66-a830-9647c3837833} - ColumnizerLib - False - + Key.snk - - - - - - - \ No newline at end of file + + + + diff --git a/src/DefaultPlugins/Eminus.cs b/src/DefaultPlugins/Eminus.cs index 540b7e5e..d60ffc77 100644 --- a/src/DefaultPlugins/Eminus.cs +++ b/src/DefaultPlugins/Eminus.cs @@ -1,13 +1,11 @@ using System; using System.Collections.Generic; -using System.Text; using System.Xml; using System.Windows.Forms; using System.Net.Sockets; using System.IO; -using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Serialization; - +using Newtonsoft.Json; namespace LogExpert { @@ -15,10 +13,12 @@ public class Eminus : IContextMenuEntry, ILogExpertPluginConfigurator { #region Fields - private const string CFG_FILE_NAME = "\\eminus.dat"; - private EminusConfig config = new EminusConfig(); + private const string CFG_FILE_NAME = "eminus.json"; + private const string dot = "."; + private const string doubleDot = ":"; + private EminusConfig _config = new(); private EminusConfigDlg dlg; - private EminusConfig tmpConfig = new EminusConfig(); + private EminusConfig tmpConfig = new(); #endregion @@ -37,42 +37,49 @@ private XmlDocument BuildParam(ILogLine line) { string temp = line.FullLine; // no Java stacktrace but some special logging of our applications at work: - if (temp.IndexOf("Exception of type") != -1 || temp.IndexOf("Nested:") != -1) + if (temp.Contains("Exception of type", StringComparison.CurrentCulture) || temp.Contains("Nested:", StringComparison.CurrentCulture)) { int pos = temp.IndexOf("created in "); if (pos == -1) { return null; } + pos += "created in ".Length; - int endPos = temp.IndexOf(".", pos); + int endPos = temp.IndexOf(dot, pos); + if (endPos == -1) { return null; } - string className = temp.Substring(pos, endPos - pos); - pos = temp.IndexOf(":", pos); + + string className = temp[pos..endPos]; + pos = temp.IndexOf(doubleDot, pos); + if (pos == -1) { return null; } - string lineNum = temp.Substring(pos + 1); + + string lineNum = temp[(pos + 1)..]; XmlDocument doc = BuildXmlDocument(className, lineNum); return doc; } - if (temp.IndexOf("at ") != -1) + + if (temp.Contains("at ", StringComparison.CurrentCulture)) { string str = temp.Trim(); string className = null; string lineNum = null; int pos = str.IndexOf("at ") + 3; - str = str.Substring(pos); // remove 'at ' - int idx = str.IndexOfAny(new char[] {'(', '$', '<'}); + str = str[pos..]; // remove 'at ' + int idx = str.IndexOfAny(['(', '$', '<']); + if (idx != -1) { if (str[idx] == '$') { - className = str.Substring(0, idx); + className = str[..idx]; } else { @@ -81,18 +88,23 @@ private XmlDocument BuildParam(ILogLine line) { return null; } - className = str.Substring(0, pos); + className = str[..pos]; } + idx = str.LastIndexOf(':'); + if (idx == -1) { return null; } + pos = str.IndexOf(')', idx); + if (pos == -1) { return null; } + lineNum = str.Substring(idx + 1, pos - idx - 1); } /* @@ -113,11 +125,11 @@ private XmlDocument BuildParam(ILogLine line) private XmlDocument BuildXmlDocument(string className, string lineNum) { - XmlDocument xmlDoc = new XmlDocument(); + XmlDocument xmlDoc = new(); xmlDoc.CreateXmlDeclaration("1.0", "UTF-8", "yes"); XmlElement rootElement = xmlDoc.CreateElement("eminus"); xmlDoc.AppendChild(rootElement); - rootElement.SetAttribute("authKey", this.config.password); + rootElement.SetAttribute("authKey", _config.password); XmlElement loadElement = xmlDoc.CreateElement("loadclass"); loadElement.SetAttribute("mode", "dialog"); @@ -164,9 +176,9 @@ public void MenuSelected(IList logLines, ILogLineColumnizer columnizer, ILo { try { - TcpClient client = new TcpClient(this.config.host, this.config.port); + TcpClient client = new(_config.host, _config.port); NetworkStream stream = client.GetStream(); - StreamWriter writer = new StreamWriter(stream); + StreamWriter writer = new(stream); doc.Save(writer); writer.Flush(); stream.Flush(); @@ -190,26 +202,22 @@ public void LoadConfig(string configDir) { string configPath = configDir + CFG_FILE_NAME; + FileInfo fileInfo = new(configDir + Path.DirectorySeparatorChar + CFG_FILE_NAME); + if (!File.Exists(configPath)) { - this.config = new EminusConfig(); + _config = new EminusConfig(); } else { - Stream fs = File.OpenRead(configPath); - BinaryFormatter formatter = new BinaryFormatter(); try { - this.config = (EminusConfig) formatter.Deserialize(fs); + _config = JsonConvert.DeserializeObject(File.ReadAllText($"{fileInfo.FullName}")); } catch (SerializationException e) { MessageBox.Show(e.Message, "Deserialize"); - this.config = new EminusConfig(); - } - finally - { - fs.Close(); + _config = new EminusConfig(); } } } @@ -217,16 +225,15 @@ public void LoadConfig(string configDir) public void SaveConfig(string configDir) { - string configPath = configDir + CFG_FILE_NAME; - if (this.dlg != null) - { - this.dlg.ApplyChanges(); - } - this.config = this.tmpConfig.Clone(); - BinaryFormatter formatter = new BinaryFormatter(); - Stream fs = new FileStream(configPath, FileMode.Create, FileAccess.Write); - formatter.Serialize(fs, this.config); - fs.Close(); + FileInfo fileInfo = new(configDir + Path.DirectorySeparatorChar + CFG_FILE_NAME); + + dlg?.ApplyChanges(); + + _config = tmpConfig.Clone(); + + using StreamWriter sw = new(fileInfo.Create()); + JsonSerializer serializer = new(); + serializer.Serialize(sw, _config); } public bool HasEmbeddedForm() @@ -236,9 +243,9 @@ public bool HasEmbeddedForm() public void ShowConfigForm(Panel panel) { - this.dlg = new EminusConfigDlg(this.tmpConfig); - this.dlg.Parent = panel; - this.dlg.Show(); + dlg = new EminusConfigDlg(tmpConfig); + dlg.Parent = panel; + dlg.Show(); } /// @@ -248,28 +255,28 @@ public void ShowConfigForm(Panel panel) /// public void ShowConfigDialog(Form owner) { - this.dlg = new EminusConfigDlg(this.tmpConfig); - this.dlg.TopLevel = true; - this.dlg.Owner = owner; - this.dlg.ShowDialog(); - this.dlg.ApplyChanges(); + dlg = new EminusConfigDlg(tmpConfig); + dlg.TopLevel = true; + dlg.Owner = owner; + dlg.ShowDialog(); + dlg.ApplyChanges(); } public void HideConfigForm() { - if (this.dlg != null) + if (dlg != null) { - this.dlg.ApplyChanges(); - this.dlg.Hide(); - this.dlg.Dispose(); - this.dlg = null; + dlg.ApplyChanges(); + dlg.Hide(); + dlg.Dispose(); + dlg = null; } } public void StartConfig() { - this.tmpConfig = this.config.Clone(); + tmpConfig = _config.Clone(); } #endregion diff --git a/src/DefaultPlugins/EminusConfig.cs b/src/DefaultPlugins/EminusConfig.cs index a707a81d..5bfa22f6 100644 --- a/src/DefaultPlugins/EminusConfig.cs +++ b/src/DefaultPlugins/EminusConfig.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; namespace LogExpert { @@ -19,10 +17,10 @@ public class EminusConfig public EminusConfig Clone() { - EminusConfig config = new EminusConfig(); - config.host = this.host; - config.port = this.port; - config.password = this.password; + EminusConfig config = new(); + config.host = host; + config.port = port; + config.password = password; return config; } diff --git a/src/DefaultPlugins/EminusConfigDlg.Designer.cs b/src/DefaultPlugins/EminusConfigDlg.Designer.cs index 9d24773f..56617b77 100644 --- a/src/DefaultPlugins/EminusConfigDlg.Designer.cs +++ b/src/DefaultPlugins/EminusConfigDlg.Designer.cs @@ -99,8 +99,6 @@ private void InitializeComponent() // // EminusConfigDlg // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(295, 187); this.ControlBox = false; this.Controls.Add(this.portTextBox); diff --git a/src/DefaultPlugins/EminusConfigDlg.cs b/src/DefaultPlugins/EminusConfigDlg.cs index c00936e1..d1464a96 100644 --- a/src/DefaultPlugins/EminusConfigDlg.cs +++ b/src/DefaultPlugins/EminusConfigDlg.cs @@ -1,9 +1,4 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; using System.Windows.Forms; namespace LogExpert diff --git a/src/DefaultPlugins/ProcessLauncher.cs b/src/DefaultPlugins/ProcessLauncher.cs index ab1db7d6..0d916765 100644 --- a/src/DefaultPlugins/ProcessLauncher.cs +++ b/src/DefaultPlugins/ProcessLauncher.cs @@ -1,4 +1,5 @@ -using System.Diagnostics; +using System; +using System.Diagnostics; namespace LogExpert { @@ -6,15 +7,14 @@ public class ProcessLauncher : IKeywordAction { #region Properties - public string Text - { - get { return GetName(); } - } + public string Text => GetName(); #endregion #region IKeywordAction Member + private readonly object _callbackLock = new object(); + public void Execute(string keyword, string param, ILogExpertCallback callback, ILogLineColumnizer columnizer) { int start = 0; @@ -22,28 +22,36 @@ public void Execute(string keyword, string param, ILogExpertCallback callback, I if (param.StartsWith("\"")) { start = 1; - end = param.IndexOf("\"", start); + end = param.IndexOf("\"", start, StringComparison.Ordinal); } else { - end = param.IndexOf(" "); + end = param.IndexOf(" ", StringComparison.Ordinal); } if (end == -1) { end = param.Length; } string procName = param.Substring(start, end - start); - string parameters = param.Substring(end).Trim(); - parameters = parameters.Replace("%F", callback.GetFileName()); - parameters = parameters.Replace("%K", keyword); - parameters = parameters.Replace("%L", "" + callback.GetLineNum()); - parameters = parameters.Replace("%T", callback.GetTabTitle()); - parameters = parameters.Replace("%C", callback.GetLogLine(callback.GetLineNum()).FullLine); - Process explorer = new Process(); - explorer.StartInfo.FileName = procName; - explorer.StartInfo.Arguments = parameters; - explorer.StartInfo.UseShellExecute = false; - explorer.Start(); + + lock(_callbackLock) + { + string parameters = param.Substring(end).Trim(); + parameters = parameters.Replace("%F", callback.GetFileName()); + parameters = parameters.Replace("%K", keyword); + + int lineNumber = callback.GetLineNum(); //Line Numbers start at 0, but are displayed (+1) + string logline = callback.GetLogLine(lineNumber).FullLine; + parameters = parameters.Replace("%L", string.Empty + lineNumber); + parameters = parameters.Replace("%T", callback.GetTabTitle()); + parameters = parameters.Replace("%C", logline); + + Process explorer = new Process(); + explorer.StartInfo.FileName = procName; + explorer.StartInfo.Arguments = parameters; + explorer.StartInfo.UseShellExecute = false; + explorer.Start(); + } } public string GetName() diff --git a/src/DefaultPlugins/Properties/AssemblyInfo.cs b/src/DefaultPlugins/Properties/AssemblyInfo.cs deleted file mode 100644 index 1c71ad96..00000000 --- a/src/DefaultPlugins/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Eminus Plugins")] -[assembly: AssemblyDescription("")] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("302f27e1-f8c3-4338-b8e6-7039003f6ad0")] \ No newline at end of file diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 00000000..11a29ac4 --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,10 @@ + + + 8.2.0 + 2.0.0.0 + 2.0.0.0 + 2.0.0.0-rc1 + Hirogen, zarunbal, RandallFlagg, TheNicker + Log Expert + + \ No newline at end of file diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props new file mode 100644 index 00000000..2ad39c43 --- /dev/null +++ b/src/Directory.Packages.props @@ -0,0 +1,31 @@ + + + true + true + $(NoWarn);NU1507 + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/FlashIconHighlighter/FlashIconHighlighter.csproj b/src/FlashIconHighlighter/FlashIconHighlighter.csproj index d6290f76..b5a8f53b 100644 --- a/src/FlashIconHighlighter/FlashIconHighlighter.csproj +++ b/src/FlashIconHighlighter/FlashIconHighlighter.csproj @@ -1,42 +1,20 @@ - - + - Debug - AnyCPU - 9.0.21022 - 2.0 - {F5E81EBE-3E6F-409F-B510-918E97F59072} + net8.0-windows + true Library - Properties - FlashIconHighlighter - FlashIconHighlighter - v4.8.1 - 512 - - - - - 3.5 - + false + true + true + false + $(SolutionDir)..\bin\$(Configuration)\plugins + CA1416; - - true - full - false - ..\..\bin\Debug\plugins\ - DEBUG;TRACE - prompt - 4 - false + + False - - pdbonly - true - ..\..\bin\Release\plugins\ - TRACE - prompt - 4 - false + + True true @@ -44,42 +22,18 @@ ..\Solution Items\Key.snk - - - - - - Properties\AssemblyVersion.cs - - - - - {e72c2bb1-34de-4d66-a830-9647c3837833} - ColumnizerLib - False - + Key.snk - - - - - - - \ No newline at end of file + + diff --git a/src/FlashIconHighlighter/Properties/AssemblyInfo.cs b/src/FlashIconHighlighter/Properties/AssemblyInfo.cs deleted file mode 100644 index d01f3f73..00000000 --- a/src/FlashIconHighlighter/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. - -[assembly: AssemblyTitle("FlashIconHighlighter")] -[assembly: AssemblyDescription("")] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("c62bc4c2-bcbe-4d8c-971f-47e921c2763a")] \ No newline at end of file diff --git a/src/GlassfishColumnizer/GlassfishColumnizer.csproj b/src/GlassfishColumnizer/GlassfishColumnizer.csproj index 217715bf..4e3ef5cb 100644 --- a/src/GlassfishColumnizer/GlassfishColumnizer.csproj +++ b/src/GlassfishColumnizer/GlassfishColumnizer.csproj @@ -1,42 +1,16 @@ - - + - Debug - AnyCPU - 9.0.21022 - 2.0 - {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB} + net8.0-windows Library - Properties - GlassfishColumnizer - GlassfishColumnizer - v4.8.1 - 512 - - - - - 3.5 - + false + false + $(SolutionDir)..\bin\$(Configuration)\plugins - - true - full - false - ..\..\bin\Debug\plugins\ - DEBUG;TRACE - prompt - 4 - false + + False - - pdbonly - true - ..\..\bin\Release\plugins\ - TRACE - prompt - 4 - false + + True true @@ -44,40 +18,21 @@ ..\Solution Items\Key.snk - - - - - Properties\AssemblyVersion.cs - - - - {e72c2bb1-34de-4d66-a830-9647c3837833} - ColumnizerLib - False - + Key.snk - - - - + GlassfishColumnizer + Glassfish logfile support for LogExpert - \ No newline at end of file + diff --git a/src/GlassfishColumnizer/Properties/AssemblyInfo.cs b/src/GlassfishColumnizer/Properties/AssemblyInfo.cs index 7c626b7b..3346c8f5 100644 --- a/src/GlassfishColumnizer/Properties/AssemblyInfo.cs +++ b/src/GlassfishColumnizer/Properties/AssemblyInfo.cs @@ -2,11 +2,5 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("GlassfishColumnizer")] -[assembly: AssemblyDescription("Glassfish logfile support for LogExpert")] - // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("ffea3945-9d17-476d-b565-268f0700704c")] \ No newline at end of file diff --git a/src/JsonColumnizer/JsonColumnizer.csproj b/src/JsonColumnizer/JsonColumnizer.csproj index d79181f0..08ea9fb1 100644 --- a/src/JsonColumnizer/JsonColumnizer.csproj +++ b/src/JsonColumnizer/JsonColumnizer.csproj @@ -1,42 +1,19 @@ - - + - Debug - AnyCPU - 9.0.21022 - 2.0 - {4C899885-E361-410A-B6AC-C2F236C436FA} + net8.0-windows + true Library - Properties - JsonColumnizer - JsonColumnizer - v4.8.1 - 512 - - - - - 3.5 - + false + true + true + false + $(SolutionDir)..\bin\$(Configuration)\plugins - - true - full - false - ..\..\bin\Debug\plugins\ - DEBUG;TRACE - prompt - 4 - false + + False - - pdbonly - true - ..\..\bin\Release\plugins\ - TRACE - prompt - 4 - false + + True true @@ -44,47 +21,23 @@ ..\Solution Items\Key.snk - - - - - - - Properties\AssemblyVersion.cs - - - - {e72c2bb1-34de-4d66-a830-9647c3837833} - ColumnizerLib - True - + Key.snk - - - 13.0.3 - - - - - - + JsonColumnizer - \ No newline at end of file + + + + diff --git a/src/JsonColumnizer/Properties/AssemblyInfo.cs b/src/JsonColumnizer/Properties/AssemblyInfo.cs index afcc466c..113a680e 100644 --- a/src/JsonColumnizer/Properties/AssemblyInfo.cs +++ b/src/JsonColumnizer/Properties/AssemblyInfo.cs @@ -2,11 +2,5 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("JsonColumnizer")] -[assembly: AssemblyDescription("")] - // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("4C0B11AE-BCAF-492C-AFE7-53C9B79148BE")] \ No newline at end of file diff --git a/src/JsonCompactColumnizer/JsonCompactColumnizer.csproj b/src/JsonCompactColumnizer/JsonCompactColumnizer.csproj index 666beef6..86b2eba4 100644 --- a/src/JsonCompactColumnizer/JsonCompactColumnizer.csproj +++ b/src/JsonCompactColumnizer/JsonCompactColumnizer.csproj @@ -1,42 +1,20 @@ - - + - Debug - AnyCPU - 9.0.21022 - 2.0 - {003535EC-4186-4958-9DD9-C641F089AEED} + net8.0-windows + true Library - Properties JsonColumnizer - JsonCompactColumnizer - v4.8.1 - 512 - - - - - 3.5 - + false + true + true + false + $(SolutionDir)..\bin\$(Configuration)\plugins - - true - full - false - ..\..\bin\Debug\plugins\ - DEBUG;TRACE - prompt - 4 - false + + False - - pdbonly - true - ..\..\bin\Release\plugins\ - TRACE - prompt - 4 - false + + True true @@ -44,51 +22,24 @@ ..\Solution Items\Key.snk - - - - - - - Properties\AssemblyVersion.cs - - - - {e72c2bb1-34de-4d66-a830-9647c3837833} - ColumnizerLib - True - - - {4C899885-E361-410A-B6AC-C2F236C436FA} - JsonColumnizer - + + Key.snk - - - 13.0.3 - - - - - - + JsonCompactColumnizer - \ No newline at end of file + + + + diff --git a/src/JsonCompactColumnizer/Properties/AssemblyInfo.cs b/src/JsonCompactColumnizer/Properties/AssemblyInfo.cs index edd09ed6..47c642d5 100644 --- a/src/JsonCompactColumnizer/Properties/AssemblyInfo.cs +++ b/src/JsonCompactColumnizer/Properties/AssemblyInfo.cs @@ -2,11 +2,5 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("JsonCompactColumnizer")] -[assembly: AssemblyDescription("")] - // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("6D5A3E51-4D0F-452E-8A86-DDCC313F3A7F")] \ No newline at end of file diff --git a/src/Log4jXmlColumnizer/Log4jXmlColumnizer.cs b/src/Log4jXmlColumnizer/Log4jXmlColumnizer.cs index bda9ba2e..b542a6cd 100644 --- a/src/Log4jXmlColumnizer/Log4jXmlColumnizer.cs +++ b/src/Log4jXmlColumnizer/Log4jXmlColumnizer.cs @@ -1,13 +1,12 @@ using System; using System.Collections.Generic; -using System.Text; using System.Globalization; -using System.Text.RegularExpressions; using System.IO; using System.Linq; using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Serialization; using System.Windows.Forms; +using Newtonsoft.Json; namespace LogExpert @@ -38,7 +37,7 @@ internal class XmlConfig : IXmlLogConfiguration public string[] Namespace { - get { return new string[] {"log4j", "http://jakarta.apache.org/log4j"}; } + get { return ["log4j", "http://jakarta.apache.org/log4j"]; } } #endregion @@ -65,9 +64,9 @@ public class Log4jColumnEntry public Log4jColumnEntry(string name, int index, int maxLen) { - this.columnName = name; - this.columnIndex = index; - this.visible = true; + columnName = name; + columnIndex = index; + visible = true; this.maxLen = maxLen; } @@ -79,7 +78,7 @@ public class Log4jXmlColumnizerConfig { #region Fields - public List columnList = new List(); + public List columnList = new(); public bool localTimestamps = true; #endregion @@ -104,7 +103,7 @@ public int ActiveColumnCount get { int count = 0; - foreach (Log4jColumnEntry entry in this.columnList) + foreach (Log4jColumnEntry entry in columnList) { if (entry.visible) { @@ -124,7 +123,7 @@ public string[] ActiveColumnNames { string[] names = new string[ActiveColumnCount]; int index = 0; - foreach (Log4jColumnEntry entry in this.columnList) + foreach (Log4jColumnEntry entry in columnList) { if (entry.visible) { @@ -141,10 +140,10 @@ public string[] ActiveColumnNames public void FillDefaults(string[] columnNames) { - this.columnList.Clear(); + columnList.Clear(); for (int i = 0; i < columnNames.Length; ++i) { - this.columnList.Add(new Log4jColumnEntry(columnNames[i], i, 0)); + columnList.Add(new Log4jColumnEntry(columnNames[i], i, 0)); } } @@ -159,11 +158,11 @@ public class Log4jXmlColumnizer : ILogLineXmlColumnizer, IColumnizerConfigurator public const int COLUMN_COUNT = 9; protected const string DATETIME_FORMAT = "dd.MM.yyyy HH:mm:ss.fff"; - private static readonly XmlConfig xmlConfig = new XmlConfig(); + private static readonly XmlConfig xmlConfig = new(); private readonly char separatorChar = '\xFFFD'; - private readonly char[] trimChars = new char[] {'\xFFFD'}; - private Log4jXmlColumnizerConfig config; - protected CultureInfo cultureInfo = new CultureInfo("de-DE"); + private readonly char[] trimChars = ['\xFFFD']; + private Log4jXmlColumnizerConfig _config; + protected CultureInfo cultureInfo = new("de-DE"); protected int timeOffset = 0; #endregion @@ -172,7 +171,7 @@ public class Log4jXmlColumnizer : ILogLineXmlColumnizer, IColumnizerConfigurator public Log4jXmlColumnizer() { - config = new Log4jXmlColumnizerConfig(GetAllColumnNames()); + _config = new Log4jXmlColumnizerConfig(GetAllColumnNames()); } #endregion @@ -186,7 +185,7 @@ public IXmlLogConfiguration GetXmlLogConfiguration() public ILogLine GetLineTextForClipboard(ILogLine logLine, ILogLineColumnizerCallback callback) { - Log4JLogLine line = new Log4JLogLine + Log4JLogLine line = new() { FullLine = logLine.FullLine.Replace(separatorChar, '|'), LineNumber = logLine.LineNumber @@ -207,20 +206,20 @@ public string GetDescription() public int GetColumnCount() { - return config.ActiveColumnCount; + return _config.ActiveColumnCount; } public string[] GetColumnNames() { - return config.ActiveColumnNames; + return _config.ActiveColumnNames; } public IColumnizedLogLine SplitLine(ILogLineColumnizerCallback callback, ILogLine line) { - ColumnizedLogLine clogLine = new ColumnizedLogLine(); + ColumnizedLogLine clogLine = new(); clogLine.LogLine = line; - Column[] columns = Column.CreateColumns(Log4jXmlColumnizer.COLUMN_COUNT, clogLine); + Column[] columns = Column.CreateColumns(COLUMN_COUNT, clogLine); // If the line is too short (i.e. does not follow the format for this columnizer) return the whole line content @@ -249,9 +248,9 @@ public IColumnizedLogLine SplitLine(ILogLineColumnizerCallback callback, ILogLin Column timestmp = columns[0]; string[] cols; - cols = line.FullLine.Split(this.trimChars, Log4jXmlColumnizer.COLUMN_COUNT, StringSplitOptions.None); + cols = line.FullLine.Split(trimChars, COLUMN_COUNT, StringSplitOptions.None); - if (cols.Length != Log4jXmlColumnizer.COLUMN_COUNT) + if (cols.Length != COLUMN_COUNT) { columns[0].FullValue = ""; columns[1].FullValue = ""; @@ -290,12 +289,12 @@ public bool IsTimeshiftImplemented() public void SetTimeOffset(int msecOffset) { - this.timeOffset = msecOffset; + timeOffset = msecOffset; } public int GetTimeOffset() { - return this.timeOffset; + return timeOffset; } public DateTime GetTimestamp(ILogLineColumnizerCallback callback, ILogLine line) @@ -319,13 +318,13 @@ public DateTime GetTimestamp(ILogLineColumnizerCallback callback, ILogLine line) if (long.TryParse(value, out timestamp)) { // Add the time offset before returning - DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + DateTime dateTime = new(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); dateTime = dateTime.AddMilliseconds(timestamp); - if (this.config.localTimestamps) + if (_config.localTimestamps) { dateTime = dateTime.ToLocalTime(); } - return dateTime.AddMilliseconds(this.timeOffset); + return dateTime.AddMilliseconds(timeOffset); } else { @@ -344,11 +343,11 @@ public void PushValue(ILogLineColumnizerCallback callback, int column, string va { try { - DateTime newDateTime = DateTime.ParseExact(value, DATETIME_FORMAT, this.cultureInfo); - DateTime oldDateTime = DateTime.ParseExact(oldValue, DATETIME_FORMAT, this.cultureInfo); + DateTime newDateTime = DateTime.ParseExact(value, DATETIME_FORMAT, cultureInfo); + DateTime oldDateTime = DateTime.ParseExact(oldValue, DATETIME_FORMAT, cultureInfo); long mSecsOld = oldDateTime.Ticks / TimeSpan.TicksPerMillisecond; long mSecsNew = newDateTime.Ticks / TimeSpan.TicksPerMillisecond; - this.timeOffset = (int) (mSecsNew - mSecsOld); + timeOffset = (int) (mSecsNew - mSecsOld); } catch (FormatException) { @@ -358,45 +357,42 @@ public void PushValue(ILogLineColumnizerCallback callback, int column, string va public void Configure(ILogLineColumnizerCallback callback, string configDir) { - string configPath = configDir + "\\log4jxmlcolumnizer.dat"; - Log4jXmlColumnizerConfigDlg dlg = new Log4jXmlColumnizerConfigDlg(this.config); + FileInfo fileInfo = new(configDir + Path.DirectorySeparatorChar + "log4jxmlcolumnizer.json"); + + Log4jXmlColumnizerConfigDlg dlg = new(_config); + if (dlg.ShowDialog() == DialogResult.OK) { - BinaryFormatter formatter = new BinaryFormatter(); - Stream fs = new FileStream(configPath, FileMode.Create, FileAccess.Write); - formatter.Serialize(fs, this.config); - fs.Close(); + using StreamWriter sw = new(fileInfo.Create()); + JsonSerializer serializer = new(); + serializer.Serialize(sw, _config); } } public void LoadConfig(string configDir) { - string configPath = configDir + "\\log4jxmlcolumnizer.dat"; + string configPath = configDir + Path.DirectorySeparatorChar + "log4jxmlcolumnizer.json"; + + FileInfo fileInfo = new(configDir + Path.DirectorySeparatorChar + "log4jxmlcolumnizer.json"); if (!File.Exists(configPath)) { - this.config = new Log4jXmlColumnizerConfig(GetAllColumnNames()); + _config = new Log4jXmlColumnizerConfig(GetAllColumnNames()); } else { - Stream fs = File.OpenRead(configPath); - BinaryFormatter formatter = new BinaryFormatter(); try { - this.config = (Log4jXmlColumnizerConfig) formatter.Deserialize(fs); - if (this.config.columnList.Count < Log4jXmlColumnizer.COLUMN_COUNT) + _config = JsonConvert.DeserializeObject(File.ReadAllText($"{fileInfo.FullName}")); + if (_config.columnList.Count < COLUMN_COUNT) { - this.config = new Log4jXmlColumnizerConfig(GetAllColumnNames()); + _config = new Log4jXmlColumnizerConfig(GetAllColumnNames()); } } catch (SerializationException e) { MessageBox.Show(e.Message, "Deserialize"); - this.config = new Log4jXmlColumnizerConfig(GetAllColumnNames()); - } - finally - { - fs.Close(); + _config = new Log4jXmlColumnizerConfig(GetAllColumnNames()); } } } @@ -417,8 +413,7 @@ public Priority GetPriority(string fileName, IEnumerable samples) private string[] GetAllColumnNames() { - return new string[] - {"Timestamp", "Level", "Logger", "Thread", "Class", "Method", "File", "Line", "Message"}; + return ["Timestamp", "Level", "Logger", "Thread", "Class", "Method", "File", "Line", "Message"]; } @@ -429,9 +424,9 @@ private string[] GetAllColumnNames() /// private Column[] MapColumns(Column[] cols) { - List output = new List(); + List output = []; int index = 0; - foreach (Log4jColumnEntry entry in config.columnList) + foreach (Log4jColumnEntry entry in _config.columnList) { if (entry.visible) { diff --git a/src/Log4jXmlColumnizer/Log4jXmlColumnizer.csproj b/src/Log4jXmlColumnizer/Log4jXmlColumnizer.csproj index 879afe51..8b1834e7 100644 --- a/src/Log4jXmlColumnizer/Log4jXmlColumnizer.csproj +++ b/src/Log4jXmlColumnizer/Log4jXmlColumnizer.csproj @@ -1,42 +1,20 @@ - - + - Debug - AnyCPU - 9.0.21022 - 2.0 - {C41A517B-7502-4B17-9119-55D5716FAD65} + net8.0-windows + true Library - Properties - Log4jXmlColumnizer - Log4jXmlColumnizer - v4.8.1 - 512 - - - - - 3.5 - + false + true + true + false + $(SolutionDir)..\bin\$(Configuration)\plugins + CA1416; - - true - full - false - ..\..\bin\Debug\plugins\ - DEBUG;TRACE - prompt - 4 - false + + False - - pdbonly - true - ..\..\bin\Release\plugins\ - TRACE - prompt - 4 - false + + True true @@ -44,57 +22,23 @@ ..\Solution Items\Key.snk - - - - - - - Properties\AssemblyVersion.cs - - - Form - - - Log4jXmlColumnizerConfigDlg.cs - - - - - - Log4jXmlColumnizerConfigDlg.cs - Designer - - - {e72c2bb1-34de-4d66-a830-9647c3837833} - ColumnizerLib - False - + Key.snk - - - - - - - \ No newline at end of file + + + + diff --git a/src/Log4jXmlColumnizer/Log4jXmlColumnizerConfigDlg.Designer.cs b/src/Log4jXmlColumnizer/Log4jXmlColumnizerConfigDlg.Designer.cs index 1a70cbce..170ed2a2 100644 --- a/src/Log4jXmlColumnizer/Log4jXmlColumnizerConfigDlg.Designer.cs +++ b/src/Log4jXmlColumnizer/Log4jXmlColumnizerConfigDlg.Designer.cs @@ -63,7 +63,7 @@ private void InitializeComponent() this.okButton.TabIndex = 1; this.okButton.Text = "OK"; this.okButton.UseVisualStyleBackColor = true; - this.okButton.Click += new System.EventHandler(this.okButton_Click); + this.okButton.Click += new System.EventHandler(this.OkButton_Click); // // label1 // @@ -153,8 +153,6 @@ private void InitializeComponent() // // Log4jXmlColumnizerConfigDlg // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(300, 266); this.Controls.Add(this.columnGridView); this.Controls.Add(this.localTimeCheckBox); diff --git a/src/Log4jXmlColumnizer/Log4jXmlColumnizerConfigDlg.cs b/src/Log4jXmlColumnizer/Log4jXmlColumnizerConfigDlg.cs index 89b88971..ca386094 100644 --- a/src/Log4jXmlColumnizer/Log4jXmlColumnizerConfigDlg.cs +++ b/src/Log4jXmlColumnizer/Log4jXmlColumnizerConfigDlg.cs @@ -1,9 +1,4 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; using System.Windows.Forms; namespace LogExpert @@ -12,7 +7,7 @@ public partial class Log4jXmlColumnizerConfigDlg : Form { #region Fields - private readonly Log4jXmlColumnizerConfig config; + private readonly Log4jXmlColumnizerConfig _config; #endregion @@ -20,10 +15,10 @@ public partial class Log4jXmlColumnizerConfigDlg : Form public Log4jXmlColumnizerConfigDlg(Log4jXmlColumnizerConfig config) { - this.config = config; + _config = config; InitializeComponent(); FillListBox(); - this.localTimeCheckBox.Checked = this.config.localTimestamps; + localTimeCheckBox.Checked = _config.localTimestamps; } #endregion @@ -32,11 +27,11 @@ public Log4jXmlColumnizerConfigDlg(Log4jXmlColumnizerConfig config) private void FillListBox() { - DataGridViewCheckBoxColumn checkColumn = (DataGridViewCheckBoxColumn) this.columnGridView.Columns[0]; - DataGridViewTextBoxColumn nameColumn = (DataGridViewTextBoxColumn) this.columnGridView.Columns[1]; - DataGridViewTextBoxColumn lenColumn = (DataGridViewTextBoxColumn) this.columnGridView.Columns[2]; + DataGridViewCheckBoxColumn checkColumn = (DataGridViewCheckBoxColumn)columnGridView.Columns[0]; + DataGridViewTextBoxColumn nameColumn = (DataGridViewTextBoxColumn)columnGridView.Columns[1]; + DataGridViewTextBoxColumn lenColumn = (DataGridViewTextBoxColumn)columnGridView.Columns[2]; - foreach (Log4jColumnEntry entry in config.columnList) + foreach (Log4jColumnEntry entry in _config.columnList) { DataGridViewRow row = new DataGridViewRow(); row.Cells.Add(new DataGridViewCheckBoxCell()); @@ -45,7 +40,7 @@ private void FillListBox() row.Cells[0].Value = entry.visible; row.Cells[1].Value = entry.columnName; row.Cells[2].Value = entry.maxLen > 0 ? "" + entry.maxLen : ""; - this.columnGridView.Rows.Add(row); + columnGridView.Rows.Add(row); } } @@ -53,27 +48,27 @@ private void FillListBox() #region Events handler - private void okButton_Click(object sender, EventArgs e) + private void OkButton_Click(object sender, EventArgs e) { // for (int i = 0; i < this.config.columnList.Count; ++i) // { // this.config.columnList[i]. visible = this.columnListBox.GetItemChecked(i); // } - for (int i = 0; i < this.columnGridView.Rows.Count; ++i) + for (int i = 0; i < columnGridView.Rows.Count; ++i) { - this.config.columnList[i].visible = (bool) this.columnGridView.Rows[i].Cells[0].Value; - string sLen = (string) this.columnGridView.Rows[i].Cells[2].Value; + _config.columnList[i].visible = (bool)columnGridView.Rows[i].Cells[0].Value; + string sLen = (string)columnGridView.Rows[i].Cells[2].Value; int len; if (int.TryParse(sLen, out len)) { - this.config.columnList[i].maxLen = len; + _config.columnList[i].maxLen = len; } else { - this.config.columnList[i].maxLen = 0; + _config.columnList[i].maxLen = 0; } } - this.config.localTimestamps = this.localTimeCheckBox.Checked; + _config.localTimestamps = localTimeCheckBox.Checked; } #endregion diff --git a/src/Log4jXmlColumnizer/Properties/AssemblyInfo.cs b/src/Log4jXmlColumnizer/Properties/AssemblyInfo.cs deleted file mode 100644 index e47b726d..00000000 --- a/src/Log4jXmlColumnizer/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Log4jXmlColumnizer")] -[assembly: AssemblyDescription("XML logfile support for LogExpert")] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("7e083fad-da9a-4962-870f-0f1676293961")] \ No newline at end of file diff --git a/src/LogExpert.Tests/BufferShiftTest.cs b/src/LogExpert.Tests/BufferShiftTest.cs index be9dc3cb..e5bb7275 100644 --- a/src/LogExpert.Tests/BufferShiftTest.cs +++ b/src/LogExpert.Tests/BufferShiftTest.cs @@ -1,8 +1,8 @@ -using System.Collections.Generic; -using System.Text; -using LogExpert.Classes.Log; +using LogExpert.Classes.Log; using LogExpert.Entities; using NUnit.Framework; +using System.Collections.Generic; +using System.Text; namespace LogExpert.Tests { @@ -36,13 +36,14 @@ public void TestShiftBuffers1() reader.ReadFiles(); IList lil = reader.GetLogFileInfoList(); - Assert.AreEqual(files.Count, lil.Count); + Assert.That(lil.Count, Is.EqualTo(files.Count)); + LinkedList.Enumerator enumerator = files.GetEnumerator(); enumerator.MoveNext(); foreach (LogFileInfo li in lil) { string fileName = enumerator.Current; - Assert.AreEqual(fileName, li.FullName); + Assert.That(li.FullName, Is.EqualTo(fileName)); enumerator.MoveNext(); } int oldCount = lil.Count; @@ -56,19 +57,19 @@ public void TestShiftBuffers1() reader.ShiftBuffers(); lil = reader.GetLogFileInfoList(); - Assert.AreEqual(oldCount + 1, lil.Count); + Assert.That(lil.Count, Is.EqualTo(oldCount + 1)); - Assert.AreEqual(linesPerFile * lil.Count, reader.LineCount); + Assert.That(reader.LineCount, Is.EqualTo(linesPerFile * lil.Count)); // Check if rollover'd file names have been handled by LogfileReader // - Assert.AreEqual(files.Count, lil.Count); + Assert.That(lil.Count, Is.EqualTo(files.Count)); enumerator = files.GetEnumerator(); enumerator.MoveNext(); foreach (LogFileInfo li in lil) { string fileName = enumerator.Current; - Assert.AreEqual(fileName, li.FullName); + Assert.That(li.FullName, Is.EqualTo(fileName)); enumerator.MoveNext(); } @@ -81,8 +82,8 @@ public void TestShiftBuffers1() int startLine = 0; foreach (LogBuffer logBuffer in logBuffers) { - Assert.AreEqual(logBuffer.FileInfo.FullName, enumerator.Current); - Assert.AreEqual(startLine, logBuffer.StartLine); + Assert.That(enumerator.Current, Is.EqualTo(logBuffer.FileInfo.FullName)); + Assert.That(logBuffer.StartLine, Is.EqualTo(startLine)); startLine += 10; enumerator.MoveNext(); } @@ -98,7 +99,7 @@ public void TestShiftBuffers1() { LogBuffer logBuffer = logBuffers[i]; ILogLine line = logBuffer.GetLineOfBlock(0); - Assert.IsTrue(line.FullLine.Contains(enumerator.Current)); + Assert.That(line.FullLine.Contains(enumerator.Current)); enumerator.MoveNext(); } enumerator.MoveNext(); @@ -107,7 +108,7 @@ public void TestShiftBuffers1() { LogBuffer logBuffer = logBuffers[i]; ILogLine line = logBuffer.GetLineOfBlock(0); - Assert.IsTrue(line.FullLine.Contains(enumerator.Current)); + Assert.That(line.FullLine.Contains(enumerator.Current)); } oldCount = lil.Count; @@ -121,16 +122,16 @@ public void TestShiftBuffers1() reader.ShiftBuffers(); lil = reader.GetLogFileInfoList(); - Assert.AreEqual(oldCount, lil.Count); // same count because oldest file is deleted - Assert.AreEqual(files.Count, lil.Count); - Assert.AreEqual(linesPerFile * lil.Count, reader.LineCount); + Assert.That(lil.Count, Is.EqualTo(oldCount)); // same count because oldest file is deleted + Assert.That(lil.Count, Is.EqualTo(files.Count)); + Assert.That(reader.LineCount, Is.EqualTo(linesPerFile * lil.Count)); // Check first line to see if buffers are correct // ILogLine firstLine = reader.GetLogLine(0); string[] names = new string[files.Count]; files.CopyTo(names, 0); - Assert.IsTrue(firstLine.FullLine.Contains(names[2])); + Assert.That(firstLine.FullLine.Contains(names[2])); } } } \ No newline at end of file diff --git a/src/LogExpert.Tests/CSVColumnizerTest.cs b/src/LogExpert.Tests/CSVColumnizerTest.cs index 92bd9f7b..9d759bd9 100644 --- a/src/LogExpert.Tests/CSVColumnizerTest.cs +++ b/src/LogExpert.Tests/CSVColumnizerTest.cs @@ -1,9 +1,8 @@ -using System; -using System.IO; -using LogExpert.Classes.Log; +using LogExpert.Classes.Log; using LogExpert.Entities; - using NUnit.Framework; +using System; +using System.IO; namespace LogExpert.Tests { @@ -19,16 +18,14 @@ public void Instantiat_CSVFile_BuildCorrectColumnizer(string filename, string[] string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, filename); LogfileReader reader = new LogfileReader(path, new EncodingOptions(), true, 40, 50, new MultiFileOptions()); reader.ReadFiles(); - - ILogLine line = reader.GetLogLineWithWait(0); + ILogLine line = reader.GetLogLine(0); IColumnizedLogLine logline = new ColumnizedLogLine(); if (line != null) { logline = csvColumnizer.SplitLine(null, line); } - string expectedResult = string.Join(",", expectedHeaders); - Assert.AreEqual(expectedResult, logline.LogLine.FullLine); + Assert.That(logline.LogLine.FullLine, Is.EqualTo(expectedResult)); } } } diff --git a/src/LogExpert.Tests/ColumnizerPickerTest.cs b/src/LogExpert.Tests/ColumnizerPickerTest.cs index 824d1db2..f04e8ff3 100644 --- a/src/LogExpert.Tests/ColumnizerPickerTest.cs +++ b/src/LogExpert.Tests/ColumnizerPickerTest.cs @@ -1,12 +1,12 @@ using JsonColumnizer; +using LogExpert.Classes; using LogExpert.Classes.Columnizer; +using LogExpert.Classes.Log; +using LogExpert.Entities; using Moq; using NUnit.Framework; using System; using System.IO; -using LogExpert.Classes; -using LogExpert.Classes.Log; -using LogExpert.Entities; namespace LogExpert.Tests { diff --git a/src/LogExpert.Tests/DateFormatParserTest.cs b/src/LogExpert.Tests/DateFormatParserTest.cs index 9cb59eb1..d2cbf471 100644 --- a/src/LogExpert.Tests/DateFormatParserTest.cs +++ b/src/LogExpert.Tests/DateFormatParserTest.cs @@ -1,103 +1,126 @@ -using LogExpert.Classes.DateTimeParser; - -using NUnit.Framework; - -using System; -using System.Globalization; -using System.Linq; - -namespace LogExpert.Tests -{ - [TestFixture] - public class DateFormatParserTest - { - [Test] - public void CanParseAllCultures() - { - var cultures = CultureInfo.GetCultures(CultureTypes.AllCultures); - - //TODO Add Support for languages with TT (AM / PM) - foreach (var culture in cultures) - { - var datePattern = GetDateAndTimeFormat(culture); - - //aa (Afar dd/MM/yyyy h:mm:ss tt) - //af-NA (Afrikaans (Namibia) yyyy-MM-dd h:mm:ss tt) - //ak (Akan yyyy/MM/dd h:mm:ss tt) - //bem (Bemba dd/MM/yyyy h:mm:ss tt) - //ceb (Cebuano M/d/yyyy h:mm:ss tt) - //el-CY (Greek (Cyprus) d/M/yyyy h:mm:ss tt) - //dz (Dzongkha yyyy-MM-dd ཆུ་ཚོད་h:mm:ss tt) - //es-CO(Spanish(Colombia) d/MM/yyyy h:mm:ss tt) - //es-DO (Spanish (Dominican Republic) d/M/yyyy h:mm:ss tt) - //es-PA (Spanish (Panama) MM/dd/yyyy h:mm:ss tt) - //es-PH (Spanish (Philippines) d/M/yyyy h:mm:ss tt) - if (datePattern.Contains("tt")) - { - Console.WriteLine($"The {culture.Name} time format is not supported yet."); - continue; - } - - var message = $"Culture: {culture.Name} ({culture.EnglishName} {datePattern})"; - var sections = Parser.ParseSections(datePattern, out bool syntaxError); - - Assert.That(syntaxError, Is.False, message); - - var dateSection = sections.FirstOrDefault(); - Assert.That(dateSection, Is.Not.Null, message); - - var now = DateTime.Now; - var expectedFormattedDate = now.ToString(datePattern); - var actualFormattedDate = now.ToString(string.Join("", dateSection.GeneralTextDateDurationParts)); - Assert.That(actualFormattedDate, Is.EqualTo(expectedFormattedDate), message); - } - } - - [Test] - [TestCase("en-US", "MM", "dd", "yyyy", "hh", "mm", "ss", "tt")] - [TestCase("fr-FR", "dd", "MM", "yyyy", "HH", "mm", "ss")] - [TestCase("de-DE", "dd", "MM", "yyyy", "HH", "mm", "ss")] - [TestCase("ar-TN", "dd", "MM", "yyyy", "HH", "mm", "ss")] - [TestCase("as", "dd", "MM", "yyyy", "tt", "hh", "mm", "ss")] - [TestCase("bg", "dd", "MM", "yyyy", "HH", "mm", "ss")] - public void TestDateFormatParserFromCulture(string cultureInfoName, params string[] expectedDateParts) - { - var culture = CultureInfo.GetCultureInfo(cultureInfoName); - - var datePattern = GetDateAndTimeFormat(culture); - - var sections = Parser.ParseSections(datePattern, out bool syntaxError); - - var message = $"Culture: {culture.EnglishName}, Actual date pattern: {datePattern}"; - - Assert.That(syntaxError, Is.False, message); - - var dateSection = sections.FirstOrDefault(); - Assert.That(dateSection, Is.Not.Null); - - var dateParts = dateSection - .GeneralTextDateDurationParts - .Where(Token.IsDatePart) - .Select(p => DateFormatPartAdjuster.AdjustDateTimeFormatPart(p)) - .ToArray(); - - Assert.That(dateParts.Length, Is.EqualTo(expectedDateParts.Length), message); - - for (var i = 0; i < expectedDateParts.Length; i++) - { - var expected = expectedDateParts[i]; - var actual = dateParts[i]; - Assert.That(actual, Is.EqualTo(expected), message); - } - } - - private string GetDateAndTimeFormat(CultureInfo culture) - { - return string.Concat( - culture.DateTimeFormat.ShortDatePattern, - " ", - culture.DateTimeFormat.LongTimePattern - ); - } - } -} \ No newline at end of file +using LogExpert.Classes.DateTimeParser; +using NUnit.Framework; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; + +namespace LogExpert.Tests +{ + [TestFixture] + public class DateFormatParserTest + { + [Test] + public void CanParseAllCultures() + { + var cultures = CultureInfo.GetCultures(CultureTypes.AllCultures); + + // HashSet exclude = ["dz", "ckb-IR", "ar-SA", "lrc" , "lrc-IR", "mzn" , "mzn-IR", "ps"]; + + foreach (var culture in cultures) + { + if (culture.Name == "dz" || culture.Name == "ar" || culture.Name.StartsWith("ar-") || culture.Name.StartsWith("dz-")) + { + Console.WriteLine($"The ${culture.Name} (${culture.DisplayName}) time format is not supported yet."); + continue; + } + + var datePattern = GetDateAndTimeFormat(culture); + + if (datePattern.StartsWith('g')) + { + Console.WriteLine("time format that starts with g is not supported yet."); + continue; + } + + var message = $"Culture: {culture.Name} ({culture.EnglishName} {datePattern})"; + var sections = Parser.ParseSections(datePattern, out bool syntaxError); + + Assert.That(syntaxError, Is.False, message); + + var dateSection = sections.FirstOrDefault(); + Assert.That(dateSection, Is.Not.Null, message); + + var now = DateTime.Now; + var expectedFormattedDate = now.ToString(datePattern); + var actualFormattedDate = now.ToString(string.Join("", dateSection.GeneralTextDateDurationParts)); + Assert.That(actualFormattedDate, Is.EqualTo(expectedFormattedDate), message); + } + } + + [Test] + [TestCase("en-US", "MM", "dd", "yyyy", "hh", "mm", "ss", "tt")] + [TestCase("fr-FR", "dd", "MM", "yyyy", "HH", "mm", "ss")] + [TestCase("de-DE", "dd", "MM", "yyyy", "HH", "mm", "ss")] + [TestCase("ar-TN", "dd", "MM", "yyyy", "hh", "mm", "ss", "tt")] + [TestCase("as", "dd", "MM", "yyyy", "tt", "hh", "mm", "ss")] + [TestCase("bg", "dd", "MM", "yyyy", "HH", "mm", "ss")] + public void TestDateFormatParserFromCulture(string cultureInfoName, params string[] expectedDateParts) + { + var culture = CultureInfo.GetCultureInfo(cultureInfoName); + + var datePattern = GetDateAndTimeFormat(culture); + + var sections = Parser.ParseSections(datePattern, out bool syntaxError); + + var message = $"Culture: {culture.EnglishName}, Actual date pattern: {datePattern}"; + + Assert.That(syntaxError, Is.False, message); + + var dateSection = sections.FirstOrDefault(); + Assert.That(dateSection, Is.Not.Null); + + var dateParts = dateSection + .GeneralTextDateDurationParts + .Where(Token.IsDatePart) + .Select(p => DateFormatPartAdjuster.AdjustDateTimeFormatPart(p)) + .ToArray(); + + Assert.That(dateParts.Length, Is.EqualTo(expectedDateParts.Length), message); + + for (var i = 0; i < expectedDateParts.Length; i++) + { + var expected = expectedDateParts[i]; + var actual = dateParts[i]; + Assert.That(actual, Is.EqualTo(expected), message); + } + } + + static string RemoveCharacters(string input, string charsToRemove) + { + HashSet charsToRemoveSet = new HashSet(charsToRemove); + StringBuilder result = new StringBuilder(); + + foreach (char c in input) + { + if (!charsToRemoveSet.Contains(c)) + { + result.Append(c); + } + } + + return result.ToString(); + } + + private string GetDateAndTimeFormat(CultureInfo culture) + { + + string InvisibleUNICODEmarkers = + "\u00AD\u034F\u061C\u115F\u1160\u17B4\u17B5" + + "\u180B\u180C\u180D\u180E\u200B\u200C\u200D\u200E\u200F" + + "\u202A\u202B\u202C\u202D\u202E\u202F\u205F\u2060\u2062" + + "\u2063\u2064\u2066\u2067\u2068\u2069\u2800\u3164\uFE00" + + "\uFE01\uFE02\uFE03\uFE04\uFE05\uFE06\uFE07\uFE08\uFE09" + + "\uFE0A\uFE0B\uFE0C\uFE0D\uFE0E\uFE0F"; + + + string dateTime = string.Concat(culture.DateTimeFormat.ShortDatePattern.ToString(), + " ", + culture.DateTimeFormat.LongTimePattern.ToString()); + + return RemoveCharacters(dateTime, InvisibleUNICODEmarkers); + + } + } +} diff --git a/src/LogExpert.Tests/Extensions/EnumerableTests.cs b/src/LogExpert.Tests/Extensions/EnumerableTests.cs index 956695bf..c29e95dd 100644 --- a/src/LogExpert.Tests/Extensions/EnumerableTests.cs +++ b/src/LogExpert.Tests/Extensions/EnumerableTests.cs @@ -1,7 +1,7 @@ -using System; -using System.Collections.Generic; -using LogExpert.Extensions; +using LogExpert.Extensions; using NUnit.Framework; +using System; +using System.Collections.Generic; namespace LogExpert.Tests.Extensions { @@ -29,7 +29,7 @@ public void Extensions_IsEmpty_FilledArray() { object[] arrayObject = {new object()}; - Assert.That(arrayObject.IsEmpty(),Is.False); + Assert.That(!arrayObject.IsEmpty(), Is.True); } [Test] @@ -53,7 +53,7 @@ public void Extensions_IsEmpty_FilledIEnumerable() { IEnumerable arrayObject = new List(new []{new object()}); - Assert.That(arrayObject.IsEmpty(), Is.False); + Assert.That(!arrayObject.IsEmpty(), Is.True); } } -} \ No newline at end of file +} diff --git a/src/LogExpert.Tests/JSONSaveTest.cs b/src/LogExpert.Tests/JSONSaveTest.cs index 0df521d0..e78be754 100644 --- a/src/LogExpert.Tests/JSONSaveTest.cs +++ b/src/LogExpert.Tests/JSONSaveTest.cs @@ -1,7 +1,7 @@ -using System.IO; -using LogExpert.Config; +using LogExpert.Config; using Newtonsoft.Json; using NUnit.Framework; +using System.IO; namespace LogExpert.Tests { @@ -27,7 +27,8 @@ public void SaveOptionsAsJSON() settings = null; Assert.DoesNotThrow(CastSettings); - Assert.That(settings, Is.Not.Null); + + Assert.That(settings, !Is.Null); Assert.That(settings.alwaysOnTop, Is.False); diff --git a/src/LogExpert.Tests/JsonColumnizerTest.cs b/src/LogExpert.Tests/JsonColumnizerTest.cs index 10ae1923..33b2a43e 100644 --- a/src/LogExpert.Tests/JsonColumnizerTest.cs +++ b/src/LogExpert.Tests/JsonColumnizerTest.cs @@ -1,8 +1,8 @@ -using NUnit.Framework; +using LogExpert.Classes.Log; +using LogExpert.Entities; +using NUnit.Framework; using System; using System.IO; -using LogExpert.Classes.Log; -using LogExpert.Entities; namespace LogExpert.Tests { @@ -17,13 +17,13 @@ public void GetColumnNames_HappyFile_ColumnNameMatches(string fileName, string e LogfileReader reader = new LogfileReader(path, new EncodingOptions(), true, 40, 50, new MultiFileOptions()); reader.ReadFiles(); - ILogLine line = reader.GetLogLineWithWait(0); + ILogLine line = reader.GetLogLine(0); if (line != null) { jsonColumnizer.SplitLine(null, line); } - line = reader.GetLogLineWithWait(1); + line = reader.GetLogLine(1); if (line != null) { jsonColumnizer.SplitLine(null, line); @@ -31,7 +31,7 @@ public void GetColumnNames_HappyFile_ColumnNameMatches(string fileName, string e var columnHeaders = jsonColumnizer.GetColumnNames(); var result = string.Join(" ", columnHeaders); - Assert.That(result, Is.EqualTo( expectedHeaders)); + Assert.That(expectedHeaders, Is.EqualTo(result)); } } } diff --git a/src/LogExpert.Tests/JsonCompactColumnizerTest.cs b/src/LogExpert.Tests/JsonCompactColumnizerTest.cs index 942b7a3a..70536b82 100644 --- a/src/LogExpert.Tests/JsonCompactColumnizerTest.cs +++ b/src/LogExpert.Tests/JsonCompactColumnizerTest.cs @@ -1,9 +1,9 @@ -using NUnit.Framework; +using LogExpert.Classes.Log; +using LogExpert.Entities; +using NUnit.Framework; using System; using System.Collections.Generic; using System.IO; -using LogExpert.Classes.Log; -using LogExpert.Entities; namespace LogExpert.Tests { diff --git a/src/LogExpert.Tests/LocalFileSystemTest.cs b/src/LogExpert.Tests/LocalFileSystemTest.cs index 27d27366..fd7fb42f 100644 --- a/src/LogExpert.Tests/LocalFileSystemTest.cs +++ b/src/LogExpert.Tests/LocalFileSystemTest.cs @@ -1,7 +1,7 @@ -using System; -using System.IO; -using LogExpert.Classes; +using LogExpert.Classes; using NUnit.Framework; +using System; +using System.IO; namespace LogExpert.Tests { @@ -25,10 +25,10 @@ public void Boot() public void TestUriHandle() { LocalFileSystem fs = new LocalFileSystem(); - Assert.True(fs.CanHandleUri("file:///c:/logfile.txt")); - Assert.True(fs.CanHandleUri("file:///c:\\logfile.txt")); - Assert.True(fs.CanHandleUri("c:/logfile.txt")); - Assert.True(fs.CanHandleUri("c:\\logfile.txt")); + Assert.That(fs.CanHandleUri("file:///c:/logfile.txt"), Is.True); + Assert.That(fs.CanHandleUri("file:///c:\\logfile.txt"), Is.True); + Assert.That(fs.CanHandleUri("c:/logfile.txt"), Is.True); + Assert.That(fs.CanHandleUri("c:\\logfile.txt"), Is.True); } [Test] @@ -39,13 +39,13 @@ public void TestUriToFileStream() LocalFileSystem fs = new LocalFileSystem(); ILogFileInfo info = fs.GetLogfileInfo(fullName); - Assert.True(info.Length > 0); - Assert.True(info.OriginalLength == info.Length); + Assert.That(info.Length > 0, Is.True); + Assert.That(info.OriginalLength == info.Length, Is.True); Stream stream = info.OpenStream(); - Assert.True(stream.CanSeek); + Assert.That(stream.CanSeek, Is.True); StreamReader reader = new StreamReader(stream); string line = reader.ReadLine(); - Assert.True(line.StartsWith("line number", StringComparison.InvariantCultureIgnoreCase)); + Assert.That(line.StartsWith("line number", StringComparison.InvariantCultureIgnoreCase), Is.True); reader.Close(); } } diff --git a/src/LogExpert.Tests/LogExpert.Tests.csproj b/src/LogExpert.Tests/LogExpert.Tests.csproj index d170e589..8e058cf3 100644 --- a/src/LogExpert.Tests/LogExpert.Tests.csproj +++ b/src/LogExpert.Tests/LogExpert.Tests.csproj @@ -1,81 +1,45 @@ - - - + - Debug - AnyCPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC} + net8.0-windows + true Library - Properties - LogExpert.Tests - LogExpert.Tests - v4.8.1 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 15.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False - UnitTest - - - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + false + true + true + false + bin\$(Configuration) + true true ..\Solution Items\Key.snk + LogExpert.Tests + LogExpert.Tests + Copyright © 2018 + 1.0.0.0 + 1.0.0.0 - - - - - - - - - - - - - - - - - - - 4.20.70 - - - 4.1.0 - - - 4.5.0 - + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + - Always + PreserveNewest PreserveNewest @@ -97,40 +61,22 @@ - - {E72C2BB1-34DE-4D66-A830-9647C3837833} - ColumnizerLib - - - {2563526E-4566-40CB-AA27-587B904FD25B} - CsvColumnizer - - - {4c899885-e361-410a-b6ac-c2f236c436fa} - JsonColumnizer - - - {003535ec-4186-4958-9dd9-c641f089aeed} - JsonCompactColumnizer - - - {c41a517b-7502-4b17-9119-55d5716fad65} - Log4jXmlColumnizer - - - {f0c0d370-f416-44ed-939a-b4827d15ac14} - LogExpert - + + + + + + - Always + PreserveNewest - Always + PreserveNewest - Always + PreserveNewest @@ -138,6 +84,18 @@ PreserveNewest - - - \ No newline at end of file + + + Key.snk + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + diff --git a/src/LogExpert.Tests/LogStreamReaderTest.cs b/src/LogExpert.Tests/LogStreamReaderTest.cs index 225a22fa..9bb51099 100644 --- a/src/LogExpert.Tests/LogStreamReaderTest.cs +++ b/src/LogExpert.Tests/LogStreamReaderTest.cs @@ -18,39 +18,40 @@ public class LogStreamReaderTest [TestCase("Line 1\rLine 2\rLine 3\r", 3)] public void ReadLinesWithSystemNewLine(string text, int expectedLines) { - using (var stream = new MemoryStream(Encoding.ASCII.GetBytes(text))) - using (var reader = new PositionAwareStreamReaderSystem(stream, new EncodingOptions())) + using var stream = new MemoryStream(Encoding.ASCII.GetBytes(text)); + using var reader = new PositionAwareStreamReaderSystem(stream, new EncodingOptions()); + int lineCount = 0; + while (true) { - int lineCount = 0; - while (true) + string line = reader.ReadLine(); + if (line == null) { - string line = reader.ReadLine(); - if (line == null) break; - - lineCount += 1; - Assert.That(line, Does.StartWith($"Line {lineCount}"), $"Invalid line: {line}"); + break; } - Assert.That(lineCount, Is.EqualTo(expectedLines), $"Unexpected lines:\n{text}"); + lineCount += 1; + + Assert.That(line.StartsWith($"Line {lineCount}"), $"Invalid line: {line}"); } + + Assert.That(expectedLines, Is.EqualTo(lineCount), $"Unexpected lines:\n{text}"); } + [Test] [TestCase("\n\n\n", 3)] [TestCase("\r\n\r\n\r\n", 3)] [TestCase("\r\r\r", 3)] public void CountLinesWithSystemNewLine(string text, int expectedLines) { - using (var stream = new MemoryStream(Encoding.ASCII.GetBytes(text))) - using (var reader = new PositionAwareStreamReaderSystem(stream, new EncodingOptions())) + using var stream = new MemoryStream(Encoding.ASCII.GetBytes(text)); + using var reader = new PositionAwareStreamReaderSystem(stream, new EncodingOptions()); + int lineCount = 0; + while (reader.ReadLine() != null) { - int lineCount = 0; - while (reader.ReadLine() != null) - { - lineCount += 1; - } - - Assert.That(lineCount, Is.EqualTo(expectedLines), $"Unexpected lines:\n{text}"); + lineCount += 1; } + + Assert.That(expectedLines, Is.EqualTo(lineCount), $"Unexpected lines:\n{text}"); } [Test] @@ -69,14 +70,17 @@ public void ReadLinesWithLegacyNewLine(string text, int expectedLines) while (true) { string line = reader.ReadLine(); - if (line == null) break; + if (line == null) + { + break; + } lineCount += 1; - Assert.That(line, Does.StartWith($"Line {lineCount}"), $"Invalid line: {line}"); + Assert.That(line.StartsWith($"Line {lineCount}"), $"Invalid line: {line}"); } - Assert.That(lineCount, Is.EqualTo(expectedLines), $"Unexpected lines:\n{text}"); + Assert.That(expectedLines, Is.EqualTo(lineCount), $"Unexpected lines:\n{text}"); } } [Test] @@ -94,7 +98,8 @@ public void CountLinesWithLegacyNewLine(string text, int expectedLines) lineCount += 1; } - Assert.That(lineCount, Is.EqualTo(expectedLines), $"Unexpected lines:\n{text}"); + + Assert.That(expectedLines, Is.EqualTo(lineCount), $"Unexpected lines:\n{text}"); } } } diff --git a/src/LogExpert.Tests/LogWindowTest.cs b/src/LogExpert.Tests/LogWindowTest.cs index 57c97369..a6da5685 100644 --- a/src/LogExpert.Tests/LogWindowTest.cs +++ b/src/LogExpert.Tests/LogWindowTest.cs @@ -1,17 +1,15 @@  -using CsvColumnizerType=CsvColumnizer.CsvColumnizer; -using NUnit.Framework; -using System; -using System.Threading; using LogExpert.Classes; using LogExpert.Controls.LogTabWindow; using LogExpert.Controls.LogWindow; using LogExpert.Entities; +using NUnit.Framework; +using System; +using CsvColumnizerType = CsvColumnizer.CsvColumnizer; namespace LogExpert.Tests { [TestFixture] - [Apartment(ApartmentState.STA)] public class LogWindowTest { // TODO: Add more tests when DI container is ready. @@ -19,10 +17,9 @@ public class LogWindowTest public void Instantiate_JsonFile_BuildCorrectColumnizer(string fileName, Type columnizerType) { LogTabWindow logTabWindow = new LogTabWindow(null, 0, false); - LogWindow logWindow = - new LogWindow(logTabWindow, fileName, false, false); + LogWindow logWindow = new LogWindow(logTabWindow, fileName, false, false); - Assert.That(logWindow.CurrentColumnizer.GetType(),Is.EqualTo(columnizerType)); + Assert.That(columnizerType, Is.EqualTo(logWindow.CurrentColumnizer.GetType())); } [TestCase(@".\TestData\XmlTest_01.xml")] @@ -35,7 +32,7 @@ public void Instantiate_AnyFile_NotCrash(string fileName) LogTabWindow logTabWindow = new LogTabWindow(null, 0, false); LogWindow logWindow = new LogWindow(logTabWindow, fileName, false, false); - Assert.That(true,Is.True); + Assert.That(true, Is.True); } } } diff --git a/src/LogExpert.Tests/Properties/AssemblyInfo.cs b/src/LogExpert.Tests/Properties/AssemblyInfo.cs index 72fe01d8..756a12ef 100644 --- a/src/LogExpert.Tests/Properties/AssemblyInfo.cs +++ b/src/LogExpert.Tests/Properties/AssemblyInfo.cs @@ -1,20 +1,10 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("LogExpert.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("LogExpert.Tests")] -[assembly: AssemblyCopyright("Copyright © 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("1ffb09a8-dae4-4deb-aff6-8bae6d01c7ac")] - -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: System.Runtime.Versioning.SupportedOSPlatform("windows")] \ No newline at end of file diff --git a/src/LogExpert.Tests/ReaderTest.cs b/src/LogExpert.Tests/ReaderTest.cs index 86cd1da5..6b76076b 100644 --- a/src/LogExpert.Tests/ReaderTest.cs +++ b/src/LogExpert.Tests/ReaderTest.cs @@ -1,10 +1,10 @@ -using System; -using System.IO; -using System.Text; -using LogExpert.Classes.Log; +using LogExpert.Classes.Log; using LogExpert.Entities; using LogExpert.Interface; using NUnit.Framework; +using System; +using System.IO; +using System.Text; namespace LogExpert.Tests { @@ -24,37 +24,34 @@ public void Boot() private void CompareReaderImplementationsInternal(string fileName, Encoding enc, int maxPosition) { string path = Environment.CurrentDirectory + "\\data\\"; - EncodingOptions encOpts = new EncodingOptions(); + EncodingOptions encOpts = new(); encOpts.Encoding = enc; - using (Stream s1 = new FileStream(path + fileName, FileMode.Open, FileAccess.Read)) - using (Stream s2 = new FileStream(path + fileName, FileMode.Open, FileAccess.Read)) + using Stream s1 = new FileStream(path + fileName, FileMode.Open, FileAccess.Read); + using Stream s2 = new FileStream(path + fileName, FileMode.Open, FileAccess.Read); + using ILogStreamReader r1 = new PositionAwareStreamReaderLegacy(s1, encOpts); + using ILogStreamReader r2 = new PositionAwareStreamReaderSystem(s2, encOpts); + for (int lineNum = 0; ; lineNum++) + { + string line1 = r1.ReadLine(); + string line2 = r2.ReadLine(); + if (line1 == null && line2 == null) { - using (ILogStreamReader r1 = new PositionAwareStreamReaderLegacy(s1, encOpts)) - using (ILogStreamReader r2 = new PositionAwareStreamReaderSystem(s2, encOpts)) - { - for (int lineNum = 0;; lineNum++) - { - string line1 = r1.ReadLine(); - string line2 = r2.ReadLine(); - if (line1 == null && line2 == null) - { - break; - } + break; + } - Assert.AreEqual(line1, line2, "File " + fileName); - if (r1.Position != maxPosition) - { - Assert.AreEqual(r1.Position, r2.Position, "Line " + lineNum + ", File: " + fileName); - } - else - { - //Its desired that the position of the new implementation is 2 bytes ahead to fix the problem of empty lines every time a new line is appended. - Assert.AreEqual(r1.Position, r2.Position - 2, "Line " + lineNum + ", File: " + fileName); - } - } - } + Assert.That(line1, Is.EqualTo(line2), "File " + fileName); + + if (r1.Position != maxPosition) + { + Assert.That(r2.Position, Is.EqualTo(r1.Position), "Line " + lineNum + ", File: " + fileName); + } + else + { + //Its desired that the position of the new implementation is 2 bytes ahead to fix the problem of empty lines every time a new line is appended. + Assert.That(r2.Position - 2, Is.EqualTo(r1.Position), "Line " + lineNum + ", File: " + fileName); } + } } //TODO find out why it does not work with appveyor, but works fine with normal environment! diff --git a/src/LogExpert.Tests/RollingNameTest.cs b/src/LogExpert.Tests/RollingNameTest.cs index c1c6cc14..1eaa9312 100644 --- a/src/LogExpert.Tests/RollingNameTest.cs +++ b/src/LogExpert.Tests/RollingNameTest.cs @@ -20,7 +20,7 @@ public void TestFilename1(string expectedResult, string formatString) RolloverFilenameBuilder fnb = new RolloverFilenameBuilder(formatString); fnb.SetFileName(expectedResult); string name = fnb.BuildFileName(); - Assert.AreEqual(expectedResult, name); + Assert.That(name, Is.EqualTo(expectedResult)); } [Test] @@ -38,7 +38,7 @@ public void TestFilenameAnd1(string fileName, string expectedResult, string form fnb.SetFileName(fileName); fnb.Index += 1; string name = fnb.BuildFileName(); - Assert.AreEqual(expectedResult, name); + Assert.That(name, Is.EqualTo(expectedResult)); } [Test] @@ -50,7 +50,7 @@ public void TestFilenameAnd2(string fileName, string expectedResult, string form fnb.SetFileName(fileName); fnb.Index += 2; string name = fnb.BuildFileName(); - Assert.AreEqual(expectedResult, name); + Assert.That(name, Is.EqualTo(expectedResult)); } @@ -62,7 +62,7 @@ public void TestFilenameMinus1(string fileName, string expectedResult, string fo fnb.SetFileName(fileName); fnb.Index -= 1; string name = fnb.BuildFileName(); - Assert.AreEqual("engine.log", name); + Assert.That(name, Is.EqualTo("engine.log")); } } } \ No newline at end of file diff --git a/src/LogExpert.Tests/RolloverHandlerTest.cs b/src/LogExpert.Tests/RolloverHandlerTest.cs index c3c9753a..4b091bc0 100644 --- a/src/LogExpert.Tests/RolloverHandlerTest.cs +++ b/src/LogExpert.Tests/RolloverHandlerTest.cs @@ -25,7 +25,7 @@ public void TestFilenameListWithAppendedIndex(string format, int retries) RolloverFilenameHandler handler = new RolloverFilenameHandler(info, options); LinkedList fileList = handler.GetNameList(); - Assert.AreEqual(files, fileList); + Assert.That(fileList, Is.EqualTo(files)); Cleanup(); } @@ -46,7 +46,7 @@ public void TestFilenameListWithDate(string format, int retries) RolloverFilenameHandler handler = new RolloverFilenameHandler(info, options); LinkedList fileList = handler.GetNameList(); - Assert.AreEqual(files, fileList); + Assert.That(fileList, Is.EqualTo(files)); Cleanup(); } diff --git a/src/LogExpert.sln b/src/LogExpert.sln index b4f8545d..c5d5aa5a 100644 --- a/src/LogExpert.sln +++ b/src/LogExpert.sln @@ -1,54 +1,53 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.5.33502.453 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LogExpert", "LogExpert\LogExpert.csproj", "{F0C0D370-F416-44ED-939A-B4827D15AC14}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LogExpert", "LogExpert\LogExpert.csproj", "{F0C0D370-F416-44ED-939A-B4827D15AC14}" ProjectSection(ProjectDependencies) = postProject {4C899885-E361-410A-B6AC-C2F236C436FA} = {4C899885-E361-410A-B6AC-C2F236C436FA} {B5A7DFA4-48A8-4616-8008-7441699EC946} = {B5A7DFA4-48A8-4616-8008-7441699EC946} {003535EC-4186-4958-9DD9-C641F089AEED} = {003535EC-4186-4958-9DD9-C641F089AEED} EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CsvColumnizer", "CsvColumnizer\CsvColumnizer.csproj", "{2563526E-4566-40CB-AA27-587B904FD25B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CsvColumnizer", "CsvColumnizer\CsvColumnizer.csproj", "{2563526E-4566-40CB-AA27-587B904FD25B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ColumnizerLib", "ColumnizerLib\ColumnizerLib.csproj", "{E72C2BB1-34DE-4D66-A830-9647C3837833}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ColumnizerLib", "ColumnizerLib\ColumnizerLib.csproj", "{E72C2BB1-34DE-4D66-A830-9647C3837833}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Log4jXmlColumnizer", "Log4jXmlColumnizer\Log4jXmlColumnizer.csproj", "{C41A517B-7502-4B17-9119-55D5716FAD65}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Log4jXmlColumnizer", "Log4jXmlColumnizer\Log4jXmlColumnizer.csproj", "{C41A517B-7502-4B17-9119-55D5716FAD65}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DefaultPlugins", "DefaultPlugins\DefaultPlugins.csproj", "{00ED9F5D-742B-441C-B48B-16940B070B77}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DefaultPlugins", "DefaultPlugins\DefaultPlugins.csproj", "{00ED9F5D-742B-441C-B48B-16940B070B77}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GlassfishColumnizer", "GlassfishColumnizer\GlassfishColumnizer.csproj", "{43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GlassfishColumnizer", "GlassfishColumnizer\GlassfishColumnizer.csproj", "{43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlashIconHighlighter", "FlashIconHighlighter\FlashIconHighlighter.csproj", "{F5E81EBE-3E6F-409F-B510-918E97F59072}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FlashIconHighlighter", "FlashIconHighlighter\FlashIconHighlighter.csproj", "{F5E81EBE-3E6F-409F-B510-918E97F59072}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormsUI", "WinFormsUI\WinFormsUI.csproj", "{C75532C4-765B-418E-B09B-46D36B2ABDB1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinFormsUI", "WinFormsUI\WinFormsUI.csproj", "{C75532C4-765B-418E-B09B-46D36B2ABDB1}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DE6375A4-B4C4-4620-8FFB-B9D5A4E21144}" ProjectSection(SolutionItems) = preProject Solution Items\AssemblyVersion.cs = Solution Items\AssemblyVersion.cs EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JsonColumnizer", "JsonColumnizer\JsonColumnizer.csproj", "{4C899885-E361-410A-B6AC-C2F236C436FA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonColumnizer", "JsonColumnizer\JsonColumnizer.csproj", "{4C899885-E361-410A-B6AC-C2F236C436FA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SftpFileSystemx64", "SftpFileSystemx64\SftpFileSystemx64.csproj", "{B9BF5AB6-4791-4CC1-B9B7-66151A212814}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SftpFileSystemx64", "SftpFileSystemx64\SftpFileSystemx64.csproj", "{B9BF5AB6-4791-4CC1-B9B7-66151A212814}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RegexColumnizer", "RegexColumnizer\RegexColumnizer.csproj", "{B5A7DFA4-48A8-4616-8008-7441699EC946}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RegexColumnizer", "RegexColumnizer\RegexColumnizer.csproj", "{B5A7DFA4-48A8-4616-8008-7441699EC946}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ColumnizerLib.UnitTests", "ColumnizerLib.UnitTests\ColumnizerLib.UnitTests.csproj", "{0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ColumnizerLib.UnitTests", "ColumnizerLib.UnitTests\ColumnizerLib.UnitTests.csproj", "{0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LogExpert.Tests", "LogExpert.Tests\LogExpert.Tests.csproj", "{1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LogExpert.Tests", "LogExpert.Tests\LogExpert.Tests.csproj", "{1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}" ProjectSection(ProjectDependencies) = postProject {2563526E-4566-40CB-AA27-587B904FD25B} = {2563526E-4566-40CB-AA27-587B904FD25B} EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JsonCompactColumnizer", "JsonCompactColumnizer\JsonCompactColumnizer.csproj", "{003535EC-4186-4958-9DD9-C641F089AEED}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonCompactColumnizer", "JsonCompactColumnizer\JsonCompactColumnizer.csproj", "{003535EC-4186-4958-9DD9-C641F089AEED}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoColumnizer", "AutoColumnizer\AutoColumnizer.csproj", "{B57259A3-4ED7-4F8B-A252-29E799A56B9E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoColumnizer", "AutoColumnizer\AutoColumnizer.csproj", "{B57259A3-4ED7-4F8B-A252-29E799A56B9E}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "..\build\_build.csproj", "{CFA0360E-BA8D-4D6F-AF76-63D8282109FA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SftpFileSystemx86", "SftpFileSystemx86\SftpFileSystemx86.csproj", "{3D01E923-5219-488B-B0A7-98521841E680}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SftpFileSystemx86", "SftpFileSystemx86\SftpFileSystemx86.csproj", "{3D01E923-5219-488B-B0A7-98521841E680}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "setup", "setup", "{C625E7C2-AF15-4C40-8C35-3E166D46F939}" ProjectSection(SolutionItems) = preProject @@ -56,312 +55,90 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "setup", "setup", "{C625E7C2 setup\LogExpertInstaller.iss = setup\LogExpertInstaller.iss EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RegexColumnizer.UnitTests", "RegexColumnizer.UnitTests\RegexColumnizer.UnitTests.csproj", "{FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RegexColumnizer.UnitTests", "RegexColumnizer.UnitTests\RegexColumnizer.UnitTests.csproj", "{FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LogexpertgRPCService", "LogexpertgRPCService\LogexpertgRPCService.csproj", "{D31D1721-9DEA-45A4-B813-D5023B2EC2CC}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|Win32 = Debug|Win32 - DebugNoTimeout|Any CPU = DebugNoTimeout|Any CPU - DebugNoTimeout|Mixed Platforms = DebugNoTimeout|Mixed Platforms - DebugNoTimeout|Win32 = DebugNoTimeout|Win32 Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {F0C0D370-F416-44ED-939A-B4827D15AC14}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F0C0D370-F416-44ED-939A-B4827D15AC14}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F0C0D370-F416-44ED-939A-B4827D15AC14}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F0C0D370-F416-44ED-939A-B4827D15AC14}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {F0C0D370-F416-44ED-939A-B4827D15AC14}.Debug|Win32.ActiveCfg = Debug|Any CPU - {F0C0D370-F416-44ED-939A-B4827D15AC14}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {F0C0D370-F416-44ED-939A-B4827D15AC14}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {F0C0D370-F416-44ED-939A-B4827D15AC14}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F0C0D370-F416-44ED-939A-B4827D15AC14}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {F0C0D370-F416-44ED-939A-B4827D15AC14}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU {F0C0D370-F416-44ED-939A-B4827D15AC14}.Release|Any CPU.ActiveCfg = Release|Any CPU {F0C0D370-F416-44ED-939A-B4827D15AC14}.Release|Any CPU.Build.0 = Release|Any CPU - {F0C0D370-F416-44ED-939A-B4827D15AC14}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {F0C0D370-F416-44ED-939A-B4827D15AC14}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {F0C0D370-F416-44ED-939A-B4827D15AC14}.Release|Win32.ActiveCfg = Release|Any CPU {2563526E-4566-40CB-AA27-587B904FD25B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2563526E-4566-40CB-AA27-587B904FD25B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2563526E-4566-40CB-AA27-587B904FD25B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {2563526E-4566-40CB-AA27-587B904FD25B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {2563526E-4566-40CB-AA27-587B904FD25B}.Debug|Win32.ActiveCfg = Debug|Any CPU - {2563526E-4566-40CB-AA27-587B904FD25B}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {2563526E-4566-40CB-AA27-587B904FD25B}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {2563526E-4566-40CB-AA27-587B904FD25B}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {2563526E-4566-40CB-AA27-587B904FD25B}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {2563526E-4566-40CB-AA27-587B904FD25B}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU {2563526E-4566-40CB-AA27-587B904FD25B}.Release|Any CPU.ActiveCfg = Release|Any CPU {2563526E-4566-40CB-AA27-587B904FD25B}.Release|Any CPU.Build.0 = Release|Any CPU - {2563526E-4566-40CB-AA27-587B904FD25B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {2563526E-4566-40CB-AA27-587B904FD25B}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {2563526E-4566-40CB-AA27-587B904FD25B}.Release|Win32.ActiveCfg = Release|Any CPU {E72C2BB1-34DE-4D66-A830-9647C3837833}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E72C2BB1-34DE-4D66-A830-9647C3837833}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E72C2BB1-34DE-4D66-A830-9647C3837833}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {E72C2BB1-34DE-4D66-A830-9647C3837833}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {E72C2BB1-34DE-4D66-A830-9647C3837833}.Debug|Win32.ActiveCfg = Debug|Any CPU - {E72C2BB1-34DE-4D66-A830-9647C3837833}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {E72C2BB1-34DE-4D66-A830-9647C3837833}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {E72C2BB1-34DE-4D66-A830-9647C3837833}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {E72C2BB1-34DE-4D66-A830-9647C3837833}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {E72C2BB1-34DE-4D66-A830-9647C3837833}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU {E72C2BB1-34DE-4D66-A830-9647C3837833}.Release|Any CPU.ActiveCfg = Release|Any CPU {E72C2BB1-34DE-4D66-A830-9647C3837833}.Release|Any CPU.Build.0 = Release|Any CPU - {E72C2BB1-34DE-4D66-A830-9647C3837833}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {E72C2BB1-34DE-4D66-A830-9647C3837833}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {E72C2BB1-34DE-4D66-A830-9647C3837833}.Release|Win32.ActiveCfg = Release|Any CPU {C41A517B-7502-4B17-9119-55D5716FAD65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C41A517B-7502-4B17-9119-55D5716FAD65}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C41A517B-7502-4B17-9119-55D5716FAD65}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {C41A517B-7502-4B17-9119-55D5716FAD65}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {C41A517B-7502-4B17-9119-55D5716FAD65}.Debug|Win32.ActiveCfg = Debug|Any CPU - {C41A517B-7502-4B17-9119-55D5716FAD65}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {C41A517B-7502-4B17-9119-55D5716FAD65}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {C41A517B-7502-4B17-9119-55D5716FAD65}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {C41A517B-7502-4B17-9119-55D5716FAD65}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {C41A517B-7502-4B17-9119-55D5716FAD65}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU {C41A517B-7502-4B17-9119-55D5716FAD65}.Release|Any CPU.ActiveCfg = Release|Any CPU {C41A517B-7502-4B17-9119-55D5716FAD65}.Release|Any CPU.Build.0 = Release|Any CPU - {C41A517B-7502-4B17-9119-55D5716FAD65}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {C41A517B-7502-4B17-9119-55D5716FAD65}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {C41A517B-7502-4B17-9119-55D5716FAD65}.Release|Win32.ActiveCfg = Release|Any CPU {00ED9F5D-742B-441C-B48B-16940B070B77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {00ED9F5D-742B-441C-B48B-16940B070B77}.Debug|Any CPU.Build.0 = Debug|Any CPU - {00ED9F5D-742B-441C-B48B-16940B070B77}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {00ED9F5D-742B-441C-B48B-16940B070B77}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {00ED9F5D-742B-441C-B48B-16940B070B77}.Debug|Win32.ActiveCfg = Debug|Any CPU - {00ED9F5D-742B-441C-B48B-16940B070B77}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {00ED9F5D-742B-441C-B48B-16940B070B77}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {00ED9F5D-742B-441C-B48B-16940B070B77}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {00ED9F5D-742B-441C-B48B-16940B070B77}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {00ED9F5D-742B-441C-B48B-16940B070B77}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU {00ED9F5D-742B-441C-B48B-16940B070B77}.Release|Any CPU.ActiveCfg = Release|Any CPU {00ED9F5D-742B-441C-B48B-16940B070B77}.Release|Any CPU.Build.0 = Release|Any CPU - {00ED9F5D-742B-441C-B48B-16940B070B77}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {00ED9F5D-742B-441C-B48B-16940B070B77}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {00ED9F5D-742B-441C-B48B-16940B070B77}.Release|Win32.ActiveCfg = Release|Any CPU {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.Debug|Win32.ActiveCfg = Debug|Any CPU - {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.Release|Any CPU.ActiveCfg = Release|Any CPU {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.Release|Any CPU.Build.0 = Release|Any CPU - {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {43B3857D-4341-41A6-9E77-4F3BA4F2C7AB}.Release|Win32.ActiveCfg = Release|Any CPU {F5E81EBE-3E6F-409F-B510-918E97F59072}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F5E81EBE-3E6F-409F-B510-918E97F59072}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F5E81EBE-3E6F-409F-B510-918E97F59072}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F5E81EBE-3E6F-409F-B510-918E97F59072}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {F5E81EBE-3E6F-409F-B510-918E97F59072}.Debug|Win32.ActiveCfg = Debug|Any CPU - {F5E81EBE-3E6F-409F-B510-918E97F59072}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {F5E81EBE-3E6F-409F-B510-918E97F59072}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {F5E81EBE-3E6F-409F-B510-918E97F59072}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F5E81EBE-3E6F-409F-B510-918E97F59072}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {F5E81EBE-3E6F-409F-B510-918E97F59072}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU {F5E81EBE-3E6F-409F-B510-918E97F59072}.Release|Any CPU.ActiveCfg = Release|Any CPU {F5E81EBE-3E6F-409F-B510-918E97F59072}.Release|Any CPU.Build.0 = Release|Any CPU - {F5E81EBE-3E6F-409F-B510-918E97F59072}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {F5E81EBE-3E6F-409F-B510-918E97F59072}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {F5E81EBE-3E6F-409F-B510-918E97F59072}.Release|Win32.ActiveCfg = Release|Any CPU {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Debug|Win32.ActiveCfg = Debug|Any CPU - {C75532C4-765B-418E-B09B-46D36B2ABDB1}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {C75532C4-765B-418E-B09B-46D36B2ABDB1}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {C75532C4-765B-418E-B09B-46D36B2ABDB1}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {C75532C4-765B-418E-B09B-46D36B2ABDB1}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {C75532C4-765B-418E-B09B-46D36B2ABDB1}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Release|Any CPU.ActiveCfg = Release|Any CPU {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Release|Any CPU.Build.0 = Release|Any CPU - {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Release|Win32.ActiveCfg = Release|Any CPU {4C899885-E361-410A-B6AC-C2F236C436FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4C899885-E361-410A-B6AC-C2F236C436FA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.Debug|Win32.ActiveCfg = Debug|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.Debug|Win32.Build.0 = Debug|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.DebugNoTimeout|Win32.Build.0 = Debug|Any CPU {4C899885-E361-410A-B6AC-C2F236C436FA}.Release|Any CPU.ActiveCfg = Release|Any CPU {4C899885-E361-410A-B6AC-C2F236C436FA}.Release|Any CPU.Build.0 = Release|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.Release|Win32.ActiveCfg = Release|Any CPU - {4C899885-E361-410A-B6AC-C2F236C436FA}.Release|Win32.Build.0 = Release|Any CPU {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.Debug|Win32.ActiveCfg = Debug|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.Debug|Win32.Build.0 = Debug|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.DebugNoTimeout|Win32.Build.0 = Debug|Any CPU {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.Release|Any CPU.ActiveCfg = Release|Any CPU {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.Release|Any CPU.Build.0 = Release|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.Release|Win32.ActiveCfg = Release|Any CPU - {B9BF5AB6-4791-4CC1-B9B7-66151A212814}.Release|Win32.Build.0 = Release|Any CPU {B5A7DFA4-48A8-4616-8008-7441699EC946}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B5A7DFA4-48A8-4616-8008-7441699EC946}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.Debug|Win32.ActiveCfg = Debug|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.Debug|Win32.Build.0 = Debug|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.DebugNoTimeout|Win32.Build.0 = Debug|Any CPU {B5A7DFA4-48A8-4616-8008-7441699EC946}.Release|Any CPU.ActiveCfg = Release|Any CPU {B5A7DFA4-48A8-4616-8008-7441699EC946}.Release|Any CPU.Build.0 = Release|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.Release|Win32.ActiveCfg = Release|Any CPU - {B5A7DFA4-48A8-4616-8008-7441699EC946}.Release|Win32.Build.0 = Release|Any CPU {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.Debug|Win32.ActiveCfg = Debug|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.Debug|Win32.Build.0 = Debug|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.DebugNoTimeout|Win32.Build.0 = Debug|Any CPU {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.Release|Any CPU.ActiveCfg = Release|Any CPU {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.Release|Any CPU.Build.0 = Release|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.Release|Win32.ActiveCfg = Release|Any CPU - {0DBBCBEF-4A91-4031-AEAB-B7EEE802F496}.Release|Win32.Build.0 = Release|Any CPU {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.Debug|Win32.ActiveCfg = Debug|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.Debug|Win32.Build.0 = Debug|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.DebugNoTimeout|Win32.Build.0 = Debug|Any CPU {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.Release|Any CPU.ActiveCfg = Release|Any CPU {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.Release|Any CPU.Build.0 = Release|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.Release|Win32.ActiveCfg = Release|Any CPU - {1FFB09A8-DAE4-4DEB-AFF6-8BAE6D01C7AC}.Release|Win32.Build.0 = Release|Any CPU {003535EC-4186-4958-9DD9-C641F089AEED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {003535EC-4186-4958-9DD9-C641F089AEED}.Debug|Any CPU.Build.0 = Debug|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.Debug|Win32.ActiveCfg = Debug|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.Debug|Win32.Build.0 = Debug|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.DebugNoTimeout|Win32.Build.0 = Debug|Any CPU {003535EC-4186-4958-9DD9-C641F089AEED}.Release|Any CPU.ActiveCfg = Release|Any CPU {003535EC-4186-4958-9DD9-C641F089AEED}.Release|Any CPU.Build.0 = Release|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.Release|Win32.ActiveCfg = Release|Any CPU - {003535EC-4186-4958-9DD9-C641F089AEED}.Release|Win32.Build.0 = Release|Any CPU {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.Debug|Win32.ActiveCfg = Debug|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.Debug|Win32.Build.0 = Debug|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.DebugNoTimeout|Win32.Build.0 = Debug|Any CPU {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.Release|Any CPU.ActiveCfg = Release|Any CPU {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.Release|Any CPU.Build.0 = Release|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.Release|Win32.ActiveCfg = Release|Any CPU - {B57259A3-4ED7-4F8B-A252-29E799A56B9E}.Release|Win32.Build.0 = Release|Any CPU {CFA0360E-BA8D-4D6F-AF76-63D8282109FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CFA0360E-BA8D-4D6F-AF76-63D8282109FA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {CFA0360E-BA8D-4D6F-AF76-63D8282109FA}.Debug|Win32.ActiveCfg = Debug|Any CPU - {CFA0360E-BA8D-4D6F-AF76-63D8282109FA}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {CFA0360E-BA8D-4D6F-AF76-63D8282109FA}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {CFA0360E-BA8D-4D6F-AF76-63D8282109FA}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU {CFA0360E-BA8D-4D6F-AF76-63D8282109FA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CFA0360E-BA8D-4D6F-AF76-63D8282109FA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {CFA0360E-BA8D-4D6F-AF76-63D8282109FA}.Release|Win32.ActiveCfg = Release|Any CPU {3D01E923-5219-488B-B0A7-98521841E680}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3D01E923-5219-488B-B0A7-98521841E680}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.Debug|Win32.ActiveCfg = Debug|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.Debug|Win32.Build.0 = Debug|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.DebugNoTimeout|Win32.Build.0 = Debug|Any CPU {3D01E923-5219-488B-B0A7-98521841E680}.Release|Any CPU.ActiveCfg = Release|Any CPU {3D01E923-5219-488B-B0A7-98521841E680}.Release|Any CPU.Build.0 = Release|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.Release|Win32.ActiveCfg = Release|Any CPU - {3D01E923-5219-488B-B0A7-98521841E680}.Release|Win32.Build.0 = Release|Any CPU {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.Debug|Win32.ActiveCfg = Debug|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.Debug|Win32.Build.0 = Debug|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.DebugNoTimeout|Any CPU.ActiveCfg = Debug|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.DebugNoTimeout|Any CPU.Build.0 = Debug|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.DebugNoTimeout|Mixed Platforms.ActiveCfg = Debug|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.DebugNoTimeout|Mixed Platforms.Build.0 = Debug|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.DebugNoTimeout|Win32.ActiveCfg = Debug|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.DebugNoTimeout|Win32.Build.0 = Debug|Any CPU {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.Release|Any CPU.ActiveCfg = Release|Any CPU {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.Release|Any CPU.Build.0 = Release|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.Release|Win32.ActiveCfg = Release|Any CPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3}.Release|Win32.Build.0 = Release|Any CPU + {D31D1721-9DEA-45A4-B813-D5023B2EC2CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D31D1721-9DEA-45A4-B813-D5023B2EC2CC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D31D1721-9DEA-45A4-B813-D5023B2EC2CC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D31D1721-9DEA-45A4-B813-D5023B2EC2CC}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/LogExpert/Classes/ArgParser.cs b/src/LogExpert/Classes/ArgParser.cs index 26434830..3c94c115 100644 --- a/src/LogExpert/Classes/ArgParser.cs +++ b/src/LogExpert/Classes/ArgParser.cs @@ -27,7 +27,7 @@ public ArgParser(string argTemplate) public string BuildArgs(ILogLine logLine, int lineNum, ILogFileInfo logFileInfo, Form parent) { - StringBuilder builder = new StringBuilder(this.argLine); + StringBuilder builder = new(this.argLine); builder.Replace("%L", "" + lineNum); builder.Replace("%P", logFileInfo.DirectoryName); builder.Replace("%N", logFileInfo.FileName); @@ -91,7 +91,7 @@ public string BuildArgs(ILogLine logLine, int lineNum, ILogFileInfo logFileInfo, end = end2; } - ParamRequesterDialog dlg = new ParamRequesterDialog(); + ParamRequesterDialog dlg = new(); dlg.ParamName = ask; dlg.Values = values; DialogResult res = dlg.ShowDialog(parent); diff --git a/src/LogExpert/Classes/Bookmark/BookmarkDataProvider.cs b/src/LogExpert/Classes/Bookmark/BookmarkDataProvider.cs index d6d4be99..8fb5cda4 100644 --- a/src/LogExpert/Classes/Bookmark/BookmarkDataProvider.cs +++ b/src/LogExpert/Classes/Bookmark/BookmarkDataProvider.cs @@ -18,7 +18,7 @@ internal class BookmarkDataProvider : IBookmarkData internal BookmarkDataProvider() { - BookmarkList = new SortedList(); + BookmarkList = []; } internal BookmarkDataProvider(SortedList bookmarkList) @@ -48,7 +48,7 @@ internal BookmarkDataProvider(SortedList bookmarkList) #region Properties - public BookmarkCollection Bookmarks => new BookmarkCollection(BookmarkList); + public BookmarkCollection Bookmarks => new(BookmarkList); internal SortedList BookmarkList { get; set; } @@ -89,7 +89,7 @@ public Entities.Bookmark GetBookmarkForLine(int lineNum) internal void ShiftBookmarks(int offset) { - SortedList newBookmarkList = new SortedList(); + SortedList newBookmarkList = []; foreach (Entities.Bookmark bookmark in BookmarkList.Values) { int line = bookmark.LineNum - offset; diff --git a/src/LogExpert/Classes/Bookmark/BookmarkExporter.cs b/src/LogExpert/Classes/Bookmark/BookmarkExporter.cs index d14361c0..5ce6b0f6 100644 --- a/src/LogExpert/Classes/Bookmark/BookmarkExporter.cs +++ b/src/LogExpert/Classes/Bookmark/BookmarkExporter.cs @@ -16,14 +16,13 @@ internal static class BookmarkExporter public static void ExportBookmarkList(SortedList bookmarkList, string logfileName, string fileName) { - FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.Write); - StreamWriter writer = new StreamWriter(fs); + FileStream fs = new(fileName, FileMode.Create, FileAccess.Write); + StreamWriter writer = new(fs); writer.WriteLine("Log file name;Line number;Comment"); foreach (Entities.Bookmark bookmark in bookmarkList.Values) { string line = logfileName + ";" + bookmark.LineNum + ";" + - bookmark.Text.Replace(replacementForNewLine, @"\" + replacementForNewLine).Replace("\r\n", - replacementForNewLine); + bookmark.Text.Replace(replacementForNewLine, @"\" + replacementForNewLine).Replace("\r\n", replacementForNewLine); writer.WriteLine(line); } writer.Close(); @@ -33,9 +32,9 @@ public static void ExportBookmarkList(SortedList bookmar public static void ImportBookmarkList(string logfileName, string fileName, SortedList bookmarkList) { - using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read)) + using (FileStream fs = new(fileName, FileMode.Open, FileAccess.Read)) { - using (StreamReader reader = new StreamReader(fs)) + using (StreamReader reader = new(fs)) { if (!reader.EndOfStream) { @@ -60,7 +59,7 @@ public static void ImportBookmarkList(string logfileName, string fileName, int lineNum; if (int.TryParse(lineStr, out lineNum)) { - Entities.Bookmark bookmark = new Entities.Bookmark(lineNum, comment); + Entities.Bookmark bookmark = new(lineNum, comment); bookmarkList.Add(lineNum, bookmark); } else diff --git a/src/LogExpert/Classes/CmdLine.cs b/src/LogExpert/Classes/CmdLine.cs index c6b2e3c7..f99bffb4 100644 --- a/src/LogExpert/Classes/CmdLine.cs +++ b/src/LogExpert/Classes/CmdLine.cs @@ -227,7 +227,7 @@ public class CmdLine #region Fields // A private dictonary containing the parameters. - private readonly Dictionary parameters = new Dictionary(); + private readonly Dictionary parameters = []; #endregion @@ -268,7 +268,7 @@ public CmdLineParameter this[string name] /// /// Registers a parameter to be used and adds it to the help screen. /// - /// The parameter to add. + /// The parameter to add. public void RegisterParameter(CmdLineParameter parameter) { if (parameters.ContainsKey(parameter.Name)) @@ -281,7 +281,7 @@ public void RegisterParameter(CmdLineParameter parameter) /// /// Registers parameters to be used and adds hem to the help screen. /// - /// The parameter to add. + /// The parameter to add. public void RegisterParameter(CmdLineParameter[] parameters) { foreach (CmdLineParameter p in parameters) @@ -300,7 +300,7 @@ public string[] Parse(string[] args) { int i = 0; - List new_args = new List(); + List new_args = []; while (i < args.Length) { diff --git a/src/LogExpert/Classes/ColumnCache.cs b/src/LogExpert/Classes/ColumnCache.cs index 1d4d32da..ba71a4e4 100644 --- a/src/LogExpert/Classes/ColumnCache.cs +++ b/src/LogExpert/Classes/ColumnCache.cs @@ -21,7 +21,7 @@ internal IColumnizedLogLine GetColumnsForLine(LogfileReader logFileReader, int l { _lastColumnizer = columnizer; _lastLineNumber = lineNumber; - ILogLine line = logFileReader.GetLogLineWithWait(lineNumber); + ILogLine line = logFileReader.GetLogLineWithWait(lineNumber).Result; if (line != null) { columnizerCallback.LineNum = lineNumber; diff --git a/src/LogExpert/Classes/Columnizer/ClfColumnizer.cs b/src/LogExpert/Classes/Columnizer/ClfColumnizer.cs index 0276e9b4..20f8b4aa 100644 --- a/src/LogExpert/Classes/Columnizer/ClfColumnizer.cs +++ b/src/LogExpert/Classes/Columnizer/ClfColumnizer.cs @@ -9,9 +9,9 @@ public class ClfColumnizer : ILogLineColumnizer { #region Fields - private readonly Regex lineRegex = new Regex("(.*) (-) (.*) (\\[.*\\]) (\".*\") (.*) (.*) (\".*\") (\".*\")"); + private readonly Regex lineRegex = new("(.*) (-) (.*) (\\[.*\\]) (\".*\") (.*) (.*) (\".*\") (\".*\")"); - protected CultureInfo cultureInfo = new CultureInfo("de-DE"); + protected CultureInfo cultureInfo = new("de-DE"); protected int timeOffset = 0; #endregion @@ -110,21 +110,21 @@ public string[] GetColumnNames() public IColumnizedLogLine SplitLine(LogExpert.ILogLineColumnizerCallback callback, ILogLine line) { - ColumnizedLogLine cLogLine = new ColumnizedLogLine + ColumnizedLogLine cLogLine = new() { LogLine = line }; Column[] columns = new Column[8] { - new Column {FullValue = "", Parent = cLogLine}, - new Column {FullValue = "", Parent = cLogLine}, - new Column {FullValue = "", Parent = cLogLine}, - new Column {FullValue = "", Parent = cLogLine}, - new Column {FullValue = "", Parent = cLogLine}, - new Column {FullValue = "", Parent = cLogLine}, - new Column {FullValue = "", Parent = cLogLine}, - new Column {FullValue = "", Parent = cLogLine} + new() {FullValue = "", Parent = cLogLine}, + new() {FullValue = "", Parent = cLogLine}, + new() {FullValue = "", Parent = cLogLine}, + new() {FullValue = "", Parent = cLogLine}, + new() {FullValue = "", Parent = cLogLine}, + new() {FullValue = "", Parent = cLogLine}, + new() {FullValue = "", Parent = cLogLine}, + new() {FullValue = "", Parent = cLogLine} }; cLogLine.ColumnValues = columns.Select(a => a as IColumn).ToArray(); diff --git a/src/LogExpert/Classes/Columnizer/ColumnizerPicker.cs b/src/LogExpert/Classes/Columnizer/ColumnizerPicker.cs index 0a3d79c8..8e46e056 100644 --- a/src/LogExpert/Classes/Columnizer/ColumnizerPicker.cs +++ b/src/LogExpert/Classes/Columnizer/ColumnizerPicker.cs @@ -100,12 +100,12 @@ public static ILogLineColumnizer FindColumnizer(string fileName, IAutoLogLineCol return new DefaultLogfileColumnizer(); } - List loglines = new List(); + List loglines = []; if (logFileReader != null) { - loglines = new List() - { + loglines = + [ // Sampling a few lines to select the correct columnizer logFileReader.GetLogLine(0), logFileReader.GetLogLine(1), @@ -117,12 +117,12 @@ public static ILogLineColumnizer FindColumnizer(string fileName, IAutoLogLineCol logFileReader.GetLogLine(100), logFileReader.GetLogLine(200), logFileReader.GetLogLine(400) - }; + ]; } var registeredColumnizer = PluginRegistry.GetInstance().RegisteredColumnizers; - List> priorityListOfColumnizers = new List>(); + List> priorityListOfColumnizers = []; foreach (ILogLineColumnizer logLineColumnizer in registeredColumnizer) { diff --git a/src/LogExpert/Classes/Columnizer/SquareBracketColumnizer.cs b/src/LogExpert/Classes/Columnizer/SquareBracketColumnizer.cs index 987a3ff1..6a8be193 100644 --- a/src/LogExpert/Classes/Columnizer/SquareBracketColumnizer.cs +++ b/src/LogExpert/Classes/Columnizer/SquareBracketColumnizer.cs @@ -11,7 +11,7 @@ public class SquareBracketColumnizer : ILogLineColumnizer, IColumnizerPriority #region ILogLineColumnizer implementation protected int timeOffset = 0; - private TimeFormatDeterminer _timeFormatDeterminer = new TimeFormatDeterminer(); + private TimeFormatDeterminer _timeFormatDeterminer = new(); // TODO: need preparing this columnizer with sample log lines before use it. private int _columnCount = 5; @@ -156,16 +156,16 @@ public IColumnizedLogLine SplitLine(LogExpert.ILogLineColumnizerCallback callbac // 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 // 03.01.2008 14:48:00.066 - ColumnizedLogLine clogLine = new ColumnizedLogLine + ColumnizedLogLine clogLine = new() { LogLine = line }; Column[] columns = new Column[] { - new Column {FullValue = "", Parent = clogLine}, - new Column {FullValue = "", Parent = clogLine}, - new Column {FullValue = "", Parent = clogLine}, + new() {FullValue = "", Parent = clogLine}, + new() {FullValue = "", Parent = clogLine}, + new() {FullValue = "", Parent = clogLine}, }; string temp = line.FullLine; @@ -218,7 +218,7 @@ public IColumnizedLogLine SplitLine(LogExpert.ILogLineColumnizerCallback callbac void SquareSplit(ref Column[] columns, string line, int dateLen, int timeLen, int dateTimeEndPos, ColumnizedLogLine clogLine) { - List columnList = new List(); + List columnList = []; int restColumn = _columnCount; if (_isTimeExists) { @@ -258,7 +258,7 @@ void SquareSplit(ref Column[] columns, string line, int dateLen, int timeLen, in public Priority GetPriority(string fileName, IEnumerable samples) { Priority result = Priority.NotSupport; - TimeFormatDeterminer timeDeterminer = new TimeFormatDeterminer(); + TimeFormatDeterminer timeDeterminer = new(); int timeStampExistsCount = 0; int bracketsExistsCount = 0; int maxBracketNumbers = 1; diff --git a/src/LogExpert/Classes/Columnizer/TimeFormatDeterminer.cs b/src/LogExpert/Classes/Columnizer/TimeFormatDeterminer.cs index d99b68b2..8a833047 100644 --- a/src/LogExpert/Classes/Columnizer/TimeFormatDeterminer.cs +++ b/src/LogExpert/Classes/Columnizer/TimeFormatDeterminer.cs @@ -39,27 +39,27 @@ public string DateTimeFormat #endregion - protected FormatInfo formatInfo1 = new FormatInfo("dd.MM.yyyy", "HH:mm:ss.fff", new CultureInfo("de-DE")); - protected FormatInfo formatInfo2 = new FormatInfo("dd.MM.yyyy", "HH:mm:ss", new CultureInfo("de-DE")); - protected FormatInfo formatInfo3 = new FormatInfo("yyyy/MM/dd", "HH:mm:ss.fff", new CultureInfo("en-US")); - protected FormatInfo formatInfo4 = new FormatInfo("yyyy/MM/dd", "HH:mm:ss", new CultureInfo("en-US")); - protected FormatInfo formatInfo5 = new FormatInfo("yyyy.MM.dd", "HH:mm:ss.fff", new CultureInfo("de-DE")); - protected FormatInfo formatInfo6 = new FormatInfo("yyyy.MM.dd", "HH:mm:ss", new CultureInfo("de-DE")); - protected FormatInfo formatInfo7 = new FormatInfo("dd.MM.yyyy", "HH:mm:ss,fff", new CultureInfo("de-DE")); - protected FormatInfo formatInfo8 = new FormatInfo("yyyy/MM/dd", "HH:mm:ss,fff", new CultureInfo("en-US")); - protected FormatInfo formatInfo9 = new FormatInfo("yyyy.MM.dd", "HH:mm:ss,fff", new CultureInfo("de-DE")); - protected FormatInfo formatInfo10 = new FormatInfo("yyyy-MM-dd", "HH:mm:ss.fff", new CultureInfo("en-US")); - protected FormatInfo formatInfo11 = new FormatInfo("yyyy-MM-dd", "HH:mm:ss,fff", new CultureInfo("en-US")); - protected FormatInfo formatInfo12 = new FormatInfo("yyyy-MM-dd", "HH:mm:ss", new CultureInfo("en-US")); - protected FormatInfo formatInfo13 = new FormatInfo("dd MMM yyyy", "HH:mm:ss,fff", new CultureInfo("de-DE")); - protected FormatInfo formatInfo14 = new FormatInfo("dd MMM yyyy", "HH:mm:ss.fff", new CultureInfo("de-DE")); - protected FormatInfo formatInfo15 = new FormatInfo("dd MMM yyyy", "HH:mm:ss", new CultureInfo("de-DE")); - protected FormatInfo formatInfo16 = new FormatInfo("dd.MM.yy", "HH:mm:ss.fff", new CultureInfo("de-DE")); - protected FormatInfo formatInfo17 = new FormatInfo("yyyy-MM-dd", "HH:mm:ss:ffff", new CultureInfo("en-US")); - protected FormatInfo formatInfo18 = new FormatInfo("dd/MM/yyyy", "HH:mm:ss.fff", new CultureInfo("en-US")); - protected FormatInfo formatInfo19 = new FormatInfo("dd/MM/yyyy", "HH:mm:ss:fff", new CultureInfo("en-US")); - protected FormatInfo formatInfo20 = new FormatInfo("yyyy-MM-dd", "HH:mm:ss.ffff", new CultureInfo("en-US")); - protected FormatInfo formatInfo21 = new FormatInfo("yyyy-MM-dd", "HH:mm:ss,ffff", new CultureInfo("en-US")); + protected FormatInfo formatInfo1 = new("dd.MM.yyyy", "HH:mm:ss.fff", new CultureInfo("de-DE")); + protected FormatInfo formatInfo2 = new("dd.MM.yyyy", "HH:mm:ss", new CultureInfo("de-DE")); + protected FormatInfo formatInfo3 = new("yyyy/MM/dd", "HH:mm:ss.fff", new CultureInfo("en-US")); + protected FormatInfo formatInfo4 = new("yyyy/MM/dd", "HH:mm:ss", new CultureInfo("en-US")); + protected FormatInfo formatInfo5 = new("yyyy.MM.dd", "HH:mm:ss.fff", new CultureInfo("de-DE")); + protected FormatInfo formatInfo6 = new("yyyy.MM.dd", "HH:mm:ss", new CultureInfo("de-DE")); + protected FormatInfo formatInfo7 = new("dd.MM.yyyy", "HH:mm:ss,fff", new CultureInfo("de-DE")); + protected FormatInfo formatInfo8 = new("yyyy/MM/dd", "HH:mm:ss,fff", new CultureInfo("en-US")); + protected FormatInfo formatInfo9 = new("yyyy.MM.dd", "HH:mm:ss,fff", new CultureInfo("de-DE")); + protected FormatInfo formatInfo10 = new("yyyy-MM-dd", "HH:mm:ss.fff", new CultureInfo("en-US")); + protected FormatInfo formatInfo11 = new("yyyy-MM-dd", "HH:mm:ss,fff", new CultureInfo("en-US")); + protected FormatInfo formatInfo12 = new("yyyy-MM-dd", "HH:mm:ss", new CultureInfo("en-US")); + protected FormatInfo formatInfo13 = new("dd MMM yyyy", "HH:mm:ss,fff", new CultureInfo("de-DE")); + protected FormatInfo formatInfo14 = new("dd MMM yyyy", "HH:mm:ss.fff", new CultureInfo("de-DE")); + protected FormatInfo formatInfo15 = new("dd MMM yyyy", "HH:mm:ss", new CultureInfo("de-DE")); + protected FormatInfo formatInfo16 = new("dd.MM.yy", "HH:mm:ss.fff", new CultureInfo("de-DE")); + protected FormatInfo formatInfo17 = new("yyyy-MM-dd", "HH:mm:ss:ffff", new CultureInfo("en-US")); + protected FormatInfo formatInfo18 = new("dd/MM/yyyy", "HH:mm:ss.fff", new CultureInfo("en-US")); + protected FormatInfo formatInfo19 = new("dd/MM/yyyy", "HH:mm:ss:fff", new CultureInfo("en-US")); + protected FormatInfo formatInfo20 = new("yyyy-MM-dd", "HH:mm:ss.ffff", new CultureInfo("en-US")); + protected FormatInfo formatInfo21 = new("yyyy-MM-dd", "HH:mm:ss,ffff", new CultureInfo("en-US")); public FormatInfo DetermineDateTimeFormatInfo(string line) diff --git a/src/LogExpert/Classes/Columnizer/TimestampColumnizer.cs b/src/LogExpert/Classes/Columnizer/TimestampColumnizer.cs index bad8a4fb..f7ed13b6 100644 --- a/src/LogExpert/Classes/Columnizer/TimestampColumnizer.cs +++ b/src/LogExpert/Classes/Columnizer/TimestampColumnizer.cs @@ -12,7 +12,7 @@ public class TimestampColumnizer : ILogLineColumnizer, IColumnizerPriority #region ILogLineColumnizer implementation protected int timeOffset = 0; - private TimeFormatDeterminer _timeFormatDeterminer = new TimeFormatDeterminer(); + private TimeFormatDeterminer _timeFormatDeterminer = new(); public bool IsTimeshiftImplemented() { @@ -110,14 +110,14 @@ public IColumnizedLogLine SplitLine(LogExpert.ILogLineColumnizerCallback callbac // 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 // 03.01.2008 14:48:00.066 - ColumnizedLogLine clogLine = new ColumnizedLogLine(); + ColumnizedLogLine clogLine = new(); clogLine.LogLine = line; Column[] columns = new Column[3] { - new Column {FullValue = "", Parent = clogLine}, - new Column {FullValue = "", Parent = clogLine}, - new Column {FullValue = "", Parent = clogLine}, + new() {FullValue = "", Parent = clogLine}, + new() {FullValue = "", Parent = clogLine}, + new() {FullValue = "", Parent = clogLine}, }; clogLine.ColumnValues = columns.Select(a => a as IColumn).ToArray(); diff --git a/src/LogExpert/Classes/DateTimeParser/DateFormatPartAdjuster.cs b/src/LogExpert/Classes/DateTimeParser/DateFormatPartAdjuster.cs index 009ee8d5..c803ea76 100644 --- a/src/LogExpert/Classes/DateTimeParser/DateFormatPartAdjuster.cs +++ b/src/LogExpert/Classes/DateTimeParser/DateFormatPartAdjuster.cs @@ -4,7 +4,7 @@ namespace LogExpert.Classes.DateTimeParser { // Ensures we have constant width (number of characters) date formats - internal static class DateFormatPartAdjuster + public static class DateFormatPartAdjuster { private static readonly IDictionary _dateTimePartReplacements = new Dictionary(StringComparer.OrdinalIgnoreCase) { diff --git a/src/LogExpert/Classes/DateTimeParser/Parser.cs b/src/LogExpert/Classes/DateTimeParser/Parser.cs index b8e00410..11346954 100644 --- a/src/LogExpert/Classes/DateTimeParser/Parser.cs +++ b/src/LogExpert/Classes/DateTimeParser/Parser.cs @@ -1,8 +1,9 @@ using System.Collections.Generic; +using System.Runtime.CompilerServices; namespace LogExpert.Classes.DateTimeParser { - internal static class Parser + public static class Parser { public static List
ParseSections(string formatString, out bool syntaxError) { @@ -33,7 +34,7 @@ private static Section ParseSection(Tokenizer reader, int index, out bool syntax { bool hasDateParts = false; string token; - List tokens = new List(); + List tokens = []; while ((token = ReadToken(reader, out syntaxError)) != null) { @@ -81,7 +82,7 @@ private static Section ParseSection(Tokenizer reader, int index, out bool syntax private static void ParseMilliseconds(List tokens, out List result) { // if tokens form .0 through .000.., combine to single subsecond token - result = new List(); + result = []; for (var i = 0; i < tokens.Count; i++) { var token = tokens[i]; diff --git a/src/LogExpert/Classes/DateTimeParser/Section.cs b/src/LogExpert/Classes/DateTimeParser/Section.cs index 4a632dcd..de17bd55 100644 --- a/src/LogExpert/Classes/DateTimeParser/Section.cs +++ b/src/LogExpert/Classes/DateTimeParser/Section.cs @@ -2,7 +2,7 @@ namespace LogExpert.Classes.DateTimeParser { - internal class Section + public class Section { public int SectionIndex { get; set; } diff --git a/src/LogExpert/Classes/DateTimeParser/Token.cs b/src/LogExpert/Classes/DateTimeParser/Token.cs index 11d60412..bf9794ce 100644 --- a/src/LogExpert/Classes/DateTimeParser/Token.cs +++ b/src/LogExpert/Classes/DateTimeParser/Token.cs @@ -2,7 +2,7 @@ namespace LogExpert.Classes.DateTimeParser { - internal static class Token + public static class Token { public static bool IsDatePart(string token) { diff --git a/src/LogExpert/Classes/DateTimeParser/Tokenizer.cs b/src/LogExpert/Classes/DateTimeParser/Tokenizer.cs index 429eb538..39f5c9a2 100644 --- a/src/LogExpert/Classes/DateTimeParser/Tokenizer.cs +++ b/src/LogExpert/Classes/DateTimeParser/Tokenizer.cs @@ -24,7 +24,10 @@ public string Substring(int startIndex, int length) public int Peek(int offset = 0) { if (formatStringPosition + offset >= formatString.Length) + { return -1; + } + return formatString[formatStringPosition + offset]; } @@ -35,9 +38,14 @@ public int PeekUntil(int startOffset, int until) { var c = Peek(offset++); if (c == -1) + { break; + } + if (c == until) + { return offset - startOffset; + } } return 0; } @@ -62,10 +70,14 @@ public void Advance(int characters = 1) public bool ReadOneOrMore(int c) { if (Peek() != c) + { return false; + } while (Peek() == c) + { Advance(); + } return true; } @@ -83,7 +95,9 @@ public bool ReadOneOf(string s) public bool ReadString(string s, bool ignoreCase = false) { if (formatStringPosition + s.Length > formatString.Length) + { return false; + } for (var i = 0; i < s.Length; i++) { @@ -91,11 +105,17 @@ public bool ReadString(string s, bool ignoreCase = false) var c2 = (char)Peek(i); if (ignoreCase) { - if (char.ToLower(c1) != char.ToLower(c2)) return false; + if (char.ToLower(c1) != char.ToLower(c2)) + { + return false; + } } else { - if (c1 != c2) return false; + if (c1 != c2) + { + return false; + } } } diff --git a/src/LogExpert/Classes/Filter/Filter.cs b/src/LogExpert/Classes/Filter/Filter.cs index b5cced19..2528eb5c 100644 --- a/src/LogExpert/Classes/Filter/Filter.cs +++ b/src/LogExpert/Classes/Filter/Filter.cs @@ -1,8 +1,10 @@ -using System; +using LogExpert.Classes.ILogLineColumnizerCallback; + +using NLog; + +using System; using System.Collections.Generic; using System.Windows.Forms; -using LogExpert.Classes.ILogLineColumnizerCallback; -using NLog; namespace LogExpert.Classes.Filter { @@ -25,9 +27,9 @@ public class Filter public Filter(ColumnizerCallback callback) { _callback = callback; - FilterResultLines = new List(); - LastFilterLinesList = new List(); - FilterHitList = new List(); + FilterResultLines = []; + LastFilterLinesList = []; + FilterHitList = []; } #endregion @@ -71,19 +73,23 @@ private int DoFilter(FilterParams filterParams, int startLine, int maxCount, Lis { return count; } + ILogLine line = _callback.GetLogLine(lineNum); if (line == null) { return count; } + _callback.LineNum = lineNum; if (Util.TestFilterCondition(filterParams, line, _callback)) { AddFilterLine(lineNum, false, filterParams, filterResultLines, lastFilterLinesList, filterHitList); } + lineNum++; callbackCounter++; + if (lineNum % PROGRESS_BAR_MODULO == 0) { progressCallback(callbackCounter); @@ -98,17 +104,19 @@ private int DoFilter(FilterParams filterParams, int startLine, int maxCount, Lis "Exception while filtering. Please report to developer: \n\n" + ex + "\n\n" + ex.StackTrace, "LogExpert"); } + return count; } private void AddFilterLine(int lineNum, bool immediate, FilterParams filterParams, List filterResultLines, List lastFilterLinesList, List filterHitList) { - int count; filterHitList.Add(lineNum); IList filterResult = GetAdditionalFilterResults(filterParams, lineNum, lastFilterLinesList); + filterResultLines.AddRange(filterResult); - count = filterResultLines.Count; + lastFilterLinesList.AddRange(filterResult); + if (lastFilterLinesList.Count > SPREAD_MAX * 2) { lastFilterLinesList.RemoveRange(0, lastFilterLinesList.Count - SPREAD_MAX * 2); @@ -117,9 +125,9 @@ private void AddFilterLine(int lineNum, bool immediate, FilterParams filterParam /// - /// Returns a list with 'additional filter results'. This is the given line number + /// Returns a list with 'additional filter results'. This is the given line number /// and (if back spread and/or fore spread is enabled) some additional lines. - /// This function doesn't check the filter condition! + /// This function doesn't check the filter condition! /// /// /// @@ -127,7 +135,7 @@ private void AddFilterLine(int lineNum, bool immediate, FilterParams filterParam /// private IList GetAdditionalFilterResults(FilterParams filterParams, int lineNum, IList checkList) { - IList resultList = new List(); + IList resultList = []; if (filterParams.spreadBefore == 0 && filterParams.spreadBehind == 0) { diff --git a/src/LogExpert/Classes/Filter/FilterCancelHandler.cs b/src/LogExpert/Classes/Filter/FilterCancelHandler.cs index 76976b4a..ef11b340 100644 --- a/src/LogExpert/Classes/Filter/FilterCancelHandler.cs +++ b/src/LogExpert/Classes/Filter/FilterCancelHandler.cs @@ -8,7 +8,7 @@ internal class FilterCancelHandler : BackgroundProcessCancelHandler private static readonly ILogger _logger = LogManager.GetCurrentClassLogger(); #region Fields - private readonly FilterStarter filterStarter; + private readonly FilterStarter _filterStarter; #endregion @@ -16,7 +16,7 @@ internal class FilterCancelHandler : BackgroundProcessCancelHandler public FilterCancelHandler(FilterStarter filterStarter) { - this.filterStarter = filterStarter; + _filterStarter = filterStarter; } #endregion @@ -26,7 +26,7 @@ public FilterCancelHandler(FilterStarter filterStarter) public void EscapePressed() { _logger.Info("FilterCancelHandler called."); - this.filterStarter.CancelFilter(); + _filterStarter.CancelFilter(); } #endregion diff --git a/src/LogExpert/Classes/Filter/FilterParams.cs b/src/LogExpert/Classes/Filter/FilterParams.cs index 25f91c26..84febf51 100644 --- a/src/LogExpert/Classes/Filter/FilterParams.cs +++ b/src/LogExpert/Classes/Filter/FilterParams.cs @@ -18,7 +18,7 @@ public class FilterParams //public List historyList = new List(); //public List rangeHistoryList = new List(); - public List columnList = new List(); // list of columns in which to search + public List columnList = []; // list of columns in which to search public bool columnRestrict = false; @@ -43,7 +43,7 @@ public class FilterParams [NonSerialized] public string lastLine = ""; - [NonSerialized] public Hashtable lastNonEmptyCols = new Hashtable(); + [NonSerialized] public Hashtable lastNonEmptyCols = []; [NonSerialized] public bool lastResult; @@ -102,7 +102,7 @@ public FilterParams CreateCopy2() // call after deserialization! public void Init() { - lastNonEmptyCols = new Hashtable(); + lastNonEmptyCols = []; lowerRangeSearchText = _rangeSearchText.ToLower(); lowerSearchText = _searchText.ToLower(); lastLine = ""; diff --git a/src/LogExpert/Classes/Filter/FilterPipe.cs b/src/LogExpert/Classes/Filter/FilterPipe.cs index 3dc4dacc..61b093c0 100644 --- a/src/LogExpert/Classes/Filter/FilterPipe.cs +++ b/src/LogExpert/Classes/Filter/FilterPipe.cs @@ -64,7 +64,7 @@ public FilterPipe(FilterParams filterParams, LogWindow logWindow) public void OpenFile() { - FileStream fStream = new FileStream(FileName, FileMode.Append, FileAccess.Write, FileShare.Read); + FileStream fStream = new(FileName, FileMode.Append, FileAccess.Write, FileShare.Read); _writer = new StreamWriter(fStream, new UnicodeEncoding(false, false)); } @@ -122,7 +122,7 @@ public int GetOriginalLineNum(int lineNum) public void ShiftLineNums(int offset) { _logger.Debug("FilterPipe.ShiftLineNums() offset={0}", offset); - List newList = new List(); + List newList = []; lock (_lineMappingList) { foreach (int lineNum in _lineMappingList) @@ -171,7 +171,7 @@ public void RecreateTempFile() { CloseFile(); // trunc file - FileStream fStream = new FileStream(FileName, FileMode.Truncate, FileAccess.Write, FileShare.Read); + FileStream fStream = new(FileName, FileMode.Truncate, FileAccess.Write, FileShare.Read); fStream.SetLength(0); fStream.Close(); } diff --git a/src/LogExpert/Classes/Filter/FilterStarter.cs b/src/LogExpert/Classes/Filter/FilterStarter.cs index 56b1e7a9..9ce8d025 100644 --- a/src/LogExpert/Classes/Filter/FilterStarter.cs +++ b/src/LogExpert/Classes/Filter/FilterStarter.cs @@ -1,8 +1,9 @@ -using System; +using LogExpert.Classes.ILogLineColumnizerCallback; +using NLog; +using System; using System.Collections.Generic; using System.Threading; -using LogExpert.Classes.ILogLineColumnizerCallback; -using NLog; +using System.Threading.Tasks; namespace LogExpert.Classes.Filter { @@ -20,6 +21,7 @@ internal class FilterStarter private readonly SortedDictionary _filterResultDict; private readonly List _filterWorkerList; + private readonly SortedDictionary _lastFilterLinesDict; private ProgressCallback _progressCallback; @@ -33,19 +35,19 @@ internal class FilterStarter public FilterStarter(ColumnizerCallback callback, int minThreads) { _callback = callback; - FilterResultLines = new List(); - LastFilterLinesList = new List(); - FilterHitList = new List(); - _filterReadyList = new List(); - _filterWorkerList = new List(); - _filterHitDict = new SortedDictionary(); - _filterResultDict = new SortedDictionary(); - _lastFilterLinesDict = new SortedDictionary(); + FilterResultLines = []; + LastFilterLinesList = []; + FilterHitList = []; + _filterReadyList = []; + _filterWorkerList = []; + _filterHitDict = []; + _filterResultDict = []; + _lastFilterLinesDict = []; ThreadCount = Environment.ProcessorCount * 4; ThreadCount = minThreads; - ThreadPool.GetMinThreads(out var worker, out var completion); + ThreadPool.GetMinThreads(out _, out var completion); ThreadPool.SetMinThreads(minThreads, completion); - ThreadPool.GetMaxThreads(out worker, out completion); + ThreadPool.GetMaxThreads(out _, out _); } #endregion @@ -64,7 +66,7 @@ public FilterStarter(ColumnizerCallback callback, int minThreads) #region Public methods - public void DoFilter(FilterParams filterParams, int startLine, int maxCount, ProgressCallback progressCallback) + public async void DoFilter(FilterParams filterParams, int startLine, int maxCount, ProgressCallback progressCallback) { FilterResultLines.Clear(); LastFilterLinesList.Clear(); @@ -73,17 +75,17 @@ public void DoFilter(FilterParams filterParams, int startLine, int maxCount, Pro _filterReadyList.Clear(); _filterResultDict.Clear(); _lastFilterLinesDict.Clear(); - _filterReadyList.Clear(); _filterWorkerList.Clear(); _shouldStop = false; int interval = maxCount / ThreadCount; + if (interval < 1) { interval = 1; } int workStartLine = startLine; - List handleList = new List(); + List handleList = []; _progressLineCount = 0; _progressCallback = progressCallback; while (workStartLine < startLine + maxCount) @@ -97,14 +99,12 @@ public void DoFilter(FilterParams filterParams, int startLine, int maxCount, Pro } } _logger.Info("FilterStarter starts worker for line {0}, lineCount {1}", workStartLine, interval); - WorkerFx workerFx = DoWork; - IAsyncResult ar = workerFx.BeginInvoke(filterParams, workStartLine, interval, ThreadProgressCallback, - FilterDoneCallback, workerFx); + + await Task.Run(() => DoWork(filterParams, workStartLine, interval, ThreadProgressCallback)).ContinueWith(FilterDoneCallback); workStartLine += interval; - handleList.Add(ar.AsyncWaitHandle); } - WaitHandle[] handles = handleList.ToArray(); + WaitHandle[] handles = [.. handleList]; // wait for worker threads completion if (handles.Length > 0) { @@ -114,7 +114,6 @@ public void DoFilter(FilterParams filterParams, int startLine, int maxCount, Pro MergeResults(); } - /// /// Requests the FilterStarter to stop all filter threads. Call this from another thread (e.g. GUI). The function returns /// immediately without waiting for filter end. @@ -144,41 +143,45 @@ private void ThreadProgressCallback(int lineCount) private Filter DoWork(FilterParams filterParams, int startLine, int maxCount, ProgressCallback progressCallback) { - _logger.Info("Started Filter worker [{0}] for line {1}", Thread.CurrentThread.ManagedThreadId, startLine); + _logger.Info("Started Filter worker [{0}] for line {1}", Environment.CurrentManagedThreadId, startLine); // Give every thread own copies of ColumnizerCallback and FilterParams, because the state of the objects changes while filtering FilterParams threadFilterParams = filterParams.CreateCopy2(); ColumnizerCallback threadColumnizerCallback = _callback.CreateCopy(); - Filter filter = new Filter(threadColumnizerCallback); + Filter filter = new(threadColumnizerCallback); lock (_filterWorkerList) { _filterWorkerList.Add(filter); } + if (_shouldStop) { return filter; } - int realCount = filter.DoFilter(threadFilterParams, startLine, maxCount, progressCallback); + + _ = filter.DoFilter(threadFilterParams, startLine, maxCount, progressCallback); _logger.Info("Filter worker [{0}] for line {1} has completed.", Thread.CurrentThread.ManagedThreadId, startLine); + lock (_filterReadyList) { _filterReadyList.Add(filter); } + return filter; } - private void FilterDoneCallback(IAsyncResult ar) + private void FilterDoneCallback(Task filterTask) { - //if (ar.IsCompleted) - //{ - // Filter filter = ((WorkerFx)ar.AsyncState).EndInvoke(ar); - // lock (this.filterReadyList) - // { - // this.filterReadyList.Add(filter); - // } - //} - Filter filter = ((WorkerFx) ar.AsyncState).EndInvoke(ar); // EndInvoke() has to be called mandatory. + if (filterTask.IsCompleted) + { + Filter filter = filterTask.Result; + + lock (_filterReadyList) + { + _filterReadyList.Add(filter); + } + } } private void MergeResults() @@ -215,8 +218,5 @@ private void MergeResults() } #endregion - - private delegate Filter WorkerFx(FilterParams filterParams, int startLine, int maxCount, - ProgressCallback callback); } } \ No newline at end of file diff --git a/src/LogExpert/Classes/Highlight/ActionEntry.cs b/src/LogExpert/Classes/Highlight/ActionEntry.cs index 95ee07cd..1a913c62 100644 --- a/src/LogExpert/Classes/Highlight/ActionEntry.cs +++ b/src/LogExpert/Classes/Highlight/ActionEntry.cs @@ -16,7 +16,7 @@ public class ActionEntry public ActionEntry Copy() { - ActionEntry e = new ActionEntry(); + ActionEntry e = new(); e.pluginName = this.pluginName; e.actionParam = this.actionParam; return e; diff --git a/src/LogExpert/Classes/LocalFileSystem.cs b/src/LogExpert/Classes/LocalFileSystem.cs index ecf9a54c..9594dc6c 100644 --- a/src/LogExpert/Classes/LocalFileSystem.cs +++ b/src/LogExpert/Classes/LocalFileSystem.cs @@ -11,7 +11,7 @@ public bool CanHandleUri(string uriString) { try { - Uri uri = new Uri(uriString); + Uri uri = new(uriString); return uri.IsFile; } catch (Exception) @@ -22,7 +22,7 @@ public bool CanHandleUri(string uriString) public ILogFileInfo GetLogfileInfo(string uriString) { - Uri uri = new Uri(uriString); + Uri uri = new(uriString); if (uri.IsFile) { ILogFileInfo logFileInfo = new LogFileInfo(uri); diff --git a/src/LogExpert/Classes/Log/LogStreamReaderBase.cs b/src/LogExpert/Classes/Log/LogStreamReaderBase.cs index 0cead95e..e47bc9af 100644 --- a/src/LogExpert/Classes/Log/LogStreamReaderBase.cs +++ b/src/LogExpert/Classes/Log/LogStreamReaderBase.cs @@ -15,7 +15,7 @@ protected LogStreamReaderBase() ~LogStreamReaderBase() { - Dispose(true); + Dispose(false); } #endregion diff --git a/src/LogExpert/Classes/Log/LogfileReader.cs b/src/LogExpert/Classes/Log/LogfileReader.cs index 49670b30..edffb493 100644 --- a/src/LogExpert/Classes/Log/LogfileReader.cs +++ b/src/LogExpert/Classes/Log/LogfileReader.cs @@ -1,14 +1,17 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Threading; -using LogExpert.Classes.xml; +using LogExpert.Classes.xml; using LogExpert.Entities; using LogExpert.Entities.EventArgs; using LogExpert.Interface; + using NLog; +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + namespace LogExpert.Classes.Log { public class LogfileReader : IAutoLogLineColumnizerCallback @@ -23,7 +26,7 @@ public class LogfileReader : IAutoLogLineColumnizerCallback private readonly int _MAX_BUFFERS = 10; private readonly int _MAX_LINES_PER_BUFFER = 100; - private readonly object _monitor = new object(); + private readonly object _monitor = new(); private readonly MultiFileOptions _multiFileOptions; private IList _bufferList; @@ -34,17 +37,21 @@ public class LogfileReader : IAutoLogLineColumnizerCallback private ReaderWriterLock _disposeLock; private EncodingOptions _encodingOptions; private long _fileLength; - private Thread _garbageCollectorThread; + + private Task _garbageCollectorTask; + private Task _monitorTask; + private readonly CancellationTokenSource cts = new(); + private bool _isDeleted; private bool _isFailModeCheckCallPending; private bool _isFastFailOnGetLogLine; private bool _isLineCountDirty = true; - private IList _logFileInfoList = new List(); + private IList _logFileInfoList = []; private Dictionary _lruCacheDict; private ReaderWriterLock _lruCacheDictLock; - private Thread _monitorThread; + private bool _shouldStop; private ILogFileInfo _watchedILogFileInfo; @@ -71,7 +78,7 @@ public LogfileReader(string fileName, EncodingOptions encodingOptions, bool mult if (multiFile) { ILogFileInfo info = GetLogFileInfo(fileName); - RolloverFilenameHandler rolloverHandler = new RolloverFilenameHandler(info, _multiFileOptions); + RolloverFilenameHandler rolloverHandler = new(info, _multiFileOptions); LinkedList nameList = rolloverHandler.GetNameList(); ILogFileInfo fileInfo = null; @@ -132,7 +139,7 @@ public LogfileReader(string[] fileNames, EncodingOptions encodingOptions, int bu public delegate void FinishedLoadingEventHandler(object sender, EventArgs e); - private delegate ILogLine GetLogLineFx(int lineNum); + private delegate Task GetLogLineFx(int lineNum); public delegate void LoadingStartedEventHandler(object sender, LoadFileEventArgs e); @@ -191,9 +198,11 @@ public EncodingOptions EncodingOptions set { { - _encodingOptions = new EncodingOptions(); - _encodingOptions.DefaultEncoding = value.DefaultEncoding; - _encodingOptions.Encoding = value.Encoding; + _encodingOptions = new EncodingOptions + { + DefaultEncoding = value.DefaultEncoding, + Encoding = value.Encoding + }; } } } @@ -242,11 +251,14 @@ public void ReadFiles() LineCount = 0; } - LogEventArgs args = new LogEventArgs(); - args.PrevFileSize = 0; - args.PrevLineCount = 0; - args.LineCount = LineCount; - args.FileSize = FileSize; + LogEventArgs args = new() + { + PrevFileSize = 0, + PrevLineCount = 0, + LineCount = LineCount, + FileSize = FileSize + }; + OnFileSizeChanged(args); } @@ -262,14 +274,13 @@ public int ShiftBuffers() _isLineCountDirty = true; lock (_monitor) { - RolloverFilenameHandler rolloverHandler = - new RolloverFilenameHandler(_watchedILogFileInfo, _multiFileOptions); + RolloverFilenameHandler rolloverHandler = new(_watchedILogFileInfo, _multiFileOptions); LinkedList fileNameList = rolloverHandler.GetNameList(); ResetBufferCache(); - IList lostILogFileInfoList = new List(); - IList readNewILogFileInfoList = new List(); - IList newFileInfoList = new List(); + IList lostILogFileInfoList = []; + IList readNewILogFileInfoList = []; + IList newFileInfoList = []; IEnumerator enumerator = _logFileInfoList.GetEnumerator(); while (enumerator.MoveNext()) { @@ -327,8 +338,8 @@ public int ShiftBuffers() _logger.Info("{0} does not exist", fileName); lostILogFileInfoList.Add(logFileInfo); #if DEBUG // for better overview in logfile: -//ILogFileInfo newILogFileInfo = new ILogFileInfo(fileName); -//ReplaceBufferInfos(ILogFileInfo, newILogFileInfo); + //ILogFileInfo newILogFileInfo = new ILogFileInfo(fileName); + //ReplaceBufferInfos(ILogFileInfo, newILogFileInfo); #endif } } @@ -397,14 +408,14 @@ public int ShiftBuffers() public ILogLine GetLogLine(int lineNum) { - return GetLogLineInternal(lineNum); + return GetLogLineInternal(lineNum).Result; } /// /// Get the text content of the given line number. /// The actual work is done in an async thread. This method waits for thread completion for only 1 second. If the async /// thread has not returned, the method will return null. This is because this method is also called from GUI thread - /// (e.g. LogWindow draw events). Under some circumstances, repeated calls to this method would lead the GUI to freeze. E.g. when + /// (e.g. LogWindow draw events). Under some circumstances, repeated calls to this method would lead the GUI to freeze. E.g. when /// trying to re-load content from disk but the file was deleted. Especially on network shares. /// /// @@ -415,7 +426,7 @@ public ILogLine GetLogLine(int lineNum) /// /// line to retrieve /// - public ILogLine GetLogLineWithWait(int lineNum) + public async Task GetLogLineWithWait(int lineNum) { const int WAIT_TIME = 1000; @@ -423,20 +434,15 @@ public ILogLine GetLogLineWithWait(int lineNum) if (!_isFastFailOnGetLogLine) { - //TODO Replace wit Async Await / awaitable task - - IAsyncResult asyncResult = _logLineFx.BeginInvoke(lineNum, null, null); - - if (asyncResult.AsyncWaitHandle.WaitOne(WAIT_TIME, false)) + var task = Task.Run(() => _logLineFx(lineNum)); + if (task.Wait(WAIT_TIME)) { - result = _logLineFx.EndInvoke(asyncResult); + result = task.Result; _isFastFailOnGetLogLine = false; } else { - _logLineFx.EndInvoke(asyncResult); // must be called according to MSDN docs... :( _isFastFailOnGetLogLine = true; - _logger.Debug("No result after {0}ms. Returning .", WAIT_TIME); } } @@ -446,7 +452,8 @@ public ILogLine GetLogLineWithWait(int lineNum) if (!_isFailModeCheckCallPending) { _isFailModeCheckCallPending = true; - IAsyncResult asyncResult = _logLineFx.BeginInvoke(lineNum, GetLineFinishedCallback, _logLineFx); + var logLine = await _logLineFx(lineNum); + GetLineFinishedCallback(logLine); } } @@ -461,7 +468,7 @@ public ILogLine GetLogLineWithWait(int lineNum) public string GetLogFileNameForLine(int lineNum) { AcquireBufferListReaderLock(); - LogBuffer logBuffer = getBufferForLine(lineNum); + LogBuffer logBuffer = GetBufferForLine(lineNum); string fileName = logBuffer?.FileInfo.FullName; ReleaseBufferListReaderLock(); return fileName; @@ -475,7 +482,7 @@ public string GetLogFileNameForLine(int lineNum) public ILogFileInfo GetLogFileInfoForLine(int lineNum) { AcquireBufferListReaderLock(); - LogBuffer logBuffer = getBufferForLine(lineNum); + LogBuffer logBuffer = GetBufferForLine(lineNum); ILogFileInfo info = logBuffer?.FileInfo; ReleaseBufferListReaderLock(); return info; @@ -491,7 +498,7 @@ public int GetNextMultiFileLine(int lineNum) { int result = -1; AcquireBufferListReaderLock(); - LogBuffer logBuffer = getBufferForLine(lineNum); + LogBuffer logBuffer = GetBufferForLine(lineNum); if (logBuffer != null) { int index = _bufferList.IndexOf(logBuffer); @@ -516,7 +523,7 @@ public int GetPrevMultiFileLine(int lineNum) { int result = -1; AcquireBufferListReaderLock(); - LogBuffer logBuffer = getBufferForLine(lineNum); + LogBuffer logBuffer = GetBufferForLine(lineNum); if (logBuffer != null) { int index = _bufferList.IndexOf(logBuffer); @@ -549,7 +556,7 @@ public int GetPrevMultiFileLine(int lineNum) public int GetRealLineNumForVirtualLineNum(int lineNum) { AcquireBufferListReaderLock(); - LogBuffer logBuffer = getBufferForLine(lineNum); + LogBuffer logBuffer = GetBufferForLine(lineNum); int result = -1; if (logBuffer != null) { @@ -564,58 +571,55 @@ public int GetRealLineNumForVirtualLineNum(int lineNum) return result; } - public void startMonitoring() + public void StartMonitoring() { _logger.Info("startMonitoring()"); - _monitorThread = new Thread(new ThreadStart(MonitorThreadProc)); - _monitorThread.IsBackground = true; + _monitorTask = Task.Run(MonitorThreadProc, cts.Token); _shouldStop = false; - _monitorThread.Start(); } - public void stopMonitoring() + public void StopMonitoring() { _logger.Info("stopMonitoring()"); _shouldStop = true; - Thread.Sleep(_watchedILogFileInfo - .PollInterval); // leave time for the threads to stop by themselves + Thread.Sleep(_watchedILogFileInfo.PollInterval); // leave time for the threads to stop by themselves - if (_monitorThread != null) + if (_monitorTask != null) { - if (_monitorThread.IsAlive) // if thread has not finished, abort it + if (_monitorTask.Status == TaskStatus.Running) // if thread has not finished, abort it { - _monitorThread.Interrupt(); - _monitorThread.Abort(); - _monitorThread.Join(); + cts.Cancel(); } } - if (_garbageCollectorThread != null) + if (_garbageCollectorTask.IsCanceled == false) { - if (_garbageCollectorThread.IsAlive) // if thread has not finished, abort it + if (_garbageCollectorTask.Status == TaskStatus.Running) // if thread has not finished, abort it { - _garbageCollectorThread.Interrupt(); - _garbageCollectorThread.Abort(); - _garbageCollectorThread.Join(); + cts.Cancel(); } } //this.loadThread = null; - _monitorThread = null; - _garbageCollectorThread = null; // preventive call + //_monitorThread = null; + //_garbageCollectorThread = null; // preventive call CloseFiles(); } /// - /// calls stopMonitoring() in a background thread and returns to the caller immediately. + /// calls stopMonitoring() in a background thread and returns to the caller immediately. /// This is useful for a fast responding GUI (e.g. when closing a file tab) /// public void StopMonitoringAsync() { - Thread stopperThread = new Thread(new ThreadStart(stopMonitoring)); - stopperThread.IsBackground = true; - stopperThread.Start(); + Task task = Task.Run(StopMonitoring); + + //Thread stopperThread = new(new ThreadStart(StopMonitoring)) + //{ + // IsBackground = true + //}; + //stopperThread.Start(); } /// @@ -676,7 +680,7 @@ public IList GetLogFileInfoList() } /// - /// For unit tests only + /// For unit tests only /// /// public IList GetBufferList() @@ -693,7 +697,7 @@ public IList GetBufferList() internal void LogBufferInfoForLine(int lineNum) { AcquireBufferListReaderLock(); - LogBuffer buffer = getBufferForLine(lineNum); + LogBuffer buffer = GetBufferForLine(lineNum); if (buffer == null) { ReleaseBufferListReaderLock(); @@ -763,7 +767,7 @@ private ILogFileInfo AddFile(string fileName) return info; } - private ILogLine GetLogLineInternal(int lineNum) + private Task GetLogLineInternal(int lineNum) { if (_isDeleted) { @@ -774,7 +778,7 @@ private ILogLine GetLogLineInternal(int lineNum) } AcquireBufferListReaderLock(); - LogBuffer logBuffer = getBufferForLine(lineNum); + LogBuffer logBuffer = GetBufferForLine(lineNum); if (logBuffer == null) { ReleaseBufferListReaderLock(); @@ -799,12 +803,12 @@ private ILogLine GetLogLineInternal(int lineNum) _disposeLock.ReleaseReaderLock(); ReleaseBufferListReaderLock(); - return line; + return Task.FromResult(line); } private void InitLruBuffers() { - _bufferList = new List(); + _bufferList = []; _bufferLru = new List(_MAX_BUFFERS + 1); //this.lruDict = new Dictionary(this.MAX_BUFFERS + 1); // key=startline, value = index in bufferLru _lruCacheDict = new Dictionary(_MAX_BUFFERS + 1); @@ -815,9 +819,10 @@ private void InitLruBuffers() private void StartGCThread() { - _garbageCollectorThread = new Thread(new ThreadStart(GarbageCollectorThreadProc)); - _garbageCollectorThread.IsBackground = true; - _garbageCollectorThread.Start(); + _garbageCollectorTask = Task.Run(GarbageCollectorThreadProc, cts.Token); + //_garbageCollectorThread = new Thread(new ThreadStart(GarbageCollectorThreadProc)); + //_garbageCollectorThread.IsBackground = true; + //_garbageCollectorThread.Start(); } private void ResetBufferCache() @@ -844,19 +849,9 @@ private void CloseFiles() private ILogFileInfo GetLogFileInfo(string fileNameOrUri) { - IFileSystemPlugin fs = PluginRegistry.GetInstance().FindFileSystemForUri(fileNameOrUri); - if (fs == null) - { - throw new LogFileException("No file system plugin found for " + fileNameOrUri); - } - + IFileSystemPlugin fs = PluginRegistry.GetInstance().FindFileSystemForUri(fileNameOrUri) ?? throw new LogFileException("No file system plugin found for " + fileNameOrUri); ILogFileInfo logFileInfo = fs.GetLogfileInfo(fileNameOrUri); - if (logFileInfo == null) - { - throw new LogFileException("Cannot find " + fileNameOrUri); - } - - return logFileInfo; + return logFileInfo ?? throw new LogFileException("Cannot find " + fileNameOrUri); } private void ReplaceBufferInfos(ILogFileInfo oldLogFileInfo, ILogFileInfo newLogFileInfo) @@ -879,7 +874,7 @@ private LogBuffer DeleteBuffersForInfo(ILogFileInfo ILogFileInfo, bool matchName { _logger.Info("Deleting buffers for file {0}", ILogFileInfo.FullName); LogBuffer lastRemovedBuffer = null; - IList deleteList = new List(); + IList deleteList = []; AcquireBufferListWriterLock(); _lruCacheDictLock.AcquireWriterLock(Timeout.Infinite); if (matchNamesOnly) @@ -940,116 +935,112 @@ private void ReadToBufferList(ILogFileInfo logFileInfo, long filePos, int startL { try { - using (Stream fileStream = logFileInfo.OpenStream()) + using Stream fileStream = logFileInfo.OpenStream(); + try { - try - { - using (ILogStreamReader reader = GetLogStreamReader(fileStream, EncodingOptions, UseNewReader)) - { - reader.Position = filePos; - _fileLength = logFileInfo.Length; - - int lineNum = startLine; - LogBuffer logBuffer; - AcquireBufferListReaderLock(); - if (_bufferList.Count == 0) - { - logBuffer = new LogBuffer(logFileInfo, _MAX_LINES_PER_BUFFER); - logBuffer.StartLine = startLine; - logBuffer.StartPos = filePos; - LockCookie cookie = UpgradeBufferListLockToWriter(); - AddBufferToList(logBuffer); - DowngradeBufferListLockFromWriter(ref cookie); - } - else - { - logBuffer = _bufferList[_bufferList.Count - 1]; - - if (!logBuffer.FileInfo.FullName.Equals(logFileInfo.FullName)) - { - logBuffer = new LogBuffer(logFileInfo, _MAX_LINES_PER_BUFFER); - logBuffer.StartLine = startLine; - logBuffer.StartPos = filePos; - LockCookie cookie = UpgradeBufferListLockToWriter(); - AddBufferToList(logBuffer); - DowngradeBufferListLockFromWriter(ref cookie); - } + using ILogStreamReader reader = GetLogStreamReader(fileStream, EncodingOptions, UseNewReader); + reader.Position = filePos; + _fileLength = logFileInfo.Length; - _disposeLock.AcquireReaderLock(Timeout.Infinite); - if (logBuffer.IsDisposed) - { - LockCookie cookie = _disposeLock.UpgradeToWriterLock(Timeout.Infinite); - ReReadBuffer(logBuffer); - _disposeLock.DowngradeFromWriterLock(ref cookie); - } + int lineNum = startLine; + LogBuffer logBuffer; + AcquireBufferListReaderLock(); + if (_bufferList.Count == 0) + { + logBuffer = new LogBuffer(logFileInfo, _MAX_LINES_PER_BUFFER); + logBuffer.StartLine = startLine; + logBuffer.StartPos = filePos; + LockCookie cookie = UpgradeBufferListLockToWriter(); + AddBufferToList(logBuffer); + DowngradeBufferListLockFromWriter(ref cookie); + } + else + { + logBuffer = _bufferList[_bufferList.Count - 1]; - _disposeLock.ReleaseReaderLock(); - } + if (!logBuffer.FileInfo.FullName.Equals(logFileInfo.FullName)) + { + logBuffer = new LogBuffer(logFileInfo, _MAX_LINES_PER_BUFFER); + logBuffer.StartLine = startLine; + logBuffer.StartPos = filePos; + LockCookie cookie = UpgradeBufferListLockToWriter(); + AddBufferToList(logBuffer); + DowngradeBufferListLockFromWriter(ref cookie); + } - Monitor.Enter(logBuffer); // Lock the buffer - ReleaseBufferListReaderLock(); - int lineCount = logBuffer.LineCount; - int droppedLines = logBuffer.PrevBuffersDroppedLinesSum; - filePos = reader.Position; + _disposeLock.AcquireReaderLock(Timeout.Infinite); + if (logBuffer.IsDisposed) + { + LockCookie cookie = _disposeLock.UpgradeToWriterLock(Timeout.Infinite); + ReReadBuffer(logBuffer); + _disposeLock.DowngradeFromWriterLock(ref cookie); + } - while (ReadLine(reader, logBuffer.StartLine + logBuffer.LineCount, logBuffer.StartLine + logBuffer.LineCount + droppedLines, out var line)) - { - LogLine logLine = new LogLine(); - if (_shouldStop) - { - Monitor.Exit(logBuffer); - return; - } + _disposeLock.ReleaseReaderLock(); + } - if (line == null) - { - logBuffer.DroppedLinesCount += 1; - droppedLines++; - continue; - } + Monitor.Enter(logBuffer); // Lock the buffer + ReleaseBufferListReaderLock(); + int lineCount = logBuffer.LineCount; + int droppedLines = logBuffer.PrevBuffersDroppedLinesSum; + filePos = reader.Position; - lineCount++; - if (lineCount > _MAX_LINES_PER_BUFFER && reader.IsBufferComplete) - { - OnLoadFile(new LoadFileEventArgs(logFileInfo.FullName, filePos, false, logFileInfo.Length, false)); - - Monitor.Exit(logBuffer); - logBuffer = new LogBuffer(logFileInfo, _MAX_LINES_PER_BUFFER); - Monitor.Enter(logBuffer); - logBuffer.StartLine = lineNum; - logBuffer.StartPos = filePos; - logBuffer.PrevBuffersDroppedLinesSum = droppedLines; - AcquireBufferListWriterLock(); - AddBufferToList(logBuffer); - ReleaseBufferListWriterLock(); - lineCount = 1; - } + while (ReadLine(reader, logBuffer.StartLine + logBuffer.LineCount, logBuffer.StartLine + logBuffer.LineCount + droppedLines, out var line)) + { + LogLine logLine = new(); + if (_shouldStop) + { + Monitor.Exit(logBuffer); + return; + } - logLine.FullLine = line; - logLine.LineNumber = logBuffer.StartLine + logBuffer.LineCount; + if (line == null) + { + logBuffer.DroppedLinesCount += 1; + droppedLines++; + continue; + } - logBuffer.AddLine(logLine, filePos); - filePos = reader.Position; - lineNum++; - } + lineCount++; + if (lineCount > _MAX_LINES_PER_BUFFER && reader.IsBufferComplete) + { + OnLoadFile(new LoadFileEventArgs(logFileInfo.FullName, filePos, false, logFileInfo.Length, false)); - logBuffer.Size = filePos - logBuffer.StartPos; Monitor.Exit(logBuffer); - _isLineCountDirty = true; - FileSize = reader.Position; - CurrentEncoding = reader.Encoding; // Reader may have detected another encoding - if (!_shouldStop) - { - OnLoadFile(new LoadFileEventArgs(logFileInfo.FullName, filePos, true, _fileLength, false)); - // Fire "Ready" Event - } + logBuffer = new LogBuffer(logFileInfo, _MAX_LINES_PER_BUFFER); + Monitor.Enter(logBuffer); + logBuffer.StartLine = lineNum; + logBuffer.StartPos = filePos; + logBuffer.PrevBuffersDroppedLinesSum = droppedLines; + AcquireBufferListWriterLock(); + AddBufferToList(logBuffer); + ReleaseBufferListWriterLock(); + lineCount = 1; } + + logLine.FullLine = line; + logLine.LineNumber = logBuffer.StartLine + logBuffer.LineCount; + + logBuffer.AddLine(logLine, filePos); + filePos = reader.Position; + lineNum++; } - catch (IOException ioex) + + logBuffer.Size = filePos - logBuffer.StartPos; + Monitor.Exit(logBuffer); + _isLineCountDirty = true; + FileSize = reader.Position; + CurrentEncoding = reader.Encoding; // Reader may have detected another encoding + if (!_shouldStop) { - _logger.Warn(ioex); + OnLoadFile(new LoadFileEventArgs(logFileInfo.FullName, filePos, true, _fileLength, false)); + // Fire "Ready" Event } } + catch (IOException ioex) + { + _logger.Warn(ioex); + } } catch (IOException fe) { @@ -1131,7 +1122,7 @@ private void SetNewStartLineForBuffer(LogBuffer logBuffer, int newLineNum) { _lruCacheDict.Remove(logBuffer.StartLine); logBuffer.StartLine = newLineNum; - LogBufferCacheEntry cacheEntry = new LogBufferCacheEntry(); + LogBufferCacheEntry cacheEntry = new(); cacheEntry.LogBuffer = logBuffer; _lruCacheDict.Add(logBuffer.StartLine, cacheEntry); } @@ -1159,7 +1150,7 @@ private void GarbageCollectLruCache() _logger.Info("Removing {0} entries from LRU cache for {1}", diff, Util.GetNameFromPath(_fileName)); } #endif - SortedList useSorterList = new SortedList(); + SortedList useSorterList = []; // sort by usage counter foreach (LogBufferCacheEntry entry in _lruCacheDict.Values) { @@ -1271,7 +1262,7 @@ private void GarbageCollectorThreadProc() // { // this.bufferLru.RemoveAt(index); // this.lruDict.Remove(buffer.StartLine); - // // adjust indizes, they have changed because of the remove + // // adjust indizes, they have changed because of the remove // for (int i = index; i < this.bufferLru.Count; ++i) // { // this.lruDict[this.bufferLru[i].StartLine] = this.lruDict[this.bufferLru[i].StartLine] - 1; @@ -1343,6 +1334,7 @@ private void ReReadBuffer(LogBuffer logBuffer) int lineCount = 0; int dropCount = logBuffer.PrevBuffersDroppedLinesSum; logBuffer.ClearLines(); + while (ReadLine(reader, logBuffer.StartLine + logBuffer.LineCount, logBuffer.StartLine + logBuffer.LineCount + dropCount, out string line)) { if (lineCount >= maxLinesCount) @@ -1356,10 +1348,11 @@ private void ReReadBuffer(LogBuffer logBuffer) continue; } - LogLine logLine = new LogLine(); - - logLine.FullLine = line; - logLine.LineNumber = logBuffer.StartLine + logBuffer.LineCount; + LogLine logLine = new() + { + FullLine = line, + LineNumber = logBuffer.StartLine + logBuffer.LineCount + }; logBuffer.AddLine(logLine, filePos); filePos = reader.Position; @@ -1394,7 +1387,7 @@ private void ReReadBuffer(LogBuffer logBuffer) } } - private LogBuffer getBufferForLine(int lineNum) + private LogBuffer GetBufferForLine(int lineNum) { #if DEBUG long startTime = Environment.TickCount; @@ -1432,11 +1425,9 @@ private LogBuffer getBufferForLine(int lineNum) /// /// Async callback used to check if the GetLogLine() call is succeeding again after a detected timeout. /// - private void GetLineFinishedCallback(IAsyncResult res) + private void GetLineFinishedCallback(ILogLine line) { _isFailModeCheckCallPending = false; - GetLogLineFx logLineFx = (GetLogLineFx) res.AsyncState; - ILogLine line = logLineFx.EndInvoke(res); if (line != null) { _logger.Debug("'isFastFailOnGetLogLine' flag was reset"); @@ -1579,7 +1570,7 @@ private void FileChanged() private void FireChangeEvent() { - LogEventArgs args = new LogEventArgs(); + LogEventArgs args = new(); args.PrevFileSize = FileSize; args.PrevLineCount = LineCount; long newSize = _fileLength; diff --git a/src/LogExpert/Classes/Log/PositionAwareStreamReaderLegacy.cs b/src/LogExpert/Classes/Log/PositionAwareStreamReaderLegacy.cs index 3fda6693..594eccff 100644 --- a/src/LogExpert/Classes/Log/PositionAwareStreamReaderLegacy.cs +++ b/src/LogExpert/Classes/Log/PositionAwareStreamReaderLegacy.cs @@ -88,7 +88,7 @@ protected override void ResetReader() private string GetLineAndResetCharBufferPos() { - string result = new string(_charBuffer, 0, _charBufferPos); + string result = new(_charBuffer, 0, _charBufferPos); ResetCharBufferPos(); return result; } diff --git a/src/LogExpert/Classes/Log/RolloverFilenameBuilder.cs b/src/LogExpert/Classes/Log/RolloverFilenameBuilder.cs index cf8f53c8..f2cdc7c9 100644 --- a/src/LogExpert/Classes/Log/RolloverFilenameBuilder.cs +++ b/src/LogExpert/Classes/Log/RolloverFilenameBuilder.cs @@ -184,9 +184,9 @@ private void ParseFormatString(string formatString) private string EscapeNonvarRegions(string formatString) { string fmt = formatString.Replace('*', '\xFFFD'); - StringBuilder result = new StringBuilder(); + StringBuilder result = new(); int state = 0; - StringBuilder segment = new StringBuilder(); + StringBuilder segment = new(); for (int i = 0; i < fmt.Length; ++i) { switch (state) diff --git a/src/LogExpert/Classes/Log/RolloverFilenameHandler.cs b/src/LogExpert/Classes/Log/RolloverFilenameHandler.cs index 5210298b..4d4c01c3 100644 --- a/src/LogExpert/Classes/Log/RolloverFilenameHandler.cs +++ b/src/LogExpert/Classes/Log/RolloverFilenameHandler.cs @@ -48,7 +48,7 @@ public RolloverFilenameHandler(ILogFileInfo logFileInfo, MultiFileOptions option /// public LinkedList GetNameList() { - LinkedList fileList = new LinkedList(); + LinkedList fileList = new(); string fileName = _filenameBuilder.BuildFileName(); string filePath = _logFileInfo.DirectoryName + _logFileInfo.DirectorySeparatorChar + fileName; fileList.AddFirst(filePath); diff --git a/src/LogExpert/Classes/LogExpertApplicationContext.cs b/src/LogExpert/Classes/LogExpertApplicationContext.cs index 6de049d9..0a6b49f4 100644 --- a/src/LogExpert/Classes/LogExpertApplicationContext.cs +++ b/src/LogExpert/Classes/LogExpertApplicationContext.cs @@ -8,7 +8,7 @@ internal class LogExpertApplicationContext : ApplicationContext { #region Fields - private readonly LogExpertProxy proxy; + private readonly LogExpertProxy _proxy; #endregion @@ -16,8 +16,8 @@ internal class LogExpertApplicationContext : ApplicationContext public LogExpertApplicationContext(LogExpertProxy proxy, LogTabWindow firstLogWin) { - this.proxy = proxy; - this.proxy.LastWindowClosed += new LogExpertProxy.LastWindowClosedEventHandler(proxy_LastWindowClosed); + _proxy = proxy; + _proxy.LastWindowClosed += new LogExpertProxy.LastWindowClosedEventHandler(OnProxyLastWindowClosed); firstLogWin.Show(); } @@ -25,7 +25,7 @@ public LogExpertApplicationContext(LogExpertProxy proxy, LogTabWindow firstLogWi #region Events handler - private void proxy_LastWindowClosed(object sender, EventArgs e) + private void OnProxyLastWindowClosed(object sender, EventArgs e) { ExitThread(); Application.Exit(); diff --git a/src/LogExpert/Classes/LogExpertProxy.cs b/src/LogExpert/Classes/LogExpertProxy.cs index f4966fd5..960a4b72 100644 --- a/src/LogExpert/Classes/LogExpertProxy.cs +++ b/src/LogExpert/Classes/LogExpertProxy.cs @@ -2,22 +2,23 @@ using System.Collections.Generic; using System.Windows.Forms; using LogExpert.Controls.LogTabWindow; +using LogExpert.Grpc; using LogExpert.Interface; using NLog; namespace LogExpert.Classes { - internal class LogExpertProxy : MarshalByRefObject, ILogExpertProxy + internal class LogExpertProxy : LogExpertService.LogExpertServiceBase, ILogExpertProxy { #region Fields private static readonly ILogger _logger = LogManager.GetCurrentClassLogger(); - [NonSerialized] private readonly List windowList = new List(); + [NonSerialized] private readonly List _windowList = []; - [NonSerialized] private LogTabWindow firstLogTabWindow; + [NonSerialized] private LogTabWindow _firstLogTabWindow; - [NonSerialized] private int logWindowIndex = 1; + [NonSerialized] private int _logWindowIndex = 1; #endregion @@ -27,7 +28,7 @@ public LogExpertProxy(LogTabWindow logTabWindow) { AddWindow(logTabWindow); logTabWindow.LogExpertProxy = this; - firstLogTabWindow = logTabWindow; + _firstLogTabWindow = logTabWindow; } #endregion @@ -61,43 +62,43 @@ public LogExpertProxy(LogTabWindow logTabWindow) public void LoadFiles(string[] fileNames) { _logger.Info("Loading files into existing LogTabWindow"); - LogTabWindow logWin = this.windowList[this.windowList.Count - 1]; - logWin.Invoke(new MethodInvoker(logWin.SetForeground)); + LogTabWindow logWin = _windowList[^1]; + _ = logWin.Invoke(new MethodInvoker(logWin.SetForeground)); logWin.LoadFiles(fileNames); } public void NewWindow(string[] fileNames) { - if (this.firstLogTabWindow.IsDisposed) + if (_firstLogTabWindow.IsDisposed) { _logger.Warn("first GUI thread window is disposed. Setting a new one."); // may occur if a window is closed because of unhandled exception. // Determine a new 'firstWindow'. If no window is left, start a new one. - RemoveWindow(this.firstLogTabWindow); - if (this.windowList.Count == 0) + RemoveWindow(_firstLogTabWindow); + if (_windowList.Count == 0) { _logger.Info("No windows left. New created window will be the new 'first' GUI window"); LoadFiles(fileNames); } else { - this.firstLogTabWindow = this.windowList[this.windowList.Count - 1]; + _firstLogTabWindow = _windowList[^1]; NewWindow(fileNames); } } else { - this.firstLogTabWindow.Invoke(new NewWindowFx(NewWindowWorker), new object[] {fileNames}); + _ = _firstLogTabWindow.Invoke(new NewWindowFx(NewWindowWorker), new object[] { fileNames }); } } public void NewWindowOrLockedWindow(string[] fileNames) { - foreach (LogTabWindow logWin in this.windowList) + foreach (LogTabWindow logWin in _windowList) { if (LogTabWindow.StaticData.CurrentLockedMainWindow == logWin) { - logWin.Invoke(new MethodInvoker(logWin.SetForeground)); + _ = logWin.Invoke(new MethodInvoker(logWin.SetForeground)); logWin.LoadFiles(fileNames); return; } @@ -110,8 +111,10 @@ public void NewWindowOrLockedWindow(string[] fileNames) public void NewWindowWorker(string[] fileNames) { _logger.Info("Creating new LogTabWindow"); - LogTabWindow logWin = new LogTabWindow(fileNames.Length > 0 ? fileNames : null, logWindowIndex++, true); - logWin.LogExpertProxy = this; + LogTabWindow logWin = new(fileNames.Length > 0 ? fileNames : null, _logWindowIndex++, true) + { + LogExpertProxy = this + }; AddWindow(logWin); logWin.Show(); logWin.Activate(); @@ -121,7 +124,7 @@ public void NewWindowWorker(string[] fileNames) public void WindowClosed(LogTabWindow logWin) { RemoveWindow(logWin); - if (this.windowList.Count == 0) + if (_windowList.Count == 0) { _logger.Info("Last LogTabWindow was closed"); PluginRegistry.GetInstance().CleanupPlugins(); @@ -129,23 +132,23 @@ public void WindowClosed(LogTabWindow logWin) } else { - if (this.firstLogTabWindow == logWin) + if (_firstLogTabWindow == logWin) { // valid firstLogTabWindow is needed for the Invoke()-Calls in NewWindow() - this.firstLogTabWindow = this.windowList[this.windowList.Count - 1]; + _firstLogTabWindow = _windowList[^1]; } } } public int GetLogWindowCount() { - return this.windowList.Count; + return _windowList.Count; } - public override object InitializeLifetimeService() - { - return null; - } + //public override object InitializeLifetimeService() + //{ + // return null; + //} #endregion @@ -154,23 +157,20 @@ public override object InitializeLifetimeService() private void AddWindow(LogTabWindow window) { _logger.Info("Adding window to list"); - this.windowList.Add(window); + _windowList.Add(window); } private void RemoveWindow(LogTabWindow window) { _logger.Info("Removing window from list"); - this.windowList.Remove(window); + _ = _windowList.Remove(window); } #endregion protected void OnLastWindowClosed() { - if (LastWindowClosed != null) - { - LastWindowClosed(this, new EventArgs()); - } + LastWindowClosed?.Invoke(this, new EventArgs()); } private delegate void NewWindowFx(string[] fileNames); diff --git a/src/LogExpert/Classes/ObjectClone.cs b/src/LogExpert/Classes/ObjectClone.cs index 43e172d0..70176ea4 100644 --- a/src/LogExpert/Classes/ObjectClone.cs +++ b/src/LogExpert/Classes/ObjectClone.cs @@ -1,27 +1,19 @@ using System.IO; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters.Binary; +using System.Text.Json; namespace LogExpert.Classes { - /* - * By - Rahul Dantkale - * Company - Indigo Architects - * - */ public static class ObjectClone { #region Public methods public static T Clone(T RealObject) { - using (Stream objectStream = new MemoryStream()) - { - IFormatter formatter = new BinaryFormatter(); - formatter.Serialize(objectStream, RealObject); - objectStream.Seek(0, SeekOrigin.Begin); - return (T) formatter.Deserialize(objectStream); - } + using MemoryStream objectStream = new (); + + JsonSerializer.Serialize(objectStream, RealObject); + objectStream.Seek(0, SeekOrigin.Begin); + return JsonSerializer.Deserialize(objectStream); } #endregion diff --git a/src/LogExpert/Classes/PaintHelper.cs b/src/LogExpert/Classes/PaintHelper.cs index 294a4927..d72457a5 100644 --- a/src/LogExpert/Classes/PaintHelper.cs +++ b/src/LogExpert/Classes/PaintHelper.cs @@ -101,7 +101,7 @@ public static void CellPainting(ILogPaintContext logPaintCtx, DataGridView gridV brush.Dispose(); if (bookmark.Text.Length > 0) { - StringFormat format = new StringFormat(); + StringFormat format = new(); format.LineAlignment = StringAlignment.Center; format.Alignment = StringAlignment.Center; Brush brush2 = new SolidBrush(Color.FromArgb(255, 190, 100, 0)); @@ -121,7 +121,7 @@ public static void CellPainting(ILogPaintContext logPaintCtx, DataGridView gridV public static DataGridViewTextBoxColumn CreateMarkerColumn() { - DataGridViewTextBoxColumn markerColumn = new DataGridViewTextBoxColumn(); + DataGridViewTextBoxColumn markerColumn = new(); markerColumn.HeaderText = ""; markerColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.NotSet; markerColumn.Resizable = DataGridViewTriState.False; @@ -134,7 +134,7 @@ public static DataGridViewTextBoxColumn CreateMarkerColumn() public static DataGridViewTextBoxColumn CreateLineNumberColumn() { - DataGridViewTextBoxColumn lineNumberColumn = new DataGridViewTextBoxColumn(); + DataGridViewTextBoxColumn lineNumberColumn = new(); lineNumberColumn.HeaderText = "Line"; lineNumberColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.NotSet; lineNumberColumn.Resizable = DataGridViewTriState.NotSet; @@ -247,7 +247,7 @@ public static void ApplyDataGridViewPrefs(DataGridView dataGridView, Preferences public static Rectangle BorderWidths(DataGridViewAdvancedBorderStyle advancedBorderStyle) { - Rectangle rect = new Rectangle(); + Rectangle rect = new(); rect.X = advancedBorderStyle.Left == DataGridViewAdvancedCellBorderStyle.None ? 0 : 1; if (advancedBorderStyle.Left == DataGridViewAdvancedCellBorderStyle.OutsetDouble || @@ -308,7 +308,7 @@ private static void PaintHighlightedCell(ILogPaintContext logPaintCtx, DataGridV { if (string.IsNullOrEmpty(column.FullValue) == false) { - HilightMatchEntry hme = new HilightMatchEntry(); + HilightMatchEntry hme = new(); hme.StartPos = 0; hme.Length = column.FullValue.Length; hme.HilightEntry = new HilightEntry(column.FullValue, groundEntry?.ForegroundColor ?? LogExpert.Config.ColorMode.ForeColor, groundEntry?.BackgroundColor ?? Color.Empty, false); @@ -317,7 +317,7 @@ private static void PaintHighlightedCell(ILogPaintContext logPaintCtx, DataGridV } int leftPad = e.CellStyle.Padding.Left; - RectangleF rect = new RectangleF(e.CellBounds.Left + leftPad, e.CellBounds.Top, e.CellBounds.Width, e.CellBounds.Height); + RectangleF rect = new(e.CellBounds.Left + leftPad, e.CellBounds.Top, e.CellBounds.Width, e.CellBounds.Height); Rectangle borderWidths = BorderWidths(e.AdvancedBorderStyle); Rectangle valBounds = e.CellBounds; valBounds.Offset(borderWidths.X, borderWidths.Y); @@ -346,7 +346,7 @@ private static void PaintHighlightedCell(ILogPaintContext logPaintCtx, DataGridV //TextRenderer.DrawText(e.Graphics, e.Value as String, e.CellStyle.Font, valBounds, Color.FromKnownColor(KnownColor.Black), flags); Point wordPos = valBounds.Location; - Size proposedSize = new Size(valBounds.Width, valBounds.Height); + Size proposedSize = new(valBounds.Width, valBounds.Height); Rectangle r = gridView.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, true); e.Graphics.SetClip(e.CellBounds); @@ -372,7 +372,7 @@ private static void PaintHighlightedCell(ILogPaintContext logPaintCtx, DataGridV Size wordSize = TextRenderer.MeasureText(e.Graphics, matchWord, font, proposedSize, flags); wordSize.Height = e.CellBounds.Height; - Rectangle wordRect = new Rectangle(wordPos, wordSize); + Rectangle wordRect = new(wordPos, wordSize); Color foreColor = matchEntry.HilightEntry.ForegroundColor; if ((e.State & DataGridViewElementStates.Selected) != DataGridViewElementStates.Selected) @@ -444,7 +444,7 @@ private static IList MergeHighlightMatchEntries(IList MergeHighlightMatchEntries(IList qualityInfoList = new Dictionary(); + public Dictionary qualityInfoList = []; - public SortedDictionary srcLines = new SortedDictionary(); + public SortedDictionary srcLines = []; public int startLine; public int targetEnd; - public SortedDictionary targetLines = new SortedDictionary(); + public SortedDictionary targetLines = []; public int targetStart; public int weigth; diff --git a/src/LogExpert/Classes/Persister/Persister.cs b/src/LogExpert/Classes/Persister/Persister.cs index 378bd09b..8d951c98 100644 --- a/src/LogExpert/Classes/Persister/Persister.cs +++ b/src/LogExpert/Classes/Persister/Persister.cs @@ -1,15 +1,17 @@ -using System; +using LogExpert.Classes.Filter; +using LogExpert.Config; +using LogExpert.Entities; + +using NLog; + +using System; using System.Collections.Generic; using System.Drawing; using System.IO; -using System.Runtime.Serialization.Formatters.Binary; using System.Text; +using System.Text.Json; using System.Windows.Forms; using System.Xml; -using LogExpert.Classes.Filter; -using LogExpert.Config; -using LogExpert.Entities; -using NLog; namespace LogExpert.Classes.Persister { @@ -17,7 +19,7 @@ public class PersistenceData { #region Fields - public SortedList bookmarkList = new SortedList(); + public SortedList bookmarkList = []; public int bookmarkListPosition = 300; public bool bookmarkListVisible = false; public string columnizerName; @@ -25,10 +27,10 @@ public class PersistenceData public Encoding encoding; public string fileName = null; public bool filterAdvanced = false; - public List filterParamsList = new List(); + public List filterParamsList = []; public int filterPosition = 222; public bool filterSaveListVisible = false; - public List filterTabDataList = new List(); + public List filterTabDataList = []; public bool filterVisible = false; public int firstDisplayedLine = -1; public bool followTail = true; @@ -37,9 +39,9 @@ public class PersistenceData public bool multiFile = false; public int multiFileMaxDays; - public List multiFileNames = new List(); + public List multiFileNames = []; public string multiFilePattern; - public SortedList rowHeightList = new SortedList(); + public SortedList rowHeightList = []; public string sessionFileName = null; public bool showBookmarkCommentColumn; public string tabName = null; @@ -120,8 +122,8 @@ public static PersistenceData LoadPersistenceDataFromFixedFile(string persistenc /// public static PersistenceData LoadOptionsOnly(string fileName) { - PersistenceData persistenceData = new PersistenceData(); - XmlDocument xmlDoc = new XmlDocument(); + PersistenceData persistenceData = new(); + XmlDocument xmlDoc = new(); try { xmlDoc.Load(fileName); @@ -154,32 +156,32 @@ private static string BuildPersisterFileName(string logFileName, Preferences pre { case SessionSaveLocation.SameDir: default: - { - FileInfo fileInfo = new FileInfo(logFileName); - dir = fileInfo.DirectoryName; - file = fileInfo.DirectoryName + Path.DirectorySeparatorChar + fileInfo.Name + ".lxp"; - break; - } + { + FileInfo fileInfo = new(logFileName); + dir = fileInfo.DirectoryName; + file = fileInfo.DirectoryName + Path.DirectorySeparatorChar + fileInfo.Name + ".lxp"; + break; + } case SessionSaveLocation.DocumentsDir: - { - dir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + - Path.DirectorySeparatorChar + - "LogExpert"; - file = dir + Path.DirectorySeparatorChar + BuildSessionFileNameFromPath(logFileName); - break; - } + { + dir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + + Path.DirectorySeparatorChar + + "LogExpert"; + file = dir + Path.DirectorySeparatorChar + BuildSessionFileNameFromPath(logFileName); + break; + } case SessionSaveLocation.OwnDir: - { - dir = preferences.sessionSaveDirectory; - file = dir + Path.DirectorySeparatorChar + BuildSessionFileNameFromPath(logFileName); - break; - } + { + dir = preferences.sessionSaveDirectory; + file = dir + Path.DirectorySeparatorChar + BuildSessionFileNameFromPath(logFileName); + break; + } case SessionSaveLocation.ApplicationStartupDir: - { - dir = Application.StartupPath + Path.DirectorySeparatorChar + "sessionfiles"; - file = dir + Path.DirectorySeparatorChar + BuildSessionFileNameFromPath(logFileName); - break; - } + { + dir = Application.StartupPath + Path.DirectorySeparatorChar + "sessionfiles"; + file = dir + Path.DirectorySeparatorChar + BuildSessionFileNameFromPath(logFileName); + break; + } } if (string.IsNullOrWhiteSpace(dir) == false && Directory.Exists(dir) == false) @@ -208,7 +210,7 @@ private static string BuildSessionFileNameFromPath(string logFileName) private static void Save(string fileName, PersistenceData persistenceData) { - XmlDocument xmlDoc = new XmlDocument(); + XmlDocument xmlDoc = new(); XmlElement rootElement = xmlDoc.CreateElement("logexpert"); xmlDoc.AppendChild(rootElement); XmlElement fileElement = xmlDoc.CreateElement("file"); @@ -255,8 +257,7 @@ private static void WriteFilterTabs(XmlDocument xmlDoc, XmlElement rootElement, WriteFilterTabs(xmlDoc, filterTabElement, persistenceData.filterTabDataList); XmlElement filterElement = xmlDoc.CreateElement("tabFilter"); filterTabElement.AppendChild(filterElement); - List filterList = new List(); - filterList.Add(data.filterParams); + List filterList = [data.filterParams]; WriteFilter(xmlDoc, filterElement, filterList); } } @@ -264,7 +265,7 @@ private static void WriteFilterTabs(XmlDocument xmlDoc, XmlElement rootElement, private static List ReadFilterTabs(XmlElement startNode) { - List dataList = new List(); + List dataList = []; XmlNode filterTabsNode = startNode.SelectSingleNode("filterTabs"); if (filterTabsNode != null) { @@ -276,7 +277,7 @@ private static List ReadFilterTabs(XmlElement startNode) if (filterNode != null) { List filterList = ReadFilter(filterNode as XmlElement); - FilterTabData data = new FilterTabData(); + FilterTabData data = new(); data.persistenceData = persistenceData; data.filterParams = filterList[0]; // there's only 1 dataList.Add(data); @@ -296,10 +297,9 @@ private static void WriteFilter(XmlDocument xmlDoc, XmlElement rootElement, List XmlElement filterElement = xmlDoc.CreateElement("filter"); XmlElement paramsElement = xmlDoc.CreateElement("params"); - BinaryFormatter formatter = new BinaryFormatter(); - MemoryStream stream = new MemoryStream(200); - formatter.Serialize(stream, filterParams); - string base64Data = System.Convert.ToBase64String(stream.ToArray()); + MemoryStream stream = new(capacity: 200); + JsonSerializer.Serialize(stream, filterParams); + string base64Data = Convert.ToBase64String(stream.ToArray()); paramsElement.InnerText = base64Data; filterElement.AppendChild(paramsElement); filtersElement.AppendChild(filterElement); @@ -309,7 +309,7 @@ private static void WriteFilter(XmlDocument xmlDoc, XmlElement rootElement, List private static List ReadFilter(XmlElement startNode) { - List filterList = new List(); + List filterList = []; XmlNode filtersNode = startNode.SelectSingleNode("filters"); if (filtersNode != null) { @@ -321,10 +321,9 @@ private static List ReadFilter(XmlElement startNode) if (subNode.Name.Equals("params")) { string base64Text = subNode.InnerText; - byte[] data = System.Convert.FromBase64String(base64Text); - BinaryFormatter formatter = new BinaryFormatter(); - MemoryStream stream = new MemoryStream(data); - FilterParams filterParams = (FilterParams) formatter.Deserialize(stream); + byte[] data = Convert.FromBase64String(base64Text); + MemoryStream stream = new(data); + FilterParams filterParams = JsonSerializer.Deserialize(stream); filterParams.Init(); filterList.Add(filterParams); } @@ -360,10 +359,10 @@ private static void WriteBookmarks(XmlDocument xmlDoc, XmlElement rootElement, private static PersistenceData Load(string fileName) { - XmlDocument xmlDoc = new XmlDocument(); + XmlDocument xmlDoc = new(); xmlDoc.Load(fileName); XmlNode fileNode = xmlDoc.SelectSingleNode("logexpert/file"); - PersistenceData persistenceData = new PersistenceData(); + PersistenceData persistenceData = new(); if (fileNode != null) { persistenceData = ReadPersistenceDataFromNode(fileNode); @@ -373,7 +372,7 @@ private static PersistenceData Load(string fileName) private static PersistenceData ReadPersistenceDataFromNode(XmlNode node) { - PersistenceData persistenceData = new PersistenceData(); + PersistenceData persistenceData = new(); XmlElement fileElement = node as XmlElement; persistenceData.bookmarkList = ReadBookmarks(fileElement); persistenceData.rowHeightList = ReadRowHeightList(fileElement); @@ -418,7 +417,7 @@ private static Encoding ReadEncoding(XmlElement fileElement) private static SortedList ReadBookmarks(XmlElement startNode) { - SortedList bookmarkList = new SortedList(); + SortedList bookmarkList = []; XmlNode boomarksNode = startNode.SelectSingleNode("bookmarks"); if (boomarksNode != null) { @@ -457,7 +456,7 @@ private static Encoding ReadEncoding(XmlElement fileElement) continue; } int lineNum = int.Parse(line); - Entities.Bookmark bookmark = new Entities.Bookmark(lineNum); + Entities.Bookmark bookmark = new(lineNum); bookmark.OverlayOffset = new Size(int.Parse(posX), int.Parse(posY)); if (text != null) { @@ -485,7 +484,7 @@ private static void WriteRowHeightList(XmlDocument xmlDoc, XmlElement rootElemen private static SortedList ReadRowHeightList(XmlElement startNode) { - SortedList rowHeightList = new SortedList(); + SortedList rowHeightList = []; XmlNode rowHeightsNode = startNode.SelectSingleNode("rowheights"); if (rowHeightsNode != null) { diff --git a/src/LogExpert/Classes/Persister/ProjectData.cs b/src/LogExpert/Classes/Persister/ProjectData.cs index 2a341418..18823c1e 100644 --- a/src/LogExpert/Classes/Persister/ProjectData.cs +++ b/src/LogExpert/Classes/Persister/ProjectData.cs @@ -6,7 +6,7 @@ public class ProjectData { #region Fields - public List memberList = new List(); + public List memberList = []; public string tabLayoutXml = null; #endregion diff --git a/src/LogExpert/Classes/Persister/ProjectPersister.cs b/src/LogExpert/Classes/Persister/ProjectPersister.cs index 3fd2a447..128b2ad1 100644 --- a/src/LogExpert/Classes/Persister/ProjectPersister.cs +++ b/src/LogExpert/Classes/Persister/ProjectPersister.cs @@ -9,8 +9,8 @@ public static class ProjectPersister public static ProjectData LoadProjectData(string projectFileName) { - ProjectData projectData = new ProjectData(); - XmlDocument xmlDoc = new XmlDocument(); + ProjectData projectData = new(); + XmlDocument xmlDoc = new(); xmlDoc.Load(projectFileName); XmlNodeList fileList = xmlDoc.GetElementsByTagName("member"); foreach (XmlNode fileNode in fileList) @@ -30,7 +30,7 @@ public static ProjectData LoadProjectData(string projectFileName) public static void SaveProjectData(string projectFileName, ProjectData projectData) { - XmlDocument xmlDoc = new XmlDocument(); + XmlDocument xmlDoc = new(); XmlElement rootElement = xmlDoc.CreateElement("logexpert"); xmlDoc.AppendChild(rootElement); XmlElement projectElement = xmlDoc.CreateElement("project"); diff --git a/src/LogExpert/Classes/PluginRegistry.cs b/src/LogExpert/Classes/PluginRegistry.cs index 33aa714d..ec2a7099 100644 --- a/src/LogExpert/Classes/PluginRegistry.cs +++ b/src/LogExpert/Classes/PluginRegistry.cs @@ -1,13 +1,14 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Reflection; -using System.Windows.Forms; -using LogExpert.Classes.Columnizer; +using LogExpert.Classes.Columnizer; using LogExpert.Config; using LogExpert.Entities; using LogExpert.Extensions; using NLog; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Windows.Forms; namespace LogExpert.Classes { @@ -24,7 +25,7 @@ public class PluginRegistry private static readonly ILogger _logger = LogManager.GetCurrentClassLogger(); - private static readonly object _lockObject = new object(); + private static readonly object _lockObject = new(); private static PluginRegistry _instance; private readonly IFileSystemCallback _fileSystemCallback = new FileSystemCallback(); @@ -78,110 +79,87 @@ internal void LoadPlugins() { _logger.Info("Loading plugins..."); - RegisteredColumnizers = new List(); - RegisteredColumnizers.Add(new DefaultLogfileColumnizer()); - RegisteredColumnizers.Add(new TimestampColumnizer()); - RegisteredColumnizers.Add(new SquareBracketColumnizer()); - RegisteredColumnizers.Add(new ClfColumnizer()); + RegisteredColumnizers = + [ + //TODO: Remove this plugins and load them as any other plugin + new DefaultLogfileColumnizer(), + new TimestampColumnizer(), + new SquareBracketColumnizer(), + new ClfColumnizer(), + ]; RegisteredFileSystemPlugins.Add(new LocalFileSystem()); - string pluginDir = Application.StartupPath + Path.DirectorySeparatorChar + "plugins"; - + string pluginDir = Path.Combine(Application.StartupPath, "plugins"); + //TODO: FIXME: This is a hack for the tests to pass. Need to find a better approach + if (!Directory.Exists(pluginDir)) { + pluginDir = "."; + } + AppDomain currentDomain = AppDomain.CurrentDomain; currentDomain.AssemblyResolve += ColumnizerResolveEventHandler; - if (Directory.Exists(pluginDir)) + + string interfaceName = typeof(ILogLineColumnizer).FullName; + foreach (string dllName in Directory.GetFiles(pluginDir, "*.dll")) { - string[] dllNames = Directory.GetFiles(pluginDir, "*.dll"); - foreach (string dllName in dllNames) + try { - try + Assembly assembly = Assembly.LoadFrom(dllName); + var types = assembly.GetTypes().Where(t => t.GetInterfaces().Any(i => i.FullName == interfaceName)); + foreach (var type in types) { - Assembly assemblyTmp = Assembly.ReflectionOnlyLoadFrom(dllName); - Assembly assembly = Assembly.Load(assemblyTmp.FullName); + _logger.Info($"Type {type.FullName} in assembly {assembly.FullName} implements {interfaceName}"); - Module[] modules = assembly.GetModules(false); - foreach (Module module in modules) + ConstructorInfo cti = type.GetConstructor(Type.EmptyTypes); + if (cti != null) { - Type[] types = module.FindTypes(Module.FilterTypeName, "*"); - foreach (Type type in types) + object o = cti.Invoke([]); + RegisteredColumnizers.Add((ILogLineColumnizer)o); + + if (o is IColumnizerConfigurator configurator) { - if (type.IsInterface) - { - continue; - } - - if (type.Name.EndsWith("Columnizer")) - { - Type t = typeof(ILogLineColumnizer); - Type inter = type.GetInterface(t.Name); - if (inter != null) - { - ConstructorInfo cti = type.GetConstructor(Type.EmptyTypes); - if (cti != null) - { - object o = cti.Invoke(new object[] { }); - RegisteredColumnizers.Add((ILogLineColumnizer) o); - - if (o is IColumnizerConfigurator configurator) - { - configurator.LoadConfig(ConfigManager.Settings.preferences.PortableMode ? ConfigManager.PortableModeDir : ConfigManager.ConfigDir); - } - - if (o is ILogExpertPlugin plugin) - { - _pluginList.Add(plugin); - plugin.PluginLoaded(); - } - - _logger.Info("Added columnizer {0}", type.Name); - } - } - } - else - { - if (TryAsContextMenu(type)) - { - continue; - } - - if (TryAsKeywordAction(type)) - { - continue; - } - - if (TryAsFileSystem(type)) - { - continue; - } - } + configurator.LoadConfig(ConfigManager.Settings.preferences.PortableMode ? ConfigManager.PortableModeDir : ConfigManager.ConfigDir); } + + if (o is ILogExpertPlugin plugin) + { + _pluginList.Add(plugin); + plugin.PluginLoaded(); + } + + _logger.Info("Added columnizer {0}", type.Name); } } - catch (BadImageFormatException e) - { - _logger.Error(e, dllName); - // nothing... could be a DLL which is needed by any plugin - } - catch (FileLoadException e) - { - // can happen when a 32bit-only DLL is loaded on a 64bit system (or vice versa) - _logger.Error(e, dllName); - } - catch (ReflectionTypeLoadException ex) + } + catch (BadImageFormatException e) + { + _logger.Error(e, dllName); + // nothing... could be a DLL which is needed by any plugin + } + catch (FileLoadException e) + { + // can happen when a 32bit-only DLL is loaded on a 64bit system (or vice versa) + _logger.Error(e, dllName); + } + catch (ReflectionTypeLoadException ex) + { + // can happen when a dll dependency is missing + if (!ex.LoaderExceptions.IsEmpty()) { - if (!ex.LoaderExceptions.IsEmpty()) + foreach (Exception loaderException in ex.LoaderExceptions) { - foreach (Exception loaderException in ex.LoaderExceptions) - { - _logger.Error(loaderException, "Plugin load failed with '{0}'", dllName); - } + _logger.Error(loaderException, "Plugin load failed with '{0}'", dllName); } + } - _logger.Error(ex, "Loader exception during load of dll '{0}'", dllName); + _logger.Error(ex, "Loader exception during load of dll '{0}'", dllName); - throw; - } + throw; + } + catch (Exception ex) + { + _logger.Error(ex, $"General Exception for the file {dllName}, of type: {ex.GetType()}, with the message: {ex.Message}"); + throw; } } @@ -242,9 +220,9 @@ private bool TryAsContextMenu(Type type) if (me != null) { RegisteredContextMenuPlugins.Add(me); - if (me is ILogExpertPluginConfigurator) + if (me is ILogExpertPluginConfigurator configurator) { - ((ILogExpertPluginConfigurator) me).LoadConfig(ConfigManager.ConfigDir); + configurator.LoadConfig(ConfigManager.ConfigDir); } if (me is ILogExpertPlugin) @@ -267,9 +245,9 @@ private bool TryAsKeywordAction(Type type) { RegisteredKeywordActions.Add(ka); _registeredKeywordsDict.Add(ka.GetName(), ka); - if (ka is ILogExpertPluginConfigurator) + if (ka is ILogExpertPluginConfigurator configurator) { - ((ILogExpertPluginConfigurator) ka).LoadConfig(ConfigManager.ConfigDir); + configurator.LoadConfig(ConfigManager.ConfigDir); } if (ka is ILogExpertPlugin) @@ -289,17 +267,14 @@ private bool TryAsFileSystem(Type type) { // file system plugins can have optional constructor with IFileSystemCallback argument IFileSystemPlugin fs = TryInstantiate(type, _fileSystemCallback); - if (fs == null) - { - fs = TryInstantiate(type); - } + fs ??= TryInstantiate(type); if (fs != null) { RegisteredFileSystemPlugins.Add(fs); - if (fs is ILogExpertPluginConfigurator) + if (fs is ILogExpertPluginConfigurator configurator) { - ((ILogExpertPluginConfigurator) fs).LoadConfig(ConfigManager.ConfigDir); + configurator.LoadConfig(ConfigManager.ConfigDir); } if (fs is ILogExpertPlugin) @@ -324,7 +299,7 @@ private T TryInstantiate(Type loadedType) where T : class ConstructorInfo cti = loadedType.GetConstructor(Type.EmptyTypes); if (cti != null) { - object o = cti.Invoke(new object[] { }); + object o = cti.Invoke([]); return o as T; } } @@ -338,15 +313,15 @@ private T TryInstantiate(Type loadedType, IFileSystemCallback fsCallback) whe Type inter = loadedType.GetInterface(t.Name); if (inter != null) { - ConstructorInfo cti = loadedType.GetConstructor(new Type[] {typeof(IFileSystemCallback)}); + ConstructorInfo cti = loadedType.GetConstructor([typeof(IFileSystemCallback)]); if (cti != null) { - object o = cti.Invoke(new object[] {fsCallback}); + object o = cti.Invoke([fsCallback]); return o as T; } } - return default(T); + return default; } #endregion @@ -360,9 +335,9 @@ private static Assembly ColumnizerResolveEventHandler(object sender, ResolveEven string mainDir = Application.StartupPath + Path.DirectorySeparatorChar; string pluginDir = mainDir + "plugins\\"; - FileInfo mainFile = new FileInfo(mainDir + file); + FileInfo mainFile = new(mainDir + file); - FileInfo pluginFile = new FileInfo(pluginDir + file); + FileInfo pluginFile = new(pluginDir + file); if (mainFile.Exists) { return Assembly.LoadFrom(mainFile.FullName); diff --git a/src/LogExpert/Classes/RangeFinder.cs b/src/LogExpert/Classes/RangeFinder.cs index 685c1e0a..bf9c456a 100644 --- a/src/LogExpert/Classes/RangeFinder.cs +++ b/src/LogExpert/Classes/RangeFinder.cs @@ -50,7 +50,7 @@ public Range FindRange(int startLine) int lineCount = _callback.GetLineCount(); int lineNum = startLine; bool foundStartLine = false; - Range range = new Range(); + Range range = new(); FilterParams tmpParam = _filterParams.CreateCopy2(); tmpParam.searchText = _filterParams.rangeSearchText; diff --git a/src/LogExpert/Classes/SysoutPipe.cs b/src/LogExpert/Classes/SysoutPipe.cs index 05d5b47d..990a766d 100644 --- a/src/LogExpert/Classes/SysoutPipe.cs +++ b/src/LogExpert/Classes/SysoutPipe.cs @@ -24,9 +24,9 @@ public SysoutPipe(StreamReader sysout) this.sysout = sysout; this.FileName = Path.GetTempFileName(); _logger.Info("sysoutPipe created temp file: {0}", this.FileName); - FileStream fStream = new FileStream(this.FileName, FileMode.Append, FileAccess.Write, FileShare.Read); + FileStream fStream = new(this.FileName, FileMode.Append, FileAccess.Write, FileShare.Read); this.writer = new StreamWriter(fStream, Encoding.Unicode); - Thread thread = new Thread(new ThreadStart(this.ReaderThread)); + Thread thread = new(new ThreadStart(this.ReaderThread)); thread.IsBackground = true; thread.Start(); } diff --git a/src/LogExpert/Classes/TimeSpreadCalculator.cs b/src/LogExpert/Classes/TimeSpreadCalculator.cs index 23ac4b5f..4fed6941 100644 --- a/src/LogExpert/Classes/TimeSpreadCalculator.cs +++ b/src/LogExpert/Classes/TimeSpreadCalculator.cs @@ -1,10 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using LogExpert.Classes.ILogLineColumnizerCallback; +using LogExpert.Classes.ILogLineColumnizerCallback; using LogExpert.Controls.LogWindow; + using NLog; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + namespace LogExpert.Classes { internal class TimeSpreadCalculator @@ -17,10 +20,9 @@ internal class TimeSpreadCalculator private static readonly ILogger _logger = LogManager.GetCurrentClassLogger(); private readonly EventWaitHandle _calcEvent = new ManualResetEvent(false); - private readonly Thread _calcThread; private readonly ColumnizerCallback _callback; - private readonly object _diffListLock = new object(); + private readonly object _diffListLock = new(); private readonly EventWaitHandle _lineCountEvent = new ManualResetEvent(false); private readonly LogWindow _logWindow; @@ -36,6 +38,7 @@ internal class TimeSpreadCalculator private int _maxDiff; private TimeSpan _maxSpan; private bool _shouldStop; + private CancellationTokenSource cts = new(); private DateTime _startTimestamp; @@ -52,9 +55,8 @@ public TimeSpreadCalculator(LogWindow logWindow) { _logWindow = logWindow; _callback = new ColumnizerCallback(_logWindow); - _calcThread = new Thread(WorkerFx); - _calcThread.IsBackground = true; - _calcThread.Start(); + + Task.Run(WorkerFx, cts.Token); } #endregion @@ -132,7 +134,7 @@ public int Contrast get => _contrast; } - public List DiffList { get; set; } = new List(); + public List DiffList { get; set; } = []; #endregion @@ -142,9 +144,7 @@ public void Stop() { _shouldStop = true; _lineCountEvent.Set(); - _calcThread.Join(300); - _calcThread.Abort(); - _calcThread.Join(); + cts.Cancel(); } public void SetLineCount(int count) @@ -173,8 +173,8 @@ public void SetDisplayHeight(int height) private void WorkerFx() { - Thread.CurrentThread.Name = "TimeSpreadCalculator Worker"; - Thread.CurrentThread.Priority = ThreadPriority.BelowNormal; + //Thread.CurrentThread.Name = "TimeSpreadCalculator Worker"; + //Thread.CurrentThread.Priority = ThreadPriority.BelowNormal; while (!_shouldStop) { @@ -227,13 +227,13 @@ private void DoCalc() if (_startTimestamp != DateTime.MinValue && _endTimestamp != DateTime.MinValue) { TimeSpan overallSpan = _endTimestamp - _startTimestamp; - int overallSpanMillis = (int) (overallSpan.Ticks / TimeSpan.TicksPerMillisecond); - _timePerLine = (int) Math.Round(overallSpanMillis / (double) _lineCount); + int overallSpanMillis = (int)(overallSpan.Ticks / TimeSpan.TicksPerMillisecond); + _timePerLine = (int)Math.Round(overallSpanMillis / (double)_lineCount); DateTime oldTime = _logWindow.GetTimestampForLineForward(ref lineNum, false); int step; if (_lineCount > _displayHeight) { - step = (int) Math.Round(_lineCount / (double) _displayHeight); + step = (int)Math.Round(_lineCount / (double)_displayHeight); } else { @@ -242,8 +242,8 @@ private void DoCalc() _logger.Debug("TimeSpreadCalculator.DoCalc() collecting data for {0} lines with step size {1}", lastLineNum, step); - List newDiffList = new List(); - List maxList = new List(); + List newDiffList = []; + List maxList = []; lineNum++; for (int i = lineNum; i < lastLineNum; i += step) { @@ -253,7 +253,7 @@ private void DoCalc() { TimeSpan span = time - oldTime; maxList.Add(span); - timePerLineSum += (int) (span.Ticks / TimeSpan.TicksPerMillisecond); + timePerLineSum += (int)(span.Ticks / TimeSpan.TicksPerMillisecond); newDiffList.Add(new SpreadEntry(i, 0, time)); oldTime = time; _logger.Debug("TimeSpreadCalculator.DoCalc() time diff {0}", span); @@ -262,12 +262,12 @@ private void DoCalc() if (maxList.Count > 3) { maxList.Sort(); - _maxSpan = maxList[maxList.Count - 3]; + _maxSpan = maxList[^3]; } lock (_diffListLock) { DiffList = newDiffList; - _timePerLine = (int) Math.Round(timePerLineSum / ((double) (lastLineNum + 1) / step)); + _timePerLine = (int)Math.Round(timePerLineSum / ((double)(lastLineNum + 1) / step)); CalcValuesViaLines(_timePerLine, _maxSpan); OnCalcDone(EventArgs.Empty); _logger.Debug("TimeSpreadCalculator.DoCalc() end"); @@ -275,6 +275,7 @@ private void DoCalc() } } + //TODO Refactor this method private void DoCalc_via_Time() { OnStartCalc(EventArgs.Empty); @@ -299,7 +300,7 @@ private void DoCalc_via_Time() long step; if (overallSpanMillis > _displayHeight) { - step = (long) Math.Round(overallSpanMillis / (double) _displayHeight); + step = (long)Math.Round(overallSpanMillis / (double)_displayHeight); } else { @@ -315,8 +316,8 @@ private void DoCalc_via_Time() int lineDiffSum = 0; int minDiff = int.MaxValue; _maxDiff = 0; - List maxList = new List(); - List newDiffList = new List(); + List maxList = []; + List newDiffList = []; while (searchTimeStamp.CompareTo(_endTimestamp) <= 0) { lineNum = _logWindow.FindTimestampLine_Internal(lineNum, lineNum, lastLineNum, searchTimeStamp, false); @@ -332,10 +333,12 @@ private void DoCalc_via_Time() { lineDiffSum += lineDiff; newDiffList.Add(new SpreadEntry(lineNum, lineDiff, searchTimeStamp)); + if (lineDiff < minDiff) { minDiff = lineDiff; } + if (lineDiff > _maxDiff) { _maxDiff = lineDiff; @@ -343,6 +346,7 @@ private void DoCalc_via_Time() maxList.Add(lineDiff); loopCount++; } + searchTimeStamp = searchTimeStamp.AddMilliseconds(step); oldLineNum = lineNum; //lineNum++; @@ -350,21 +354,24 @@ private void DoCalc_via_Time() if (maxList.Count > 3) { maxList.Sort(); - _maxDiff = maxList[maxList.Count - 3]; + _maxDiff = maxList[^3]; } - _average = lineDiffSum / (double) loopCount; + _average = lineDiffSum / (double)loopCount; //double average = maxList[maxList.Count / 2]; _logger.Debug("Average diff={0} minDiff={1} maxDiff={2}", _average, minDiff, _maxDiff); + lock (_diffListLock) { if (newDiffList.Count > 0) { newDiffList.RemoveAt(0); } + if (newDiffList.Count > 0) { newDiffList.RemoveAt(0); } + DiffList = newDiffList; CalcValuesViaTime(_maxDiff, _average); OnCalcDone(EventArgs.Empty); @@ -372,25 +379,26 @@ private void DoCalc_via_Time() } } } - + private DateTime CalcValuesViaLines(int timePerLine, TimeSpan maxSpan) { DateTime oldTime = DateTime.MinValue; if (DiffList.Count > 0) { - oldTime = DiffList[0].timestamp; + oldTime = DiffList[0].Timestamp; foreach (SpreadEntry entry in DiffList) { - TimeSpan span = entry.timestamp - oldTime; - double diffFromAverage = (int) (span.Ticks / TimeSpan.TicksPerMillisecond) - timePerLine; + TimeSpan span = entry.Timestamp - oldTime; + double diffFromAverage = (int)(span.Ticks / TimeSpan.TicksPerMillisecond) - timePerLine; + if (diffFromAverage < 0) { diffFromAverage = 0; } - int value = (int) (diffFromAverage / (timePerLine / TimeSpan.TicksPerMillisecond) - * _contrast); - entry.value = 255 - value; - oldTime = entry.timestamp; + + int value = (int)(diffFromAverage / (timePerLine / TimeSpan.TicksPerMillisecond) * _contrast); + entry.Value = 255 - value; + oldTime = entry.Timestamp; } } return oldTime; @@ -400,15 +408,15 @@ private void CalcValuesViaTime(int maxDiff, double average) { foreach (SpreadEntry entry in DiffList) { - int lineDiff = entry.diff; - double diffFromAverage = entry.diff - average; + int lineDiff = entry.Diff; + double diffFromAverage = entry.Diff - average; if (diffFromAverage < 0) { diffFromAverage = 0; } - int value = (int) (diffFromAverage / maxDiff * _contrast); - entry.value = 255 - value; - _logger.Debug("TimeSpreadCalculator.DoCalc() test time {0:HH:mm:ss.fff} line diff={1} value={2}", entry.timestamp, lineDiff, value); + int value = (int)(diffFromAverage / maxDiff * _contrast); + entry.Value = 255 - value; + _logger.Debug("TimeSpreadCalculator.DoCalc() test time {0:HH:mm:ss.fff} line diff={1} value={2}", entry.Timestamp, lineDiff, value); } } @@ -428,10 +436,13 @@ public class SpreadEntry { #region Fields - public int diff; - public int lineNum; - public DateTime timestamp; - public int value; + public int Diff { get; set; } + + public DateTime Timestamp { get; set; } + + public int LineNum { get; set; } + + public int Value { get; set; } #endregion @@ -439,9 +450,9 @@ public class SpreadEntry public SpreadEntry(int lineNum, int diff, DateTime timestamp) { - this.lineNum = lineNum; - this.diff = diff; - this.timestamp = timestamp; + LineNum = lineNum; + Diff = diff; + Timestamp = timestamp; } #endregion diff --git a/src/LogExpert/Classes/TimeSyncList.cs b/src/LogExpert/Classes/TimeSyncList.cs index 41317c2a..bdef4e90 100644 --- a/src/LogExpert/Classes/TimeSyncList.cs +++ b/src/LogExpert/Classes/TimeSyncList.cs @@ -66,6 +66,7 @@ public void RemoveWindow(LogWindow logWindow) /// Scrolls all LogWindows to the given timestamp /// /// + /// public void NavigateToTimestamp(DateTime timestamp, LogWindow sender) { this.CurrentTimestamp = timestamp; diff --git a/src/LogExpert/Classes/Util.cs b/src/LogExpert/Classes/Util.cs index 2cda5503..79d77d75 100644 --- a/src/LogExpert/Classes/Util.cs +++ b/src/LogExpert/Classes/Util.cs @@ -176,7 +176,7 @@ public static unsafe int YetiLevenshtein(string s1, string s2, int substitionCos /// /// Cetin Sert, David Necas - /// http://webcleaner.svn.sourceforge.net/viewvc/webcleaner/trunk/webcleaner2/wc/levenshtein.c?revision=6015&view=markup + /// Source Code /// /// /// @@ -375,7 +375,7 @@ public static unsafe int YetiLevenshtein(char* s1, int l1, char* s2, int l2, int /// /// Returns true, if the given string is null or empty /// - /// + /// /// public static bool IsNull(string toTest) { @@ -385,7 +385,7 @@ public static bool IsNull(string toTest) /// /// Returns true, if the given string is null or empty or contains only spaces /// - /// + /// /// public static bool IsNullOrSpaces(string toTest) { @@ -407,18 +407,18 @@ public string GetWordFromPos(int xPos, string text, Graphics g, Font font) string[] words = text.Split(new char[] {' ', '.', ':', ';'}); int i = 0; int index = 0; - List crList = new List(); + List crList = []; for (i = 0; i < words.Length; ++i) { crList.Add(new CharacterRange(index, words[i].Length)); index += words[i].Length; } CharacterRange[] crArray = crList.ToArray(); - StringFormat stringFormat = new StringFormat(StringFormat.GenericTypographic); + StringFormat stringFormat = new(StringFormat.GenericTypographic); stringFormat.Trimming = StringTrimming.None; stringFormat.FormatFlags = StringFormatFlags.NoClip; stringFormat.SetMeasurableCharacterRanges(crArray); - RectangleF rect = new RectangleF(0, 0, 3000, 20); + RectangleF rect = new(0, 0, 3000, 20); Region[] stringRegions = g.MeasureCharacterRanges(text, font, rect, stringFormat); bool found = false; diff --git a/src/LogExpert/Classes/Win32.cs b/src/LogExpert/Classes/Win32.cs index 37703037..def689b1 100644 --- a/src/LogExpert/Classes/Win32.cs +++ b/src/LogExpert/Classes/Win32.cs @@ -24,8 +24,8 @@ public static Icon LoadIconFromExe(string fileName, int index) { //IntPtr[] smallIcons = new IntPtr[1]; //IntPtr[] largeIcons = new IntPtr[1]; - IntPtr smallIcons = new IntPtr(); - IntPtr largeIcons = new IntPtr(); + IntPtr smallIcons = new(); + IntPtr largeIcons = new(); int num = (int)ExtractIconEx(fileName, index, ref largeIcons, ref smallIcons, 1); if (num > 0 && smallIcons.ToInt32() != 0) { @@ -53,8 +53,8 @@ public static Icon LoadIconFromExe(string fileName, int index) return null; } - IntPtr smallIcons = new IntPtr(); - IntPtr largeIcons = new IntPtr(); + IntPtr smallIcons = new(); + IntPtr largeIcons = new(); Icon[,] result = new Icon[2, iconCount]; for (int i = 0; i < iconCount; ++i) @@ -81,6 +81,9 @@ public static Icon LoadIconFromExe(string fileName, int index) } return result; } + + [DllImport("user32.dll")] + public static extern long GetSystemMetricsForDpi(long index); [DllImport("user32.dll")] diff --git a/src/LogExpert/Classes/xml/XmlBlockSplitter.cs b/src/LogExpert/Classes/xml/XmlBlockSplitter.cs index f45ad469..fac013f5 100644 --- a/src/LogExpert/Classes/xml/XmlBlockSplitter.cs +++ b/src/LogExpert/Classes/xml/XmlBlockSplitter.cs @@ -12,18 +12,19 @@ internal class XmlBlockSplitter : LogStreamReaderBase { #region Fields - private static readonly string[] splitStrings = new string[] { "\r\n", "\n", "\r" }; - private static readonly char[] newLineChar = new char[] { '\n' }; + private static readonly string[] _splitStrings = { "\r\n", "\n", "\r" }; - private readonly XmlLogReader reader; + private static readonly char[] _newLineChar = { '\n' }; - private readonly XmlParserContext context; - private readonly XmlReaderSettings settings; + private readonly XmlLogReader _reader; - private readonly Queue lineList = new Queue(); + private readonly XmlParserContext _context; + private readonly XmlReaderSettings _settings; + + private readonly Queue _lineList = new(); - private string stylesheet; - private XslCompiledTransform xslt; + private string _stylesheet; + private XslCompiledTransform _xslt; #endregion @@ -31,23 +32,23 @@ internal class XmlBlockSplitter : LogStreamReaderBase public XmlBlockSplitter(XmlLogReader reader, IXmlLogConfiguration xmlLogConfig) { - this.reader = reader; - this.reader.StartTag = xmlLogConfig.XmlStartTag; - this.reader.EndTag = xmlLogConfig.XmlEndTag; + _reader = reader; + _reader.StartTag = xmlLogConfig.XmlStartTag; + _reader.EndTag = xmlLogConfig.XmlEndTag; Stylesheet = xmlLogConfig.Stylesheet; // Create the XmlNamespaceManager. - NameTable nt = new NameTable(); - XmlNamespaceManager nsmgr = new XmlNamespaceManager(nt); + NameTable nt = new(); + XmlNamespaceManager nsmgr = new(nt); if (xmlLogConfig.Namespace != null) { nsmgr.AddNamespace(xmlLogConfig.Namespace[0], xmlLogConfig.Namespace[1]); } // Create the XmlParserContext. - context = new XmlParserContext(nt, nsmgr, null, XmlSpace.None); - settings = new XmlReaderSettings(); - settings.ConformanceLevel = ConformanceLevel.Fragment; + _context = new XmlParserContext(nt, nsmgr, null, XmlSpace.None); + _settings = new XmlReaderSettings(); + _settings.ConformanceLevel = ConformanceLevel.Fragment; } #endregion @@ -56,30 +57,30 @@ public XmlBlockSplitter(XmlLogReader reader, IXmlLogConfiguration xmlLogConfig) public override long Position { - get => reader.Position; - set => reader.Position = value; + get => _reader.Position; + set => _reader.Position = value; } - public override Encoding Encoding => reader.Encoding; + public override Encoding Encoding => _reader.Encoding; - public override bool IsBufferComplete => lineList.Count == 0; + public override bool IsBufferComplete => _lineList.Count == 0; public string Stylesheet { - get => stylesheet; + get => _stylesheet; set { - stylesheet = value; - if (stylesheet != null) + _stylesheet = value; + if (_stylesheet != null) { - XmlReader stylesheetReader = XmlReader.Create(new StringReader(stylesheet)); + XmlReader stylesheetReader = XmlReader.Create(new StringReader(_stylesheet)); - xslt = new XslCompiledTransform(); - xslt.Load(stylesheetReader); + _xslt = new XslCompiledTransform(); + _xslt.Load(stylesheetReader); } else { - xslt = null; + _xslt = null; } } } @@ -90,16 +91,16 @@ public string Stylesheet private void ParseXmlBlock(string block) { - if (stylesheet != null) + if (_stylesheet != null) { - XmlReader xmlReader = XmlReader.Create(new StringReader(block), settings, context); + XmlReader xmlReader = XmlReader.Create(new StringReader(block), _settings, _context); xmlReader.Read(); xmlReader.MoveToContent(); //xmlReader.MoveToContent(); - StringWriter textWriter = new StringWriter(); + StringWriter textWriter = new(); - xslt.Transform(xmlReader, null, textWriter); + _xslt.Transform(xmlReader, null, textWriter); string message = textWriter.ToString(); SplitToLinesList(message); } @@ -113,17 +114,17 @@ private void ParseXmlBlock(string block) private void SplitToLinesList(string message) { const int MAX_LEN = 3000; - string[] lines = message.Split(splitStrings, StringSplitOptions.None); + string[] lines = message.Split(_splitStrings, StringSplitOptions.None); foreach (string theLine in lines) { - string line = theLine.Trim(newLineChar); + string line = theLine.Trim(_newLineChar); while (line.Length > MAX_LEN) { string part = line.Substring(0, MAX_LEN); line = line.Substring(MAX_LEN); - lineList.Enqueue(part); + _lineList.Enqueue(part); } - lineList.Enqueue(line); + _lineList.Enqueue(line); } } @@ -135,20 +136,20 @@ protected override void Dispose(bool disposing) { if (disposing) { - reader.Dispose(); + _reader.Dispose(); } } public override int ReadChar() { - return reader.ReadChar(); + return _reader.ReadChar(); } public override string ReadLine() { - if (lineList.Count == 0) + if (_lineList.Count == 0) { - string block = reader.ReadLine(); + string block = _reader.ReadLine(); if (block == null) { return null; @@ -160,10 +161,10 @@ public override string ReadLine() } catch (XmlException) { - lineList.Enqueue("[XML Parser error] " + block); + _lineList.Enqueue("[XML Parser error] " + block); } } - return lineList.Dequeue(); + return _lineList.Dequeue(); } #endregion diff --git a/src/LogExpert/Classes/xml/XmlLogReader.cs b/src/LogExpert/Classes/xml/XmlLogReader.cs index 5e63b2a8..b64294e9 100644 --- a/src/LogExpert/Classes/xml/XmlLogReader.cs +++ b/src/LogExpert/Classes/xml/XmlLogReader.cs @@ -63,7 +63,7 @@ public override string ReadLine() bool eof = false; int tryCounter = 5; - StringBuilder builder = new StringBuilder(); + StringBuilder builder = new(); while (!eof && !blockComplete) { diff --git a/src/LogExpert/Config/ColorMode.cs b/src/LogExpert/Config/ColorMode.cs index 444ad857..aa5c74f4 100644 --- a/src/LogExpert/Config/ColorMode.cs +++ b/src/LogExpert/Config/ColorMode.cs @@ -1,10 +1,6 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; using System.Drawing; +using System.Runtime.InteropServices; namespace LogExpert.Config { @@ -28,7 +24,7 @@ public static class ColorMode private static readonly Color DarkForeColor = Color.FromArgb(255, 255, 255); // Default - public static Color BackgroundColor = LessBrightBackgroundColor; + public static Color BackgroundColor = BrightBackgroundColor; public static Color DockBackgroundColor = BrighterBackgroundColor; public static Color BookmarksDefaultBackgroundColor = BrightBookmarkDefaultSystemColor; public static Color ForeColor = BrightForeColor; @@ -39,7 +35,7 @@ public static class ColorMode public static Color TabsBackgroundStripColor = LessBrightBackgroundColor; - public static bool DarkModeEnabled = false; + public static bool DarkModeEnabled; public static void LoadColorMode() { diff --git a/src/LogExpert/Config/ConfigManager.cs b/src/LogExpert/Config/ConfigManager.cs index bc68df0f..79cf0f08 100644 --- a/src/LogExpert/Config/ConfigManager.cs +++ b/src/LogExpert/Config/ConfigManager.cs @@ -21,9 +21,9 @@ public class ConfigManager private static readonly ILogger _logger = LogManager.GetCurrentClassLogger(); - private static readonly object _monitor = new object(); + private static readonly object _monitor = new(); private static ConfigManager _instance; - private readonly object _loadSaveLock = new object(); + private readonly object _loadSaveLock = new(); private Settings _settings; #endregion @@ -51,10 +51,7 @@ public static ConfigManager Instance { lock (_monitor) { - if (_instance == null) - { - _instance = new ConfigManager(); - } + _instance ??= new ConfigManager(); } return _instance; } @@ -127,7 +124,7 @@ private Settings Load() try { - FileInfo fileInfo = new FileInfo(dir + Path.DirectorySeparatorChar + "settings.json"); + FileInfo fileInfo = new(dir + Path.DirectorySeparatorChar + "settings.json"); return LoadOrCreateNew(fileInfo); } catch (Exception e) @@ -166,35 +163,17 @@ private Settings LoadOrCreateNew(FileSystemInfo fileInfo) } } - if (settings.preferences == null) - { - settings.preferences = new Preferences(); - } + settings.preferences ??= new Preferences(); - if (settings.preferences.toolEntries == null) - { - settings.preferences.toolEntries = new List(); - } + settings.preferences.toolEntries ??= []; - if (settings.preferences.columnizerMaskList == null) - { - settings.preferences.columnizerMaskList = new List(); - } + settings.preferences.columnizerMaskList ??= []; - if (settings.fileHistoryList == null) - { - settings.fileHistoryList = new List(); - } + settings.fileHistoryList ??= []; - if (settings.lastOpenFilesList == null) - { - settings.lastOpenFilesList = new List(); - } + settings.lastOpenFilesList ??= []; - if (settings.fileColors == null) - { - settings.fileColors = new List(); - } + settings.fileColors ??= []; if (settings.preferences.showTailColor == Color.Empty) { @@ -216,25 +195,13 @@ private Settings LoadOrCreateNew(FileSystemInfo fileInfo) settings.preferences.linesPerBuffer = 500; } - if (settings.filterList == null) - { - settings.filterList = new List(); - } + settings.filterList ??= []; - if (settings.searchHistoryList == null) - { - settings.searchHistoryList = new List(); - } + settings.searchHistoryList ??= []; - if (settings.filterHistoryList == null) - { - settings.filterHistoryList = new List(); - } + settings.filterHistoryList ??= []; - if (settings.filterRangeHistoryList == null) - { - settings.filterRangeHistoryList = new List(); - } + settings.filterRangeHistoryList ??= []; foreach (FilterParams filterParams in settings.filterList) { @@ -243,33 +210,24 @@ private Settings LoadOrCreateNew(FileSystemInfo fileInfo) if (settings.hilightGroupList == null) { - settings.hilightGroupList = new List(); + settings.hilightGroupList = []; // migrate old non-grouped entries - HilightGroup defaultGroup = new HilightGroup(); + HilightGroup defaultGroup = new(); defaultGroup.GroupName = "[Default]"; defaultGroup.HilightEntryList = settings.hilightEntryList; settings.hilightGroupList.Add(defaultGroup); } - if (settings.preferences.highlightMaskList == null) - { - settings.preferences.highlightMaskList = new List(); - } + settings.preferences.highlightMaskList ??= []; if (settings.preferences.pollingInterval < 20) { settings.preferences.pollingInterval = 250; } - if (settings.preferences.multiFileOptions == null) - { - settings.preferences.multiFileOptions = new MultiFileOptions(); - } + settings.preferences.multiFileOptions ??= new MultiFileOptions(); - if (settings.preferences.defaultEncoding == null) - { - settings.preferences.defaultEncoding = Encoding.Default.HeaderName; - } + settings.preferences.defaultEncoding ??= Encoding.Default.HeaderName; if (settings.preferences.maximumFilterEntriesDisplayed == 0) { @@ -308,7 +266,7 @@ private void Save(Settings settings, SettingsFlags flags) Directory.CreateDirectory(dir); } - FileInfo fileInfo = new FileInfo(dir + Path.DirectorySeparatorChar + "settings.json"); + FileInfo fileInfo = new(dir + Path.DirectorySeparatorChar + "settings.json"); Save(fileInfo, settings); } @@ -331,11 +289,9 @@ private void SaveAsJSON(FileInfo fileInfo, Settings settings) { settings.versionBuild = Assembly.GetExecutingAssembly().GetName().Version.Build; - using (StreamWriter sw = new StreamWriter(fileInfo.Create())) - { - JsonSerializer serializer = new JsonSerializer(); - serializer.Serialize(sw, settings); - } + using StreamWriter sw = new(fileInfo.Create()); + JsonSerializer serializer = new(); + serializer.Serialize(sw, settings); } /// @@ -350,7 +306,7 @@ private void ConvertSettings(Settings settings) if (oldBuildNumber < 3584) { // External tools - List newList = new List(); + List newList = []; foreach (ToolEntry tool in settings.preferences.toolEntries) { // set favourite to true only when name is empty, because there are always version released without this conversion fx diff --git a/src/LogExpert/Config/Preferences.cs b/src/LogExpert/Config/Preferences.cs index 719f3aa2..81af2077 100644 --- a/src/LogExpert/Config/Preferences.cs +++ b/src/LogExpert/Config/Preferences.cs @@ -19,7 +19,7 @@ public class Preferences public int bufferCount = 100; - public List columnizerMaskList = new List(); + public List columnizerMaskList = []; public string defaultEncoding; @@ -33,7 +33,7 @@ public class Preferences public float fontSize = 9; - public List highlightMaskList = new List(); + public List highlightMaskList = []; public bool isAutoHideFilterList = false; @@ -96,7 +96,7 @@ public class Preferences public DateTimeDragControl.DragOrientations timestampControlDragOrientation = DateTimeDragControl.DragOrientations.Horizontal; - public List toolEntries = new List(); + public List toolEntries = []; public bool useLegacyReader; diff --git a/src/LogExpert/Config/RegexHistory.cs b/src/LogExpert/Config/RegexHistory.cs index 0cf061b4..2cbcde4f 100644 --- a/src/LogExpert/Config/RegexHistory.cs +++ b/src/LogExpert/Config/RegexHistory.cs @@ -8,8 +8,8 @@ public class RegexHistory { #region Fields - public List expressionHistoryList = new List(); - public List testtextHistoryList = new List(); + public List expressionHistoryList = []; + public List testtextHistoryList = []; #endregion } diff --git a/src/LogExpert/Config/Settings.cs b/src/LogExpert/Config/Settings.cs index e75fade7..01a10f8e 100644 --- a/src/LogExpert/Config/Settings.cs +++ b/src/LogExpert/Config/Settings.cs @@ -1,10 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Drawing; using LogExpert.Classes.Filter; using LogExpert.Classes.Highlight; using LogExpert.Entities; +using System; +using System.Collections.Generic; +using System.Drawing; + namespace LogExpert.Config { [Serializable] @@ -15,45 +16,45 @@ public class Settings public bool alwaysOnTop; public Rectangle appBounds; - + public Rectangle appBoundsFullscreen; - - public IList columnizerHistoryList = new List(); - - public List fileColors = new List(); - - public List fileHistoryList = new List(); - - public List filterHistoryList = new List(); - - public List filterList = new List(); - - public FilterParams filterParams = new FilterParams(); - - public List filterRangeHistoryList = new List(); - + + public IList columnizerHistoryList = []; + + public List fileColors = []; + + public List fileHistoryList = []; + + public List filterHistoryList = []; + + public List filterList = []; + + public FilterParams filterParams = new(); + + public List filterRangeHistoryList = []; + public bool hideLineColumn; - public List hilightEntryList = new List(); // legacy. is automatically converted to highlight groups on settings load + public List hilightEntryList = []; // legacy. is automatically converted to highlight groups on settings load - public List hilightGroupList = new List(); // should be in Preferences but is here for mistake. Maybe I migrate it some day. + public List hilightGroupList = []; // should be in Preferences but is here for mistake. Maybe I migrate it some day. public bool isMaximized; - + public string lastDirectory; - - public List lastOpenFilesList = new List(); - - public Preferences preferences = new Preferences(); - - public RegexHistory regexHistory = new RegexHistory(); - - public List searchHistoryList = new List(); - - public SearchParams searchParams = new SearchParams(); - - public IList uriHistoryList = new List(); - + + public List lastOpenFilesList = []; + + public Preferences preferences = new(); + + public RegexHistory regexHistory = new(); + + public List searchHistoryList = []; + + public SearchParams searchParams = new(); + + public IList uriHistoryList = []; + public int versionBuild; #endregion diff --git a/src/LogExpert/Config/ToolEntry.cs b/src/LogExpert/Config/ToolEntry.cs index 84428dd8..64ef026e 100644 --- a/src/LogExpert/Config/ToolEntry.cs +++ b/src/LogExpert/Config/ToolEntry.cs @@ -29,7 +29,7 @@ public override string ToString() public ToolEntry Clone() { - ToolEntry clone = new ToolEntry(); + ToolEntry clone = new(); clone.cmd = this.cmd; clone.args = this.args; clone.name = this.name; diff --git a/src/LogExpert/Controls/KnobControl.Designer.cs b/src/LogExpert/Controls/KnobControl.Designer.cs index bf5aa05d..4b897228 100644 --- a/src/LogExpert/Controls/KnobControl.Designer.cs +++ b/src/LogExpert/Controls/KnobControl.Designer.cs @@ -32,8 +32,6 @@ private void InitializeComponent() // // KnobControl // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Name = "KnobControl"; this.Size = new System.Drawing.Size(21, 21); this.ResumeLayout(false); diff --git a/src/LogExpert/Controls/KnobControl.cs b/src/LogExpert/Controls/KnobControl.cs index b1fc0a7f..3a9846b1 100644 --- a/src/LogExpert/Controls/KnobControl.cs +++ b/src/LogExpert/Controls/KnobControl.cs @@ -12,7 +12,7 @@ public partial class KnobControl : UserControl private static readonly ILogger _logger = LogManager.GetCurrentClassLogger(); - private readonly StringFormat stringFormat = new StringFormat(); + private readonly StringFormat stringFormat = new(); private bool isShiftPressed = false; @@ -79,8 +79,8 @@ protected override void OnPaint(PaintEventArgs e) Color foregroundColor = this.Enabled ? Color.Black : Color.Gray; - Pen blackPen = new Pen(foregroundColor, 1); - Pen greyPen = new Pen(Color.Gray, 1); + Pen blackPen = new(foregroundColor, 1); + Pen greyPen = new(Color.Gray, 1); Rectangle rect = this.ClientRectangle; int height = this.Font.Height + 3; @@ -100,7 +100,7 @@ protected override void OnPaint(PaintEventArgs e) e.Graphics.DrawPie(blackPen, rect, startAngle, sweepAngle); Brush brush = new SolidBrush(foregroundColor); - RectangleF rectF = new RectangleF(0, 0, this.ClientRectangle.Width, this.ClientRectangle.Height); + RectangleF rectF = new(0, 0, this.ClientRectangle.Width, this.ClientRectangle.Height); e.Graphics.DrawString("" + this.value, this.Font, brush, rectF, this.stringFormat); blackPen.Dispose(); diff --git a/src/LogExpert/Controls/LogTabControl.cs b/src/LogExpert/Controls/LogTabControl.cs index 44039c8b..8f19e2c2 100644 --- a/src/LogExpert/Controls/LogTabControl.cs +++ b/src/LogExpert/Controls/LogTabControl.cs @@ -31,7 +31,7 @@ protected override void OnPaint(PaintEventArgs e) currentContext = BufferedGraphicsManager.Current; myBuffer = currentContext.Allocate(this.CreateGraphics(), this.DisplayRectangle); - PaintEventArgs args = new PaintEventArgs(myBuffer.Graphics, e.ClipRectangle); + PaintEventArgs args = new(myBuffer.Graphics, e.ClipRectangle); base.OnPaint(args); diff --git a/src/LogExpert/Controls/LogTabPage.cs b/src/LogExpert/Controls/LogTabPage.cs index de83775a..f679937f 100644 --- a/src/LogExpert/Controls/LogTabPage.cs +++ b/src/LogExpert/Controls/LogTabPage.cs @@ -12,7 +12,7 @@ internal class LogTabPage : TabPage private const int DIFF_MAX = 100; private int diffSum = 0; - private readonly object diffSumLock = new object(); + private readonly object diffSumLock = new(); private readonly Thread ledThread; private bool shouldStop = false; diff --git a/src/LogExpert/Controls/LogTabWindow/LogTabWindow.cs b/src/LogExpert/Controls/LogTabWindow/LogTabWindow.cs index 4bd6c535..e9bcd4ef 100644 --- a/src/LogExpert/Controls/LogTabWindow/LogTabWindow.cs +++ b/src/LogExpert/Controls/LogTabWindow/LogTabWindow.cs @@ -1,17 +1,19 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Reflection; -using System.Text; -using System.Threading; -using System.Windows.Forms; -using LogExpert.Config; +using LogExpert.Config; using LogExpert.Dialogs; using LogExpert.Entities; using LogExpert.Entities.EventArgs; using LogExpert.Extensions.Forms; using LogExpert.Interface; + using NLog; + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Reflection; +using System.Text; +using System.Threading; +using System.Windows.Forms; //using System.Linq; namespace LogExpert.Controls.LogTabWindow @@ -44,9 +46,9 @@ public partial class LogTabWindow : Form private readonly EventWaitHandle _statusLineEventHandle = new AutoResetEvent(false); private readonly EventWaitHandle _statusLineEventWakeupHandle = new ManualResetEvent(false); - private readonly object _statusLineLock = new object(); + private readonly object _statusLineLock = new(); private readonly Brush _syncLedBrush; - private readonly StringFormat _tabStringFormat = new StringFormat(); + private readonly StringFormat _tabStringFormat = new(); private readonly Brush[] _tailLedBrush = new Brush[3]; private BookmarkWindow _bookmarkWindow; @@ -73,9 +75,14 @@ public partial class LogTabWindow : Form public LogTabWindow(string[] fileNames, int instanceNumber, bool showInstanceNumbers) { - InitializeComponent(); + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; + + InitializeComponent(); - ChangeTheme(Controls); + //Fix MainMenu and externalToolsToolStrip.Location, if the location has unintentionally been changed in the designer + mainMenuStrip.Location = new Point(0, 0); + externalToolsToolStrip.Location = new Point(0, 54); _startupFileNames = fileNames; _instanceNumber = instanceNumber; @@ -83,10 +90,10 @@ public LogTabWindow(string[] fileNames, int instanceNumber, bool showInstanceNum Load += OnLogTabWindowLoad; - ConfigManager.Instance.ConfigChanged += ConfigChanged; + ConfigManager.Instance.ConfigChanged += OnConfigChanged; HilightGroupList = ConfigManager.Settings.hilightGroupList; - Rectangle led = new Rectangle(0, 0, 8, 2); + Rectangle led = new(0, 0, 8, 2); for (int i = 0; i < _leds.Length; ++i) { @@ -117,7 +124,7 @@ public LogTabWindow(string[] fileNames, int instanceNumber, bool showInstanceNum _tabStringFormat.LineAlignment = StringAlignment.Center; _tabStringFormat.Alignment = StringAlignment.Near; - ToolStripControlHost host = new ToolStripControlHost(checkBoxFollowTail); + ToolStripControlHost host = new(checkBoxFollowTail); host.Padding = new Padding(20, 0, 0, 0); host.BackColor = Color.FromKnownColor(KnownColor.Transparent); @@ -145,7 +152,7 @@ public LogTabWindow(string[] fileNames, int instanceNumber, bool showInstanceNum // get a list of resource names from the manifest string[] resNames = a.GetManifestResourceNames(); - Bitmap bmp = Properties.Resources.delete_page_red; + Bitmap bmp = Properties.Resources.Deceased; _deadIcon = Icon.FromHandle(bmp.GetHicon()); bmp.Dispose(); Closing += OnLogTabWindowClosing; @@ -176,10 +183,8 @@ public void ChangeTheme(Control.ControlCollection container) component.ForeColor = ColorMode.ForeColor; } - if (component is MenuStrip) + if (component is MenuStrip menu) { - var menu = (MenuStrip)component; - foreach (ToolStripMenuItem item in menu.Items) { item.ForeColor = ColorMode.ForeColor; @@ -187,18 +192,17 @@ public void ChangeTheme(Control.ControlCollection container) try { - for(var x = 0; x< item.DropDownItems.Count; x++) + for (var x = 0; x < item.DropDownItems.Count; x++) { var children = item.DropDownItems[x]; children.ForeColor = ColorMode.ForeColor; children.BackColor = ColorMode.MenuBackgroundColor; - - if(children is ToolStripDropDownItem) { - - for (var y = 0; y < ((ToolStripDropDownItem)children).DropDownItems.Count; y++) + if (children is ToolStripDropDownItem toolstripDropDownItem) + { + for (var y = 0; y < toolstripDropDownItem.DropDownItems.Count; y++) { - var subChildren = ((ToolStripDropDownItem)children).DropDownItems[y]; + var subChildren = toolstripDropDownItem.DropDownItems[y]; subChildren.ForeColor = ColorMode.ForeColor; subChildren.BackColor = ColorMode.MenuBackgroundColor; } @@ -216,7 +220,7 @@ public void ChangeTheme(Control.ControlCollection container) // Colors for selected menus mainMenuStrip.Renderer = new ExtendedMenuStripRenderer(); - + // Dock special color dockPanel.DockBackColor = ColorMode.DockBackgroundColor; @@ -252,7 +256,7 @@ public void ChangeTheme(Control.ControlCollection container) dockPanel.Skin.DockPaneStripSkin.DocumentGradient.InactiveTabGradient.StartColor = ColorMode.InactiveTabColor; dockPanel.Skin.DockPaneStripSkin.DocumentGradient.InactiveTabGradient.EndColor = ColorMode.InactiveTabColor; - dockPanel.Skin.DockPaneStripSkin.DocumentGradient.InactiveTabGradient.TextColor = ColorMode.ForeColor; + dockPanel.Skin.DockPaneStripSkin.DocumentGradient.InactiveTabGradient.TextColor = ColorMode.ForeColor; #endregion Tabs } #endregion @@ -303,7 +307,7 @@ public LogWindow.LogWindow CurrentLogWindow public Preferences Preferences => ConfigManager.Settings.preferences; - public List HilightGroupList { get; private set; } = new List(); + public List HilightGroupList { get; private set; } = []; //public Settings Settings //{ @@ -361,4 +365,4 @@ internal class StaticLogTabWindowData #endregion } } -} \ No newline at end of file +} diff --git a/src/LogExpert/Controls/LogTabWindow/LogTabWindow.designer.cs b/src/LogExpert/Controls/LogTabWindow/LogTabWindow.designer.cs index 997b5806..45393abd 100644 --- a/src/LogExpert/Controls/LogTabWindow/LogTabWindow.designer.cs +++ b/src/LogExpert/Controls/LogTabWindow/LogTabWindow.designer.cs @@ -1,8 +1,9 @@ using System.Windows.Forms; -using LogExpert.Config; using LogExpert.Dialogs; -using LogExpert.Extensions; using LogExpert.Extensions.Forms; +using LogExpert.Properties; + +using WeifenLuo.WinFormsUI.Docking; namespace LogExpert.Controls.LogTabWindow { @@ -26,1035 +27,820 @@ protected override void Dispose(bool disposing) base.Dispose(disposing); } - #region Windows Form Designer generated code + #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - WeifenLuo.WinFormsUI.Docking.DockPanelSkin dockPanelSkin1 = new WeifenLuo.WinFormsUI.Docking.DockPanelSkin(); - WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin autoHideStripSkin1 = new WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin(); - WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient1 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient(); - WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient1 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); - WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin dockPaneStripSkin1 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin(); - WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient dockPaneStripGradient1 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient(); - WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient2 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); - WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient2 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient(); - WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient3 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); - WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient dockPaneStripToolWindowGradient1 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient(); - WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient4 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); - WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient5 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); - WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient3 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient(); - WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient6 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); - WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient7 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + DockPanelSkin dockPanelSkin1 = new DockPanelSkin(); + AutoHideStripSkin autoHideStripSkin1 = new AutoHideStripSkin(); + DockPanelGradient dockPanelGradient1 = new DockPanelGradient(); + TabGradient tabGradient1 = new TabGradient(); + DockPaneStripSkin dockPaneStripSkin1 = new DockPaneStripSkin(); + DockPaneStripGradient dockPaneStripGradient1 = new DockPaneStripGradient(); + TabGradient tabGradient2 = new TabGradient(); + DockPanelGradient dockPanelGradient2 = new DockPanelGradient(); + TabGradient tabGradient3 = new TabGradient(); + DockPaneStripToolWindowGradient dockPaneStripToolWindowGradient1 = new DockPaneStripToolWindowGradient(); + TabGradient tabGradient4 = new TabGradient(); + TabGradient tabGradient5 = new TabGradient(); + DockPanelGradient dockPanelGradient3 = new DockPanelGradient(); + TabGradient tabGradient6 = new TabGradient(); + TabGradient tabGradient7 = new TabGradient(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LogTabWindow)); - - - - this.statusStrip = new System.Windows.Forms.StatusStrip(); - this.labelLines = new System.Windows.Forms.ToolStripStatusLabel(); - this.labelSize = new System.Windows.Forms.ToolStripStatusLabel(); - this.labelCurrentLine = new System.Windows.Forms.ToolStripStatusLabel(); - this.loadProgessBar = new System.Windows.Forms.ToolStripProgressBar(); - this.labelStatus = new System.Windows.Forms.ToolStripStatusLabel(); - this.mainMenuStrip = new System.Windows.Forms.MenuStrip(); - this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.openURIToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.closeFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.reloadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.newFromClipboardToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator8 = new MenuToolStripSeparatorExtension(); - this.multiFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.multiFileEnabledStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.multifileMaskToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator7 = new MenuToolStripSeparatorExtension(); - this.loadProjectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveProjectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.exportBookmarksToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator14 = new MenuToolStripSeparatorExtension(); - this.lastUsedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.viewNavigateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.goToLineToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.searchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.filterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.bookmarksToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toggleBookmarkToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.jumpToNextToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.jumpToPrevToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.showBookmarkListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.columnFinderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator2 = new MenuToolStripSeparatorExtension(); - this.toolStripEncodingMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripEncodingASCIIItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripEncodingANSIItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripEncodingISO88591Item = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripEncodingUTF8Item = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripEncodingUTF16Item = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator4 = new MenuToolStripSeparatorExtension(); - this.timeshiftToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.timeshiftMenuTextBox = new System.Windows.Forms.ToolStripTextBox(); - this.toolStripSeparator3 = new MenuToolStripSeparatorExtension(); - this.copyMarkedLinesIntoNewTabToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.optionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.columnizerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.hilightingToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator6 = new MenuToolStripSeparatorExtension(); - this.cellSelectModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.alwaysOnTopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.hideLineColumnToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator19 = new MenuToolStripSeparatorExtension(); - this.lockInstanceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.configureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.configureToolStripSeparator = new MenuToolStripSeparatorExtension(); - this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.showHelpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator5 = new MenuToolStripSeparatorExtension(); - this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.debugToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.dumpLogBufferInfoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.dumpBufferDiagnosticToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.runGCToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.gCInfoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator18 = new MenuToolStripSeparatorExtension(); - this.throwExceptionGUIThreadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.throwExceptionbackgroundThToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.throwExceptionBackgroundThreadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator12 = new MenuToolStripSeparatorExtension(); - this.loglevelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.warnToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.infoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.debugToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.disableWordHighlightModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.host = new System.Windows.Forms.CheckBox(); - this.toolStripContainer = new System.Windows.Forms.ToolStripContainer(); - this.dockPanel = new WeifenLuo.WinFormsUI.Docking.DockPanel(); - this.buttonToolStrip = new System.Windows.Forms.ToolStrip(); - this.toolStripButtonOpen = new System.Windows.Forms.ToolStripButton(); - this.toolStripSeparator10 = new LineToolStripSeparatorExtension(); - this.toolStripButtonSearch = new System.Windows.Forms.ToolStripButton(); - this.toolStripButtonFilter = new System.Windows.Forms.ToolStripButton(); - this.toolStripSeparator11 = new LineToolStripSeparatorExtension(); - this.toolStripButtonBookmark = new System.Windows.Forms.ToolStripButton(); - this.toolStripButtonUp = new System.Windows.Forms.ToolStripButton(); - this.toolStripButtonDown = new System.Windows.Forms.ToolStripButton(); - this.toolStripSeparator1 = new LineToolStripSeparatorExtension(); - this.toolStripButtonBubbles = new System.Windows.Forms.ToolStripButton(); - this.toolStripSeparator15 = new LineToolStripSeparatorExtension(); - this.toolStripButtonTail = new System.Windows.Forms.ToolStripButton(); - this.toolStripSeparator17 = new LineToolStripSeparatorExtension(); - this.groupsComboBoxHighlightGroups = new System.Windows.Forms.ToolStripComboBox(); - this.externalToolsToolStrip = new System.Windows.Forms.ToolStrip(); - this.toolStripSeparator9 = new MenuToolStripSeparatorExtension(); - this.checkBoxFollowTail = new System.Windows.Forms.CheckBox(); - this.tabContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); - this.closeThisTabToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.closeOtherTabsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.closeAllTabsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator13 = new MenuToolStripSeparatorExtension(); - this.tabColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.tabRenameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator16 = new MenuToolStripSeparatorExtension(); - this.copyPathToClipboardToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.findInExplorerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.dragControlDateTime = new LogExpert.Dialogs.DateTimeDragControl(); - this.statusStrip.SuspendLayout(); - this.mainMenuStrip.SuspendLayout(); - this.toolStripContainer.ContentPanel.SuspendLayout(); - this.toolStripContainer.TopToolStripPanel.SuspendLayout(); - this.toolStripContainer.SuspendLayout(); - this.buttonToolStrip.SuspendLayout(); - this.tabContextMenuStrip.SuspendLayout(); - this.SuspendLayout(); + statusStrip = new StatusStrip(); + labelLines = new ToolStripStatusLabel(); + labelSize = new ToolStripStatusLabel(); + labelCurrentLine = new ToolStripStatusLabel(); + loadProgessBar = new ToolStripProgressBar(); + labelStatus = new ToolStripStatusLabel(); + mainMenuStrip = new MenuStrip(); + fileToolStripMenuItem = new ToolStripMenuItem(); + openToolStripMenuItem = new ToolStripMenuItem(); + openURIToolStripMenuItem = new ToolStripMenuItem(); + closeFileToolStripMenuItem = new ToolStripMenuItem(); + reloadToolStripMenuItem = new ToolStripMenuItem(); + newFromClipboardToolStripMenuItem = new ToolStripMenuItem(); + menuToolStripSeparatorExtension1 = new MenuToolStripSeparatorExtension(); + multiFileToolStripMenuItem = new ToolStripMenuItem(); + multiFileEnabledStripMenuItem = new ToolStripMenuItem(); + multifileMaskToolStripMenuItem = new ToolStripMenuItem(); + menuToolStripSeparatorExtension2 = new MenuToolStripSeparatorExtension(); + loadProjectToolStripMenuItem = new ToolStripMenuItem(); + saveProjectToolStripMenuItem = new ToolStripMenuItem(); + exportBookmarksToolStripMenuItem = new ToolStripMenuItem(); + menuToolStripSeparatorExtension3 = new MenuToolStripSeparatorExtension(); + lastUsedToolStripMenuItem = new ToolStripMenuItem(); + exitToolStripMenuItem = new ToolStripMenuItem(); + viewNavigateToolStripMenuItem = new ToolStripMenuItem(); + goToLineToolStripMenuItem = new ToolStripMenuItem(); + searchToolStripMenuItem = new ToolStripMenuItem(); + filterToolStripMenuItem = new ToolStripMenuItem(); + bookmarksToolStripMenuItem = new ToolStripMenuItem(); + toggleBookmarkToolStripMenuItem = new ToolStripMenuItem(); + jumpToNextToolStripMenuItem = new ToolStripMenuItem(); + jumpToPrevToolStripMenuItem = new ToolStripMenuItem(); + showBookmarkListToolStripMenuItem = new ToolStripMenuItem(); + columnFinderToolStripMenuItem = new ToolStripMenuItem(); + menuToolStripSeparatorExtension5 = new MenuToolStripSeparatorExtension(); + toolStripEncodingMenuItem = new ToolStripMenuItem(); + toolStripEncodingASCIIItem = new ToolStripMenuItem(); + toolStripEncodingANSIItem = new ToolStripMenuItem(); + toolStripEncodingISO88591Item = new ToolStripMenuItem(); + toolStripEncodingUTF8Item = new ToolStripMenuItem(); + toolStripEncodingUTF16Item = new ToolStripMenuItem(); + menuToolStripSeparatorExtension6 = new MenuToolStripSeparatorExtension(); + timeshiftToolStripMenuItem = new ToolStripMenuItem(); + timeshiftMenuTextBox = new ToolStripTextBox(); + menuToolStripSeparatorExtension4 = new MenuToolStripSeparatorExtension(); + copyMarkedLinesIntoNewTabToolStripMenuItem = new ToolStripMenuItem(); + optionToolStripMenuItem = new ToolStripMenuItem(); + columnizerToolStripMenuItem = new ToolStripMenuItem(); + hilightingToolStripMenuItem1 = new ToolStripMenuItem(); + menuToolStripSeparatorExtension7 = new MenuToolStripSeparatorExtension(); + settingsToolStripMenuItem = new ToolStripMenuItem(); + menuToolStripSeparatorExtension9 = new MenuToolStripSeparatorExtension(); + cellSelectModeToolStripMenuItem = new ToolStripMenuItem(); + alwaysOnTopToolStripMenuItem = new ToolStripMenuItem(); + hideLineColumnToolStripMenuItem = new ToolStripMenuItem(); + menuToolStripSeparatorExtension8 = new MenuToolStripSeparatorExtension(); + lockInstanceToolStripMenuItem = new ToolStripMenuItem(); + toolsToolStripMenuItem = new ToolStripMenuItem(); + configureToolStripMenuItem = new ToolStripMenuItem(); + configureToolStripSeparator = new MenuToolStripSeparatorExtension(); + helpToolStripMenuItem = new ToolStripMenuItem(); + showHelpToolStripMenuItem = new ToolStripMenuItem(); + menuToolStripSeparatorExtension11 = new MenuToolStripSeparatorExtension(); + aboutToolStripMenuItem = new ToolStripMenuItem(); + debugToolStripMenuItem = new ToolStripMenuItem(); + dumpLogBufferInfoToolStripMenuItem = new ToolStripMenuItem(); + dumpBufferDiagnosticToolStripMenuItem = new ToolStripMenuItem(); + runGCToolStripMenuItem = new ToolStripMenuItem(); + gCInfoToolStripMenuItem = new ToolStripMenuItem(); + throwExceptionGUIThreadToolStripMenuItem = new ToolStripMenuItem(); + throwExceptionbackgroundThToolStripMenuItem = new ToolStripMenuItem(); + throwExceptionBackgroundThreadToolStripMenuItem = new ToolStripMenuItem(); + loglevelToolStripMenuItem = new ToolStripMenuItem(); + warnToolStripMenuItem = new ToolStripMenuItem(); + infoToolStripMenuItem = new ToolStripMenuItem(); + debugToolStripMenuItem1 = new ToolStripMenuItem(); + disableWordHighlightModeToolStripMenuItem = new ToolStripMenuItem(); + host = new CheckBox(); + toolStripContainer = new ToolStripContainer(); + dockPanel = new DockPanel(); + externalToolsToolStrip = new ToolStrip(); + buttonToolStrip = new ToolStrip(); + toolStripButtonOpen = new ToolStripButton(); + lineToolStripSeparatorExtension1 = new LineToolStripSeparatorExtension(); + toolStripButtonSearch = new ToolStripButton(); + toolStripButtonFilter = new ToolStripButton(); + lineToolStripSeparatorExtension2 = new LineToolStripSeparatorExtension(); + toolStripButtonBookmark = new ToolStripButton(); + toolStripButtonUp = new ToolStripButton(); + toolStripButtonDown = new ToolStripButton(); + lineToolStripSeparatorExtension3 = new LineToolStripSeparatorExtension(); + toolStripButtonBubbles = new ToolStripButton(); + lineToolStripSeparatorExtension4 = new LineToolStripSeparatorExtension(); + toolStripButtonTail = new ToolStripButton(); + lineToolStripSeparatorExtension5 = new LineToolStripSeparatorExtension(); + groupsComboBoxHighlightGroups = new ToolStripComboBox(); + checkBoxFollowTail = new CheckBox(); + tabContextMenuStrip = new ContextMenuStrip(components); + closeThisTabToolStripMenuItem = new ToolStripMenuItem(); + closeOtherTabsToolStripMenuItem = new ToolStripMenuItem(); + closeAllTabsToolStripMenuItem = new ToolStripMenuItem(); + tabColorToolStripMenuItem = new ToolStripMenuItem(); + tabRenameToolStripMenuItem = new ToolStripMenuItem(); + copyPathToClipboardToolStripMenuItem = new ToolStripMenuItem(); + findInExplorerToolStripMenuItem = new ToolStripMenuItem(); + dragControlDateTime = new DateTimeDragControl(); + statusStrip.SuspendLayout(); + mainMenuStrip.SuspendLayout(); + toolStripContainer.ContentPanel.SuspendLayout(); + toolStripContainer.TopToolStripPanel.SuspendLayout(); + toolStripContainer.SuspendLayout(); + buttonToolStrip.SuspendLayout(); + tabContextMenuStrip.SuspendLayout(); + SuspendLayout(); // // statusStrip // - this.statusStrip.AutoSize = false; - this.statusStrip.BackColor = System.Drawing.SystemColors.Control; - this.statusStrip.ImageScalingSize = new System.Drawing.Size(24, 24); - this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.labelLines, - this.labelSize, - this.labelCurrentLine, - this.loadProgessBar, - this.labelStatus}); - this.statusStrip.Location = new System.Drawing.Point(0, 623); - this.statusStrip.Name = "statusStrip"; - this.statusStrip.Padding = new System.Windows.Forms.Padding(2, 0, 19, 0); - this.statusStrip.Size = new System.Drawing.Size(1283, 28); - this.statusStrip.SizingGrip = false; - this.statusStrip.TabIndex = 5; - this.statusStrip.Text = "statusStrip1"; + statusStrip.AutoSize = false; + statusStrip.ImageScalingSize = new System.Drawing.Size(24, 24); + statusStrip.Items.AddRange(new ToolStripItem[] { labelLines, labelSize, labelCurrentLine, loadProgessBar, labelStatus }); + statusStrip.Location = new System.Drawing.Point(0, 954); + statusStrip.Name = "statusStrip"; + statusStrip.Padding = new Padding(3, 0, 23, 0); + statusStrip.Size = new System.Drawing.Size(1603, 63); + statusStrip.SizingGrip = false; + statusStrip.TabIndex = 5; + statusStrip.Text = "statusStrip1"; // // labelLines // - this.labelLines.AutoSize = false; - this.labelLines.BorderSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Top) - | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) - | System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom))); - this.labelLines.BorderStyle = System.Windows.Forms.Border3DStyle.SunkenOuter; - this.labelLines.Name = "labelLines"; - this.labelLines.Size = new System.Drawing.Size(90, 22); - this.labelLines.Text = "0"; + labelLines.AutoSize = false; + labelLines.BorderSides = ToolStripStatusLabelBorderSides.Left | ToolStripStatusLabelBorderSides.Top | ToolStripStatusLabelBorderSides.Right | ToolStripStatusLabelBorderSides.Bottom; + labelLines.BorderStyle = Border3DStyle.SunkenOuter; + labelLines.Name = "labelLines"; + labelLines.Size = new System.Drawing.Size(26, 58); + labelLines.Text = "0"; // // labelSize // - this.labelSize.AutoSize = false; - this.labelSize.BorderSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Top) - | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) - | System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom))); - this.labelSize.BorderStyle = System.Windows.Forms.Border3DStyle.SunkenOuter; - this.labelSize.Name = "labelSize"; - this.labelSize.Size = new System.Drawing.Size(90, 22); - this.labelSize.Text = "0"; + labelSize.AutoSize = false; + labelSize.BorderSides = ToolStripStatusLabelBorderSides.Left | ToolStripStatusLabelBorderSides.Top | ToolStripStatusLabelBorderSides.Right | ToolStripStatusLabelBorderSides.Bottom; + labelSize.BorderStyle = Border3DStyle.SunkenOuter; + labelSize.Name = "labelSize"; + labelSize.Size = new System.Drawing.Size(26, 58); + labelSize.Text = "0"; // // labelCurrentLine // - this.labelCurrentLine.AutoSize = false; - this.labelCurrentLine.BorderSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Top) - | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) - | System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom))); - this.labelCurrentLine.BorderStyle = System.Windows.Forms.Border3DStyle.SunkenOuter; - this.labelCurrentLine.Name = "labelCurrentLine"; - this.labelCurrentLine.Size = new System.Drawing.Size(90, 22); - this.labelCurrentLine.Text = "L:"; + labelCurrentLine.AutoSize = false; + labelCurrentLine.BorderSides = ToolStripStatusLabelBorderSides.Left | ToolStripStatusLabelBorderSides.Top | ToolStripStatusLabelBorderSides.Right | ToolStripStatusLabelBorderSides.Bottom; + labelCurrentLine.BorderStyle = Border3DStyle.SunkenOuter; + labelCurrentLine.Name = "labelCurrentLine"; + labelCurrentLine.Size = new System.Drawing.Size(28, 58); + labelCurrentLine.Text = "L:"; // // loadProgessBar // - this.loadProgessBar.Name = "loadProgessBar"; - this.loadProgessBar.Size = new System.Drawing.Size(67, 20); + loadProgessBar.Name = "loadProgessBar"; + loadProgessBar.Size = new System.Drawing.Size(83, 57); // // labelStatus // - this.labelStatus.Name = "labelStatus"; - this.labelStatus.Size = new System.Drawing.Size(50, 22); - this.labelStatus.Text = "Ready"; + labelStatus.Name = "labelStatus"; + labelStatus.Size = new System.Drawing.Size(39, 58); + labelStatus.Text = "Ready"; // // mainMenuStrip // - this.mainMenuStrip.AllowMerge = false; - this.mainMenuStrip.BackColor = System.Drawing.SystemColors.Control; - this.mainMenuStrip.Dock = System.Windows.Forms.DockStyle.None; - this.mainMenuStrip.ImageScalingSize = new System.Drawing.Size(24, 24); - this.mainMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fileToolStripMenuItem, - this.viewNavigateToolStripMenuItem, - this.toolsToolStripMenuItem, - this.optionToolStripMenuItem, - this.helpToolStripMenuItem, - this.debugToolStripMenuItem}); - this.mainMenuStrip.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.Flow; - this.mainMenuStrip.Location = new System.Drawing.Point(0, 31); - this.mainMenuStrip.Name = "mainMenuStrip"; - this.mainMenuStrip.Size = new System.Drawing.Size(1283, 28); - this.mainMenuStrip.TabIndex = 6; - this.mainMenuStrip.Text = "menuStrip1"; + mainMenuStrip.AllowMerge = false; + mainMenuStrip.Dock = DockStyle.None; + mainMenuStrip.ImageScalingSize = new System.Drawing.Size(24, 24); + mainMenuStrip.Items.AddRange(new ToolStripItem[] { fileToolStripMenuItem, viewNavigateToolStripMenuItem, optionToolStripMenuItem, toolsToolStripMenuItem, helpToolStripMenuItem, debugToolStripMenuItem }); + mainMenuStrip.LayoutStyle = ToolStripLayoutStyle.Flow; + mainMenuStrip.Location = new System.Drawing.Point(0, 19); + mainMenuStrip.Name = "mainMenuStrip"; + mainMenuStrip.Size = new System.Drawing.Size(1603, 23); + mainMenuStrip.TabIndex = 6; + mainMenuStrip.Text = "menuStrip1"; // // fileToolStripMenuItem // - this.fileToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.openToolStripMenuItem, - this.openURIToolStripMenuItem, - this.closeFileToolStripMenuItem, - this.reloadToolStripMenuItem, - this.newFromClipboardToolStripMenuItem, - this.toolStripSeparator8, - this.multiFileToolStripMenuItem, - this.toolStripSeparator7, - this.loadProjectToolStripMenuItem, - this.saveProjectToolStripMenuItem, - this.exportBookmarksToolStripMenuItem, - this.toolStripSeparator14, - this.lastUsedToolStripMenuItem, - this.exitToolStripMenuItem}); - this.fileToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(46, 24); - this.fileToolStripMenuItem.Text = "File"; - this.fileToolStripMenuItem.DropDownOpening += new System.EventHandler(this.OnFileToolStripMenuItemDropDownOpening); + fileToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { openToolStripMenuItem, openURIToolStripMenuItem, closeFileToolStripMenuItem, reloadToolStripMenuItem, newFromClipboardToolStripMenuItem, menuToolStripSeparatorExtension1, multiFileToolStripMenuItem, menuToolStripSeparatorExtension2, loadProjectToolStripMenuItem, saveProjectToolStripMenuItem, exportBookmarksToolStripMenuItem, menuToolStripSeparatorExtension3, lastUsedToolStripMenuItem, exitToolStripMenuItem }); + fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + fileToolStripMenuItem.Size = new System.Drawing.Size(37, 19); + fileToolStripMenuItem.Text = "File"; + fileToolStripMenuItem.DropDownOpening += OnFileToolStripMenuItemDropDownOpening; // // openToolStripMenuItem // - this.openToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.openToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.openToolStripMenuItem.Image = global::LogExpert.Properties.Resources.folder_blue; - this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); - this.openToolStripMenuItem.Size = new System.Drawing.Size(305, 26); - this.openToolStripMenuItem.Text = "Open..."; - this.openToolStripMenuItem.Click += new System.EventHandler(this.OnOpenToolStripMenuItemClick); + openToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; + openToolStripMenuItem.Image = Resources.File_open; + openToolStripMenuItem.Name = "openToolStripMenuItem"; + openToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.O; + openToolStripMenuItem.Size = new System.Drawing.Size(253, 30); + openToolStripMenuItem.Text = "Open..."; + openToolStripMenuItem.Click += OnOpenToolStripMenuItemClick; // // openURIToolStripMenuItem // - this.openURIToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.openURIToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.openURIToolStripMenuItem.Name = "openURIToolStripMenuItem"; - this.openURIToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.U))); - this.openURIToolStripMenuItem.Size = new System.Drawing.Size(305, 26); - this.openURIToolStripMenuItem.Text = "Open URL..."; - this.openURIToolStripMenuItem.ToolTipText = "Opens a file by entering a URL which is supported by a file system plugin"; - this.openURIToolStripMenuItem.Click += new System.EventHandler(this.OnOpenURIToolStripMenuItemClick); + openURIToolStripMenuItem.Name = "openURIToolStripMenuItem"; + openURIToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.U; + openURIToolStripMenuItem.Size = new System.Drawing.Size(253, 30); + openURIToolStripMenuItem.Text = "Open URL..."; + openURIToolStripMenuItem.ToolTipText = "Opens a file by entering a URL which is supported by a file system plugin"; + openURIToolStripMenuItem.Click += OnOpenURIToolStripMenuItemClick; // // closeFileToolStripMenuItem // - this.closeFileToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.closeFileToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.closeFileToolStripMenuItem.Name = "closeFileToolStripMenuItem"; - this.closeFileToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F4))); - this.closeFileToolStripMenuItem.Size = new System.Drawing.Size(305, 26); - this.closeFileToolStripMenuItem.Text = "Close File"; - this.closeFileToolStripMenuItem.Click += new System.EventHandler(this.OnCloseFileToolStripMenuItemClick); + closeFileToolStripMenuItem.Image = Resources.Close; + closeFileToolStripMenuItem.Name = "closeFileToolStripMenuItem"; + closeFileToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.F4; + closeFileToolStripMenuItem.Size = new System.Drawing.Size(253, 30); + closeFileToolStripMenuItem.Text = "Close File"; + closeFileToolStripMenuItem.Click += OnCloseFileToolStripMenuItemClick; // // reloadToolStripMenuItem // - this.reloadToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.reloadToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.reloadToolStripMenuItem.Name = "reloadToolStripMenuItem"; - this.reloadToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F5; - this.reloadToolStripMenuItem.Size = new System.Drawing.Size(305, 26); - this.reloadToolStripMenuItem.Text = "Reload"; - this.reloadToolStripMenuItem.Click += new System.EventHandler(this.OnReloadToolStripMenuItemClick); + reloadToolStripMenuItem.Image = Resources.Restart_alt; + reloadToolStripMenuItem.Name = "reloadToolStripMenuItem"; + reloadToolStripMenuItem.ShortcutKeys = Keys.F5; + reloadToolStripMenuItem.Size = new System.Drawing.Size(253, 30); + reloadToolStripMenuItem.Text = "Reload"; + reloadToolStripMenuItem.Click += OnReloadToolStripMenuItemClick; // // newFromClipboardToolStripMenuItem // - this.newFromClipboardToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.newFromClipboardToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.newFromClipboardToolStripMenuItem.Name = "newFromClipboardToolStripMenuItem"; - this.newFromClipboardToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); - this.newFromClipboardToolStripMenuItem.Size = new System.Drawing.Size(305, 26); - this.newFromClipboardToolStripMenuItem.Text = "New tab from clipboard"; - this.newFromClipboardToolStripMenuItem.ToolTipText = "Creates a new tab with content from clipboard"; - this.newFromClipboardToolStripMenuItem.Click += new System.EventHandler(this.OnNewFromClipboardToolStripMenuItemClick); + newFromClipboardToolStripMenuItem.Name = "newFromClipboardToolStripMenuItem"; + newFromClipboardToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.N; + newFromClipboardToolStripMenuItem.Size = new System.Drawing.Size(253, 30); + newFromClipboardToolStripMenuItem.Text = "New tab from clipboard"; + newFromClipboardToolStripMenuItem.ToolTipText = "Creates a new tab with content from clipboard"; + newFromClipboardToolStripMenuItem.Click += OnNewFromClipboardToolStripMenuItemClick; // - // toolStripSeparator8 + // menuToolStripSeparatorExtension1 // - this.toolStripSeparator8.BackColor = System.Drawing.SystemColors.Control; - this.toolStripSeparator8.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.toolStripSeparator8.Name = "toolStripSeparator8"; - this.toolStripSeparator8.Size = new System.Drawing.Size(302, 6); + menuToolStripSeparatorExtension1.Name = "menuToolStripSeparatorExtension1"; + menuToolStripSeparatorExtension1.Size = new System.Drawing.Size(250, 6); // // multiFileToolStripMenuItem // - this.multiFileToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.multiFileToolStripMenuItem.CheckOnClick = true; - this.multiFileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.multiFileEnabledStripMenuItem, - this.multifileMaskToolStripMenuItem}); - this.multiFileToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.multiFileToolStripMenuItem.Name = "multiFileToolStripMenuItem"; - this.multiFileToolStripMenuItem.Size = new System.Drawing.Size(305, 26); - this.multiFileToolStripMenuItem.Text = "MultiFile"; - this.multiFileToolStripMenuItem.ToolTipText = "Treat multiple files as one large file (e.g. data.log, data.log.1, data.log.2,..." + - ")"; - this.multiFileToolStripMenuItem.Click += new System.EventHandler(this.OnMultiFileToolStripMenuItemClick); + multiFileToolStripMenuItem.CheckOnClick = true; + multiFileToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { multiFileEnabledStripMenuItem, multifileMaskToolStripMenuItem }); + multiFileToolStripMenuItem.Name = "multiFileToolStripMenuItem"; + multiFileToolStripMenuItem.Size = new System.Drawing.Size(253, 30); + multiFileToolStripMenuItem.Text = "MultiFile"; + multiFileToolStripMenuItem.ToolTipText = "Treat multiple files as one large file (e.g. data.log, data.log.1, data.log.2,...)"; + multiFileToolStripMenuItem.Click += OnMultiFileToolStripMenuItemClick; // // multiFileEnabledStripMenuItem // - this.multiFileEnabledStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.multiFileEnabledStripMenuItem.CheckOnClick = true; - this.multiFileEnabledStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.multiFileEnabledStripMenuItem.Name = "multiFileEnabledStripMenuItem"; - this.multiFileEnabledStripMenuItem.Size = new System.Drawing.Size(203, 26); - this.multiFileEnabledStripMenuItem.Text = "Enable MultiFile"; - this.multiFileEnabledStripMenuItem.Click += new System.EventHandler(this.OnMultiFileEnabledStripMenuItemClick); + multiFileEnabledStripMenuItem.BackColor = System.Drawing.SystemColors.Control; + multiFileEnabledStripMenuItem.CheckOnClick = true; + multiFileEnabledStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + multiFileEnabledStripMenuItem.Name = "multiFileEnabledStripMenuItem"; + multiFileEnabledStripMenuItem.Size = new System.Drawing.Size(165, 22); + multiFileEnabledStripMenuItem.Text = "Enable MultiFile"; + multiFileEnabledStripMenuItem.Click += OnMultiFileEnabledStripMenuItemClick; // // multifileMaskToolStripMenuItem // - this.multifileMaskToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.multifileMaskToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.multifileMaskToolStripMenuItem.Name = "multifileMaskToolStripMenuItem"; - this.multifileMaskToolStripMenuItem.Size = new System.Drawing.Size(203, 26); - this.multifileMaskToolStripMenuItem.Text = "File name mask..."; - this.multifileMaskToolStripMenuItem.Click += new System.EventHandler(this.OnMultiFileMaskToolStripMenuItemClick); + multifileMaskToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; + multifileMaskToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + multifileMaskToolStripMenuItem.Name = "multifileMaskToolStripMenuItem"; + multifileMaskToolStripMenuItem.Size = new System.Drawing.Size(165, 22); + multifileMaskToolStripMenuItem.Text = "File name mask..."; + multifileMaskToolStripMenuItem.Click += OnMultiFileMaskToolStripMenuItemClick; // - // toolStripSeparator7 + // menuToolStripSeparatorExtension2 // - this.toolStripSeparator7.Name = "toolStripSeparator7"; - this.toolStripSeparator7.Size = new System.Drawing.Size(302, 6); + menuToolStripSeparatorExtension2.Name = "menuToolStripSeparatorExtension2"; + menuToolStripSeparatorExtension2.Size = new System.Drawing.Size(250, 6); // // loadProjectToolStripMenuItem // - this.loadProjectToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.loadProjectToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.loadProjectToolStripMenuItem.Name = "loadProjectToolStripMenuItem"; - this.loadProjectToolStripMenuItem.Size = new System.Drawing.Size(305, 26); - this.loadProjectToolStripMenuItem.Text = "Load session..."; - this.loadProjectToolStripMenuItem.ToolTipText = "Load a saved session (list of log files)"; - this.loadProjectToolStripMenuItem.Click += new System.EventHandler(this.OnLoadProjectToolStripMenuItemClick); + loadProjectToolStripMenuItem.Name = "loadProjectToolStripMenuItem"; + loadProjectToolStripMenuItem.Size = new System.Drawing.Size(253, 30); + loadProjectToolStripMenuItem.Text = "Load session..."; + loadProjectToolStripMenuItem.ToolTipText = "Load a saved session (list of log files)"; + loadProjectToolStripMenuItem.Click += OnLoadProjectToolStripMenuItemClick; // // saveProjectToolStripMenuItem // - this.saveProjectToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.saveProjectToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.saveProjectToolStripMenuItem.Name = "saveProjectToolStripMenuItem"; - this.saveProjectToolStripMenuItem.Size = new System.Drawing.Size(305, 26); - this.saveProjectToolStripMenuItem.Text = "Save session..."; - this.saveProjectToolStripMenuItem.ToolTipText = "Save a session (all open tabs)"; - this.saveProjectToolStripMenuItem.Click += new System.EventHandler(this.OnSaveProjectToolStripMenuItemClick); + saveProjectToolStripMenuItem.Name = "saveProjectToolStripMenuItem"; + saveProjectToolStripMenuItem.Size = new System.Drawing.Size(253, 30); + saveProjectToolStripMenuItem.Text = "Save session..."; + saveProjectToolStripMenuItem.ToolTipText = "Save a session (all open tabs)"; + saveProjectToolStripMenuItem.Click += OnSaveProjectToolStripMenuItemClick; // // exportBookmarksToolStripMenuItem // - this.exportBookmarksToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.exportBookmarksToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.exportBookmarksToolStripMenuItem.Name = "exportBookmarksToolStripMenuItem"; - this.exportBookmarksToolStripMenuItem.Size = new System.Drawing.Size(305, 26); - this.exportBookmarksToolStripMenuItem.Text = "Export bookmarks..."; - this.exportBookmarksToolStripMenuItem.ToolTipText = "Write a list of bookmarks and their comments to a CSV file"; - this.exportBookmarksToolStripMenuItem.Click += new System.EventHandler(this.OnExportBookmarksToolStripMenuItemClick); + exportBookmarksToolStripMenuItem.Name = "exportBookmarksToolStripMenuItem"; + exportBookmarksToolStripMenuItem.Size = new System.Drawing.Size(253, 30); + exportBookmarksToolStripMenuItem.Text = "Export bookmarks..."; + exportBookmarksToolStripMenuItem.ToolTipText = "Write a list of bookmarks and their comments to a CSV file"; + exportBookmarksToolStripMenuItem.Click += OnExportBookmarksToolStripMenuItemClick; // - // toolStripSeparator14 + // menuToolStripSeparatorExtension3 // - this.toolStripSeparator14.Name = "toolStripSeparator14"; - this.toolStripSeparator14.Size = new System.Drawing.Size(302, 6); + menuToolStripSeparatorExtension3.Name = "menuToolStripSeparatorExtension3"; + menuToolStripSeparatorExtension3.Size = new System.Drawing.Size(250, 6); // // lastUsedToolStripMenuItem // - this.lastUsedToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.lastUsedToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.lastUsedToolStripMenuItem.Name = "lastUsedToolStripMenuItem"; - this.lastUsedToolStripMenuItem.Size = new System.Drawing.Size(305, 26); - this.lastUsedToolStripMenuItem.Text = "Last used"; + lastUsedToolStripMenuItem.Name = "lastUsedToolStripMenuItem"; + lastUsedToolStripMenuItem.Size = new System.Drawing.Size(253, 30); + lastUsedToolStripMenuItem.Text = "Last used"; // // exitToolStripMenuItem // - this.exitToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.exitToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4))); - this.exitToolStripMenuItem.Size = new System.Drawing.Size(305, 26); - this.exitToolStripMenuItem.Text = "Exit"; - this.exitToolStripMenuItem.Click += new System.EventHandler(this.OnExitToolStripMenuItemClick); + exitToolStripMenuItem.Image = Resources.Exit; + exitToolStripMenuItem.Name = "exitToolStripMenuItem"; + exitToolStripMenuItem.ShortcutKeys = Keys.Alt | Keys.F4; + exitToolStripMenuItem.Size = new System.Drawing.Size(253, 30); + exitToolStripMenuItem.Text = "Exit"; + exitToolStripMenuItem.Click += OnExitToolStripMenuItemClick; // // viewNavigateToolStripMenuItem // - this.viewNavigateToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.viewNavigateToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.goToLineToolStripMenuItem, - this.searchToolStripMenuItem, - this.filterToolStripMenuItem, - this.bookmarksToolStripMenuItem, - this.columnFinderToolStripMenuItem, - this.toolStripSeparator2, - this.toolStripEncodingMenuItem, - this.toolStripSeparator4, - this.timeshiftToolStripMenuItem, - this.timeshiftMenuTextBox, - this.toolStripSeparator3, - this.copyMarkedLinesIntoNewTabToolStripMenuItem}); - this.viewNavigateToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.viewNavigateToolStripMenuItem.Name = "viewNavigateToolStripMenuItem"; - this.viewNavigateToolStripMenuItem.Size = new System.Drawing.Size(121, 24); - this.viewNavigateToolStripMenuItem.Text = "View/Navigate"; + viewNavigateToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { goToLineToolStripMenuItem, searchToolStripMenuItem, filterToolStripMenuItem, bookmarksToolStripMenuItem, columnFinderToolStripMenuItem, menuToolStripSeparatorExtension5, toolStripEncodingMenuItem, menuToolStripSeparatorExtension6, timeshiftToolStripMenuItem, timeshiftMenuTextBox, menuToolStripSeparatorExtension4, copyMarkedLinesIntoNewTabToolStripMenuItem }); + viewNavigateToolStripMenuItem.Name = "viewNavigateToolStripMenuItem"; + viewNavigateToolStripMenuItem.Size = new System.Drawing.Size(96, 19); + viewNavigateToolStripMenuItem.Text = "View/Navigate"; // // goToLineToolStripMenuItem // - this.goToLineToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.goToLineToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.goToLineToolStripMenuItem.Name = "goToLineToolStripMenuItem"; - this.goToLineToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.G))); - this.goToLineToolStripMenuItem.Size = new System.Drawing.Size(221, 26); - this.goToLineToolStripMenuItem.Text = "Go to line..."; - this.goToLineToolStripMenuItem.Click += new System.EventHandler(this.OnGoToLineToolStripMenuItemClick); + goToLineToolStripMenuItem.Name = "goToLineToolStripMenuItem"; + goToLineToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.G; + goToLineToolStripMenuItem.Size = new System.Drawing.Size(189, 30); + goToLineToolStripMenuItem.Text = "Go to line..."; + goToLineToolStripMenuItem.Click += OnGoToLineToolStripMenuItemClick; // // searchToolStripMenuItem // - this.searchToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.searchToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.searchToolStripMenuItem.Name = "searchToolStripMenuItem"; - this.searchToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F))); - this.searchToolStripMenuItem.Size = new System.Drawing.Size(221, 26); - this.searchToolStripMenuItem.Text = "Search..."; - this.searchToolStripMenuItem.Click += new System.EventHandler(this.OnSearchToolStripMenuItemClick); + searchToolStripMenuItem.Name = "searchToolStripMenuItem"; + searchToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.F; + searchToolStripMenuItem.Size = new System.Drawing.Size(189, 30); + searchToolStripMenuItem.Text = "Search..."; + searchToolStripMenuItem.Click += OnSearchToolStripMenuItemClick; // // filterToolStripMenuItem // - this.filterToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.filterToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.filterToolStripMenuItem.Image = global::LogExpert.Properties.Resources.search_blue; - this.filterToolStripMenuItem.Name = "filterToolStripMenuItem"; - this.filterToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F4; - this.filterToolStripMenuItem.Size = new System.Drawing.Size(221, 26); - this.filterToolStripMenuItem.Text = "Filter"; - this.filterToolStripMenuItem.Click += new System.EventHandler(this.OnFilterToolStripMenuItemClick); + filterToolStripMenuItem.Image = Resources.Filter; + filterToolStripMenuItem.Name = "filterToolStripMenuItem"; + filterToolStripMenuItem.ShortcutKeys = Keys.F4; + filterToolStripMenuItem.Size = new System.Drawing.Size(189, 30); + filterToolStripMenuItem.Text = "Filter"; + filterToolStripMenuItem.Click += OnFilterToolStripMenuItemClick; // // bookmarksToolStripMenuItem // - this.bookmarksToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.bookmarksToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toggleBookmarkToolStripMenuItem, - this.jumpToNextToolStripMenuItem, - this.jumpToPrevToolStripMenuItem, - this.showBookmarkListToolStripMenuItem}); - this.bookmarksToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.bookmarksToolStripMenuItem.Name = "bookmarksToolStripMenuItem"; - this.bookmarksToolStripMenuItem.Size = new System.Drawing.Size(221, 26); - this.bookmarksToolStripMenuItem.Text = "Bookmarks"; + bookmarksToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { toggleBookmarkToolStripMenuItem, jumpToNextToolStripMenuItem, jumpToPrevToolStripMenuItem, showBookmarkListToolStripMenuItem }); + bookmarksToolStripMenuItem.Name = "bookmarksToolStripMenuItem"; + bookmarksToolStripMenuItem.Size = new System.Drawing.Size(189, 30); + bookmarksToolStripMenuItem.Text = "Bookmarks"; // // toggleBookmarkToolStripMenuItem // - this.toggleBookmarkToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.toggleBookmarkToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.toggleBookmarkToolStripMenuItem.Image = global::LogExpert.Properties.Resources.check_blue; - this.toggleBookmarkToolStripMenuItem.Name = "toggleBookmarkToolStripMenuItem"; - this.toggleBookmarkToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F2))); - this.toggleBookmarkToolStripMenuItem.Size = new System.Drawing.Size(266, 26); - this.toggleBookmarkToolStripMenuItem.Text = "Toggle Bookmark"; - this.toggleBookmarkToolStripMenuItem.Click += new System.EventHandler(this.OnToggleBookmarkToolStripMenuItemClick); + toggleBookmarkToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; + toggleBookmarkToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + toggleBookmarkToolStripMenuItem.Image = Resources.Bookmark_add; + toggleBookmarkToolStripMenuItem.Name = "toggleBookmarkToolStripMenuItem"; + toggleBookmarkToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.F2; + toggleBookmarkToolStripMenuItem.Size = new System.Drawing.Size(253, 30); + toggleBookmarkToolStripMenuItem.Text = "Toggle Bookmark"; + toggleBookmarkToolStripMenuItem.Click += OnToggleBookmarkToolStripMenuItemClick; // // jumpToNextToolStripMenuItem // - this.jumpToNextToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.jumpToNextToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.jumpToNextToolStripMenuItem.Image = global::LogExpert.Properties.Resources.down_blue; - this.jumpToNextToolStripMenuItem.Name = "jumpToNextToolStripMenuItem"; - this.jumpToNextToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F2; - this.jumpToNextToolStripMenuItem.Size = new System.Drawing.Size(266, 26); - this.jumpToNextToolStripMenuItem.Text = "Jump to next"; - this.jumpToNextToolStripMenuItem.Click += new System.EventHandler(this.OnJumpToNextToolStripMenuItemClick); + jumpToNextToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; + jumpToNextToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + jumpToNextToolStripMenuItem.Image = Resources.ArrowDown; + jumpToNextToolStripMenuItem.Name = "jumpToNextToolStripMenuItem"; + jumpToNextToolStripMenuItem.ShortcutKeys = Keys.F2; + jumpToNextToolStripMenuItem.Size = new System.Drawing.Size(253, 30); + jumpToNextToolStripMenuItem.Text = "Jump to next"; + jumpToNextToolStripMenuItem.Click += OnJumpToNextToolStripMenuItemClick; // // jumpToPrevToolStripMenuItem // - this.jumpToPrevToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.jumpToPrevToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.jumpToPrevToolStripMenuItem.Image = global::LogExpert.Properties.Resources.up_blue; - this.jumpToPrevToolStripMenuItem.Name = "jumpToPrevToolStripMenuItem"; - this.jumpToPrevToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Shift | System.Windows.Forms.Keys.F2))); - this.jumpToPrevToolStripMenuItem.Size = new System.Drawing.Size(266, 26); - this.jumpToPrevToolStripMenuItem.Text = "Jump to prev"; - this.jumpToPrevToolStripMenuItem.Click += new System.EventHandler(this.OnJumpToPrevToolStripMenuItemClick); + jumpToPrevToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; + jumpToPrevToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + jumpToPrevToolStripMenuItem.Image = Resources.ArrowUp; + jumpToPrevToolStripMenuItem.Name = "jumpToPrevToolStripMenuItem"; + jumpToPrevToolStripMenuItem.ShortcutKeys = Keys.Shift | Keys.F2; + jumpToPrevToolStripMenuItem.Size = new System.Drawing.Size(253, 30); + jumpToPrevToolStripMenuItem.Text = "Jump to prev"; + jumpToPrevToolStripMenuItem.Click += OnJumpToPrevToolStripMenuItemClick; // // showBookmarkListToolStripMenuItem // - this.showBookmarkListToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.showBookmarkListToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.showBookmarkListToolStripMenuItem.Name = "showBookmarkListToolStripMenuItem"; - this.showBookmarkListToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F6; - this.showBookmarkListToolStripMenuItem.Size = new System.Drawing.Size(266, 26); - this.showBookmarkListToolStripMenuItem.Text = "Bookmark list"; - this.showBookmarkListToolStripMenuItem.Click += new System.EventHandler(this.OnShowBookmarkListToolStripMenuItemClick); + showBookmarkListToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; + showBookmarkListToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + showBookmarkListToolStripMenuItem.Name = "showBookmarkListToolStripMenuItem"; + showBookmarkListToolStripMenuItem.ShortcutKeys = Keys.F6; + showBookmarkListToolStripMenuItem.Size = new System.Drawing.Size(253, 30); + showBookmarkListToolStripMenuItem.Text = "Bookmark list"; + showBookmarkListToolStripMenuItem.Click += OnShowBookmarkListToolStripMenuItemClick; // // columnFinderToolStripMenuItem // - this.columnFinderToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.columnFinderToolStripMenuItem.CheckOnClick = true; - this.columnFinderToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.columnFinderToolStripMenuItem.Name = "columnFinderToolStripMenuItem"; - this.columnFinderToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F8; - this.columnFinderToolStripMenuItem.Size = new System.Drawing.Size(221, 26); - this.columnFinderToolStripMenuItem.Text = "Column finder"; - this.columnFinderToolStripMenuItem.Click += new System.EventHandler(this.OnColumnFinderToolStripMenuItemClick); + columnFinderToolStripMenuItem.CheckOnClick = true; + columnFinderToolStripMenuItem.Name = "columnFinderToolStripMenuItem"; + columnFinderToolStripMenuItem.ShortcutKeys = Keys.F8; + columnFinderToolStripMenuItem.Size = new System.Drawing.Size(189, 30); + columnFinderToolStripMenuItem.Text = "Column finder"; + columnFinderToolStripMenuItem.Click += OnColumnFinderToolStripMenuItemClick; // - // toolStripSeparator2 + // menuToolStripSeparatorExtension5 // - this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(218, 6); + menuToolStripSeparatorExtension5.Name = "menuToolStripSeparatorExtension5"; + menuToolStripSeparatorExtension5.Size = new System.Drawing.Size(186, 6); // // toolStripEncodingMenuItem // - this.toolStripEncodingMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.toolStripEncodingMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripEncodingASCIIItem, - this.toolStripEncodingANSIItem, - this.toolStripEncodingISO88591Item, - this.toolStripEncodingUTF8Item, - this.toolStripEncodingUTF16Item}); - this.toolStripEncodingMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.toolStripEncodingMenuItem.Name = "toolStripEncodingMenuItem"; - this.toolStripEncodingMenuItem.Size = new System.Drawing.Size(221, 26); - this.toolStripEncodingMenuItem.Text = "Encoding"; + toolStripEncodingMenuItem.DropDownItems.AddRange(new ToolStripItem[] { toolStripEncodingASCIIItem, toolStripEncodingANSIItem, toolStripEncodingISO88591Item, toolStripEncodingUTF8Item, toolStripEncodingUTF16Item }); + toolStripEncodingMenuItem.Name = "toolStripEncodingMenuItem"; + toolStripEncodingMenuItem.Size = new System.Drawing.Size(189, 30); + toolStripEncodingMenuItem.Text = "Encoding"; // // toolStripEncodingASCIIItem // - this.toolStripEncodingASCIIItem.BackColor = System.Drawing.SystemColors.Control; - this.toolStripEncodingASCIIItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.toolStripEncodingASCIIItem.Name = "toolStripEncodingASCIIItem"; - this.toolStripEncodingASCIIItem.Size = new System.Drawing.Size(167, 26); - this.toolStripEncodingASCIIItem.Tag = ""; - this.toolStripEncodingASCIIItem.Text = "ASCII"; - this.toolStripEncodingASCIIItem.Click += new System.EventHandler(this.OnASCIIToolStripMenuItemClick); + toolStripEncodingASCIIItem.BackColor = System.Drawing.SystemColors.Control; + toolStripEncodingASCIIItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + toolStripEncodingASCIIItem.Name = "toolStripEncodingASCIIItem"; + toolStripEncodingASCIIItem.Size = new System.Drawing.Size(132, 22); + toolStripEncodingASCIIItem.Tag = ""; + toolStripEncodingASCIIItem.Text = "ASCII"; + toolStripEncodingASCIIItem.Click += OnASCIIToolStripMenuItemClick; // // toolStripEncodingANSIItem // - this.toolStripEncodingANSIItem.BackColor = System.Drawing.SystemColors.Control; - this.toolStripEncodingANSIItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.toolStripEncodingANSIItem.Name = "toolStripEncodingANSIItem"; - this.toolStripEncodingANSIItem.Size = new System.Drawing.Size(167, 26); - this.toolStripEncodingANSIItem.Tag = ""; - this.toolStripEncodingANSIItem.Text = "ANSI"; - this.toolStripEncodingANSIItem.Click += new System.EventHandler(this.OnANSIToolStripMenuItemClick); + toolStripEncodingANSIItem.BackColor = System.Drawing.SystemColors.Control; + toolStripEncodingANSIItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + toolStripEncodingANSIItem.Name = "toolStripEncodingANSIItem"; + toolStripEncodingANSIItem.Size = new System.Drawing.Size(132, 22); + toolStripEncodingANSIItem.Tag = ""; + toolStripEncodingANSIItem.Text = "ANSI"; + toolStripEncodingANSIItem.Click += OnANSIToolStripMenuItemClick; // // toolStripEncodingISO88591Item // - this.toolStripEncodingISO88591Item.BackColor = System.Drawing.SystemColors.Control; - this.toolStripEncodingISO88591Item.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.toolStripEncodingISO88591Item.Name = "toolStripEncodingISO88591Item"; - this.toolStripEncodingISO88591Item.Size = new System.Drawing.Size(167, 26); - this.toolStripEncodingISO88591Item.Text = "ISO-8859-1"; - this.toolStripEncodingISO88591Item.Click += new System.EventHandler(this.OnISO88591ToolStripMenuItemClick); + toolStripEncodingISO88591Item.BackColor = System.Drawing.SystemColors.Control; + toolStripEncodingISO88591Item.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + toolStripEncodingISO88591Item.Name = "toolStripEncodingISO88591Item"; + toolStripEncodingISO88591Item.Size = new System.Drawing.Size(132, 22); + toolStripEncodingISO88591Item.Text = "ISO-8859-1"; + toolStripEncodingISO88591Item.Click += OnISO88591ToolStripMenuItemClick; // // toolStripEncodingUTF8Item // - this.toolStripEncodingUTF8Item.BackColor = System.Drawing.SystemColors.Control; - this.toolStripEncodingUTF8Item.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.toolStripEncodingUTF8Item.Name = "toolStripEncodingUTF8Item"; - this.toolStripEncodingUTF8Item.Size = new System.Drawing.Size(167, 26); - this.toolStripEncodingUTF8Item.Text = "UTF8"; - this.toolStripEncodingUTF8Item.Click += new System.EventHandler(this.OnUTF8ToolStripMenuItemClick); + toolStripEncodingUTF8Item.BackColor = System.Drawing.SystemColors.Control; + toolStripEncodingUTF8Item.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + toolStripEncodingUTF8Item.Name = "toolStripEncodingUTF8Item"; + toolStripEncodingUTF8Item.Size = new System.Drawing.Size(132, 22); + toolStripEncodingUTF8Item.Text = "UTF8"; + toolStripEncodingUTF8Item.Click += OnUTF8ToolStripMenuItemClick; // // toolStripEncodingUTF16Item // - this.toolStripEncodingUTF16Item.BackColor = System.Drawing.SystemColors.Control; - this.toolStripEncodingUTF16Item.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.toolStripEncodingUTF16Item.Name = "toolStripEncodingUTF16Item"; - this.toolStripEncodingUTF16Item.Size = new System.Drawing.Size(167, 26); - this.toolStripEncodingUTF16Item.Text = "Unicode"; - this.toolStripEncodingUTF16Item.Click += new System.EventHandler(this.OnUTF16ToolStripMenuItemClick); + toolStripEncodingUTF16Item.BackColor = System.Drawing.SystemColors.Control; + toolStripEncodingUTF16Item.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + toolStripEncodingUTF16Item.Name = "toolStripEncodingUTF16Item"; + toolStripEncodingUTF16Item.Size = new System.Drawing.Size(132, 22); + toolStripEncodingUTF16Item.Text = "Unicode"; + toolStripEncodingUTF16Item.Click += OnUTF16ToolStripMenuItemClick; // - // toolStripSeparator4 + // menuToolStripSeparatorExtension6 // - this.toolStripSeparator4.BackColor = System.Drawing.SystemColors.Control; - this.toolStripSeparator4.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(218, 6); + menuToolStripSeparatorExtension6.Name = "menuToolStripSeparatorExtension6"; + menuToolStripSeparatorExtension6.Size = new System.Drawing.Size(186, 6); // // timeshiftToolStripMenuItem // - this.timeshiftToolStripMenuItem.BackColor = System.Drawing.SystemColors.ControlDarkDark; - this.timeshiftToolStripMenuItem.CheckOnClick = true; - this.timeshiftToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlLightLight; - this.timeshiftToolStripMenuItem.Name = "timeshiftToolStripMenuItem"; - this.timeshiftToolStripMenuItem.Size = new System.Drawing.Size(221, 26); - this.timeshiftToolStripMenuItem.Text = "Timeshift"; - this.timeshiftToolStripMenuItem.ToolTipText = "If supported by the columnizer, you can set an offset to the displayed log time"; - this.timeshiftToolStripMenuItem.CheckStateChanged += new System.EventHandler(this.OnTimeShiftToolStripMenuItemCheckStateChanged); + timeshiftToolStripMenuItem.CheckOnClick = true; + timeshiftToolStripMenuItem.Name = "timeshiftToolStripMenuItem"; + timeshiftToolStripMenuItem.Size = new System.Drawing.Size(189, 30); + timeshiftToolStripMenuItem.Text = "Timeshift"; + timeshiftToolStripMenuItem.ToolTipText = "If supported by the columnizer, you can set an offset to the displayed log time"; + timeshiftToolStripMenuItem.CheckStateChanged += OnTimeShiftToolStripMenuItemCheckStateChanged; // // timeshiftMenuTextBox // - this.timeshiftMenuTextBox.BackColor = System.Drawing.SystemColors.ControlDarkDark; - this.timeshiftMenuTextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.timeshiftMenuTextBox.Enabled = false; - this.timeshiftMenuTextBox.Font = new System.Drawing.Font("Segoe UI", 9F); - this.timeshiftMenuTextBox.ForeColor = System.Drawing.SystemColors.ControlLightLight; - this.timeshiftMenuTextBox.Name = "timeshiftMenuTextBox"; - this.timeshiftMenuTextBox.Size = new System.Drawing.Size(150, 27); - this.timeshiftMenuTextBox.Text = "+00:00:00.000"; - this.timeshiftMenuTextBox.ToolTipText = "Time offset (hh:mm:ss.fff)"; - this.timeshiftMenuTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnTimeShiftMenuTextBoxKeyDown); + timeshiftMenuTextBox.BorderStyle = BorderStyle.FixedSingle; + timeshiftMenuTextBox.Enabled = false; + timeshiftMenuTextBox.Font = new System.Drawing.Font("Segoe UI", 9F); + timeshiftMenuTextBox.Name = "timeshiftMenuTextBox"; + timeshiftMenuTextBox.Size = new System.Drawing.Size(100, 23); + timeshiftMenuTextBox.Text = "+00:00:00.000"; + timeshiftMenuTextBox.ToolTipText = "Time offset (hh:mm:ss.fff)"; + timeshiftMenuTextBox.KeyDown += OnTimeShiftMenuTextBoxKeyDown; // - // toolStripSeparator3 + // menuToolStripSeparatorExtension4 // - this.toolStripSeparator3.BackColor = System.Drawing.SystemColors.Control; - this.toolStripSeparator3.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.toolStripSeparator3.Name = "toolStripSeparator3"; - this.toolStripSeparator3.Size = new System.Drawing.Size(218, 6); + menuToolStripSeparatorExtension4.Name = "menuToolStripSeparatorExtension4"; + menuToolStripSeparatorExtension4.Size = new System.Drawing.Size(186, 6); // // copyMarkedLinesIntoNewTabToolStripMenuItem // - this.copyMarkedLinesIntoNewTabToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.copyMarkedLinesIntoNewTabToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.copyMarkedLinesIntoNewTabToolStripMenuItem.Name = "copyMarkedLinesIntoNewTabToolStripMenuItem"; - this.copyMarkedLinesIntoNewTabToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.T))); - this.copyMarkedLinesIntoNewTabToolStripMenuItem.Size = new System.Drawing.Size(221, 26); - this.copyMarkedLinesIntoNewTabToolStripMenuItem.Text = "Copy to Tab"; - this.copyMarkedLinesIntoNewTabToolStripMenuItem.ToolTipText = "Copies all selected lines into a new tab page"; - this.copyMarkedLinesIntoNewTabToolStripMenuItem.Click += new System.EventHandler(this.OnCopyMarkedLinesIntoNewTabToolStripMenuItemClick); + copyMarkedLinesIntoNewTabToolStripMenuItem.Name = "copyMarkedLinesIntoNewTabToolStripMenuItem"; + copyMarkedLinesIntoNewTabToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.T; + copyMarkedLinesIntoNewTabToolStripMenuItem.Size = new System.Drawing.Size(189, 30); + copyMarkedLinesIntoNewTabToolStripMenuItem.Text = "Copy to Tab"; + copyMarkedLinesIntoNewTabToolStripMenuItem.ToolTipText = "Copies all selected lines into a new tab page"; + copyMarkedLinesIntoNewTabToolStripMenuItem.Click += OnCopyMarkedLinesIntoNewTabToolStripMenuItemClick; // // optionToolStripMenuItem // - this.optionToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.optionToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.columnizerToolStripMenuItem, - this.hilightingToolStripMenuItem1, - this.settingsToolStripMenuItem, - this.toolStripSeparator6, - this.cellSelectModeToolStripMenuItem, - this.alwaysOnTopToolStripMenuItem, - this.hideLineColumnToolStripMenuItem, - this.toolStripSeparator19, - this.lockInstanceToolStripMenuItem}); - this.optionToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.optionToolStripMenuItem.Name = "optionToolStripMenuItem"; - this.optionToolStripMenuItem.Size = new System.Drawing.Size(75, 24); - this.optionToolStripMenuItem.Text = "Options"; - this.optionToolStripMenuItem.DropDownOpening += new System.EventHandler(this.OnOptionToolStripMenuItemDropDownOpening); + optionToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { columnizerToolStripMenuItem, hilightingToolStripMenuItem1, menuToolStripSeparatorExtension7, settingsToolStripMenuItem, menuToolStripSeparatorExtension9, cellSelectModeToolStripMenuItem, alwaysOnTopToolStripMenuItem, hideLineColumnToolStripMenuItem, menuToolStripSeparatorExtension8, lockInstanceToolStripMenuItem }); + optionToolStripMenuItem.Name = "optionToolStripMenuItem"; + optionToolStripMenuItem.Size = new System.Drawing.Size(61, 19); + optionToolStripMenuItem.Text = "Options"; + optionToolStripMenuItem.DropDownOpening += OnOptionToolStripMenuItemDropDownOpening; // // columnizerToolStripMenuItem // - this.columnizerToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.columnizerToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.columnizerToolStripMenuItem.Name = "columnizerToolStripMenuItem"; - this.columnizerToolStripMenuItem.Size = new System.Drawing.Size(268, 26); - this.columnizerToolStripMenuItem.Text = "Columnizer..."; - this.columnizerToolStripMenuItem.ToolTipText = "Splits various kinds of logfiles into fixed columns"; - this.columnizerToolStripMenuItem.Click += new System.EventHandler(this.OnSelectFilterToolStripMenuItemClick); + columnizerToolStripMenuItem.Name = "columnizerToolStripMenuItem"; + columnizerToolStripMenuItem.Size = new System.Drawing.Size(224, 30); + columnizerToolStripMenuItem.Text = "Columnizer..."; + columnizerToolStripMenuItem.ToolTipText = "Splits various kinds of logfiles into fixed columns"; + columnizerToolStripMenuItem.Click += OnSelectFilterToolStripMenuItemClick; // // hilightingToolStripMenuItem1 // - this.hilightingToolStripMenuItem1.BackColor = System.Drawing.SystemColors.Control; - this.hilightingToolStripMenuItem1.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.hilightingToolStripMenuItem1.Name = "hilightingToolStripMenuItem1"; - this.hilightingToolStripMenuItem1.Size = new System.Drawing.Size(268, 26); - this.hilightingToolStripMenuItem1.Text = "Highlighting and triggers..."; - this.hilightingToolStripMenuItem1.Click += new System.EventHandler(this.OnHighlightingToolStripMenuItemClick); + hilightingToolStripMenuItem1.Name = "hilightingToolStripMenuItem1"; + hilightingToolStripMenuItem1.Size = new System.Drawing.Size(224, 30); + hilightingToolStripMenuItem1.Text = "Highlighting and triggers..."; + hilightingToolStripMenuItem1.Click += OnHighlightingToolStripMenuItemClick; + // + // menuToolStripSeparatorExtension7 + // + menuToolStripSeparatorExtension7.Name = "menuToolStripSeparatorExtension7"; + menuToolStripSeparatorExtension7.Size = new System.Drawing.Size(221, 6); // // settingsToolStripMenuItem // - this.settingsToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.settingsToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem"; - this.settingsToolStripMenuItem.Size = new System.Drawing.Size(268, 26); - this.settingsToolStripMenuItem.Text = "Settings..."; - this.settingsToolStripMenuItem.Click += new System.EventHandler(this.OnSettingsToolStripMenuItemClick); + settingsToolStripMenuItem.Image = Resources.Settings; + settingsToolStripMenuItem.Name = "settingsToolStripMenuItem"; + settingsToolStripMenuItem.Size = new System.Drawing.Size(224, 30); + settingsToolStripMenuItem.Text = "Settings..."; + settingsToolStripMenuItem.Click += OnSettingsToolStripMenuItemClick; // - // toolStripSeparator6 + // menuToolStripSeparatorExtension9 // - this.toolStripSeparator6.BackColor = System.Drawing.SystemColors.Control; - this.toolStripSeparator6.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.toolStripSeparator6.Name = "toolStripSeparator6"; - this.toolStripSeparator6.Size = new System.Drawing.Size(265, 6); + menuToolStripSeparatorExtension9.Name = "menuToolStripSeparatorExtension9"; + menuToolStripSeparatorExtension9.Size = new System.Drawing.Size(221, 6); // // cellSelectModeToolStripMenuItem // - this.cellSelectModeToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.cellSelectModeToolStripMenuItem.CheckOnClick = true; - this.cellSelectModeToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.cellSelectModeToolStripMenuItem.Name = "cellSelectModeToolStripMenuItem"; - this.cellSelectModeToolStripMenuItem.Size = new System.Drawing.Size(268, 26); - this.cellSelectModeToolStripMenuItem.Text = "Cell select mode"; - this.cellSelectModeToolStripMenuItem.ToolTipText = "Switches between foll row selection and single cell selection mode"; - this.cellSelectModeToolStripMenuItem.Click += new System.EventHandler(this.OnCellSelectModeToolStripMenuItemClick); + cellSelectModeToolStripMenuItem.CheckOnClick = true; + cellSelectModeToolStripMenuItem.Name = "cellSelectModeToolStripMenuItem"; + cellSelectModeToolStripMenuItem.Size = new System.Drawing.Size(224, 30); + cellSelectModeToolStripMenuItem.Text = "Cell select mode"; + cellSelectModeToolStripMenuItem.ToolTipText = "Switches between foll row selection and single cell selection mode"; + cellSelectModeToolStripMenuItem.Click += OnCellSelectModeToolStripMenuItemClick; // // alwaysOnTopToolStripMenuItem // - this.alwaysOnTopToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.alwaysOnTopToolStripMenuItem.CheckOnClick = true; - this.alwaysOnTopToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.alwaysOnTopToolStripMenuItem.Name = "alwaysOnTopToolStripMenuItem"; - this.alwaysOnTopToolStripMenuItem.Size = new System.Drawing.Size(268, 26); - this.alwaysOnTopToolStripMenuItem.Text = "Always on top"; - this.alwaysOnTopToolStripMenuItem.Click += new System.EventHandler(this.OnAlwaysOnTopToolStripMenuItemClick); + alwaysOnTopToolStripMenuItem.CheckOnClick = true; + alwaysOnTopToolStripMenuItem.Name = "alwaysOnTopToolStripMenuItem"; + alwaysOnTopToolStripMenuItem.Size = new System.Drawing.Size(224, 30); + alwaysOnTopToolStripMenuItem.Text = "Always on top"; + alwaysOnTopToolStripMenuItem.Click += OnAlwaysOnTopToolStripMenuItemClick; // // hideLineColumnToolStripMenuItem // - this.hideLineColumnToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.hideLineColumnToolStripMenuItem.CheckOnClick = true; - this.hideLineColumnToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.hideLineColumnToolStripMenuItem.Name = "hideLineColumnToolStripMenuItem"; - this.hideLineColumnToolStripMenuItem.Size = new System.Drawing.Size(268, 26); - this.hideLineColumnToolStripMenuItem.Text = "Hide line column"; - this.hideLineColumnToolStripMenuItem.Click += new System.EventHandler(this.OnHideLineColumnToolStripMenuItemClick); + hideLineColumnToolStripMenuItem.CheckOnClick = true; + hideLineColumnToolStripMenuItem.Name = "hideLineColumnToolStripMenuItem"; + hideLineColumnToolStripMenuItem.Size = new System.Drawing.Size(224, 30); + hideLineColumnToolStripMenuItem.Text = "Hide line column"; + hideLineColumnToolStripMenuItem.Click += OnHideLineColumnToolStripMenuItemClick; // - // toolStripSeparator19 + // menuToolStripSeparatorExtension8 // - this.toolStripSeparator19.BackColor = System.Drawing.SystemColors.Control; - this.toolStripSeparator19.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.toolStripSeparator19.Name = "toolStripSeparator19"; - this.toolStripSeparator19.Size = new System.Drawing.Size(265, 6); + menuToolStripSeparatorExtension8.Name = "menuToolStripSeparatorExtension8"; + menuToolStripSeparatorExtension8.Size = new System.Drawing.Size(221, 6); // // lockInstanceToolStripMenuItem // - this.lockInstanceToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.lockInstanceToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.lockInstanceToolStripMenuItem.Name = "lockInstanceToolStripMenuItem"; - this.lockInstanceToolStripMenuItem.Size = new System.Drawing.Size(268, 26); - this.lockInstanceToolStripMenuItem.Text = "Lock instance"; - this.lockInstanceToolStripMenuItem.ToolTipText = "When enabled all new launched LogExpert instances will redirect to this window"; - this.lockInstanceToolStripMenuItem.Click += new System.EventHandler(this.OnLockInstanceToolStripMenuItemClick); + lockInstanceToolStripMenuItem.Name = "lockInstanceToolStripMenuItem"; + lockInstanceToolStripMenuItem.Size = new System.Drawing.Size(224, 30); + lockInstanceToolStripMenuItem.Text = "Lock instance"; + lockInstanceToolStripMenuItem.ToolTipText = "When enabled all new launched LogExpert instances will redirect to this window"; + lockInstanceToolStripMenuItem.Click += OnLockInstanceToolStripMenuItemClick; // // toolsToolStripMenuItem // - this.toolsToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.configureToolStripMenuItem, - this.configureToolStripSeparator}); - this.toolsToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem"; - this.toolsToolStripMenuItem.Size = new System.Drawing.Size(58, 24); - this.toolsToolStripMenuItem.Text = "Tools"; - this.toolsToolStripMenuItem.ToolTipText = "Launch external tools (configure in the settings)"; - this.toolsToolStripMenuItem.DropDownItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.OnToolsToolStripMenuItemDropDownItemClicked); + toolsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { configureToolStripMenuItem, configureToolStripSeparator }); + toolsToolStripMenuItem.Name = "toolsToolStripMenuItem"; + toolsToolStripMenuItem.Size = new System.Drawing.Size(47, 19); + toolsToolStripMenuItem.Text = "Tools"; + toolsToolStripMenuItem.ToolTipText = "Launch external tools (configure in the settings)"; + toolsToolStripMenuItem.DropDownItemClicked += OnToolsToolStripMenuItemDropDownItemClicked; // // configureToolStripMenuItem // - this.configureToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.configureToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.configureToolStripMenuItem.Name = "configureToolStripMenuItem"; - this.configureToolStripMenuItem.Size = new System.Drawing.Size(224, 26); - this.configureToolStripMenuItem.Text = "Configure..."; - this.configureToolStripMenuItem.Click += new System.EventHandler(this.OnConfigureToolStripMenuItemClick); + configureToolStripMenuItem.Name = "configureToolStripMenuItem"; + configureToolStripMenuItem.Size = new System.Drawing.Size(136, 22); + configureToolStripMenuItem.Text = "Configure..."; + configureToolStripMenuItem.Click += OnConfigureToolStripMenuItemClick; // // configureToolStripSeparator // - this.configureToolStripSeparator.BackColor = System.Drawing.SystemColors.Control; - this.configureToolStripSeparator.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.configureToolStripSeparator.Name = "configureToolStripSeparator"; - this.configureToolStripSeparator.Size = new System.Drawing.Size(221, 6); + configureToolStripSeparator.Name = "configureToolStripSeparator"; + configureToolStripSeparator.Size = new System.Drawing.Size(133, 6); // // helpToolStripMenuItem // - this.helpToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.showHelpToolStripMenuItem, - this.toolStripSeparator5, - this.aboutToolStripMenuItem}); - this.helpToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - this.helpToolStripMenuItem.Size = new System.Drawing.Size(55, 24); - this.helpToolStripMenuItem.Text = "Help"; + helpToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { showHelpToolStripMenuItem, menuToolStripSeparatorExtension11, aboutToolStripMenuItem }); + helpToolStripMenuItem.Name = "helpToolStripMenuItem"; + helpToolStripMenuItem.Size = new System.Drawing.Size(44, 19); + helpToolStripMenuItem.Text = "Help"; // // showHelpToolStripMenuItem // - this.showHelpToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.showHelpToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.showHelpToolStripMenuItem.Name = "showHelpToolStripMenuItem"; - this.showHelpToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F1; - this.showHelpToolStripMenuItem.Size = new System.Drawing.Size(185, 26); - this.showHelpToolStripMenuItem.Text = "Show help"; - this.showHelpToolStripMenuItem.Click += new System.EventHandler(this.OnShowHelpToolStripMenuItemClick); + showHelpToolStripMenuItem.Name = "showHelpToolStripMenuItem"; + showHelpToolStripMenuItem.ShortcutKeys = Keys.F1; + showHelpToolStripMenuItem.Size = new System.Drawing.Size(148, 22); + showHelpToolStripMenuItem.Text = "Show help"; + showHelpToolStripMenuItem.Click += OnShowHelpToolStripMenuItemClick; // - // toolStripSeparator5 + // menuToolStripSeparatorExtension11 // - this.toolStripSeparator5.BackColor = System.Drawing.SystemColors.Control; - this.toolStripSeparator5.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.toolStripSeparator5.Name = "toolStripSeparator5"; - this.toolStripSeparator5.Size = new System.Drawing.Size(182, 6); + menuToolStripSeparatorExtension11.Name = "menuToolStripSeparatorExtension11"; + menuToolStripSeparatorExtension11.Size = new System.Drawing.Size(145, 6); // // aboutToolStripMenuItem // - this.aboutToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.aboutToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; - this.aboutToolStripMenuItem.Size = new System.Drawing.Size(185, 26); - this.aboutToolStripMenuItem.Text = "About"; - this.aboutToolStripMenuItem.Click += new System.EventHandler(this.OnAboutToolStripMenuItemClick); + aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; + aboutToolStripMenuItem.Size = new System.Drawing.Size(148, 22); + aboutToolStripMenuItem.Text = "About"; + aboutToolStripMenuItem.Click += OnAboutToolStripMenuItemClick; // // debugToolStripMenuItem // - this.debugToolStripMenuItem.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - this.debugToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.debugToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.dumpLogBufferInfoToolStripMenuItem, - this.dumpBufferDiagnosticToolStripMenuItem, - this.runGCToolStripMenuItem, - this.gCInfoToolStripMenuItem, - this.toolStripSeparator18, - this.throwExceptionGUIThreadToolStripMenuItem, - this.throwExceptionbackgroundThToolStripMenuItem, - this.throwExceptionBackgroundThreadToolStripMenuItem, - this.toolStripSeparator12, - this.loglevelToolStripMenuItem, - this.disableWordHighlightModeToolStripMenuItem}); - this.debugToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.debugToolStripMenuItem.Name = "debugToolStripMenuItem"; - this.debugToolStripMenuItem.Size = new System.Drawing.Size(68, 24); - this.debugToolStripMenuItem.Text = "Debug"; + debugToolStripMenuItem.Alignment = ToolStripItemAlignment.Right; + debugToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { dumpLogBufferInfoToolStripMenuItem, dumpBufferDiagnosticToolStripMenuItem, runGCToolStripMenuItem, gCInfoToolStripMenuItem, throwExceptionGUIThreadToolStripMenuItem, throwExceptionbackgroundThToolStripMenuItem, throwExceptionBackgroundThreadToolStripMenuItem, loglevelToolStripMenuItem, disableWordHighlightModeToolStripMenuItem }); + debugToolStripMenuItem.Name = "debugToolStripMenuItem"; + debugToolStripMenuItem.Size = new System.Drawing.Size(54, 19); + debugToolStripMenuItem.Text = "Debug"; // // dumpLogBufferInfoToolStripMenuItem // - this.dumpLogBufferInfoToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.dumpLogBufferInfoToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.dumpLogBufferInfoToolStripMenuItem.Name = "dumpLogBufferInfoToolStripMenuItem"; - this.dumpLogBufferInfoToolStripMenuItem.Size = new System.Drawing.Size(342, 26); - this.dumpLogBufferInfoToolStripMenuItem.Text = "Dump LogBuffer info"; - this.dumpLogBufferInfoToolStripMenuItem.Click += new System.EventHandler(this.OnDumpLogBufferInfoToolStripMenuItemClick); + dumpLogBufferInfoToolStripMenuItem.Name = "dumpLogBufferInfoToolStripMenuItem"; + dumpLogBufferInfoToolStripMenuItem.Size = new System.Drawing.Size(274, 22); + dumpLogBufferInfoToolStripMenuItem.Text = "Dump LogBuffer info"; + dumpLogBufferInfoToolStripMenuItem.Click += OnDumpLogBufferInfoToolStripMenuItemClick; // // dumpBufferDiagnosticToolStripMenuItem // - this.dumpBufferDiagnosticToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.dumpBufferDiagnosticToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.dumpBufferDiagnosticToolStripMenuItem.Name = "dumpBufferDiagnosticToolStripMenuItem"; - this.dumpBufferDiagnosticToolStripMenuItem.Size = new System.Drawing.Size(342, 26); - this.dumpBufferDiagnosticToolStripMenuItem.Text = "Dump buffer diagnostic"; - this.dumpBufferDiagnosticToolStripMenuItem.Click += new System.EventHandler(this.OnDumpBufferDiagnosticToolStripMenuItemClick); + dumpBufferDiagnosticToolStripMenuItem.Name = "dumpBufferDiagnosticToolStripMenuItem"; + dumpBufferDiagnosticToolStripMenuItem.Size = new System.Drawing.Size(274, 22); + dumpBufferDiagnosticToolStripMenuItem.Text = "Dump buffer diagnostic"; + dumpBufferDiagnosticToolStripMenuItem.Click += OnDumpBufferDiagnosticToolStripMenuItemClick; // // runGCToolStripMenuItem // - this.runGCToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.runGCToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.runGCToolStripMenuItem.Name = "runGCToolStripMenuItem"; - this.runGCToolStripMenuItem.Size = new System.Drawing.Size(342, 26); - this.runGCToolStripMenuItem.Text = "Run GC"; - this.runGCToolStripMenuItem.Click += new System.EventHandler(this.OnRunGCToolStripMenuItemClick); + runGCToolStripMenuItem.Name = "runGCToolStripMenuItem"; + runGCToolStripMenuItem.Size = new System.Drawing.Size(274, 22); + runGCToolStripMenuItem.Text = "Run GC"; + runGCToolStripMenuItem.Click += OnRunGCToolStripMenuItemClick; // // gCInfoToolStripMenuItem // - this.gCInfoToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.gCInfoToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.gCInfoToolStripMenuItem.Name = "gCInfoToolStripMenuItem"; - this.gCInfoToolStripMenuItem.Size = new System.Drawing.Size(342, 26); - this.gCInfoToolStripMenuItem.Text = "Dump GC info"; - this.gCInfoToolStripMenuItem.Click += new System.EventHandler(this.OnGCInfoToolStripMenuItemClick); - // - // toolStripSeparator18 - // - this.toolStripSeparator18.BackColor = System.Drawing.SystemColors.Control; - this.toolStripSeparator18.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.toolStripSeparator18.Name = "toolStripSeparator18"; - this.toolStripSeparator18.Size = new System.Drawing.Size(339, 6); + gCInfoToolStripMenuItem.Name = "gCInfoToolStripMenuItem"; + gCInfoToolStripMenuItem.Size = new System.Drawing.Size(274, 22); + gCInfoToolStripMenuItem.Text = "Dump GC info"; + gCInfoToolStripMenuItem.Click += OnGCInfoToolStripMenuItemClick; // // throwExceptionGUIThreadToolStripMenuItem // - this.throwExceptionGUIThreadToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.throwExceptionGUIThreadToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.throwExceptionGUIThreadToolStripMenuItem.Name = "throwExceptionGUIThreadToolStripMenuItem"; - this.throwExceptionGUIThreadToolStripMenuItem.Size = new System.Drawing.Size(342, 26); - this.throwExceptionGUIThreadToolStripMenuItem.Text = "Throw exception (GUI Thread)"; - this.throwExceptionGUIThreadToolStripMenuItem.Click += new System.EventHandler(this.OnThrowExceptionGUIThreadToolStripMenuItemClick); + throwExceptionGUIThreadToolStripMenuItem.Name = "throwExceptionGUIThreadToolStripMenuItem"; + throwExceptionGUIThreadToolStripMenuItem.Size = new System.Drawing.Size(274, 22); + throwExceptionGUIThreadToolStripMenuItem.Text = "Throw exception (GUI Thread)"; + throwExceptionGUIThreadToolStripMenuItem.Click += OnThrowExceptionGUIThreadToolStripMenuItemClick; // // throwExceptionbackgroundThToolStripMenuItem // - this.throwExceptionbackgroundThToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.throwExceptionbackgroundThToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.throwExceptionbackgroundThToolStripMenuItem.Name = "throwExceptionbackgroundThToolStripMenuItem"; - this.throwExceptionbackgroundThToolStripMenuItem.Size = new System.Drawing.Size(342, 26); - this.throwExceptionbackgroundThToolStripMenuItem.Text = "Throw exception (Async delegate)"; - this.throwExceptionbackgroundThToolStripMenuItem.Click += new System.EventHandler(this.OnThrowExceptionBackgroundThToolStripMenuItemClick); + throwExceptionbackgroundThToolStripMenuItem.Name = "throwExceptionbackgroundThToolStripMenuItem"; + throwExceptionbackgroundThToolStripMenuItem.Size = new System.Drawing.Size(274, 22); + throwExceptionbackgroundThToolStripMenuItem.Text = "Throw exception (Async delegate)"; + throwExceptionbackgroundThToolStripMenuItem.Click += OnThrowExceptionBackgroundThToolStripMenuItemClick; // // throwExceptionBackgroundThreadToolStripMenuItem // - this.throwExceptionBackgroundThreadToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.throwExceptionBackgroundThreadToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.throwExceptionBackgroundThreadToolStripMenuItem.Name = "throwExceptionBackgroundThreadToolStripMenuItem"; - this.throwExceptionBackgroundThreadToolStripMenuItem.Size = new System.Drawing.Size(342, 26); - this.throwExceptionBackgroundThreadToolStripMenuItem.Text = "Throw exception (background thread)"; - this.throwExceptionBackgroundThreadToolStripMenuItem.Click += new System.EventHandler(this.OnThrowExceptionBackgroundThreadToolStripMenuItemClick); - // - // toolStripSeparator12 - // - this.toolStripSeparator12.BackColor = System.Drawing.SystemColors.Control; - this.toolStripSeparator12.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.toolStripSeparator12.Name = "toolStripSeparator12"; - this.toolStripSeparator12.Size = new System.Drawing.Size(339, 6); + throwExceptionBackgroundThreadToolStripMenuItem.Name = "throwExceptionBackgroundThreadToolStripMenuItem"; + throwExceptionBackgroundThreadToolStripMenuItem.Size = new System.Drawing.Size(274, 22); + throwExceptionBackgroundThreadToolStripMenuItem.Text = "Throw exception (background thread)"; + throwExceptionBackgroundThreadToolStripMenuItem.Click += OnThrowExceptionBackgroundThreadToolStripMenuItemClick; // // loglevelToolStripMenuItem // - this.loglevelToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.loglevelToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.warnToolStripMenuItem, - this.infoToolStripMenuItem, - this.debugToolStripMenuItem1}); - this.loglevelToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.loglevelToolStripMenuItem.Name = "loglevelToolStripMenuItem"; - this.loglevelToolStripMenuItem.Size = new System.Drawing.Size(342, 26); - this.loglevelToolStripMenuItem.Text = "Loglevel"; - this.loglevelToolStripMenuItem.DropDownOpening += new System.EventHandler(this.OnLogLevelToolStripMenuItemDropDownOpening); - this.loglevelToolStripMenuItem.Click += new System.EventHandler(this.OnLogLevelToolStripMenuItemClick); + loglevelToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { warnToolStripMenuItem, infoToolStripMenuItem, debugToolStripMenuItem1 }); + loglevelToolStripMenuItem.Name = "loglevelToolStripMenuItem"; + loglevelToolStripMenuItem.Size = new System.Drawing.Size(274, 22); + loglevelToolStripMenuItem.Text = "Loglevel"; + loglevelToolStripMenuItem.DropDownOpening += OnLogLevelToolStripMenuItemDropDownOpening; + loglevelToolStripMenuItem.Click += OnLogLevelToolStripMenuItemClick; // // warnToolStripMenuItem // - this.warnToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.warnToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.warnToolStripMenuItem.Name = "warnToolStripMenuItem"; - this.warnToolStripMenuItem.Size = new System.Drawing.Size(137, 26); - this.warnToolStripMenuItem.Text = "Warn"; - this.warnToolStripMenuItem.Click += new System.EventHandler(this.OnWarnToolStripMenuItemClick); + warnToolStripMenuItem.Name = "warnToolStripMenuItem"; + warnToolStripMenuItem.Size = new System.Drawing.Size(109, 22); + warnToolStripMenuItem.Text = "Warn"; + warnToolStripMenuItem.Click += OnWarnToolStripMenuItemClick; // // infoToolStripMenuItem // - this.infoToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.infoToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.infoToolStripMenuItem.Name = "infoToolStripMenuItem"; - this.infoToolStripMenuItem.Size = new System.Drawing.Size(137, 26); - this.infoToolStripMenuItem.Text = "Info"; - this.infoToolStripMenuItem.Click += new System.EventHandler(this.OnInfoToolStripMenuItemClick); + infoToolStripMenuItem.Name = "infoToolStripMenuItem"; + infoToolStripMenuItem.Size = new System.Drawing.Size(109, 22); + infoToolStripMenuItem.Text = "Info"; + infoToolStripMenuItem.Click += OnInfoToolStripMenuItemClick; // // debugToolStripMenuItem1 // - this.debugToolStripMenuItem1.BackColor = System.Drawing.SystemColors.Control; - this.debugToolStripMenuItem1.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.debugToolStripMenuItem1.Name = "debugToolStripMenuItem1"; - this.debugToolStripMenuItem1.Size = new System.Drawing.Size(137, 26); - this.debugToolStripMenuItem1.Text = "Debug"; - this.debugToolStripMenuItem1.Click += new System.EventHandler(this.OnDebugToolStripMenuItemClick); + debugToolStripMenuItem1.Name = "debugToolStripMenuItem1"; + debugToolStripMenuItem1.Size = new System.Drawing.Size(109, 22); + debugToolStripMenuItem1.Text = "Debug"; + debugToolStripMenuItem1.Click += OnDebugToolStripMenuItemClick; // // disableWordHighlightModeToolStripMenuItem // - this.disableWordHighlightModeToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.disableWordHighlightModeToolStripMenuItem.CheckOnClick = true; - this.disableWordHighlightModeToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.disableWordHighlightModeToolStripMenuItem.Name = "disableWordHighlightModeToolStripMenuItem"; - this.disableWordHighlightModeToolStripMenuItem.Size = new System.Drawing.Size(342, 26); - this.disableWordHighlightModeToolStripMenuItem.Text = "Disable word highlight mode"; - this.disableWordHighlightModeToolStripMenuItem.Click += new System.EventHandler(this.OnDisableWordHighlightModeToolStripMenuItemClick); + disableWordHighlightModeToolStripMenuItem.CheckOnClick = true; + disableWordHighlightModeToolStripMenuItem.Name = "disableWordHighlightModeToolStripMenuItem"; + disableWordHighlightModeToolStripMenuItem.Size = new System.Drawing.Size(274, 22); + disableWordHighlightModeToolStripMenuItem.Text = "Disable word highlight mode"; + disableWordHighlightModeToolStripMenuItem.Click += OnDisableWordHighlightModeToolStripMenuItemClick; // // host // - this.host.AccessibleName = "host"; - this.host.AutoSize = true; - this.host.BackColor = System.Drawing.Color.Transparent; - this.host.Location = new System.Drawing.Point(9, 1); - this.host.Name = "host"; - this.host.Size = new System.Drawing.Size(80, 22); - this.host.TabIndex = 7; - this.host.Text = "Follow tail"; - this.host.UseVisualStyleBackColor = false; + host.AccessibleName = "host"; + host.AutoSize = true; + host.BackColor = System.Drawing.Color.Transparent; + host.Location = new System.Drawing.Point(9, 1); + host.Name = "host"; + host.Size = new System.Drawing.Size(80, 22); + host.TabIndex = 7; + host.Text = "Follow tail"; + host.UseVisualStyleBackColor = false; // // toolStripContainer // // // toolStripContainer.BottomToolStripPanel // - this.toolStripContainer.BottomToolStripPanel.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; - this.toolStripContainer.BottomToolStripPanelVisible = false; + toolStripContainer.BottomToolStripPanel.RenderMode = ToolStripRenderMode.System; + toolStripContainer.BottomToolStripPanelVisible = false; // // toolStripContainer.ContentPanel // - this.toolStripContainer.ContentPanel.BackColor = System.Drawing.SystemColors.Control; - this.toolStripContainer.ContentPanel.Controls.Add(this.dockPanel); - this.toolStripContainer.ContentPanel.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.toolStripContainer.ContentPanel.Margin = new System.Windows.Forms.Padding(0); - this.toolStripContainer.ContentPanel.Size = new System.Drawing.Size(1283, 564); - this.toolStripContainer.Dock = System.Windows.Forms.DockStyle.Fill; + toolStripContainer.ContentPanel.Controls.Add(dockPanel); + toolStripContainer.ContentPanel.Margin = new Padding(0); + toolStripContainer.ContentPanel.Size = new System.Drawing.Size(1603, 881); + toolStripContainer.Dock = DockStyle.Fill; // // toolStripContainer.LeftToolStripPanel // - this.toolStripContainer.LeftToolStripPanel.BackColor = System.Drawing.SystemColors.Control; - this.toolStripContainer.LeftToolStripPanel.Enabled = false; - this.toolStripContainer.LeftToolStripPanel.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.toolStripContainer.LeftToolStripPanelVisible = false; - this.toolStripContainer.Location = new System.Drawing.Point(0, 0); - this.toolStripContainer.Margin = new System.Windows.Forms.Padding(0); - this.toolStripContainer.Name = "toolStripContainer"; + toolStripContainer.LeftToolStripPanel.Enabled = false; + toolStripContainer.LeftToolStripPanelVisible = false; + toolStripContainer.Location = new System.Drawing.Point(0, 0); + toolStripContainer.Margin = new Padding(0); + toolStripContainer.Name = "toolStripContainer"; // // toolStripContainer.RightToolStripPanel // - this.toolStripContainer.RightToolStripPanel.BackColor = System.Drawing.SystemColors.Control; - this.toolStripContainer.RightToolStripPanel.Enabled = false; - this.toolStripContainer.RightToolStripPanel.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.toolStripContainer.RightToolStripPanelVisible = false; - this.toolStripContainer.Size = new System.Drawing.Size(1283, 623); - this.toolStripContainer.TabIndex = 13; - this.toolStripContainer.Text = "toolStripContainer1"; + toolStripContainer.RightToolStripPanel.Enabled = false; + toolStripContainer.RightToolStripPanelVisible = false; + toolStripContainer.Size = new System.Drawing.Size(1603, 954); + toolStripContainer.TabIndex = 13; + toolStripContainer.Text = "toolStripContainer1"; // // toolStripContainer.TopToolStripPanel // - this.toolStripContainer.TopToolStripPanel.BackColor = System.Drawing.SystemColors.Control; - this.toolStripContainer.TopToolStripPanel.Controls.Add(this.buttonToolStrip); - this.toolStripContainer.TopToolStripPanel.Controls.Add(this.mainMenuStrip); - this.toolStripContainer.TopToolStripPanel.Controls.Add(this.externalToolsToolStrip); - this.toolStripContainer.TopToolStripPanel.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + toolStripContainer.TopToolStripPanel.Controls.Add(externalToolsToolStrip); + toolStripContainer.TopToolStripPanel.Controls.Add(mainMenuStrip); + toolStripContainer.TopToolStripPanel.Controls.Add(buttonToolStrip); // // dockPanel // - this.dockPanel.ActiveAutoHideContent = null; - this.dockPanel.BackColor = System.Drawing.SystemColors.Control; - this.dockPanel.DefaultFloatWindowSize = new System.Drawing.Size(600, 400); - this.dockPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.dockPanel.DockBackColor = System.Drawing.SystemColors.ControlLight; - this.dockPanel.DocumentStyle = WeifenLuo.WinFormsUI.Docking.DocumentStyle.DockingWindow; - this.dockPanel.ForeColor = System.Drawing.SystemColors.Control; - this.dockPanel.Location = new System.Drawing.Point(0, 0); - this.dockPanel.Margin = new System.Windows.Forms.Padding(0); - this.dockPanel.Name = "dockPanel"; - this.dockPanel.ShowDocumentIcon = true; - this.dockPanel.Size = new System.Drawing.Size(1283, 564); + dockPanel.ActiveAutoHideContent = null; + dockPanel.DefaultFloatWindowSize = new System.Drawing.Size(600, 400); + dockPanel.Dock = DockStyle.Fill; + dockPanel.DockBackColor = System.Drawing.SystemColors.Control; + dockPanel.DocumentStyle = DocumentStyle.DockingWindow; + dockPanel.ForeColor = System.Drawing.SystemColors.Control; + dockPanel.Location = new System.Drawing.Point(0, 0); + dockPanel.Margin = new Padding(0); + dockPanel.Name = "dockPanel"; + dockPanel.ShowDocumentIcon = true; + dockPanel.Size = new System.Drawing.Size(1603, 881); dockPanelGradient1.EndColor = System.Drawing.SystemColors.Control; dockPanelGradient1.StartColor = System.Drawing.SystemColors.Control; autoHideStripSkin1.DockStripGradient = dockPanelGradient1; @@ -1100,343 +886,291 @@ private void InitializeComponent() dockPaneStripToolWindowGradient1.InactiveTabGradient = tabGradient7; dockPaneStripSkin1.ToolWindowGradient = dockPaneStripToolWindowGradient1; dockPanelSkin1.DockPaneStripSkin = dockPaneStripSkin1; - this.dockPanel.Skin = dockPanelSkin1; - this.dockPanel.TabIndex = 14; - this.dockPanel.ActiveContentChanged += new System.EventHandler(this.OnDockPanelActiveContentChanged); + dockPanel.Skin = dockPanelSkin1; + dockPanel.TabIndex = 14; + dockPanel.ActiveContentChanged += OnDockPanelActiveContentChanged; + // + // externalToolsToolStrip + // + externalToolsToolStrip.AllowMerge = false; + externalToolsToolStrip.Dock = DockStyle.None; + externalToolsToolStrip.ImageScalingSize = new System.Drawing.Size(24, 24); + externalToolsToolStrip.LayoutStyle = ToolStripLayoutStyle.Flow; + externalToolsToolStrip.Location = new System.Drawing.Point(8, 0); + externalToolsToolStrip.Name = "externalToolsToolStrip"; + externalToolsToolStrip.Size = new System.Drawing.Size(32, 19); + externalToolsToolStrip.TabIndex = 8; + externalToolsToolStrip.ItemClicked += OnExternalToolsToolStripItemClicked; // // buttonToolStrip // - this.buttonToolStrip.AllowMerge = false; - this.buttonToolStrip.BackColor = System.Drawing.SystemColors.Control; - this.buttonToolStrip.Dock = System.Windows.Forms.DockStyle.None; - this.buttonToolStrip.ImageScalingSize = new System.Drawing.Size(24, 24); - this.buttonToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripButtonOpen, - this.toolStripSeparator10, - this.toolStripButtonSearch, - this.toolStripButtonFilter, - this.toolStripSeparator11, - this.toolStripButtonBookmark, - this.toolStripButtonUp, - this.toolStripButtonDown, - this.toolStripSeparator1, - this.toolStripButtonBubbles, - this.toolStripSeparator15, - this.toolStripButtonTail, - this.toolStripSeparator17, - this.groupsComboBoxHighlightGroups}); - this.buttonToolStrip.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.Flow; - this.buttonToolStrip.Location = new System.Drawing.Point(4, 0); - this.buttonToolStrip.Name = "buttonToolStrip"; - this.buttonToolStrip.Size = new System.Drawing.Size(420, 31); - this.buttonToolStrip.TabIndex = 7; + buttonToolStrip.AllowMerge = false; + buttonToolStrip.Dock = DockStyle.None; + buttonToolStrip.ImageScalingSize = new System.Drawing.Size(24, 24); + buttonToolStrip.Items.AddRange(new ToolStripItem[] { toolStripButtonOpen, lineToolStripSeparatorExtension1, toolStripButtonSearch, toolStripButtonFilter, lineToolStripSeparatorExtension2, toolStripButtonBookmark, toolStripButtonUp, toolStripButtonDown, lineToolStripSeparatorExtension3, toolStripButtonBubbles, lineToolStripSeparatorExtension4, toolStripButtonTail, lineToolStripSeparatorExtension5, groupsComboBoxHighlightGroups }); + buttonToolStrip.LayoutStyle = ToolStripLayoutStyle.Flow; + buttonToolStrip.Location = new System.Drawing.Point(3, 42); + buttonToolStrip.Name = "buttonToolStrip"; + buttonToolStrip.Size = new System.Drawing.Size(406, 31); + buttonToolStrip.TabIndex = 7; // // toolStripButtonOpen // - this.toolStripButtonOpen.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButtonOpen.Image = global::LogExpert.Properties.Resources.folder_blue; - this.toolStripButtonOpen.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButtonOpen.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButtonOpen.Name = "toolStripButtonOpen"; - this.toolStripButtonOpen.Size = new System.Drawing.Size(29, 18); - this.toolStripButtonOpen.Text = "toolStripButton1"; - this.toolStripButtonOpen.ToolTipText = "Open file"; - this.toolStripButtonOpen.Click += new System.EventHandler(this.OnToolStripButtonOpenClick); + toolStripButtonOpen.DisplayStyle = ToolStripItemDisplayStyle.Image; + toolStripButtonOpen.Image = Resources.File_open; + toolStripButtonOpen.ImageTransparentColor = System.Drawing.Color.Magenta; + toolStripButtonOpen.Name = "toolStripButtonOpen"; + toolStripButtonOpen.Size = new System.Drawing.Size(28, 28); + toolStripButtonOpen.Text = "Open File"; + toolStripButtonOpen.ToolTipText = "Open file"; + toolStripButtonOpen.Click += OnToolStripButtonOpenClick; // - // toolStripSeparator10 + // lineToolStripSeparatorExtension1 // - this.toolStripSeparator10.Name = "toolStripSeparator10"; - this.toolStripSeparator10.Size = new System.Drawing.Size(6, 23); + lineToolStripSeparatorExtension1.Name = "lineToolStripSeparatorExtension1"; + lineToolStripSeparatorExtension1.Size = new System.Drawing.Size(6, 23); // // toolStripButtonSearch // - this.toolStripButtonSearch.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButtonSearch.Image = global::LogExpert.Properties.Resources.search_icon_blue; - this.toolStripButtonSearch.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButtonSearch.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButtonSearch.Name = "toolStripButtonSearch"; - this.toolStripButtonSearch.Size = new System.Drawing.Size(29, 18); - this.toolStripButtonSearch.Text = "toolStripButtonSearch"; - this.toolStripButtonSearch.ToolTipText = "Search"; - this.toolStripButtonSearch.Click += new System.EventHandler(this.OnToolStripButtonSearchClick); + toolStripButtonSearch.DisplayStyle = ToolStripItemDisplayStyle.Image; + toolStripButtonSearch.Image = Resources.Search; + toolStripButtonSearch.ImageTransparentColor = System.Drawing.Color.Magenta; + toolStripButtonSearch.Name = "toolStripButtonSearch"; + toolStripButtonSearch.Size = new System.Drawing.Size(28, 28); + toolStripButtonSearch.Text = "Search"; + toolStripButtonSearch.ToolTipText = "Search"; + toolStripButtonSearch.Click += OnToolStripButtonSearchClick; // // toolStripButtonFilter // - this.toolStripButtonFilter.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButtonFilter.Image = global::LogExpert.Properties.Resources.search_folder_blue; - this.toolStripButtonFilter.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButtonFilter.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButtonFilter.Name = "toolStripButtonFilter"; - this.toolStripButtonFilter.Size = new System.Drawing.Size(29, 18); - this.toolStripButtonFilter.Text = "toolStripButton1"; - this.toolStripButtonFilter.ToolTipText = "Filter window"; - this.toolStripButtonFilter.Click += new System.EventHandler(this.OnToolStripButtonFilterClick); + toolStripButtonFilter.DisplayStyle = ToolStripItemDisplayStyle.Image; + toolStripButtonFilter.Image = Resources.Filter; + toolStripButtonFilter.ImageTransparentColor = System.Drawing.Color.Magenta; + toolStripButtonFilter.Name = "toolStripButtonFilter"; + toolStripButtonFilter.Size = new System.Drawing.Size(28, 28); + toolStripButtonFilter.Text = "Filter"; + toolStripButtonFilter.ToolTipText = "Filter window"; + toolStripButtonFilter.Click += OnToolStripButtonFilterClick; // - // toolStripSeparator11 + // lineToolStripSeparatorExtension2 // - this.toolStripSeparator11.Name = "toolStripSeparator11"; - this.toolStripSeparator11.Size = new System.Drawing.Size(6, 23); + lineToolStripSeparatorExtension2.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + lineToolStripSeparatorExtension2.Name = "lineToolStripSeparatorExtension2"; + lineToolStripSeparatorExtension2.Size = new System.Drawing.Size(6, 23); // // toolStripButtonBookmark // - this.toolStripButtonBookmark.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButtonBookmark.Image = global::LogExpert.Properties.Resources.check_blue; - this.toolStripButtonBookmark.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButtonBookmark.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButtonBookmark.Name = "toolStripButtonBookmark"; - this.toolStripButtonBookmark.Size = new System.Drawing.Size(29, 18); - this.toolStripButtonBookmark.Text = "toolStripButton1"; - this.toolStripButtonBookmark.ToolTipText = "Toggle bookmark"; - this.toolStripButtonBookmark.Click += new System.EventHandler(this.OnToolStripButtonBookmarkClick); + toolStripButtonBookmark.DisplayStyle = ToolStripItemDisplayStyle.Image; + toolStripButtonBookmark.Image = Resources.Bookmark_add; + toolStripButtonBookmark.ImageTransparentColor = System.Drawing.Color.Magenta; + toolStripButtonBookmark.Name = "toolStripButtonBookmark"; + toolStripButtonBookmark.Size = new System.Drawing.Size(28, 28); + toolStripButtonBookmark.Text = "Toggle Bookmark"; + toolStripButtonBookmark.ToolTipText = "Toggle bookmark"; + toolStripButtonBookmark.Click += OnToolStripButtonBookmarkClick; // // toolStripButtonUp // - this.toolStripButtonUp.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButtonUp.Image = global::LogExpert.Properties.Resources.up_blue; - this.toolStripButtonUp.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButtonUp.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButtonUp.Name = "toolStripButtonUp"; - this.toolStripButtonUp.Size = new System.Drawing.Size(29, 18); - this.toolStripButtonUp.Text = "toolStripButton1"; - this.toolStripButtonUp.ToolTipText = "Go to previous bookmark"; - this.toolStripButtonUp.Click += new System.EventHandler(this.OnToolStripButtonUpClick); + toolStripButtonUp.DisplayStyle = ToolStripItemDisplayStyle.Image; + toolStripButtonUp.Image = Resources.ArrowUp; + toolStripButtonUp.ImageTransparentColor = System.Drawing.Color.Magenta; + toolStripButtonUp.Name = "toolStripButtonUp"; + toolStripButtonUp.Size = new System.Drawing.Size(28, 28); + toolStripButtonUp.Text = "Previous Bookmark"; + toolStripButtonUp.ToolTipText = "Go to previous bookmark"; + toolStripButtonUp.Click += OnToolStripButtonUpClick; // // toolStripButtonDown // - this.toolStripButtonDown.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButtonDown.Image = global::LogExpert.Properties.Resources.down_blue; - this.toolStripButtonDown.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripButtonDown.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButtonDown.Name = "toolStripButtonDown"; - this.toolStripButtonDown.Size = new System.Drawing.Size(29, 18); - this.toolStripButtonDown.Text = "toolStripButton1"; - this.toolStripButtonDown.ToolTipText = "Go to next bookmark"; - this.toolStripButtonDown.Click += new System.EventHandler(this.OnToolStripButtonDownClick); + toolStripButtonDown.DisplayStyle = ToolStripItemDisplayStyle.Image; + toolStripButtonDown.Image = Resources.ArrowDown; + toolStripButtonDown.ImageTransparentColor = System.Drawing.Color.Magenta; + toolStripButtonDown.Name = "toolStripButtonDown"; + toolStripButtonDown.Size = new System.Drawing.Size(28, 28); + toolStripButtonDown.Text = "Next Bookmark"; + toolStripButtonDown.ToolTipText = "Go to next bookmark"; + toolStripButtonDown.Click += OnToolStripButtonDownClick; // - // toolStripSeparator1 + // lineToolStripSeparatorExtension3 // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(6, 23); + lineToolStripSeparatorExtension3.Name = "lineToolStripSeparatorExtension3"; + lineToolStripSeparatorExtension3.Size = new System.Drawing.Size(6, 23); // // toolStripButtonBubbles // - this.toolStripButtonBubbles.CheckOnClick = true; - this.toolStripButtonBubbles.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButtonBubbles.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonBubbles.Image"))); - this.toolStripButtonBubbles.ImageAlign = System.Drawing.ContentAlignment.BottomCenter; - this.toolStripButtonBubbles.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButtonBubbles.Name = "toolStripButtonBubbles"; - this.toolStripButtonBubbles.Size = new System.Drawing.Size(29, 28); - this.toolStripButtonBubbles.Text = "Show bookmark bubbles"; - this.toolStripButtonBubbles.Click += new System.EventHandler(this.OnToolStripButtonBubblesClick); + toolStripButtonBubbles.CheckOnClick = true; + toolStripButtonBubbles.DisplayStyle = ToolStripItemDisplayStyle.Image; + toolStripButtonBubbles.Image = Resources.bookmark_bubbles; + toolStripButtonBubbles.ImageAlign = System.Drawing.ContentAlignment.BottomCenter; + toolStripButtonBubbles.ImageTransparentColor = System.Drawing.Color.Magenta; + toolStripButtonBubbles.Name = "toolStripButtonBubbles"; + toolStripButtonBubbles.Size = new System.Drawing.Size(28, 28); + toolStripButtonBubbles.Text = "Show bookmark bubbles"; + toolStripButtonBubbles.Click += OnToolStripButtonBubblesClick; // - // toolStripSeparator15 + // lineToolStripSeparatorExtension4 // - this.toolStripSeparator15.Name = "toolStripSeparator15"; - this.toolStripSeparator15.Size = new System.Drawing.Size(6, 23); + lineToolStripSeparatorExtension4.Name = "lineToolStripSeparatorExtension4"; + lineToolStripSeparatorExtension4.Size = new System.Drawing.Size(6, 23); // // toolStripButtonTail // - this.toolStripButtonTail.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButtonTail.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonTail.Image"))); - this.toolStripButtonTail.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButtonTail.Name = "toolStripButtonTail"; - this.toolStripButtonTail.Size = new System.Drawing.Size(34, 24); - this.toolStripButtonTail.Text = "tail"; + toolStripButtonTail.DisplayStyle = ToolStripItemDisplayStyle.Text; + toolStripButtonTail.Image = (System.Drawing.Image)resources.GetObject("toolStripButtonTail.Image"); + toolStripButtonTail.ImageTransparentColor = System.Drawing.Color.Magenta; + toolStripButtonTail.Name = "toolStripButtonTail"; + toolStripButtonTail.Size = new System.Drawing.Size(27, 19); + toolStripButtonTail.Text = "tail"; // - // toolStripSeparator17 + // lineToolStripSeparatorExtension5 // - this.toolStripSeparator17.Name = "toolStripSeparator17"; - this.toolStripSeparator17.Size = new System.Drawing.Size(6, 23); + lineToolStripSeparatorExtension5.Name = "lineToolStripSeparatorExtension5"; + lineToolStripSeparatorExtension5.Size = new System.Drawing.Size(6, 23); // // groupsComboBoxHighlightGroups // - this.groupsComboBoxHighlightGroups.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.groupsComboBoxHighlightGroups.DropDownWidth = 250; - this.groupsComboBoxHighlightGroups.FlatStyle = System.Windows.Forms.FlatStyle.Standard; - this.groupsComboBoxHighlightGroups.Name = "groupsComboBoxHighlightGroups"; - this.groupsComboBoxHighlightGroups.Size = new System.Drawing.Size(150, 28); - this.groupsComboBoxHighlightGroups.ToolTipText = "Select the current highlight settings for the log file (right-click to open highl" + - "ight settings)"; - this.groupsComboBoxHighlightGroups.DropDownClosed += new System.EventHandler(this.OnHighlightGroupsComboBoxDropDownClosed); - this.groupsComboBoxHighlightGroups.SelectedIndexChanged += new System.EventHandler(this.OnHighlightGroupsComboBoxSelectedIndexChanged); - this.groupsComboBoxHighlightGroups.MouseUp += new System.Windows.Forms.MouseEventHandler(this.OnHighlightGroupsComboBoxMouseUp); - // - // externalToolsToolStrip - // - this.externalToolsToolStrip.AllowMerge = false; - this.externalToolsToolStrip.BackColor = System.Drawing.SystemColors.ControlLight; - this.externalToolsToolStrip.Dock = System.Windows.Forms.DockStyle.None; - this.externalToolsToolStrip.ImageScalingSize = new System.Drawing.Size(24, 24); - this.externalToolsToolStrip.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.Flow; - this.externalToolsToolStrip.Location = new System.Drawing.Point(148, 59); - this.externalToolsToolStrip.Name = "externalToolsToolStrip"; - this.externalToolsToolStrip.Size = new System.Drawing.Size(1, 0); - this.externalToolsToolStrip.TabIndex = 8; - this.externalToolsToolStrip.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.OnExternalToolsToolStripItemClicked); - // - // toolStripSeparator9 - // - this.toolStripSeparator9.Name = "toolStripSeparator9"; - this.toolStripSeparator9.Size = new System.Drawing.Size(6, 25); + groupsComboBoxHighlightGroups.DropDownStyle = ComboBoxStyle.DropDownList; + groupsComboBoxHighlightGroups.DropDownWidth = 250; + groupsComboBoxHighlightGroups.FlatStyle = FlatStyle.Standard; + groupsComboBoxHighlightGroups.Name = "groupsComboBoxHighlightGroups"; + groupsComboBoxHighlightGroups.Size = new System.Drawing.Size(150, 23); + groupsComboBoxHighlightGroups.ToolTipText = "Select the current highlight settings for the log file (right-click to open highlight settings)"; + groupsComboBoxHighlightGroups.DropDownClosed += OnHighlightGroupsComboBoxDropDownClosed; + groupsComboBoxHighlightGroups.SelectedIndexChanged += OnHighlightGroupsComboBoxSelectedIndexChanged; + groupsComboBoxHighlightGroups.MouseUp += OnHighlightGroupsComboBoxMouseUp; // // checkBoxFollowTail // - this.checkBoxFollowTail.AutoSize = true; - this.checkBoxFollowTail.Location = new System.Drawing.Point(530, 630); - this.checkBoxFollowTail.Margin = new System.Windows.Forms.Padding(4); - this.checkBoxFollowTail.Name = "checkBoxFollowTail"; - this.checkBoxFollowTail.Size = new System.Drawing.Size(91, 21); - this.checkBoxFollowTail.TabIndex = 14; - this.checkBoxFollowTail.Text = "Follow tail"; - this.checkBoxFollowTail.UseVisualStyleBackColor = true; - this.checkBoxFollowTail.Click += new System.EventHandler(this.OnFollowTailCheckBoxClick); + checkBoxFollowTail.AutoSize = true; + checkBoxFollowTail.Location = new System.Drawing.Point(663, 985); + checkBoxFollowTail.Margin = new Padding(4, 7, 4, 7); + checkBoxFollowTail.Name = "checkBoxFollowTail"; + checkBoxFollowTail.Size = new System.Drawing.Size(80, 19); + checkBoxFollowTail.TabIndex = 14; + checkBoxFollowTail.Text = "Follow tail"; + checkBoxFollowTail.UseVisualStyleBackColor = true; + checkBoxFollowTail.Click += OnFollowTailCheckBoxClick; // // tabContextMenuStrip // - this.tabContextMenuStrip.BackColor = System.Drawing.SystemColors.Control; - this.tabContextMenuStrip.ForeColor = System.Drawing.SystemColors.ControlText; - this.tabContextMenuStrip.ImageScalingSize = new System.Drawing.Size(24, 24); - this.tabContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.closeThisTabToolStripMenuItem, - this.closeOtherTabsToolStripMenuItem, - this.closeAllTabsToolStripMenuItem, - this.toolStripSeparator13, - this.tabColorToolStripMenuItem, - this.tabRenameToolStripMenuItem, - this.toolStripSeparator16, - this.copyPathToClipboardToolStripMenuItem, - this.findInExplorerToolStripMenuItem}); - this.tabContextMenuStrip.Name = "tabContextMenuStrip"; - this.tabContextMenuStrip.Size = new System.Drawing.Size(233, 184); + tabContextMenuStrip.ForeColor = System.Drawing.SystemColors.ControlText; + tabContextMenuStrip.ImageScalingSize = new System.Drawing.Size(24, 24); + tabContextMenuStrip.Items.AddRange(new ToolStripItem[] { closeThisTabToolStripMenuItem, closeOtherTabsToolStripMenuItem, closeAllTabsToolStripMenuItem, tabColorToolStripMenuItem, tabRenameToolStripMenuItem, copyPathToClipboardToolStripMenuItem, findInExplorerToolStripMenuItem }); + tabContextMenuStrip.Name = "tabContextMenuStrip"; + tabContextMenuStrip.Size = new System.Drawing.Size(197, 158); // // closeThisTabToolStripMenuItem // - this.closeThisTabToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.closeThisTabToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlText; - this.closeThisTabToolStripMenuItem.Name = "closeThisTabToolStripMenuItem"; - this.closeThisTabToolStripMenuItem.Size = new System.Drawing.Size(232, 24); - this.closeThisTabToolStripMenuItem.Text = "Close this tab"; - this.closeThisTabToolStripMenuItem.Click += new System.EventHandler(this.OnCloseThisTabToolStripMenuItemClick); + closeThisTabToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; + closeThisTabToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlText; + closeThisTabToolStripMenuItem.Name = "closeThisTabToolStripMenuItem"; + closeThisTabToolStripMenuItem.Size = new System.Drawing.Size(196, 22); + closeThisTabToolStripMenuItem.Text = "Close this tab"; + closeThisTabToolStripMenuItem.Click += OnCloseThisTabToolStripMenuItemClick; // // closeOtherTabsToolStripMenuItem // - this.closeOtherTabsToolStripMenuItem.Name = "closeOtherTabsToolStripMenuItem"; - this.closeOtherTabsToolStripMenuItem.Size = new System.Drawing.Size(232, 24); - this.closeOtherTabsToolStripMenuItem.Text = "Close other tabs"; - this.closeOtherTabsToolStripMenuItem.ToolTipText = "Close all tabs except of this one"; - this.closeOtherTabsToolStripMenuItem.Click += new System.EventHandler(this.OnCloseOtherTabsToolStripMenuItemClick); + closeOtherTabsToolStripMenuItem.Name = "closeOtherTabsToolStripMenuItem"; + closeOtherTabsToolStripMenuItem.Size = new System.Drawing.Size(196, 22); + closeOtherTabsToolStripMenuItem.Text = "Close other tabs"; + closeOtherTabsToolStripMenuItem.ToolTipText = "Close all tabs except of this one"; + closeOtherTabsToolStripMenuItem.Click += OnCloseOtherTabsToolStripMenuItemClick; // // closeAllTabsToolStripMenuItem // - this.closeAllTabsToolStripMenuItem.Name = "closeAllTabsToolStripMenuItem"; - this.closeAllTabsToolStripMenuItem.Size = new System.Drawing.Size(232, 24); - this.closeAllTabsToolStripMenuItem.Text = "Close all tabs"; - this.closeAllTabsToolStripMenuItem.ToolTipText = "Close all tabs"; - this.closeAllTabsToolStripMenuItem.Click += new System.EventHandler(this.OnCloseAllTabsToolStripMenuItemClick); - // - // toolStripSeparator13 - // - this.toolStripSeparator13.Name = "toolStripSeparator13"; - this.toolStripSeparator13.Size = new System.Drawing.Size(229, 6); + closeAllTabsToolStripMenuItem.Name = "closeAllTabsToolStripMenuItem"; + closeAllTabsToolStripMenuItem.Size = new System.Drawing.Size(196, 22); + closeAllTabsToolStripMenuItem.Text = "Close all tabs"; + closeAllTabsToolStripMenuItem.ToolTipText = "Close all tabs"; + closeAllTabsToolStripMenuItem.Click += OnCloseAllTabsToolStripMenuItemClick; // // tabColorToolStripMenuItem // - this.tabColorToolStripMenuItem.Name = "tabColorToolStripMenuItem"; - this.tabColorToolStripMenuItem.Size = new System.Drawing.Size(232, 24); - this.tabColorToolStripMenuItem.Text = "Tab color..."; - this.tabColorToolStripMenuItem.ToolTipText = "Sets the tab color"; - this.tabColorToolStripMenuItem.Click += new System.EventHandler(this.OnTabColorToolStripMenuItemClick); + tabColorToolStripMenuItem.Name = "tabColorToolStripMenuItem"; + tabColorToolStripMenuItem.Size = new System.Drawing.Size(196, 22); + tabColorToolStripMenuItem.Text = "Tab color..."; + tabColorToolStripMenuItem.ToolTipText = "Sets the tab color"; + tabColorToolStripMenuItem.Click += OnTabColorToolStripMenuItemClick; // // tabRenameToolStripMenuItem // - this.tabRenameToolStripMenuItem.Name = "tabRenameToolStripMenuItem"; - this.tabRenameToolStripMenuItem.Size = new System.Drawing.Size(232, 24); - this.tabRenameToolStripMenuItem.Text = "Tab rename..."; - this.tabRenameToolStripMenuItem.ToolTipText = "Set the text which is shown on the tab"; - this.tabRenameToolStripMenuItem.Click += new System.EventHandler(this.OnTabRenameToolStripMenuItemClick); - // - // toolStripSeparator16 - // - this.toolStripSeparator16.Name = "toolStripSeparator16"; - this.toolStripSeparator16.Size = new System.Drawing.Size(229, 6); + tabRenameToolStripMenuItem.Name = "tabRenameToolStripMenuItem"; + tabRenameToolStripMenuItem.Size = new System.Drawing.Size(196, 22); + tabRenameToolStripMenuItem.Text = "Tab rename..."; + tabRenameToolStripMenuItem.ToolTipText = "Set the text which is shown on the tab"; + tabRenameToolStripMenuItem.Click += OnTabRenameToolStripMenuItemClick; // // copyPathToClipboardToolStripMenuItem // - this.copyPathToClipboardToolStripMenuItem.Name = "copyPathToClipboardToolStripMenuItem"; - this.copyPathToClipboardToolStripMenuItem.Size = new System.Drawing.Size(232, 24); - this.copyPathToClipboardToolStripMenuItem.Text = "Copy path to clipboard"; - this.copyPathToClipboardToolStripMenuItem.ToolTipText = "The complete file name (incl. path) is copied to clipboard"; - this.copyPathToClipboardToolStripMenuItem.Click += new System.EventHandler(this.OnCopyPathToClipboardToolStripMenuItemClick); + copyPathToClipboardToolStripMenuItem.Name = "copyPathToClipboardToolStripMenuItem"; + copyPathToClipboardToolStripMenuItem.Size = new System.Drawing.Size(196, 22); + copyPathToClipboardToolStripMenuItem.Text = "Copy path to clipboard"; + copyPathToClipboardToolStripMenuItem.ToolTipText = "The complete file name (incl. path) is copied to clipboard"; + copyPathToClipboardToolStripMenuItem.Click += OnCopyPathToClipboardToolStripMenuItemClick; // // findInExplorerToolStripMenuItem // - this.findInExplorerToolStripMenuItem.Name = "findInExplorerToolStripMenuItem"; - this.findInExplorerToolStripMenuItem.Size = new System.Drawing.Size(232, 24); - this.findInExplorerToolStripMenuItem.Text = "Find in Explorer"; - this.findInExplorerToolStripMenuItem.ToolTipText = "Opens an Explorer window and selects the log file"; - this.findInExplorerToolStripMenuItem.Click += new System.EventHandler(this.OnFindInExplorerToolStripMenuItemClick); + findInExplorerToolStripMenuItem.Name = "findInExplorerToolStripMenuItem"; + findInExplorerToolStripMenuItem.Size = new System.Drawing.Size(196, 22); + findInExplorerToolStripMenuItem.Text = "Find in Explorer"; + findInExplorerToolStripMenuItem.ToolTipText = "Opens an Explorer window and selects the log file"; + findInExplorerToolStripMenuItem.Click += OnFindInExplorerToolStripMenuItemClick; // // dragControlDateTime // - this.dragControlDateTime.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.dragControlDateTime.BackColor = System.Drawing.SystemColors.Control; - this.dragControlDateTime.DateTime = new System.DateTime(((long)(0))); - this.dragControlDateTime.DragOrientation = LogExpert.Dialogs.DateTimeDragControl.DragOrientations.Vertical; - this.dragControlDateTime.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.dragControlDateTime.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.dragControlDateTime.HoverColor = System.Drawing.Color.LightGray; - this.dragControlDateTime.Location = new System.Drawing.Point(814, 626); - this.dragControlDateTime.Margin = new System.Windows.Forms.Padding(0); - this.dragControlDateTime.MaxDateTime = new System.DateTime(9999, 12, 31, 23, 59, 59, 999); - this.dragControlDateTime.MinDateTime = new System.DateTime(((long)(0))); - this.dragControlDateTime.Name = "dragControlDateTime"; - this.dragControlDateTime.Size = new System.Drawing.Size(251, 25); - this.dragControlDateTime.TabIndex = 14; - this.dragControlDateTime.ValueChanged += new LogExpert.Dialogs.DateTimeDragControl.ValueChangedEventHandler(this.OnDateTimeDragControlValueChanged); - this.dragControlDateTime.ValueDragged += new LogExpert.Dialogs.DateTimeDragControl.ValueDraggedEventHandler(this.OnDateTimeDragControlValueDragged); + dragControlDateTime.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; + dragControlDateTime.BackColor = System.Drawing.SystemColors.Control; + dragControlDateTime.DateTime = new System.DateTime(0L); + dragControlDateTime.DragOrientation = DateTimeDragControl.DragOrientations.Vertical; + dragControlDateTime.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0); + dragControlDateTime.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + dragControlDateTime.HoverColor = System.Drawing.Color.LightGray; + dragControlDateTime.Location = new System.Drawing.Point(1017, 977); + dragControlDateTime.Margin = new Padding(0); + dragControlDateTime.MaxDateTime = new System.DateTime(9999, 12, 31, 23, 59, 59, 999); + dragControlDateTime.MinDateTime = new System.DateTime(0L); + dragControlDateTime.Name = "dragControlDateTime"; + dragControlDateTime.Size = new System.Drawing.Size(313, 38); + dragControlDateTime.TabIndex = 14; + dragControlDateTime.ValueChanged += OnDateTimeDragControlValueChanged; + dragControlDateTime.ValueDragged += OnDateTimeDragControlValueDragged; // // LogTabWindow // - this.AllowDrop = true; - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.Control; - this.ClientSize = new System.Drawing.Size(1283, 651); - this.Controls.Add(this.checkBoxFollowTail); - this.Controls.Add(this.dragControlDateTime); - this.Controls.Add(this.toolStripContainer); - this.Controls.Add(this.statusStrip); - this.DoubleBuffered = true; - this.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.KeyPreview = true; - this.MainMenuStrip = this.mainMenuStrip; - this.Margin = new System.Windows.Forms.Padding(4); - this.Name = "LogTabWindow"; - this.Text = "LogExpert"; - this.Activated += new System.EventHandler(this.OnLogTabWindowActivated); - this.Deactivate += new System.EventHandler(this.OnLogTabWindowDeactivate); - this.SizeChanged += new System.EventHandler(this.OnLogTabWindowSizeChanged); - this.DragDrop += new System.Windows.Forms.DragEventHandler(this.OnLogWindowDragDrop); - this.DragEnter += new System.Windows.Forms.DragEventHandler(this.OnLogTabWindowDragEnter); - this.DragOver += new System.Windows.Forms.DragEventHandler(this.OnLogWindowDragOver); - this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnLogTabWindowKeyDown); - this.statusStrip.ResumeLayout(false); - this.statusStrip.PerformLayout(); - this.mainMenuStrip.ResumeLayout(false); - this.mainMenuStrip.PerformLayout(); - this.toolStripContainer.ContentPanel.ResumeLayout(false); - this.toolStripContainer.TopToolStripPanel.ResumeLayout(false); - this.toolStripContainer.TopToolStripPanel.PerformLayout(); - this.toolStripContainer.ResumeLayout(false); - this.toolStripContainer.PerformLayout(); - this.buttonToolStrip.ResumeLayout(false); - this.buttonToolStrip.PerformLayout(); - this.tabContextMenuStrip.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); - + AllowDrop = true; + ClientSize = new System.Drawing.Size(1603, 1017); + Controls.Add(checkBoxFollowTail); + Controls.Add(dragControlDateTime); + Controls.Add(toolStripContainer); + Controls.Add(statusStrip); + DoubleBuffered = true; + Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon"); + KeyPreview = true; + MainMenuStrip = mainMenuStrip; + Margin = new Padding(4, 7, 4, 7); + Name = "LogTabWindow"; + Text = "LogExpert"; + Activated += OnLogTabWindowActivated; + Deactivate += OnLogTabWindowDeactivate; + SizeChanged += OnLogTabWindowSizeChanged; + DragDrop += OnLogWindowDragDrop; + DragEnter += OnLogTabWindowDragEnter; + DragOver += OnLogWindowDragOver; + KeyDown += OnLogTabWindowKeyDown; + statusStrip.ResumeLayout(false); + statusStrip.PerformLayout(); + mainMenuStrip.ResumeLayout(false); + mainMenuStrip.PerformLayout(); + toolStripContainer.ContentPanel.ResumeLayout(false); + toolStripContainer.TopToolStripPanel.ResumeLayout(false); + toolStripContainer.TopToolStripPanel.PerformLayout(); + toolStripContainer.ResumeLayout(false); + toolStripContainer.PerformLayout(); + buttonToolStrip.ResumeLayout(false); + buttonToolStrip.PerformLayout(); + tabContextMenuStrip.ResumeLayout(false); + ResumeLayout(false); + PerformLayout(); } #endregion @@ -1529,28 +1263,24 @@ private void InitializeComponent() private ToolStripMenuItem newFromClipboardToolStripMenuItem; private ToolStripMenuItem openURIToolStripMenuItem; private ToolStripMenuItem columnFinderToolStripMenuItem; - private WeifenLuo.WinFormsUI.Docking.DockPanel dockPanel; + private DockPanel dockPanel; private ToolStripMenuItem tabRenameToolStripMenuItem; - private LineToolStripSeparatorExtension toolStripSeparator1; - private MenuToolStripSeparatorExtension toolStripSeparator2; - private MenuToolStripSeparatorExtension toolStripSeparator3; - private MenuToolStripSeparatorExtension toolStripSeparator4; - private MenuToolStripSeparatorExtension toolStripSeparator6; - private MenuToolStripSeparatorExtension toolStripSeparator8; - private MenuToolStripSeparatorExtension toolStripSeparator7; - private MenuToolStripSeparatorExtension toolStripSeparator9; - private LineToolStripSeparatorExtension toolStripSeparator10; - private LineToolStripSeparatorExtension toolStripSeparator11; - private MenuToolStripSeparatorExtension toolStripSeparator5; - private MenuToolStripSeparatorExtension toolStripSeparator13; - private MenuToolStripSeparatorExtension toolStripSeparator14; - private LineToolStripSeparatorExtension toolStripSeparator15; - private MenuToolStripSeparatorExtension toolStripSeparator16; - private LineToolStripSeparatorExtension toolStripSeparator17; + private LineToolStripSeparatorExtension lineToolStripSeparatorExtension1; + private LineToolStripSeparatorExtension lineToolStripSeparatorExtension2; + private MenuToolStripSeparatorExtension menuToolStripSeparatorExtension1; + private MenuToolStripSeparatorExtension menuToolStripSeparatorExtension2; + private MenuToolStripSeparatorExtension menuToolStripSeparatorExtension3; + private LineToolStripSeparatorExtension lineToolStripSeparatorExtension3; + private LineToolStripSeparatorExtension lineToolStripSeparatorExtension4; + private LineToolStripSeparatorExtension lineToolStripSeparatorExtension5; + private MenuToolStripSeparatorExtension menuToolStripSeparatorExtension5; + private MenuToolStripSeparatorExtension menuToolStripSeparatorExtension6; + private MenuToolStripSeparatorExtension menuToolStripSeparatorExtension4; + private MenuToolStripSeparatorExtension menuToolStripSeparatorExtension7; + private MenuToolStripSeparatorExtension menuToolStripSeparatorExtension9; + private MenuToolStripSeparatorExtension menuToolStripSeparatorExtension8; private MenuToolStripSeparatorExtension configureToolStripSeparator; - private MenuToolStripSeparatorExtension toolStripSeparator12; - private MenuToolStripSeparatorExtension toolStripSeparator18; - private MenuToolStripSeparatorExtension toolStripSeparator19; + private MenuToolStripSeparatorExtension menuToolStripSeparatorExtension11; } } diff --git a/src/LogExpert/Controls/LogTabWindow/LogTabWindow.resx b/src/LogExpert/Controls/LogTabWindow/LogTabWindow.resx index 99080256..ff6cd4c1 100644 --- a/src/LogExpert/Controls/LogTabWindow/LogTabWindow.resx +++ b/src/LogExpert/Controls/LogTabWindow/LogTabWindow.resx @@ -1,17 +1,17 @@ - @@ -123,38 +123,28 @@ 133, 17 + + 522, 17 + 417, 17 - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAADRSURBVDhPvZEhDoQwEEU5D5ID4LkAHo/BIbFIHBaLRqKQ - CDyCs8zmNQNT0SzNin3Jz5Tmvya0yc2yLDJNU1ToqmaM4yjXdUWFQ1QzOOA8z6jQVc0YhkGO43AFf4b2 - 6Kpm9H0v+74/kr/2v5l0VTO6rpNt21zhbdJVzWiaRtZ1jQpd1Yy6rt3zxISuakZVVTLPc1ToqmaUZen+ - 774o3prnYvr7TLqqGW3bSlEUT5AJkr9P6KoWJs9z91TcOuvgpX0jyzInM4MX9gZSmqa/yX8mST5z+a54 - jYnq1AAAAABJRU5ErkJggg== - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG - YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 - 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw - bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc - VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 - c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 - Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo - mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ - kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D - TgDQASA1MVpwzwAAAABJRU5ErkJggg== + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIFSURBVDhPpZLtS1NhGMbPPxJmmlYSgqHiKzGU1EDxg4iK + YKyG2WBogqMYJQOtCEVRFBGdTBCJfRnkS4VaaWNT5sqx1BUxRXxDHYxAJLvkusEeBaPAB+5z4Jzn+t3X + /aLhnEfjo8m+dCoa+7/C3O2Hqe0zDC+8KG+cRZHZhdzaaWTVTCLDMIY0vfM04Nfh77/G/sEhwpEDbO3t + I7TxE8urEVy99fT/AL5gWDLrTB/hnF4XsW0khCu5ln8DmJliT2AXrcNBsU1gj/MH4nMeKwBrPktM28xM + cX79DFKrHHD5d9D26hvicx4pABt2lpg10zYzU0zr7+e3xXGcrkEB2O2TNec9nJFwB3alZn5jZorfeDZh + 6Q3g8s06BeCoKF4MRURoH1+BY2oNCbeb0TIclIYxOhzf8frTOuo7FxCbbVIAzpni0iceEc8vhzEwGkJD + lx83ymxifejdKjRNk/8PWnyIyTQqAJek0jqHwfEVscu31baIu8+90sTE4nY025dQ2/5FIPpnXlzKuK8A + HBUzHot52djqQ6HZhfR7IwK4mKpHtvEDMqvfCiQ6zaAAXM8x94aIWTNrLLG4kVUzgaTSPlzLtyJOZxbb + 1wtfyg4Q+AfA3aZlButjSfxGcUJBk4g5tuP3haQKRKXcUQDOmbvNTpPOJeFFjordZmbWTNvMTHFUcpUC + nOccAdABIDXXE1nzAAAAAElFTkSuQmCC - - 522, 17 - 248, 17 diff --git a/src/LogExpert/Controls/LogTabWindow/LogTabWindowEventHandlers.cs b/src/LogExpert/Controls/LogTabWindow/LogTabWindowEventHandlers.cs index a3d6a48e..c54686ab 100644 --- a/src/LogExpert/Controls/LogTabWindow/LogTabWindowEventHandlers.cs +++ b/src/LogExpert/Controls/LogTabWindow/LogTabWindowEventHandlers.cs @@ -99,7 +99,7 @@ private void OnLogTabWindowClosing(object sender, CancelEventArgs e) DestroyBookmarkWindow(); - ConfigManager.Instance.ConfigChanged -= ConfigChanged; + ConfigManager.Instance.ConfigChanged -= OnConfigChanged; SaveWindowPosition(); ConfigManager.Save(SettingsFlags.WindowPosition | SettingsFlags.FileHistory); @@ -158,7 +158,7 @@ private void OnSelectFilterToolStripMenuItemClick(object sender, EventArgs e) } CurrentLogWindow.ColumnizerCallbackObject.LineNum = CurrentLogWindow.GetCurrentLineNum(); - FilterSelectorForm form = new FilterSelectorForm(PluginRegistry.GetInstance().RegisteredColumnizers, CurrentLogWindow.CurrentColumnizer, CurrentLogWindow.ColumnizerCallbackObject); + FilterSelectorForm form = new(PluginRegistry.GetInstance().RegisteredColumnizers, CurrentLogWindow.CurrentColumnizer, CurrentLogWindow.ColumnizerCallbackObject); form.Owner = this; form.TopMost = TopMost; DialogResult res = form.ShowDialog(); @@ -221,7 +221,7 @@ private void OnGoToLineToolStripMenuItemClick(object sender, EventArgs e) return; } - GotoLineDialog dlg = new GotoLineDialog(this); + GotoLineDialog dlg = new(this); DialogResult res = dlg.ShowDialog(); if (res == DialogResult.OK) { @@ -313,7 +313,7 @@ private void OnTimeShiftToolStripMenuItemCheckStateChanged(object sender, EventA private void OnAboutToolStripMenuItemClick(object sender, EventArgs e) { - AboutBox aboutBox = new AboutBox(); + AboutBox aboutBox = new(); aboutBox.TopMost = TopMost; aboutBox.ShowDialog(); } @@ -707,19 +707,21 @@ private void OnTabColorToolStripMenuItemClick(object sender, EventArgs e) LogWindow.LogWindow logWindow = dockPanel.ActiveContent as LogWindow.LogWindow; LogWindowData data = logWindow.Tag as LogWindowData; + if (data == null) { return; } - ColorDialog dlg = new ColorDialog(); + ColorDialog dlg = new(); dlg.Color = data.color; if (dlg.ShowDialog() == DialogResult.OK) { data.color = dlg.Color; SetTabColor(logWindow, data.color); } - List delList = new List(); + List delList = []; + foreach (ColorEntry entry in ConfigManager.Settings.fileColors) { if (entry.FileName.ToLower().Equals(logWindow.FileName.ToLower())) @@ -727,11 +729,13 @@ private void OnTabColorToolStripMenuItemClick(object sender, EventArgs e) delList.Add(entry); } } + foreach (ColorEntry entry in delList) { ConfigManager.Settings.fileColors.Remove(entry); } ConfigManager.Settings.fileColors.Add(new ColorEntry(logWindow.FileName, dlg.Color)); + while (ConfigManager.Settings.fileColors.Count > MAX_COLOR_HISTORY) { ConfigManager.Settings.fileColors.RemoveAt(0); @@ -748,13 +752,14 @@ private void OnLogTabWindowSizeChanged(object sender, EventArgs e) private void OnSaveProjectToolStripMenuItemClick(object sender, EventArgs e) { - SaveFileDialog dlg = new SaveFileDialog(); + SaveFileDialog dlg = new(); dlg.DefaultExt = "lxj"; dlg.Filter = @"LogExpert session (*.lxj)|*.lxj"; + if (dlg.ShowDialog() == DialogResult.OK) { string fileName = dlg.FileName; - List fileNames = new List(); + List fileNames = []; lock (_logWindowList) { @@ -768,7 +773,8 @@ private void OnSaveProjectToolStripMenuItemClick(object sender, EventArgs e) } } } - ProjectData projectData = new ProjectData(); + + ProjectData projectData = new(); projectData.memberList = fileNames; projectData.tabLayoutXml = SaveLayout(); ProjectPersister.SaveProjectData(fileName, projectData); @@ -777,7 +783,7 @@ private void OnSaveProjectToolStripMenuItemClick(object sender, EventArgs e) private void OnLoadProjectToolStripMenuItemClick(object sender, EventArgs e) { - OpenFileDialog dlg = new OpenFileDialog(); + OpenFileDialog dlg = new(); dlg.DefaultExt = "lxj"; dlg.Filter = @"LogExpert sessions (*.lxj)|*.lxj"; @@ -806,7 +812,7 @@ private void OnFindInExplorerToolStripMenuItemClick(object sender, EventArgs e) { LogWindow.LogWindow logWindow = dockPanel.ActiveContent as LogWindow.LogWindow; - Process explorer = new Process(); + Process explorer = new(); explorer.StartInfo.FileName = "explorer.exe"; explorer.StartInfo.Arguments = "/e,/select," + logWindow.Title; explorer.StartInfo.UseShellExecute = false; @@ -836,7 +842,8 @@ private void OnHighlightGroupsComboBoxMouseUp(object sender, MouseEventArgs e) } } - private void ConfigChanged(object sender, ConfigChangedEventArgs e) + + private void OnConfigChanged(object sender, ConfigChangedEventArgs e) { if (LogExpertProxy != null) { @@ -899,7 +906,7 @@ private void OnThrowExceptionBackgroundThToolStripMenuItemClick(object sender, E private void OnThrowExceptionBackgroundThreadToolStripMenuItemClick(object sender, EventArgs e) { - Thread thread = new Thread(ThrowExceptionThreadFx); + Thread thread = new(ThrowExceptionThreadFx); thread.IsBackground = true; thread.Start(); } @@ -969,7 +976,7 @@ private void OnNewFromClipboardToolStripMenuItemClick(object sender, EventArgs e private void OnOpenURIToolStripMenuItemClick(object sender, EventArgs e) { - OpenUriDialog dlg = new OpenUriDialog(); + OpenUriDialog dlg = new(); dlg.UriHistory = ConfigManager.Settings.uriHistoryList; if (DialogResult.OK == dlg.ShowDialog()) @@ -1005,7 +1012,7 @@ private void OnTabRenameToolStripMenuItemClick(object sender, EventArgs e) { if (CurrentLogWindow != null) { - TabRenameDlg dlg = new TabRenameDlg(); + TabRenameDlg dlg = new(); dlg.TabName = CurrentLogWindow.Text; if (DialogResult.OK == dlg.ShowDialog()) { diff --git a/src/LogExpert/Controls/LogTabWindow/LogTabWindowPrivate.cs b/src/LogExpert/Controls/LogTabWindow/LogTabWindowPrivate.cs index 0f42cf61..4e11a442 100644 --- a/src/LogExpert/Controls/LogTabWindow/LogTabWindowPrivate.cs +++ b/src/LogExpert/Controls/LogTabWindow/LogTabWindowPrivate.cs @@ -1,4 +1,12 @@ -using System; +using LogExpert.Classes; +using LogExpert.Classes.Columnizer; +using LogExpert.Classes.Persister; +using LogExpert.Config; +using LogExpert.Dialogs; +using LogExpert.Entities; +using LogExpert.Entities.EventArgs; + +using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; @@ -9,13 +17,7 @@ using System.Text; using System.Threading; using System.Windows.Forms; -using LogExpert.Classes; -using LogExpert.Classes.Columnizer; -using LogExpert.Classes.Persister; -using LogExpert.Config; -using LogExpert.Dialogs; -using LogExpert.Entities; -using LogExpert.Entities.EventArgs; + using WeifenLuo.WinFormsUI.Docking; namespace LogExpert.Controls.LogTabWindow @@ -34,8 +36,8 @@ private void PasteFromClipboard() string text = Clipboard.GetText(); string fileName = Path.GetTempFileName(); - using (FileStream fStream = new FileStream(fileName, FileMode.Append, FileAccess.Write, FileShare.Read)) - using (StreamWriter writer = new StreamWriter(fStream, Encoding.Unicode)) + using (FileStream fStream = new(fileName, FileMode.Append, FileAccess.Write, FileShare.Read)) + using (StreamWriter writer = new(fStream, Encoding.Unicode)) { writer.Write(text); writer.Close(); @@ -164,7 +166,7 @@ private void AddLogWindow(LogWindow.LogWindow logWindow, string title, bool doNo logWindow.Show(dockPanel); } - LogWindowData data = new LogWindowData(); + LogWindowData data = new(); data.diffSum = 0; logWindow.Tag = data; lock (_logWindowList) @@ -326,15 +328,15 @@ private void RemoveAndDisposeLogWindow(LogWindow.LogWindow logWindow, bool dontA private void ShowHighlightSettingsDialog() { - HighlightDialog dlg = new HighlightDialog(); + HighlightDialog dlg = new(); dlg.KeywordActionList = PluginRegistry.GetInstance().RegisteredKeywordActions; dlg.Owner = this; dlg.TopMost = TopMost; dlg.HighlightGroupList = HilightGroupList; dlg.PreSelectedGroupName = groupsComboBoxHighlightGroups.Text; - + DialogResult res = dlg.ShowDialog(); - + if (res == DialogResult.OK) { HilightGroupList = dlg.HighlightGroupList; @@ -361,11 +363,11 @@ private void FillHighlightComboBox() private void OpenFileDialog() { - OpenFileDialog openFileDialog = new OpenFileDialog(); + OpenFileDialog openFileDialog = new(); if (CurrentLogWindow != null) { - FileInfo info = new FileInfo(CurrentLogWindow.FileName); + FileInfo info = new(CurrentLogWindow.FileName); openFileDialog.InitialDirectory = info.DirectoryName; } else @@ -392,7 +394,7 @@ private void OpenFileDialog() if (DialogResult.OK == openFileDialog.ShowDialog(this)) { - FileInfo info = new FileInfo(openFileDialog.FileName); + FileInfo info = new(openFileDialog.FileName); if (info.Directory.Exists) { ConfigManager.Settings.lastDirectory = info.DirectoryName; @@ -425,7 +427,7 @@ private void LoadFiles(string[] names, bool invertLogic) MultiFileOption option = ConfigManager.Settings.preferences.multiFileOption; if (option == MultiFileOption.Ask) { - MultiLoadRequestDialog dlg = new MultiLoadRequestDialog(); + MultiLoadRequestDialog dlg = new(); DialogResult res = dlg.ShowDialog(); if (res == DialogResult.Yes) @@ -587,7 +589,7 @@ private void ConnectToolWindows(LogWindow.LogWindow logWindow) private void ConnectBookmarkWindow(LogWindow.LogWindow logWindow) { - FileViewContext ctx = new FileViewContext(logWindow, logWindow); + FileViewContext ctx = new(logWindow, logWindow); _bookmarkWindow.SetBookmarkData(logWindow.BookmarkData); _bookmarkWindow.SetCurrentFile(ctx); } @@ -704,9 +706,9 @@ private void StatusLineEventWorker(StatusLineEventArgs e) { //_logger.logDebug("StatusLineEvent: text = " + e.StatusText); labelStatus.Text = e.StatusText; - labelLines.Text = "" + e.LineCount + " lines"; + labelLines.Text = $@"{string.Empty} {e.LineCount} lines"; labelSize.Text = Util.GetFileSizeAsText(e.FileSize); - labelCurrentLine.Text = "" + e.CurrentLineNum; + labelCurrentLine.Text = $@"Line: {e.CurrentLineNum}"; statusStrip.Refresh(); } @@ -717,7 +719,7 @@ private Icon CreateLedIcon(int level, bool dirty, int tailState, int syncMode) Rectangle iconRect = _leds[0]; iconRect.Height = 16; // (DockPanel's damn hardcoded height) // this.leds[this.leds.Length - 1].Bottom; iconRect.Width = iconRect.Right + 6; - Bitmap bmp = new Bitmap(iconRect.Width, iconRect.Height); + Bitmap bmp = new(iconRect.Width, iconRect.Height); Graphics gfx = Graphics.FromImage(bmp); int offsetFromTop = 4; @@ -726,7 +728,7 @@ private Icon CreateLedIcon(int level, bool dirty, int tailState, int syncMode) { Rectangle ledRect = _leds[i]; ledRect.Offset(0, offsetFromTop); - + if (level >= _leds.Length - i) { gfx.FillRectangle(_ledBrushes[i], ledRect); @@ -740,10 +742,10 @@ private Icon CreateLedIcon(int level, bool dirty, int tailState, int syncMode) int ledSize = 3; int ledGap = 1; Rectangle lastLed = _leds[_leds.Length - 1]; - Rectangle dirtyLed = new Rectangle(lastLed.Right + 2, lastLed.Bottom - ledSize, ledSize, ledSize); - Rectangle tailLed = new Rectangle(dirtyLed.Location, dirtyLed.Size); + Rectangle dirtyLed = new(lastLed.Right + 2, lastLed.Bottom - ledSize, ledSize, ledSize); + Rectangle tailLed = new(dirtyLed.Location, dirtyLed.Size); tailLed.Offset(0, -(ledSize + ledGap)); - Rectangle syncLed = new Rectangle(tailLed.Location, dirtyLed.Size); + Rectangle syncLed = new(tailLed.Location, dirtyLed.Size); syncLed.Offset(0, -(ledSize + ledGap)); syncLed.Offset(0, offsetFromTop); @@ -944,7 +946,7 @@ private void RefreshEncodingMenuBar(Encoding encoding) private void OpenSettings(int tabToOpen) { - SettingsDialog dlg = new SettingsDialog(ConfigManager.Settings.preferences, this, tabToOpen); + SettingsDialog dlg = new(ConfigManager.Settings.preferences, this, tabToOpen); dlg.TopMost = TopMost; if (DialogResult.OK == dlg.ShowDialog()) @@ -1065,7 +1067,7 @@ private void ToolButtonClick(ToolEntry toolEntry) ILogFileInfo info = CurrentLogWindow.GetCurrentFileInfo(); if (line != null && info != null) { - ArgParser parser = new ArgParser(toolEntry.args); + ArgParser parser = new(toolEntry.args); string argLine = parser.BuildArgs(line, CurrentLogWindow.GetRealLineNum() + 1, info, this); if (argLine != null) { @@ -1083,8 +1085,8 @@ private void StartTool(string cmd, string args, bool sysoutPipe, string columniz return; } - Process process = new Process(); - ProcessStartInfo startInfo = new ProcessStartInfo(cmd, args); + Process process = new(); + ProcessStartInfo startInfo = new(cmd, args); if (!Util.IsNull(workingDir)) { startInfo.WorkingDirectory = workingDir; @@ -1113,18 +1115,21 @@ private void StartTool(string cmd, string args, bool sysoutPipe, string columniz return; } - SysoutPipe pipe = new SysoutPipe(process.StandardOutput); + SysoutPipe pipe = new(process.StandardOutput); + LogWindow.LogWindow logWin = AddTempFileTab(pipe.FileName, CurrentLogWindow.IsTempFile ? CurrentLogWindow.TempTitleName : Util.GetNameFromPath(CurrentLogWindow.FileName) + "->E"); logWin.ForceColumnizer(columnizer); + process.Exited += pipe.ProcessExitedEventHandler; //process.BeginOutputReadLine(); } else { _logger.Info("Starting external tool: {0} {1}", cmd, args); + try { startInfo.UseShellExecute = false; @@ -1175,7 +1180,7 @@ private void LoadProject(string projectFileName, bool restoreLayout) if (hasLayoutData && restoreLayout && _logWindowList.Count > 0) { - ProjectLoadDlg dlg = new ProjectLoadDlg(); + ProjectLoadDlg dlg = new(); if (DialogResult.Cancel != dlg.ShowDialog()) { switch (dlg.ProjectLoadResult) @@ -1187,7 +1192,7 @@ private void LoadProject(string projectFileName, bool restoreLayout) CloseAllTabs(); break; case ProjectLoadDlgResult.NewWindow: - LogExpertProxy.NewWindow(new string[] {projectFileName}); + LogExpertProxy.NewWindow(new[] { projectFileName }); return; } } @@ -1225,7 +1230,7 @@ private void ApplySelectedHighlightGroup() private void FillToolLauncherBar() { - char[] labels = + char[] labels = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' @@ -1240,14 +1245,18 @@ private void FillToolLauncherBar() { if (tool.isFavourite) { - ToolStripButton button = new ToolStripButton("" + labels[num % 26]); - button.Tag = tool; + ToolStripButton button = new("" + labels[num % 26]) + { + Alignment = ToolStripItemAlignment.Left, + Tag = tool + }; + SetToolIcon(tool, button); externalToolsToolStrip.Items.Add(button); } num++; - ToolStripMenuItem menuItem = new ToolStripMenuItem(tool.name); + ToolStripMenuItem menuItem = new(tool.name); menuItem.Tag = tool; SetToolIcon(tool, menuItem); toolsToolStripMenuItem.DropDownItems.Add(menuItem); @@ -1288,32 +1297,35 @@ private void ThrowExceptionThreadFx() private string SaveLayout() { - ; - using (MemoryStream memStream = new MemoryStream(2000)) - using (StreamReader r = new StreamReader(memStream)) + using (MemoryStream memStream = new(2000)) { - dockPanel.SaveAsXml(memStream, Encoding.UTF8, true); + using (StreamReader r = new(memStream)) + { + dockPanel.SaveAsXml(memStream, Encoding.UTF8, true); - memStream.Seek(0, SeekOrigin.Begin); - string resultXml = r.ReadToEnd(); + memStream.Seek(0, SeekOrigin.Begin); + string resultXml = r.ReadToEnd(); - r.Close(); + r.Close(); - return resultXml; + return resultXml; + } } } private void RestoreLayout(string layoutXml) { - using (MemoryStream memStream = new MemoryStream(2000)) - using (StreamWriter w = new StreamWriter(memStream)) + using (MemoryStream memStream = new(2000)) { - w.Write(layoutXml); - w.Flush(); + using (StreamWriter w = new(memStream)) + { + w.Write(layoutXml); + w.Flush(); - memStream.Seek(0, SeekOrigin.Begin); + memStream.Seek(0, SeekOrigin.Begin); - dockPanel.LoadFromXml(memStream, DeserializeDockContent, true); + dockPanel.LoadFromXml(memStream, DeserializeDockContent, true); + } } } diff --git a/src/LogExpert/Controls/LogTabWindow/LogTabWindowPublic.cs b/src/LogExpert/Controls/LogTabWindow/LogTabWindowPublic.cs index f1456bd0..90cbc461 100644 --- a/src/LogExpert/Controls/LogTabWindow/LogTabWindowPublic.cs +++ b/src/LogExpert/Controls/LogTabWindow/LogTabWindowPublic.cs @@ -4,6 +4,7 @@ using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; +using System.Threading.Tasks; using System.Windows.Forms; using LogExpert.Classes; using LogExpert.Classes.Columnizer; @@ -29,7 +30,7 @@ public LogWindow.LogWindow AddFilterTab(FilterPipe pipe, string title, ILogLineC LogWindow.LogWindow logWin = AddFileTab(pipe.FileName, true, title, false, preProcessColumnizer); if (pipe.FilterParams.searchText.Length > 0) { - ToolTip tip = new ToolTip(components); + ToolTip tip = new(components); tip.SetToolTip(logWin, "Filter: \"" + pipe.FilterParams.searchText + "\"" + (pipe.FilterParams.isInvert ? " (Invert match)" : "") + @@ -64,9 +65,9 @@ public LogWindow.LogWindow AddFileTab(string givenFileName, bool isTempFile, str return win; } - EncodingOptions encodingOptions = new EncodingOptions(); + EncodingOptions encodingOptions = new(); FillDefaultEncodingFromSettings(encodingOptions); - LogWindow.LogWindow logWindow = new LogWindow.LogWindow(this, logFileName, isTempFile, forcePersistenceLoading); + LogWindow.LogWindow logWindow = new(this, logFileName, isTempFile, forcePersistenceLoading); logWindow.GivenFileName = givenFileName; @@ -116,7 +117,7 @@ public LogWindow.LogWindow AddFileTab(string givenFileName, bool isTempFile, str // this.BeginInvoke(new LoadFileDelegate(logWindow.LoadFile), new object[] { logFileName, encoding }); LoadFileDelegate loadFileFx = logWindow.LoadFile; - loadFileFx.BeginInvoke(logFileName, encodingOptions, null, null); + Task task = Task.Run(() => logWindow.LoadFile(logFileName, encodingOptions)); return logWindow; } @@ -127,11 +128,11 @@ public LogWindow.LogWindow AddMultiFileTab(string[] fileNames) return null; } - LogWindow.LogWindow logWindow = new LogWindow.LogWindow(this, fileNames[fileNames.Length - 1], false, false); + LogWindow.LogWindow logWindow = new(this, fileNames[fileNames.Length - 1], false, false); AddLogWindow(logWindow, fileNames[fileNames.Length - 1], false); multiFileToolStripMenuItem.Checked = true; multiFileEnabledStripMenuItem.Checked = true; - EncodingOptions encodingOptions = new EncodingOptions(); + EncodingOptions encodingOptions = new(); FillDefaultEncodingFromSettings(encodingOptions); BeginInvoke(new LoadMultiFilesDelegate(logWindow.LoadFilesAsMulti), fileNames, encodingOptions); AddToFileHistory(fileNames[0]); @@ -150,7 +151,7 @@ public void OpenSearchDialog() return; } - SearchDialog dlg = new SearchDialog(); + SearchDialog dlg = new(); AddOwnedForm(dlg); dlg.TopMost = TopMost; SearchParams.historyList = ConfigManager.Settings.searchHistoryList; diff --git a/src/LogExpert/Controls/LogWindow/LogWindow.cs b/src/LogExpert/Controls/LogWindow/LogWindow.cs index 3988fd6e..0bc09e9e 100644 --- a/src/LogExpert/Controls/LogWindow/LogWindow.cs +++ b/src/LogExpert/Controls/LogWindow/LogWindow.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Threading; -using System.Windows.Forms; -using LogExpert.Classes; +using LogExpert.Classes; using LogExpert.Classes.Bookmark; using LogExpert.Classes.Filter; using LogExpert.Classes.Highlight; @@ -16,7 +11,16 @@ using LogExpert.Entities.EventArgs; using LogExpert.Extensions.Forms; using LogExpert.Interface; + using NLog; + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; + using WeifenLuo.WinFormsUI.Docking; namespace LogExpert.Controls.LogWindow @@ -27,70 +31,74 @@ public partial class LogWindow : DockContent, ILogPaintContext, ILogView private const int SPREAD_MAX = 99; private const int PROGRESS_BAR_MODULO = 1000; - private const int FILTER_ADVANCED_SPLITTER_DISTANCE = 54; + private const int FILTER_ADVANCED_SPLITTER_DISTANCE = 100; private static readonly ILogger _logger = LogManager.GetCurrentClassLogger(); private readonly Image _advancedButtonImage; - private readonly object _bookmarkLock = new object(); - private readonly BookmarkDataProvider _bookmarkProvider = new BookmarkDataProvider(); + private readonly object _bookmarkLock = new(); + private readonly BookmarkDataProvider _bookmarkProvider = new(); private readonly IList _cancelHandlerList = new List(); - private readonly object _currentColumnizerLock = new object(); + private readonly object _currentColumnizerLock = new(); - private readonly object _currentHighlightGroupLock = new object(); + private readonly object _currentHighlightGroupLock = new(); private readonly EventWaitHandle _externaLoadingFinishedEvent = new ManualResetEvent(false); private readonly IList _filterPipeList = new List(); - private readonly Dictionary _freezeStateMap = new Dictionary(); - private readonly GuiStateArgs _guiStateArgs = new GuiStateArgs(); + private readonly Dictionary _freezeStateMap = []; + private readonly GuiStateArgs _guiStateArgs = new(); - private readonly List _lineHashList = new List(); + private readonly List _lineHashList = []; private readonly EventWaitHandle _loadingFinishedEvent = new ManualResetEvent(false); private readonly EventWaitHandle _logEventArgsEvent = new ManualResetEvent(false); - private readonly List _logEventArgsList = new List(); - private readonly Thread _logEventHandlerThread; + private readonly List _logEventArgsList = []; + private readonly Task _logEventHandlerTask; + //private readonly Thread _logEventHandlerThread; private readonly Image _panelCloseButtonImage; private readonly Image _panelOpenButtonImage; private readonly LogTabWindow.LogTabWindow _parentLogTabWin; - private readonly ProgressEventArgs _progressEventArgs = new ProgressEventArgs(); - private readonly object _reloadLock = new object(); + private readonly ProgressEventArgs _progressEventArgs = new(); + private readonly object _reloadLock = new(); private readonly Image _searchButtonImage; - private readonly DelayedTrigger _selectionChangedTrigger = new DelayedTrigger(200); - private readonly StatusLineEventArgs _statusEventArgs = new StatusLineEventArgs(); + private readonly DelayedTrigger _selectionChangedTrigger = new(200); + private readonly StatusLineEventArgs _statusEventArgs = new(); - private readonly DelayedTrigger _statusLineTrigger = new DelayedTrigger(200); - private readonly object _tempHighlightEntryListLock = new object(); + private readonly DelayedTrigger _statusLineTrigger = new(200); + private readonly object _tempHighlightEntryListLock = new(); - private readonly Thread _timeShiftSyncThread; + private readonly Task _timeShiftSyncTask; + private readonly CancellationTokenSource cts = new(); + + //private readonly Thread _timeShiftSyncThread; private readonly EventWaitHandle _timeShiftSyncTimerEvent = new ManualResetEvent(false); private readonly EventWaitHandle _timeShiftSyncWakeupEvent = new ManualResetEvent(false); private readonly TimeSpreadCalculator _timeSpreadCalc; - private readonly object _timeSyncListLock = new object(); + private readonly object _timeSyncListLock = new(); - private ColumnCache _columnCache = new ColumnCache(); + private ColumnCache _columnCache = new(); private ILogLineColumnizer _currentColumnizer; //List currentHilightEntryList = new List(); - private HilightGroup _currentHighlightGroup = new HilightGroup(); + private HilightGroup _currentHighlightGroup = new(); private SearchParams _currentSearchParams; private string[] _fileNames; - private List _filterHitList = new List(); - private FilterParams _filterParams = new FilterParams(); + private List _filterHitList = []; + private FilterParams _filterParams = new(); private int _filterPipeNameCounter = 0; - private List _filterResultList = new List(); + private List _filterResultList = []; private EventWaitHandle _filterUpdateEvent = new ManualResetEvent(false); @@ -103,25 +111,25 @@ public partial class LogWindow : DockContent, ILogPaintContext, ILogView private bool _isMultiFile; private bool _isSearching; private bool _isTimestampDisplaySyncing; - private List _lastFilterLinesList = new List(); + private List _lastFilterLinesList = []; private int _lineHeight = 0; internal LogfileReader _logFileReader; - private MultiFileOptions _multiFileOptions = new MultiFileOptions(); + private MultiFileOptions _multiFileOptions = new(); private bool _noSelectionUpdates; - private PatternArgs _patternArgs = new PatternArgs(); + private PatternArgs _patternArgs = new(); private PatternWindow _patternWindow; private ReloadMemento _reloadMemento; private int _reloadOverloadCounter = 0; - private SortedList _rowHeightList = new SortedList(); + private SortedList _rowHeightList = []; private int _selectedCol = 0; // set by context menu event for column headers only private bool _shouldCallTimeSync; private bool _shouldCancel; private bool _shouldTimestampDisplaySyncingCancel; private bool _showAdvanced; - private List _tempHighlightEntryList = new List(); + private List _tempHighlightEntryList = []; private int _timeShiftSyncLine = 0; private bool _waitingForClose; @@ -134,8 +142,13 @@ public LogWindow(LogTabWindow.LogTabWindow parent, string fileName, bool isTempF { SuspendLayout(); + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; + InitializeComponent(); + CreateDefaultViewStyle(); + columnNamesLabel.Text = ""; // no filtering on columns by default _parentLogTabWin = parent; @@ -147,10 +160,12 @@ public LogWindow(LogTabWindow.LogTabWindow parent, string fileName, bool isTempF ForcePersistenceLoading = forcePersistenceLoading; dataGridView.CellValueNeeded += OnDataGridViewCellValueNeeded; - dataGridView.CellPainting += dataGridView_CellPainting; + dataGridView.CellPainting += OnDataGridView_CellPainting; filterGridView.CellValueNeeded += OnFilterGridViewCellValueNeeded; filterGridView.CellPainting += OnFilterGridViewCellPainting; + filterListBox.DrawMode = DrawMode.OwnerDrawVariable; + filterListBox.MeasureItem += MeasureItem; Closing += OnLogWindowClosing; Disposed += OnLogWindowDisposed; @@ -183,9 +198,9 @@ public LogWindow(LogTabWindow.LogTabWindow parent, string fileName, bool isTempF filterComboBox.Items.Add(item); } - filterComboBox.DropDownHeight = filterComboBox.ItemHeight * ConfigManager.Settings.preferences.maximumFilterEntriesDisplayed; + filterComboBox.DropDownHeight = filterComboBox.ItemHeight * ConfigManager.Settings.preferences.maximumFilterEntriesDisplayed; AutoResizeFilterBox(); - + filterRegexCheckBox.Checked = _filterParams.isRegex; filterCaseSensitiveCheckBox.Checked = _filterParams.isCaseSensitive; filterTailCheckBox.Checked = _filterParams.isFilterTail; @@ -193,13 +208,17 @@ public LogWindow(LogTabWindow.LogTabWindow parent, string fileName, bool isTempF splitContainerLogWindow.Panel2Collapsed = true; advancedFilterSplitContainer.SplitterDistance = FILTER_ADVANCED_SPLITTER_DISTANCE; - _timeShiftSyncThread = new Thread(SyncTimestampDisplayWorker); - _timeShiftSyncThread.IsBackground = true; - _timeShiftSyncThread.Start(); + _timeShiftSyncTask = new Task(SyncTimestampDisplayWorker, cts.Token); + _timeShiftSyncTask.Start(); + //_timeShiftSyncThread = new Thread(SyncTimestampDisplayWorker); + //_timeShiftSyncThread.IsBackground = true; + //_timeShiftSyncThread.Start(); - _logEventHandlerThread = new Thread(LogEventWorker); - _logEventHandlerThread.IsBackground = true; - _logEventHandlerThread.Start(); + _logEventHandlerTask = new Task(LogEventWorker, cts.Token); + _logEventHandlerTask.Start(); + //_logEventHandlerThread = new Thread(LogEventWorker); + //_logEventHandlerThread.IsBackground = true; + //_logEventHandlerThread.Start(); //this.filterUpdateThread = new Thread(new ThreadStart(this.FilterUpdateWorker)); //this.filterUpdateThread.Start(); @@ -211,11 +230,12 @@ public LogWindow(LogTabWindow.LogTabWindow parent, string fileName, bool isTempF dataGridView.EditModeMenuStrip = editModeContextMenuStrip; markEditModeToolStripMenuItem.Enabled = true; - _panelOpenButtonImage = Properties.Resources.PanelOpen; - _panelCloseButtonImage = Properties.Resources.PanelClose; + _panelOpenButtonImage = Properties.Resources.Arrow_menu_open; + _panelCloseButtonImage = Properties.Resources.Arrow_menu_close; Settings settings = ConfigManager.Settings; - if (settings.appBounds != null && settings.appBounds.Right > 0) + + if (settings.appBounds.Right > 0) { Bounds = settings.appBounds; } @@ -269,7 +289,7 @@ public void ChangeTheme(Control.ControlCollection container) } } - #endregion + #endregion #region DataGridView @@ -542,7 +562,7 @@ internal void RefreshAllGrids() internal void ChangeMultifileMask() { - MultiFileMaskDialog dlg = new MultiFileMaskDialog(this, FileName); + MultiFileMaskDialog dlg = new(this, FileName); dlg.Owner = this; dlg.MaxDays = _multiFileOptions.MaxDayTry; dlg.FileNamePattern = _multiFileOptions.FormatPattern; @@ -564,8 +584,7 @@ internal void ToggleColumnFinder(bool show, bool setFocus) { columnComboBox.AutoCompleteMode = AutoCompleteMode.Suggest; columnComboBox.AutoCompleteSource = AutoCompleteSource.CustomSource; - columnComboBox.AutoCompleteCustomSource = new AutoCompleteStringCollection(); - columnComboBox.AutoCompleteCustomSource.AddRange(CurrentColumnizer.GetColumnNames()); + columnComboBox.AutoCompleteCustomSource = [.. CurrentColumnizer.GetColumnNames()]; if (setFocus) { columnComboBox.Focus(); @@ -590,6 +609,15 @@ protected override string GetPersistString() #endregion + private void OnButtonSizeChanged(object sender, EventArgs e) + { + if (sender is Button button && button.Image != null) + { + button.ImageAlign = ContentAlignment.MiddleCenter; + button.Image = new Bitmap(button.Image, new Size(button.Size.Height, button.Size.Height)); + } + } + // used for external wait fx WaitForLoadFinished() private delegate void UpdateGridCallback(LogEventArgs e); @@ -598,13 +626,10 @@ protected override string GetPersistString() private delegate void LoadingStartedFx(LoadFileEventArgs e); - private delegate int SearchFx(SearchParams searchParams); - private delegate void SelectLineFx(int line, bool triggerSyncCall); - private delegate void FilterFx( - FilterParams filterParams, List filterResultLines, List lastFilterResultLines, - List filterHitList); + private Action, List, List> FilterFxAction; + //private delegate void FilterFx(FilterParams filterParams, List filterResultLines, List lastFilterResultLines, List filterHitList); private delegate void UpdateProgressBarFx(int lineNum); diff --git a/src/LogExpert/Controls/LogWindow/LogWindow.designer.cs b/src/LogExpert/Controls/LogWindow/LogWindow.designer.cs index e2b85d08..fe64b10a 100644 --- a/src/LogExpert/Controls/LogWindow/LogWindow.designer.cs +++ b/src/LogExpert/Controls/LogWindow/LogWindow.designer.cs @@ -1,5 +1,11 @@ using LogExpert.Dialogs; using LogExpert.Extensions.Forms; +using LogExpert.Properties; + +using System; +using System.Drawing; +using System.IO; +using System.Windows.Forms; namespace LogExpert.Controls.LogWindow { @@ -23,1221 +29,1148 @@ protected override void Dispose(bool disposing) base.Dispose(disposing); } - #region Windows Form Designer generated code + #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LogWindow)); - this.splitContainerLogWindow = new System.Windows.Forms.SplitContainer(); - this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); - this.columnFinderPanel = new System.Windows.Forms.Panel(); - this.columnComboBox = new System.Windows.Forms.ComboBox(); - this.lblColumnName = new System.Windows.Forms.Label(); - this.dataGridView = new LogExpert.Dialogs.BufferedDataGridView(); - this.dataGridContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); - this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.copyToTabToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator1 = new MenuToolStripSeparatorExtension(); - this.scrollAllTabsToTimestampToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.syncTimestampsToToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.freeThisWindowFromTimeSyncToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.locateLineInOriginalFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator2 = new MenuToolStripSeparatorExtension(); - this.toggleBoomarkToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.bookmarkCommentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator4 = new MenuToolStripSeparatorExtension(); - this.markEditModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.tempHighlightsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.removeAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.makePermanentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.markCurrentFilterRangeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.pluginSeparator = new MenuToolStripSeparatorExtension(); - this.timeSpreadingControl = new LogExpert.Dialogs.TimeSpreadingControl(); - this.advancedBackPanel = new System.Windows.Forms.Panel(); - this.advancedFilterSplitContainer = new System.Windows.Forms.SplitContainer(); - this.pnlProFilter = new System.Windows.Forms.Panel(); - this.columnButton = new System.Windows.Forms.Button(); - this.columnRestrictCheckBox = new System.Windows.Forms.CheckBox(); - this.rangeCheckBox = new System.Windows.Forms.CheckBox(); - this.filterRangeComboBox = new System.Windows.Forms.ComboBox(); - this.columnNamesLabel = new System.Windows.Forms.Label(); - this.fuzzyLabel = new System.Windows.Forms.Label(); - this.fuzzyKnobControl = new LogExpert.Controls.KnobControl(); - this.invertFilterCheckBox = new System.Windows.Forms.CheckBox(); - this.pnlProFilterLabel = new System.Windows.Forms.Panel(); - this.lblBackSpread = new System.Windows.Forms.Label(); - this.filterKnobBackSpread = new LogExpert.Controls.KnobControl(); - this.lblForeSpread = new System.Windows.Forms.Label(); - this.filterKnobForeSpread = new LogExpert.Controls.KnobControl(); - this.btnFilterToTab = new System.Windows.Forms.Button(); - this.btnToggleHighlightPanel = new System.Windows.Forms.Button(); - this.highlightSplitContainer = new System.Windows.Forms.SplitContainer(); - this.filterGridView = new LogExpert.Dialogs.BufferedDataGridView(); - this.filterContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); - this.setBookmarksOnSelectedLinesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.filterToTabToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.markFilterHitsInLogViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.highlightSplitContainerBackPanel = new System.Windows.Forms.Panel(); - this.hideFilterListOnLoadCheckBox = new System.Windows.Forms.CheckBox(); - this.filterDownButton = new System.Windows.Forms.Button(); - this.filterUpButton = new System.Windows.Forms.Button(); - this.filterOnLoadCheckBox = new System.Windows.Forms.CheckBox(); - this.saveFilterButton = new System.Windows.Forms.Button(); - this.deleteFilterButton = new System.Windows.Forms.Button(); - this.filterListBox = new System.Windows.Forms.ListBox(); - this.filterListContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); - this.colorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.pnlFilterInput = new System.Windows.Forms.Panel(); - this.filterSplitContainer = new System.Windows.Forms.SplitContainer(); - this.lblTextFilter = new System.Windows.Forms.Label(); - this.filterComboBox = new System.Windows.Forms.ComboBox(); - this.advancedButton = new System.Windows.Forms.Button(); - this.syncFilterCheckBox = new System.Windows.Forms.CheckBox(); - this.lblFilterCount = new System.Windows.Forms.Label(); - this.filterTailCheckBox = new System.Windows.Forms.CheckBox(); - this.filterRegexCheckBox = new System.Windows.Forms.CheckBox(); - this.filterCaseSensitiveCheckBox = new System.Windows.Forms.CheckBox(); - this.filterSearchButton = new System.Windows.Forms.Button(); - this.bookmarkContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); - this.deleteBookmarksToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.columnContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); - this.freezeLeftColumnsUntilHereToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator3 = new MenuToolStripSeparatorExtension(); - this.moveToLastColumnToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.moveLeftToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.moveRightToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator5 = new MenuToolStripSeparatorExtension(); - this.hideColumnToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.restoreColumnsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator6 = new MenuToolStripSeparatorExtension(); - this.allColumnsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.editModeContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); - this.editModecopyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.highlightSelectionInLogFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.highlightSelectionInLogFilewordModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.filterForSelectionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.setSelectedTextAsBookmarkCommentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.helpToolTip = new System.Windows.Forms.ToolTip(this.components); - ((System.ComponentModel.ISupportInitialize)(this.splitContainerLogWindow)).BeginInit(); - this.splitContainerLogWindow.Panel1.SuspendLayout(); - this.splitContainerLogWindow.Panel2.SuspendLayout(); - this.splitContainerLogWindow.SuspendLayout(); - this.tableLayoutPanel1.SuspendLayout(); - this.columnFinderPanel.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); - this.dataGridContextMenuStrip.SuspendLayout(); - this.advancedBackPanel.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.advancedFilterSplitContainer)).BeginInit(); - this.advancedFilterSplitContainer.Panel1.SuspendLayout(); - this.advancedFilterSplitContainer.Panel2.SuspendLayout(); - this.advancedFilterSplitContainer.SuspendLayout(); - this.pnlProFilter.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.highlightSplitContainer)).BeginInit(); - this.highlightSplitContainer.Panel1.SuspendLayout(); - this.highlightSplitContainer.Panel2.SuspendLayout(); - this.highlightSplitContainer.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.filterGridView)).BeginInit(); - this.filterContextMenuStrip.SuspendLayout(); - this.highlightSplitContainerBackPanel.SuspendLayout(); - this.filterListContextMenuStrip.SuspendLayout(); - this.pnlFilterInput.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.filterSplitContainer)).BeginInit(); - this.filterSplitContainer.Panel1.SuspendLayout(); - this.filterSplitContainer.Panel2.SuspendLayout(); - this.filterSplitContainer.SuspendLayout(); - this.bookmarkContextMenuStrip.SuspendLayout(); - this.columnContextMenuStrip.SuspendLayout(); - this.editModeContextMenuStrip.SuspendLayout(); - this.SuspendLayout(); + splitContainerLogWindow = new SplitContainer(); + tableLayoutPanel1 = new TableLayoutPanel(); + columnFinderPanel = new Panel(); + columnComboBox = new ComboBox(); + lblColumnName = new Label(); + dataGridView = new BufferedDataGridView(); + dataGridContextMenuStrip = new ContextMenuStrip(components); + copyToolStripMenuItem = new ToolStripMenuItem(); + copyToTabToolStripMenuItem = new ToolStripMenuItem(); + scrollAllTabsToTimestampToolStripMenuItem = new ToolStripMenuItem(); + syncTimestampsToToolStripMenuItem = new ToolStripMenuItem(); + freeThisWindowFromTimeSyncToolStripMenuItem = new ToolStripMenuItem(); + locateLineInOriginalFileToolStripMenuItem = new ToolStripMenuItem(); + toggleBoomarkToolStripMenuItem = new ToolStripMenuItem(); + bookmarkCommentToolStripMenuItem = new ToolStripMenuItem(); + markEditModeToolStripMenuItem = new ToolStripMenuItem(); + tempHighlightsToolStripMenuItem = new ToolStripMenuItem(); + removeAllToolStripMenuItem = new ToolStripMenuItem(); + makePermanentToolStripMenuItem = new ToolStripMenuItem(); + markCurrentFilterRangeToolStripMenuItem = new ToolStripMenuItem(); + timeSpreadingControl = new TimeSpreadingControl(); + advancedBackPanel = new Panel(); + advancedFilterSplitContainer = new SplitContainer(); + pnlProFilter = new Panel(); + columnButton = new Button(); + columnRestrictCheckBox = new CheckBox(); + rangeCheckBox = new CheckBox(); + filterRangeComboBox = new ComboBox(); + columnNamesLabel = new Label(); + fuzzyLabel = new Label(); + fuzzyKnobControl = new KnobControl(); + invertFilterCheckBox = new CheckBox(); + pnlProFilterLabel = new Panel(); + lblBackSpread = new Label(); + filterKnobBackSpread = new KnobControl(); + lblForeSpread = new Label(); + filterKnobForeSpread = new KnobControl(); + btnFilterToTab = new Button(); + panelBackgroundAdvancedFilterSplitContainer = new Panel(); + btnToggleHighlightPanel = new Button(); + highlightSplitContainer = new SplitContainer(); + filterGridView = new BufferedDataGridView(); + filterContextMenuStrip = new ContextMenuStrip(components); + setBookmarksOnSelectedLinesToolStripMenuItem = new ToolStripMenuItem(); + filterToTabToolStripMenuItem = new ToolStripMenuItem(); + markFilterHitsInLogViewToolStripMenuItem = new ToolStripMenuItem(); + highlightSplitContainerBackPanel = new Panel(); + hideFilterListOnLoadCheckBox = new CheckBox(); + filterDownButton = new Button(); + filterUpButton = new Button(); + filterOnLoadCheckBox = new CheckBox(); + saveFilterButton = new Button(); + deleteFilterButton = new Button(); + filterListBox = new ListBox(); + filterListContextMenuStrip = new ContextMenuStrip(components); + colorToolStripMenuItem = new ToolStripMenuItem(); + pnlFilterInput = new Panel(); + filterSplitContainer = new SplitContainer(); + filterComboBox = new ComboBox(); + lblTextFilter = new Label(); + advancedButton = new Button(); + syncFilterCheckBox = new CheckBox(); + lblFilterCount = new Label(); + filterTailCheckBox = new CheckBox(); + filterRegexCheckBox = new CheckBox(); + filterCaseSensitiveCheckBox = new CheckBox(); + filterSearchButton = new Button(); + bookmarkContextMenuStrip = new ContextMenuStrip(components); + deleteBookmarksToolStripMenuItem = new ToolStripMenuItem(); + columnContextMenuStrip = new ContextMenuStrip(components); + freezeLeftColumnsUntilHereToolStripMenuItem = new ToolStripMenuItem(); + moveToLastColumnToolStripMenuItem = new ToolStripMenuItem(); + moveLeftToolStripMenuItem = new ToolStripMenuItem(); + moveRightToolStripMenuItem = new ToolStripMenuItem(); + hideColumnToolStripMenuItem = new ToolStripMenuItem(); + restoreColumnsToolStripMenuItem = new ToolStripMenuItem(); + allColumnsToolStripMenuItem = new ToolStripMenuItem(); + editModeContextMenuStrip = new ContextMenuStrip(components); + editModecopyToolStripMenuItem = new ToolStripMenuItem(); + highlightSelectionInLogFileToolStripMenuItem = new ToolStripMenuItem(); + highlightSelectionInLogFilewordModeToolStripMenuItem = new ToolStripMenuItem(); + filterForSelectionToolStripMenuItem = new ToolStripMenuItem(); + setSelectedTextAsBookmarkCommentToolStripMenuItem = new ToolStripMenuItem(); + helpToolTip = new ToolTip(components); + ((System.ComponentModel.ISupportInitialize)splitContainerLogWindow).BeginInit(); + splitContainerLogWindow.Panel1.SuspendLayout(); + splitContainerLogWindow.Panel2.SuspendLayout(); + splitContainerLogWindow.SuspendLayout(); + tableLayoutPanel1.SuspendLayout(); + columnFinderPanel.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); + dataGridContextMenuStrip.SuspendLayout(); + advancedBackPanel.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)advancedFilterSplitContainer).BeginInit(); + advancedFilterSplitContainer.Panel1.SuspendLayout(); + advancedFilterSplitContainer.Panel2.SuspendLayout(); + advancedFilterSplitContainer.SuspendLayout(); + pnlProFilter.SuspendLayout(); + panelBackgroundAdvancedFilterSplitContainer.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)highlightSplitContainer).BeginInit(); + highlightSplitContainer.Panel1.SuspendLayout(); + highlightSplitContainer.Panel2.SuspendLayout(); + highlightSplitContainer.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)filterGridView).BeginInit(); + filterContextMenuStrip.SuspendLayout(); + highlightSplitContainerBackPanel.SuspendLayout(); + filterListContextMenuStrip.SuspendLayout(); + pnlFilterInput.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)filterSplitContainer).BeginInit(); + filterSplitContainer.Panel1.SuspendLayout(); + filterSplitContainer.Panel2.SuspendLayout(); + filterSplitContainer.SuspendLayout(); + bookmarkContextMenuStrip.SuspendLayout(); + columnContextMenuStrip.SuspendLayout(); + editModeContextMenuStrip.SuspendLayout(); + SuspendLayout(); // // splitContainerLogWindow // - this.splitContainerLogWindow.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.splitContainerLogWindow.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainerLogWindow.Location = new System.Drawing.Point(0, 0); - this.splitContainerLogWindow.Margin = new System.Windows.Forms.Padding(0); - this.splitContainerLogWindow.Name = "splitContainerLogWindow"; - this.splitContainerLogWindow.Orientation = System.Windows.Forms.Orientation.Horizontal; + splitContainerLogWindow.BorderStyle = BorderStyle.FixedSingle; + splitContainerLogWindow.Dock = DockStyle.Fill; + splitContainerLogWindow.Location = new Point(0, 0); + splitContainerLogWindow.Margin = new Padding(0); + splitContainerLogWindow.Name = "splitContainerLogWindow"; + splitContainerLogWindow.Orientation = Orientation.Horizontal; // // splitContainerLogWindow.Panel1 // - this.splitContainerLogWindow.Panel1.Controls.Add(this.tableLayoutPanel1); - this.splitContainerLogWindow.Panel1MinSize = 50; + splitContainerLogWindow.Panel1.Controls.Add(tableLayoutPanel1); + splitContainerLogWindow.Panel1MinSize = 50; // // splitContainerLogWindow.Panel2 // - this.splitContainerLogWindow.Panel2.Controls.Add(this.advancedBackPanel); - this.splitContainerLogWindow.Panel2.Controls.Add(this.pnlFilterInput); - this.splitContainerLogWindow.Panel2MinSize = 50; - this.splitContainerLogWindow.Size = new System.Drawing.Size(1014, 656); - this.splitContainerLogWindow.SplitterDistance = 364; - this.splitContainerLogWindow.TabIndex = 9; - this.splitContainerLogWindow.SplitterMoved += new System.Windows.Forms.SplitterEventHandler(this.OnSplitContainerSplitterMoved); + splitContainerLogWindow.Panel2.Controls.Add(advancedBackPanel); + splitContainerLogWindow.Panel2.Controls.Add(pnlFilterInput); + splitContainerLogWindow.Panel2MinSize = 50; + splitContainerLogWindow.Size = new Size(1862, 1104); + splitContainerLogWindow.SplitterDistance = 486; + splitContainerLogWindow.TabIndex = 9; + splitContainerLogWindow.SplitterMoved += OnSplitContainerSplitterMoved; // // tableLayoutPanel1 // - this.tableLayoutPanel1.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single; - this.tableLayoutPanel1.ColumnCount = 2; - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 181F)); - this.tableLayoutPanel1.Controls.Add(this.columnFinderPanel, 0, 0); - this.tableLayoutPanel1.Controls.Add(this.dataGridView, 0, 1); - this.tableLayoutPanel1.Controls.Add(this.timeSpreadingControl, 1, 1); - this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); - this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); - this.tableLayoutPanel1.Name = "tableLayoutPanel1"; - this.tableLayoutPanel1.RowCount = 2; - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(1012, 362); - this.tableLayoutPanel1.TabIndex = 2; + tableLayoutPanel1.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single; + tableLayoutPanel1.ColumnCount = 2; + tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle()); + tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 181F)); + tableLayoutPanel1.Controls.Add(columnFinderPanel, 0, 0); + tableLayoutPanel1.Controls.Add(dataGridView, 0, 1); + tableLayoutPanel1.Controls.Add(timeSpreadingControl, 1, 1); + tableLayoutPanel1.Dock = DockStyle.Fill; + tableLayoutPanel1.ForeColor = SystemColors.ControlText; + tableLayoutPanel1.Location = new Point(0, 0); + tableLayoutPanel1.Margin = new Padding(0); + tableLayoutPanel1.Name = "tableLayoutPanel1"; + tableLayoutPanel1.RowCount = 2; + tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 28F)); + tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); + tableLayoutPanel1.Size = new Size(1860, 484); + tableLayoutPanel1.TabIndex = 2; // // columnFinderPanel // - this.columnFinderPanel.Controls.Add(this.columnComboBox); - this.columnFinderPanel.Controls.Add(this.lblColumnName); - this.columnFinderPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.columnFinderPanel.Location = new System.Drawing.Point(4, 4); - this.columnFinderPanel.Name = "columnFinderPanel"; - this.columnFinderPanel.Size = new System.Drawing.Size(841, 22); - this.columnFinderPanel.TabIndex = 2; + columnFinderPanel.Controls.Add(columnComboBox); + columnFinderPanel.Controls.Add(lblColumnName); + columnFinderPanel.Dock = DockStyle.Fill; + columnFinderPanel.Location = new Point(4, 4); + columnFinderPanel.Name = "columnFinderPanel"; + columnFinderPanel.Size = new Size(841, 22); + columnFinderPanel.TabIndex = 2; // // columnComboBox // - this.columnComboBox.FormattingEnabled = true; - this.columnComboBox.Location = new System.Drawing.Point(88, 1); - this.columnComboBox.MaxDropDownItems = 15; - this.columnComboBox.Name = "columnComboBox"; - this.columnComboBox.Size = new System.Drawing.Size(181, 21); - this.columnComboBox.TabIndex = 1; - this.helpToolTip.SetToolTip(this.columnComboBox, "Select column to scroll to"); - this.columnComboBox.SelectionChangeCommitted += new System.EventHandler(this.OnColumnComboBoxSelectionChangeCommitted); - this.columnComboBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnColumnComboBoxKeyDown); - this.columnComboBox.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.OnColumnComboBoxPreviewKeyDown); + columnComboBox.FormattingEnabled = true; + columnComboBox.Location = new Point(125, 1); + columnComboBox.MaxDropDownItems = 15; + columnComboBox.Name = "columnComboBox"; + columnComboBox.Size = new Size(181, 21); + columnComboBox.TabIndex = 1; + helpToolTip.SetToolTip(columnComboBox, "Select column to scroll to"); + columnComboBox.SelectionChangeCommitted += OnColumnComboBoxSelectionChangeCommitted; + columnComboBox.KeyDown += OnColumnComboBoxKeyDown; + columnComboBox.PreviewKeyDown += OnColumnComboBoxPreviewKeyDown; // // lblColumnName // - this.lblColumnName.AutoSize = true; - this.lblColumnName.Location = new System.Drawing.Point(8, 4); - this.lblColumnName.Name = "lblColumnName"; - this.lblColumnName.Size = new System.Drawing.Size(74, 13); - this.lblColumnName.TabIndex = 0; - this.lblColumnName.Text = "Column name:"; + lblColumnName.AutoSize = true; + lblColumnName.Location = new Point(8, 4); + lblColumnName.Name = "lblColumnName"; + lblColumnName.Size = new Size(74, 13); + lblColumnName.TabIndex = 0; + lblColumnName.Text = "Column name:"; // // dataGridView // - this.dataGridView.AllowUserToAddRows = false; - this.dataGridView.AllowUserToDeleteRows = false; - this.dataGridView.AllowUserToOrderColumns = true; - this.dataGridView.AllowUserToResizeRows = false; - this.dataGridView.BackgroundColor = System.Drawing.SystemColors.ControlLight; - this.dataGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.dataGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; - this.dataGridView.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.EnableWithoutHeaderText; - this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.dataGridView.ContextMenuStrip = this.dataGridContextMenuStrip; - this.dataGridView.Dock = System.Windows.Forms.DockStyle.Fill; - this.dataGridView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; - this.dataGridView.EditModeMenuStrip = null; - this.dataGridView.ImeMode = System.Windows.Forms.ImeMode.Disable; - this.dataGridView.Location = new System.Drawing.Point(1, 30); - this.dataGridView.Margin = new System.Windows.Forms.Padding(0); - this.dataGridView.Name = "dataGridView"; - this.dataGridView.PaintWithOverlays = false; - this.dataGridView.RowHeadersVisible = false; - this.dataGridView.RowTemplate.DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomLeft; - this.dataGridView.RowTemplate.DefaultCellStyle.Padding = new System.Windows.Forms.Padding(2, 0, 0, 0); - this.dataGridView.RowTemplate.Height = 15; - this.dataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.dataGridView.ShowCellErrors = false; - this.dataGridView.ShowCellToolTips = false; - this.dataGridView.ShowEditingIcon = false; - this.dataGridView.ShowRowErrors = false; - this.dataGridView.Size = new System.Drawing.Size(847, 331); - this.dataGridView.TabIndex = 0; - this.dataGridView.VirtualMode = true; - this.dataGridView.OverlayDoubleClicked += new LogExpert.Dialogs.BufferedDataGridView.OverlayDoubleClickedEventHandler(this.OnDataGridViewOverlayDoubleClicked); - this.dataGridView.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.OnDataGridViewCellClick); - this.dataGridView.CellContentDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.OnDataGridViewCellContentDoubleClick); - this.dataGridView.CellContextMenuStripNeeded += new System.Windows.Forms.DataGridViewCellContextMenuStripNeededEventHandler(this.OnDataGridViewCellContextMenuStripNeeded); - this.dataGridView.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.OnDataGridViewCellDoubleClick); - this.dataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnDataGridViewCellValuePushed); - this.dataGridView.RowHeightInfoNeeded += new System.Windows.Forms.DataGridViewRowHeightInfoNeededEventHandler(this.OnDataGridViewRowHeightInfoNeeded); - this.dataGridView.RowUnshared += new System.Windows.Forms.DataGridViewRowEventHandler(this.OnDataGridViewRowUnshared); - this.dataGridView.Scroll += new System.Windows.Forms.ScrollEventHandler(this.OnDataGridViewScroll); - this.dataGridView.SelectionChanged += new System.EventHandler(this.OnDataGridViewSelectionChanged); - this.dataGridView.Paint += new System.Windows.Forms.PaintEventHandler(this.OnDataGridViewPaint); - this.dataGridView.Enter += new System.EventHandler(this.OnDataGridViewEnter); - this.dataGridView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnDataGridViewKeyDown); - this.dataGridView.Leave += new System.EventHandler(this.OnDataGridViewLeave); - this.dataGridView.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.OnDataGridViewPreviewKeyDown); - this.dataGridView.Resize += new System.EventHandler(this.OnDataGridViewResize); + dataGridView.AllowUserToAddRows = false; + dataGridView.AllowUserToDeleteRows = false; + dataGridView.AllowUserToOrderColumns = true; + dataGridView.AllowUserToResizeRows = false; + dataGridView.BackgroundColor = SystemColors.Window; + dataGridView.BorderStyle = BorderStyle.None; + dataGridView.CellBorderStyle = DataGridViewCellBorderStyle.None; + dataGridView.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText; + dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridView.ContextMenuStrip = dataGridContextMenuStrip; + dataGridView.Dock = DockStyle.Fill; + dataGridView.EditMode = DataGridViewEditMode.EditProgrammatically; + dataGridView.EditModeMenuStrip = null; + dataGridView.ImeMode = ImeMode.Disable; + dataGridView.Location = new Point(1, 30); + dataGridView.Margin = new Padding(0); + dataGridView.Name = "dataGridView"; + dataGridView.PaintWithOverlays = false; + dataGridView.RowHeadersVisible = false; + dataGridView.RowHeadersWidth = 62; + dataGridView.RowTemplate.DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomLeft; + dataGridView.RowTemplate.DefaultCellStyle.Padding = new Padding(2, 0, 0, 0); + dataGridView.RowTemplate.Height = 15; + dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect; + dataGridView.ShowCellErrors = false; + dataGridView.ShowCellToolTips = false; + dataGridView.ShowEditingIcon = false; + dataGridView.ShowRowErrors = false; + dataGridView.Size = new Size(847, 453); + dataGridView.TabIndex = 0; + dataGridView.VirtualMode = true; + dataGridView.OverlayDoubleClicked += OnDataGridViewOverlayDoubleClicked; + dataGridView.CellClick += OnDataGridViewCellClick; + dataGridView.CellContentDoubleClick += OnDataGridViewCellContentDoubleClick; + dataGridView.CellContextMenuStripNeeded += OnDataGridViewCellContextMenuStripNeeded; + dataGridView.CellDoubleClick += OnDataGridViewCellDoubleClick; + dataGridView.CellValuePushed += OnDataGridViewCellValuePushed; + dataGridView.RowHeightInfoNeeded += OnDataGridViewRowHeightInfoNeeded; + dataGridView.RowUnshared += OnDataGridViewRowUnshared; + dataGridView.Scroll += OnDataGridViewScroll; + dataGridView.SelectionChanged += OnDataGridViewSelectionChanged; + dataGridView.Paint += OnDataGridViewPaint; + dataGridView.Enter += OnDataGridViewEnter; + dataGridView.KeyDown += OnDataGridViewKeyDown; + dataGridView.Leave += OnDataGridViewLeave; + dataGridView.PreviewKeyDown += OnDataGridViewPreviewKeyDown; + dataGridView.Resize += OnDataGridViewResize; // // dataGridContextMenuStrip // - this.dataGridContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.copyToolStripMenuItem, - this.copyToTabToolStripMenuItem, - this.toolStripSeparator1, - this.scrollAllTabsToTimestampToolStripMenuItem, - this.syncTimestampsToToolStripMenuItem, - this.freeThisWindowFromTimeSyncToolStripMenuItem, - this.locateLineInOriginalFileToolStripMenuItem, - this.toolStripSeparator2, - this.toggleBoomarkToolStripMenuItem, - this.bookmarkCommentToolStripMenuItem, - this.toolStripSeparator4, - this.markEditModeToolStripMenuItem, - this.tempHighlightsToolStripMenuItem, - this.markCurrentFilterRangeToolStripMenuItem, - this.pluginSeparator}); - this.dataGridContextMenuStrip.Name = "dataGridContextMenuStrip"; - this.dataGridContextMenuStrip.Size = new System.Drawing.Size(287, 270); - this.dataGridContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.OnDataGridContextMenuStripOpening); + dataGridContextMenuStrip.ImageScalingSize = new Size(24, 24); + dataGridContextMenuStrip.Items.AddRange(new ToolStripItem[] { copyToolStripMenuItem, copyToTabToolStripMenuItem, scrollAllTabsToTimestampToolStripMenuItem, syncTimestampsToToolStripMenuItem, freeThisWindowFromTimeSyncToolStripMenuItem, locateLineInOriginalFileToolStripMenuItem, toggleBoomarkToolStripMenuItem, bookmarkCommentToolStripMenuItem, markEditModeToolStripMenuItem, tempHighlightsToolStripMenuItem, markCurrentFilterRangeToolStripMenuItem }); + dataGridContextMenuStrip.Name = "dataGridContextMenuStrip"; + dataGridContextMenuStrip.Size = new Size(289, 246); + dataGridContextMenuStrip.Opening += OnDataGridContextMenuStripOpening; // // copyToolStripMenuItem // - this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; - this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); - this.copyToolStripMenuItem.Size = new System.Drawing.Size(286, 22); - this.copyToolStripMenuItem.Text = "Copy to clipboard"; - this.copyToolStripMenuItem.Click += new System.EventHandler(this.OnCopyToolStripMenuItemClick); + copyToolStripMenuItem.Name = "copyToolStripMenuItem"; + copyToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.C; + copyToolStripMenuItem.Size = new Size(288, 22); + copyToolStripMenuItem.Text = "Copy to clipboard"; + copyToolStripMenuItem.Click += OnCopyToolStripMenuItemClick; // // copyToTabToolStripMenuItem // - this.copyToTabToolStripMenuItem.Name = "copyToTabToolStripMenuItem"; - this.copyToTabToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.T))); - this.copyToTabToolStripMenuItem.Size = new System.Drawing.Size(286, 22); - this.copyToTabToolStripMenuItem.Text = "Copy to new tab"; - this.copyToTabToolStripMenuItem.ToolTipText = "Copy marked lines into a new tab window"; - this.copyToTabToolStripMenuItem.Click += new System.EventHandler(this.OnCopyToTabToolStripMenuItemClick); - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(283, 6); + copyToTabToolStripMenuItem.Name = "copyToTabToolStripMenuItem"; + copyToTabToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.T; + copyToTabToolStripMenuItem.Size = new Size(288, 22); + copyToTabToolStripMenuItem.Text = "Copy to new tab"; + copyToTabToolStripMenuItem.ToolTipText = "Copy marked lines into a new tab window"; + copyToTabToolStripMenuItem.Click += OnCopyToTabToolStripMenuItemClick; // // scrollAllTabsToTimestampToolStripMenuItem // - this.scrollAllTabsToTimestampToolStripMenuItem.Name = "scrollAllTabsToTimestampToolStripMenuItem"; - this.scrollAllTabsToTimestampToolStripMenuItem.Size = new System.Drawing.Size(286, 22); - this.scrollAllTabsToTimestampToolStripMenuItem.Text = "Scroll all tabs to current timestamp"; - this.scrollAllTabsToTimestampToolStripMenuItem.ToolTipText = "Scolls all open tabs to the selected timestamp, if possible"; - this.scrollAllTabsToTimestampToolStripMenuItem.Click += new System.EventHandler(this.OnScrollAllTabsToTimestampToolStripMenuItemClick); + scrollAllTabsToTimestampToolStripMenuItem.Name = "scrollAllTabsToTimestampToolStripMenuItem"; + scrollAllTabsToTimestampToolStripMenuItem.Size = new Size(288, 22); + scrollAllTabsToTimestampToolStripMenuItem.Text = "Scroll all tabs to current timestamp"; + scrollAllTabsToTimestampToolStripMenuItem.ToolTipText = "Scolls all open tabs to the selected timestamp, if possible"; + scrollAllTabsToTimestampToolStripMenuItem.Click += OnScrollAllTabsToTimestampToolStripMenuItemClick; // // syncTimestampsToToolStripMenuItem // - this.syncTimestampsToToolStripMenuItem.Name = "syncTimestampsToToolStripMenuItem"; - this.syncTimestampsToToolStripMenuItem.Size = new System.Drawing.Size(286, 22); - this.syncTimestampsToToolStripMenuItem.Text = "Time synced files"; + syncTimestampsToToolStripMenuItem.Name = "syncTimestampsToToolStripMenuItem"; + syncTimestampsToToolStripMenuItem.Size = new Size(288, 22); + syncTimestampsToToolStripMenuItem.Text = "Time synced files"; // // freeThisWindowFromTimeSyncToolStripMenuItem // - this.freeThisWindowFromTimeSyncToolStripMenuItem.Name = "freeThisWindowFromTimeSyncToolStripMenuItem"; - this.freeThisWindowFromTimeSyncToolStripMenuItem.Size = new System.Drawing.Size(286, 22); - this.freeThisWindowFromTimeSyncToolStripMenuItem.Text = "Free this window from time sync"; - this.freeThisWindowFromTimeSyncToolStripMenuItem.Click += new System.EventHandler(this.OnFreeThisWindowFromTimeSyncToolStripMenuItemClick); + freeThisWindowFromTimeSyncToolStripMenuItem.Name = "freeThisWindowFromTimeSyncToolStripMenuItem"; + freeThisWindowFromTimeSyncToolStripMenuItem.Size = new Size(288, 22); + freeThisWindowFromTimeSyncToolStripMenuItem.Text = "Free this window from time sync"; + freeThisWindowFromTimeSyncToolStripMenuItem.Click += OnFreeThisWindowFromTimeSyncToolStripMenuItemClick; // // locateLineInOriginalFileToolStripMenuItem // - this.locateLineInOriginalFileToolStripMenuItem.Name = "locateLineInOriginalFileToolStripMenuItem"; - this.locateLineInOriginalFileToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.L))); - this.locateLineInOriginalFileToolStripMenuItem.Size = new System.Drawing.Size(286, 22); - this.locateLineInOriginalFileToolStripMenuItem.Text = "Locate filtered line in original file"; - this.locateLineInOriginalFileToolStripMenuItem.Click += new System.EventHandler(this.OnLocateLineInOriginalFileToolStripMenuItemClick); - // - // toolStripSeparator2 - // - this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(283, 6); + locateLineInOriginalFileToolStripMenuItem.Name = "locateLineInOriginalFileToolStripMenuItem"; + locateLineInOriginalFileToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.L; + locateLineInOriginalFileToolStripMenuItem.Size = new Size(288, 22); + locateLineInOriginalFileToolStripMenuItem.Text = "Locate filtered line in original file"; + locateLineInOriginalFileToolStripMenuItem.Click += OnLocateLineInOriginalFileToolStripMenuItemClick; // // toggleBoomarkToolStripMenuItem // - this.toggleBoomarkToolStripMenuItem.Name = "toggleBoomarkToolStripMenuItem"; - this.toggleBoomarkToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F2))); - this.toggleBoomarkToolStripMenuItem.Size = new System.Drawing.Size(286, 22); - this.toggleBoomarkToolStripMenuItem.Text = "Toggle Boomark"; - this.toggleBoomarkToolStripMenuItem.Click += new System.EventHandler(this.OnToggleBoomarkToolStripMenuItemClick); + toggleBoomarkToolStripMenuItem.Name = "toggleBoomarkToolStripMenuItem"; + toggleBoomarkToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.F2; + toggleBoomarkToolStripMenuItem.Size = new Size(288, 22); + toggleBoomarkToolStripMenuItem.Text = "Toggle Boomark"; + toggleBoomarkToolStripMenuItem.Click += OnToggleBoomarkToolStripMenuItemClick; // // bookmarkCommentToolStripMenuItem // - this.bookmarkCommentToolStripMenuItem.Name = "bookmarkCommentToolStripMenuItem"; - this.bookmarkCommentToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F2))); - this.bookmarkCommentToolStripMenuItem.Size = new System.Drawing.Size(286, 22); - this.bookmarkCommentToolStripMenuItem.Text = "Bookmark comment..."; - this.bookmarkCommentToolStripMenuItem.ToolTipText = "Edit the comment for a bookmark"; - this.bookmarkCommentToolStripMenuItem.Click += new System.EventHandler(this.OnBookmarkCommentToolStripMenuItemClick); - // - // toolStripSeparator4 - // - this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(283, 6); + bookmarkCommentToolStripMenuItem.Name = "bookmarkCommentToolStripMenuItem"; + bookmarkCommentToolStripMenuItem.ShortcutKeys = Keys.Alt | Keys.F2; + bookmarkCommentToolStripMenuItem.Size = new Size(288, 22); + bookmarkCommentToolStripMenuItem.Text = "Bookmark comment..."; + bookmarkCommentToolStripMenuItem.ToolTipText = "Edit the comment for a bookmark"; + bookmarkCommentToolStripMenuItem.Click += OnBookmarkCommentToolStripMenuItemClick; // // markEditModeToolStripMenuItem // - this.markEditModeToolStripMenuItem.Name = "markEditModeToolStripMenuItem"; - this.markEditModeToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E))); - this.markEditModeToolStripMenuItem.Size = new System.Drawing.Size(286, 22); - this.markEditModeToolStripMenuItem.Text = "Mark/Edit-Mode"; - this.markEditModeToolStripMenuItem.Click += new System.EventHandler(this.OnMarkEditModeToolStripMenuItemClick); + markEditModeToolStripMenuItem.Name = "markEditModeToolStripMenuItem"; + markEditModeToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.E; + markEditModeToolStripMenuItem.Size = new Size(288, 22); + markEditModeToolStripMenuItem.Text = "Mark/Edit-Mode"; + markEditModeToolStripMenuItem.Click += OnMarkEditModeToolStripMenuItemClick; // // tempHighlightsToolStripMenuItem // - this.tempHighlightsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.removeAllToolStripMenuItem, - this.makePermanentToolStripMenuItem}); - this.tempHighlightsToolStripMenuItem.Name = "tempHighlightsToolStripMenuItem"; - this.tempHighlightsToolStripMenuItem.Size = new System.Drawing.Size(286, 22); - this.tempHighlightsToolStripMenuItem.Text = "Temp Highlights"; + tempHighlightsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { removeAllToolStripMenuItem, makePermanentToolStripMenuItem }); + tempHighlightsToolStripMenuItem.Name = "tempHighlightsToolStripMenuItem"; + tempHighlightsToolStripMenuItem.Size = new Size(288, 22); + tempHighlightsToolStripMenuItem.Text = "Temp Highlights"; // // removeAllToolStripMenuItem // - this.removeAllToolStripMenuItem.Name = "removeAllToolStripMenuItem"; - this.removeAllToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) - | System.Windows.Forms.Keys.H))); - this.removeAllToolStripMenuItem.Size = new System.Drawing.Size(207, 22); - this.removeAllToolStripMenuItem.Text = "Remove all"; - this.removeAllToolStripMenuItem.Click += new System.EventHandler(this.OnRemoveAllToolStripMenuItemClick); + removeAllToolStripMenuItem.Name = "removeAllToolStripMenuItem"; + removeAllToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.Shift | Keys.H; + removeAllToolStripMenuItem.Size = new Size(260, 22); + removeAllToolStripMenuItem.Text = "Remove all"; + removeAllToolStripMenuItem.Click += OnRemoveAllToolStripMenuItemClick; // // makePermanentToolStripMenuItem // - this.makePermanentToolStripMenuItem.Name = "makePermanentToolStripMenuItem"; - this.makePermanentToolStripMenuItem.Size = new System.Drawing.Size(207, 22); - this.makePermanentToolStripMenuItem.Text = "Make all permanent"; - this.makePermanentToolStripMenuItem.Click += new System.EventHandler(this.OnMakePermanentToolStripMenuItemClick); + makePermanentToolStripMenuItem.Name = "makePermanentToolStripMenuItem"; + makePermanentToolStripMenuItem.Size = new Size(260, 22); + makePermanentToolStripMenuItem.Text = "Make all permanent"; + makePermanentToolStripMenuItem.Click += OnMakePermanentToolStripMenuItemClick; // // markCurrentFilterRangeToolStripMenuItem // - this.markCurrentFilterRangeToolStripMenuItem.Name = "markCurrentFilterRangeToolStripMenuItem"; - this.markCurrentFilterRangeToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.R))); - this.markCurrentFilterRangeToolStripMenuItem.Size = new System.Drawing.Size(286, 22); - this.markCurrentFilterRangeToolStripMenuItem.Text = "Mark current filter range"; - this.markCurrentFilterRangeToolStripMenuItem.Click += new System.EventHandler(this.OnMarkCurrentFilterRangeToolStripMenuItemClick); - // - // pluginSeparator - // - this.pluginSeparator.Name = "pluginSeparator"; - this.pluginSeparator.Size = new System.Drawing.Size(283, 6); + markCurrentFilterRangeToolStripMenuItem.Name = "markCurrentFilterRangeToolStripMenuItem"; + markCurrentFilterRangeToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.R; + markCurrentFilterRangeToolStripMenuItem.Size = new Size(288, 22); + markCurrentFilterRangeToolStripMenuItem.Text = "Mark current filter range"; + markCurrentFilterRangeToolStripMenuItem.Click += OnMarkCurrentFilterRangeToolStripMenuItemClick; // // timeSpreadingControl // - this.timeSpreadingControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Right))); - this.timeSpreadingControl.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.timeSpreadingControl.ForeColor = System.Drawing.Color.Teal; - this.timeSpreadingControl.Location = new System.Drawing.Point(1013, 30); - this.timeSpreadingControl.Margin = new System.Windows.Forms.Padding(2, 0, 1, 0); - this.timeSpreadingControl.Name = "timeSpreadingControl"; - this.timeSpreadingControl.ReverseAlpha = false; - this.timeSpreadingControl.Size = new System.Drawing.Size(16, 331); - this.timeSpreadingControl.TabIndex = 1; + timeSpreadingControl.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right; + timeSpreadingControl.Font = new Font("Verdana", 8.25F, FontStyle.Regular, GraphicsUnit.Point, 0); + timeSpreadingControl.ForeColor = Color.Teal; + timeSpreadingControl.Location = new Point(1842, 30); + timeSpreadingControl.Margin = new Padding(2, 0, 1, 0); + timeSpreadingControl.Name = "timeSpreadingControl"; + timeSpreadingControl.ReverseAlpha = false; + timeSpreadingControl.Size = new Size(16, 453); + timeSpreadingControl.TabIndex = 1; // // advancedBackPanel // - this.advancedBackPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.advancedBackPanel.Controls.Add(this.advancedFilterSplitContainer); - this.advancedBackPanel.Location = new System.Drawing.Point(3, 35); - this.advancedBackPanel.Name = "advancedBackPanel"; - this.advancedBackPanel.Size = new System.Drawing.Size(1007, 248); - this.advancedBackPanel.TabIndex = 3; + advancedBackPanel.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + advancedBackPanel.Controls.Add(advancedFilterSplitContainer); + advancedBackPanel.Location = new Point(3, 48); + advancedBackPanel.Name = "advancedBackPanel"; + advancedBackPanel.Size = new Size(1855, 561); + advancedBackPanel.TabIndex = 3; // // advancedFilterSplitContainer // - this.advancedFilterSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill; - this.advancedFilterSplitContainer.IsSplitterFixed = true; - this.advancedFilterSplitContainer.Location = new System.Drawing.Point(0, 0); - this.advancedFilterSplitContainer.Margin = new System.Windows.Forms.Padding(0); - this.advancedFilterSplitContainer.Name = "advancedFilterSplitContainer"; - this.advancedFilterSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal; + advancedFilterSplitContainer.Dock = DockStyle.Fill; + advancedFilterSplitContainer.IsSplitterFixed = true; + advancedFilterSplitContainer.Location = new Point(0, 0); + advancedFilterSplitContainer.Margin = new Padding(0); + advancedFilterSplitContainer.Name = "advancedFilterSplitContainer"; + advancedFilterSplitContainer.Orientation = Orientation.Horizontal; // // advancedFilterSplitContainer.Panel1 // - this.advancedFilterSplitContainer.Panel1.Controls.Add(this.pnlProFilter); - this.advancedFilterSplitContainer.Panel1MinSize = 54; + advancedFilterSplitContainer.Panel1.Controls.Add(pnlProFilter); + advancedFilterSplitContainer.Panel1MinSize = 100; // // advancedFilterSplitContainer.Panel2 // - this.advancedFilterSplitContainer.Panel2.Controls.Add(this.btnToggleHighlightPanel); - this.advancedFilterSplitContainer.Panel2.Controls.Add(this.highlightSplitContainer); - this.advancedFilterSplitContainer.Panel2MinSize = 50; - this.advancedFilterSplitContainer.Size = new System.Drawing.Size(1007, 248); - this.advancedFilterSplitContainer.SplitterDistance = 73; - this.advancedFilterSplitContainer.SplitterWidth = 2; - this.advancedFilterSplitContainer.TabIndex = 2; + advancedFilterSplitContainer.Panel2.Controls.Add(panelBackgroundAdvancedFilterSplitContainer); + advancedFilterSplitContainer.Panel2MinSize = 200; + advancedFilterSplitContainer.Size = new Size(1855, 561); + advancedFilterSplitContainer.SplitterDistance = 124; + advancedFilterSplitContainer.SplitterWidth = 2; + advancedFilterSplitContainer.TabIndex = 2; // // pnlProFilter // - this.pnlProFilter.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.pnlProFilter.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(227)))), ((int)(((byte)(227)))), ((int)(((byte)(227))))); - this.pnlProFilter.Controls.Add(this.columnButton); - this.pnlProFilter.Controls.Add(this.columnRestrictCheckBox); - this.pnlProFilter.Controls.Add(this.rangeCheckBox); - this.pnlProFilter.Controls.Add(this.filterRangeComboBox); - this.pnlProFilter.Controls.Add(this.columnNamesLabel); - this.pnlProFilter.Controls.Add(this.fuzzyLabel); - this.pnlProFilter.Controls.Add(this.fuzzyKnobControl); - this.pnlProFilter.Controls.Add(this.invertFilterCheckBox); - this.pnlProFilter.Controls.Add(this.pnlProFilterLabel); - this.pnlProFilter.Controls.Add(this.lblBackSpread); - this.pnlProFilter.Controls.Add(this.filterKnobBackSpread); - this.pnlProFilter.Controls.Add(this.lblForeSpread); - this.pnlProFilter.Controls.Add(this.filterKnobForeSpread); - this.pnlProFilter.Controls.Add(this.btnFilterToTab); - this.pnlProFilter.Location = new System.Drawing.Point(0, 3); - this.pnlProFilter.Name = "pnlProFilter"; - this.pnlProFilter.Size = new System.Drawing.Size(1004, 69); - this.pnlProFilter.TabIndex = 0; + pnlProFilter.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + pnlProFilter.Controls.Add(columnButton); + pnlProFilter.Controls.Add(columnRestrictCheckBox); + pnlProFilter.Controls.Add(rangeCheckBox); + pnlProFilter.Controls.Add(filterRangeComboBox); + pnlProFilter.Controls.Add(columnNamesLabel); + pnlProFilter.Controls.Add(fuzzyLabel); + pnlProFilter.Controls.Add(fuzzyKnobControl); + pnlProFilter.Controls.Add(invertFilterCheckBox); + pnlProFilter.Controls.Add(pnlProFilterLabel); + pnlProFilter.Controls.Add(lblBackSpread); + pnlProFilter.Controls.Add(filterKnobBackSpread); + pnlProFilter.Controls.Add(lblForeSpread); + pnlProFilter.Controls.Add(filterKnobForeSpread); + pnlProFilter.Controls.Add(btnFilterToTab); + pnlProFilter.Location = new Point(0, 3); + pnlProFilter.Name = "pnlProFilter"; + pnlProFilter.Size = new Size(1852, 117); + pnlProFilter.TabIndex = 0; // // columnButton // - this.columnButton.Enabled = false; - this.columnButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 6F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.columnButton.Location = new System.Drawing.Point(655, 30); - this.columnButton.Name = "columnButton"; - this.columnButton.Size = new System.Drawing.Size(71, 23); - this.columnButton.TabIndex = 15; - this.columnButton.Text = "Columns..."; - this.helpToolTip.SetToolTip(this.columnButton, "Choose columns for \'Column restrict\'"); - this.columnButton.UseVisualStyleBackColor = true; - this.columnButton.Click += new System.EventHandler(this.OncolumnButtonClick); + columnButton.Enabled = false; + columnButton.Location = new Point(750, 41); + columnButton.Name = "columnButton"; + columnButton.Size = new Size(85, 35); + columnButton.TabIndex = 15; + columnButton.Text = "Columns..."; + helpToolTip.SetToolTip(columnButton, "Choose columns for 'Column restrict'"); + columnButton.UseVisualStyleBackColor = true; + columnButton.Click += OnColumnButtonClick; // // columnRestrictCheckBox // - this.columnRestrictCheckBox.AutoSize = true; - this.columnRestrictCheckBox.Location = new System.Drawing.Point(527, 37); - this.columnRestrictCheckBox.Name = "columnRestrictCheckBox"; - this.columnRestrictCheckBox.Size = new System.Drawing.Size(95, 17); - this.columnRestrictCheckBox.TabIndex = 14; - this.columnRestrictCheckBox.Text = "Column restrict"; - this.helpToolTip.SetToolTip(this.columnRestrictCheckBox, "Restrict search to columns"); - this.columnRestrictCheckBox.UseVisualStyleBackColor = true; - this.columnRestrictCheckBox.CheckedChanged += new System.EventHandler(this.OnColumnRestrictCheckBoxCheckedChanged); + columnRestrictCheckBox.AutoSize = true; + columnRestrictCheckBox.Location = new Point(594, 38); + columnRestrictCheckBox.Name = "columnRestrictCheckBox"; + columnRestrictCheckBox.Size = new Size(95, 17); + columnRestrictCheckBox.TabIndex = 14; + columnRestrictCheckBox.Text = "Column restrict"; + helpToolTip.SetToolTip(columnRestrictCheckBox, "Restrict search to columns"); + columnRestrictCheckBox.UseVisualStyleBackColor = true; + columnRestrictCheckBox.CheckedChanged += OnColumnRestrictCheckBoxCheckedChanged; // // rangeCheckBox // - this.rangeCheckBox.AutoSize = true; - this.rangeCheckBox.Location = new System.Drawing.Point(75, 36); - this.rangeCheckBox.Name = "rangeCheckBox"; - this.rangeCheckBox.Size = new System.Drawing.Size(93, 17); - this.rangeCheckBox.TabIndex = 13; - this.rangeCheckBox.Text = "Range search"; - this.helpToolTip.SetToolTip(this.rangeCheckBox, "Enable a special search mode which filters all content between the 2 given search" + - " terms."); - this.rangeCheckBox.UseVisualStyleBackColor = true; - this.rangeCheckBox.CheckedChanged += new System.EventHandler(this.OnRangeCheckBoxCheckedChanged); + rangeCheckBox.AutoSize = true; + rangeCheckBox.Location = new Point(73, 38); + rangeCheckBox.Name = "rangeCheckBox"; + rangeCheckBox.Size = new Size(93, 17); + rangeCheckBox.TabIndex = 13; + rangeCheckBox.Text = "Range search"; + helpToolTip.SetToolTip(rangeCheckBox, "Enable a special search mode which filters all content between the 2 given search terms."); + rangeCheckBox.UseVisualStyleBackColor = true; + rangeCheckBox.CheckedChanged += OnRangeCheckBoxCheckedChanged; // // filterRangeComboBox // - this.filterRangeComboBox.Enabled = false; - this.filterRangeComboBox.FormattingEnabled = true; - this.filterRangeComboBox.Location = new System.Drawing.Point(73, 11); - this.filterRangeComboBox.Name = "filterRangeComboBox"; - this.filterRangeComboBox.Size = new System.Drawing.Size(207, 21); - this.filterRangeComboBox.TabIndex = 12; - this.helpToolTip.SetToolTip(this.filterRangeComboBox, "2nd search string (\'end string\') when using the range search"); - this.filterRangeComboBox.TextChanged += new System.EventHandler(this.OnFilterRangeComboBoxTextChanged); + filterRangeComboBox.Enabled = false; + filterRangeComboBox.FormattingEnabled = true; + filterRangeComboBox.Location = new Point(73, 11); + filterRangeComboBox.Name = "filterRangeComboBox"; + filterRangeComboBox.Size = new Size(207, 21); + filterRangeComboBox.TabIndex = 12; + helpToolTip.SetToolTip(filterRangeComboBox, "2nd search string ('end string') when using the range search"); + filterRangeComboBox.TextChanged += OnFilterRangeComboBoxTextChanged; // // columnNamesLabel // - this.columnNamesLabel.AutoSize = true; - this.columnNamesLabel.Location = new System.Drawing.Point(732, 35); - this.columnNamesLabel.Name = "columnNamesLabel"; - this.columnNamesLabel.Size = new System.Drawing.Size(75, 13); - this.columnNamesLabel.TabIndex = 11; - this.columnNamesLabel.Text = "column names"; + columnNamesLabel.AutoSize = true; + columnNamesLabel.Location = new Point(841, 41); + columnNamesLabel.Name = "columnNamesLabel"; + columnNamesLabel.Size = new Size(75, 13); + columnNamesLabel.TabIndex = 11; + columnNamesLabel.Text = "column names"; // // fuzzyLabel // - this.fuzzyLabel.AutoSize = true; - this.fuzzyLabel.Location = new System.Drawing.Point(435, 38); - this.fuzzyLabel.Name = "fuzzyLabel"; - this.fuzzyLabel.Size = new System.Drawing.Size(56, 13); - this.fuzzyLabel.TabIndex = 11; - this.fuzzyLabel.Text = "Fuzzyness"; + fuzzyLabel.AutoSize = true; + fuzzyLabel.Location = new Point(502, 38); + fuzzyLabel.Name = "fuzzyLabel"; + fuzzyLabel.Size = new Size(56, 13); + fuzzyLabel.TabIndex = 11; + fuzzyLabel.Text = "Fuzzyness"; // // fuzzyKnobControl // - this.fuzzyKnobControl.DragSensitivity = 6; - this.fuzzyKnobControl.Font = new System.Drawing.Font("Verdana", 6F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.fuzzyKnobControl.Location = new System.Drawing.Point(454, 7); - this.fuzzyKnobControl.Margin = new System.Windows.Forms.Padding(2); - this.fuzzyKnobControl.MaxValue = 0; - this.fuzzyKnobControl.MinValue = 0; - this.fuzzyKnobControl.Name = "fuzzyKnobControl"; - this.fuzzyKnobControl.Size = new System.Drawing.Size(17, 29); - this.fuzzyKnobControl.TabIndex = 10; - this.helpToolTip.SetToolTip(this.fuzzyKnobControl, "Fuzzy search level (0 = fuzzy off)"); - this.fuzzyKnobControl.Value = 0; - this.fuzzyKnobControl.ValueChanged += new LogExpert.Controls.KnobControl.ValueChangedEventHandler(this.OnFuzzyKnobControlValueChanged); + fuzzyKnobControl.DragSensitivity = 6; + fuzzyKnobControl.Font = new Font("Verdana", 6F, FontStyle.Regular, GraphicsUnit.Point, 0); + fuzzyKnobControl.Location = new Point(521, 7); + fuzzyKnobControl.Margin = new Padding(2); + fuzzyKnobControl.MaxValue = 0; + fuzzyKnobControl.MinValue = 0; + fuzzyKnobControl.Name = "fuzzyKnobControl"; + fuzzyKnobControl.Size = new Size(17, 29); + fuzzyKnobControl.TabIndex = 10; + helpToolTip.SetToolTip(fuzzyKnobControl, "Fuzzy search level (0 = fuzzy off)"); + fuzzyKnobControl.Value = 0; + fuzzyKnobControl.ValueChanged += OnFuzzyKnobControlValueChanged; // // invertFilterCheckBox // - this.invertFilterCheckBox.AutoSize = true; - this.invertFilterCheckBox.Location = new System.Drawing.Point(527, 13); - this.invertFilterCheckBox.Name = "invertFilterCheckBox"; - this.invertFilterCheckBox.Size = new System.Drawing.Size(86, 17); - this.invertFilterCheckBox.TabIndex = 8; - this.invertFilterCheckBox.Text = "Invert Match"; - this.helpToolTip.SetToolTip(this.invertFilterCheckBox, "Invert the search result"); - this.invertFilterCheckBox.UseVisualStyleBackColor = true; - this.invertFilterCheckBox.CheckedChanged += new System.EventHandler(this.OnInvertFilterCheckBoxCheckedChanged); + invertFilterCheckBox.AutoSize = true; + invertFilterCheckBox.Location = new Point(594, 7); + invertFilterCheckBox.Name = "invertFilterCheckBox"; + invertFilterCheckBox.Size = new Size(86, 17); + invertFilterCheckBox.TabIndex = 8; + invertFilterCheckBox.Text = "Invert Match"; + helpToolTip.SetToolTip(invertFilterCheckBox, "Invert the search result"); + invertFilterCheckBox.UseVisualStyleBackColor = true; + invertFilterCheckBox.CheckedChanged += OnInvertFilterCheckBoxCheckedChanged; // // pnlProFilterLabel // - this.pnlProFilterLabel.BackgroundImage = global::LogExpert.Properties.Resources.Pro_Filter; - this.pnlProFilterLabel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; - this.pnlProFilterLabel.Location = new System.Drawing.Point(5, 7); - this.pnlProFilterLabel.Name = "pnlProFilterLabel"; - this.pnlProFilterLabel.Size = new System.Drawing.Size(60, 44); - this.pnlProFilterLabel.TabIndex = 7; - this.pnlProFilterLabel.Visible = true; + pnlProFilterLabel.BackgroundImage = Resources.Pro_Filter; + pnlProFilterLabel.BackgroundImageLayout = ImageLayout.Center; + pnlProFilterLabel.Location = new Point(5, 7); + pnlProFilterLabel.Name = "pnlProFilterLabel"; + pnlProFilterLabel.Size = new Size(60, 44); + pnlProFilterLabel.TabIndex = 7; // // lblBackSpread // - this.lblBackSpread.AutoSize = true; - this.lblBackSpread.Location = new System.Drawing.Point(273, 38); - this.lblBackSpread.Name = "lblBackSpread"; - this.lblBackSpread.Size = new System.Drawing.Size(72, 13); - this.lblBackSpread.TabIndex = 6; - this.lblBackSpread.Text = "Back Spread "; + lblBackSpread.AutoSize = true; + lblBackSpread.Location = new Point(287, 38); + lblBackSpread.Name = "lblBackSpread"; + lblBackSpread.Size = new Size(72, 13); + lblBackSpread.TabIndex = 6; + lblBackSpread.Text = "Back Spread "; // // filterKnobBackSpread // - this.filterKnobBackSpread.DragSensitivity = 3; - this.filterKnobBackSpread.Font = new System.Drawing.Font("Verdana", 6F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.filterKnobBackSpread.Location = new System.Drawing.Point(299, 7); - this.filterKnobBackSpread.Margin = new System.Windows.Forms.Padding(2); - this.filterKnobBackSpread.MaxValue = 0; - this.filterKnobBackSpread.MinValue = 0; - this.filterKnobBackSpread.Name = "filterKnobBackSpread"; - this.filterKnobBackSpread.Size = new System.Drawing.Size(17, 29); - this.filterKnobBackSpread.TabIndex = 5; - this.helpToolTip.SetToolTip(this.filterKnobBackSpread, "Add preceding lines to search result (Drag up/down, press Shift for finer pitch)"); - this.filterKnobBackSpread.Value = 0; + filterKnobBackSpread.DragSensitivity = 3; + filterKnobBackSpread.Font = new Font("Verdana", 6F, FontStyle.Regular, GraphicsUnit.Point, 0); + filterKnobBackSpread.Location = new Point(313, 7); + filterKnobBackSpread.Margin = new Padding(2); + filterKnobBackSpread.MaxValue = 0; + filterKnobBackSpread.MinValue = 0; + filterKnobBackSpread.Name = "filterKnobBackSpread"; + filterKnobBackSpread.Size = new Size(17, 29); + filterKnobBackSpread.TabIndex = 5; + helpToolTip.SetToolTip(filterKnobBackSpread, "Add preceding lines to search result (Drag up/down, press Shift for finer pitch)"); + filterKnobBackSpread.Value = 0; // // lblForeSpread // - this.lblForeSpread.AutoSize = true; - this.lblForeSpread.Location = new System.Drawing.Point(342, 38); - this.lblForeSpread.Name = "lblForeSpread"; - this.lblForeSpread.Size = new System.Drawing.Size(65, 13); - this.lblForeSpread.TabIndex = 2; - this.lblForeSpread.Text = "Fore Spread"; + lblForeSpread.AutoSize = true; + lblForeSpread.Location = new Point(397, 38); + lblForeSpread.Name = "lblForeSpread"; + lblForeSpread.Size = new Size(65, 13); + lblForeSpread.TabIndex = 2; + lblForeSpread.Text = "Fore Spread"; // // filterKnobForeSpread // - this.filterKnobForeSpread.DragSensitivity = 3; - this.filterKnobForeSpread.Font = new System.Drawing.Font("Verdana", 6F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.filterKnobForeSpread.Location = new System.Drawing.Point(365, 7); - this.filterKnobForeSpread.Margin = new System.Windows.Forms.Padding(2); - this.filterKnobForeSpread.MaxValue = 0; - this.filterKnobForeSpread.MinValue = 0; - this.filterKnobForeSpread.Name = "filterKnobForeSpread"; - this.filterKnobForeSpread.Size = new System.Drawing.Size(17, 29); - this.filterKnobForeSpread.TabIndex = 1; - this.helpToolTip.SetToolTip(this.filterKnobForeSpread, "Add following lines to search result (Drag up/down, press Shift for finer pitch)"); - this.filterKnobForeSpread.Value = 0; + filterKnobForeSpread.DragSensitivity = 3; + filterKnobForeSpread.Font = new Font("Verdana", 6F, FontStyle.Regular, GraphicsUnit.Point, 0); + filterKnobForeSpread.Location = new Point(420, 7); + filterKnobForeSpread.Margin = new Padding(2); + filterKnobForeSpread.MaxValue = 0; + filterKnobForeSpread.MinValue = 0; + filterKnobForeSpread.Name = "filterKnobForeSpread"; + filterKnobForeSpread.Size = new Size(17, 29); + filterKnobForeSpread.TabIndex = 1; + helpToolTip.SetToolTip(filterKnobForeSpread, "Add following lines to search result (Drag up/down, press Shift for finer pitch)"); + filterKnobForeSpread.Value = 0; // // btnFilterToTab // - this.btnFilterToTab.Location = new System.Drawing.Point(655, 3); - this.btnFilterToTab.Name = "btnFilterToTab"; - this.btnFilterToTab.Size = new System.Drawing.Size(71, 23); - this.btnFilterToTab.TabIndex = 0; - this.btnFilterToTab.Text = "Filter to Tab"; - this.helpToolTip.SetToolTip(this.btnFilterToTab, "Launch a new tab with filtered content"); - this.btnFilterToTab.UseVisualStyleBackColor = true; - this.btnFilterToTab.Click += new System.EventHandler(this.OnFilterToTabButtonClick); + btnFilterToTab.Location = new Point(750, 3); + btnFilterToTab.Name = "btnFilterToTab"; + btnFilterToTab.Size = new Size(85, 35); + btnFilterToTab.TabIndex = 0; + btnFilterToTab.Text = "Filter to Tab"; + helpToolTip.SetToolTip(btnFilterToTab, "Launch a new tab with filtered content"); + btnFilterToTab.UseVisualStyleBackColor = true; + btnFilterToTab.Click += OnFilterToTabButtonClick; + // + // panelBackgroundAdvancedFilterSplitContainer + // + panelBackgroundAdvancedFilterSplitContainer.Controls.Add(btnToggleHighlightPanel); + panelBackgroundAdvancedFilterSplitContainer.Controls.Add(highlightSplitContainer); + panelBackgroundAdvancedFilterSplitContainer.Dock = DockStyle.Fill; + panelBackgroundAdvancedFilterSplitContainer.Location = new Point(0, 0); + panelBackgroundAdvancedFilterSplitContainer.Name = "panelBackgroundAdvancedFilterSplitContainer"; + panelBackgroundAdvancedFilterSplitContainer.Size = new Size(1855, 435); + panelBackgroundAdvancedFilterSplitContainer.TabIndex = 7; // // btnToggleHighlightPanel // - this.btnToggleHighlightPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnToggleHighlightPanel.Image = global::LogExpert.Properties.Resources.PanelOpen; - this.btnToggleHighlightPanel.Location = new System.Drawing.Point(984, 1); - this.btnToggleHighlightPanel.Name = "btnToggleHighlightPanel"; - this.btnToggleHighlightPanel.Size = new System.Drawing.Size(20, 21); - this.btnToggleHighlightPanel.TabIndex = 6; - this.helpToolTip.SetToolTip(this.btnToggleHighlightPanel, "Open or close a list with saved filters"); - this.btnToggleHighlightPanel.UseVisualStyleBackColor = true; - this.btnToggleHighlightPanel.Click += new System.EventHandler(this.OnToggleHighlightPanelButtonClick); + btnToggleHighlightPanel.Anchor = AnchorStyles.Top | AnchorStyles.Right; + btnToggleHighlightPanel.Image = Resources.Arrow_menu_open; + btnToggleHighlightPanel.Location = new Point(1832, 1); + btnToggleHighlightPanel.Name = "btnToggleHighlightPanel"; + btnToggleHighlightPanel.Size = new Size(20, 21); + btnToggleHighlightPanel.TabIndex = 6; + helpToolTip.SetToolTip(btnToggleHighlightPanel, "Open or close a list with saved filters"); + btnToggleHighlightPanel.UseVisualStyleBackColor = true; + btnToggleHighlightPanel.SizeChanged += OnButtonSizeChanged; + btnToggleHighlightPanel.Click += OnToggleHighlightPanelButtonClick; // // highlightSplitContainer // - this.highlightSplitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.highlightSplitContainer.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.highlightSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; - this.highlightSplitContainer.IsSplitterFixed = true; - this.highlightSplitContainer.Location = new System.Drawing.Point(0, 0); - this.highlightSplitContainer.Name = "highlightSplitContainer"; + highlightSplitContainer.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + highlightSplitContainer.BorderStyle = BorderStyle.FixedSingle; + highlightSplitContainer.FixedPanel = FixedPanel.Panel2; + highlightSplitContainer.Location = new Point(0, 3); + highlightSplitContainer.Name = "highlightSplitContainer"; // // highlightSplitContainer.Panel1 // - this.highlightSplitContainer.Panel1.Controls.Add(this.filterGridView); + highlightSplitContainer.Panel1.Controls.Add(filterGridView); + highlightSplitContainer.Panel1MinSize = 100; // // highlightSplitContainer.Panel2 // - this.highlightSplitContainer.Panel2.Controls.Add(this.highlightSplitContainerBackPanel); - this.highlightSplitContainer.Panel2MinSize = 30; - this.highlightSplitContainer.Size = new System.Drawing.Size(981, 175); - this.highlightSplitContainer.SplitterDistance = 612; - this.highlightSplitContainer.TabIndex = 2; + highlightSplitContainer.Panel2.Controls.Add(highlightSplitContainerBackPanel); + highlightSplitContainer.Panel2MinSize = 350; + highlightSplitContainer.Size = new Size(1829, 432); + highlightSplitContainer.SplitterDistance = 1475; + highlightSplitContainer.TabIndex = 2; // // filterGridView // - this.filterGridView.AllowUserToAddRows = false; - this.filterGridView.AllowUserToDeleteRows = false; - this.filterGridView.AllowUserToOrderColumns = true; - this.filterGridView.AllowUserToResizeRows = false; - this.filterGridView.BackgroundColor = System.Drawing.SystemColors.ControlLight; - this.filterGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.filterGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; - this.filterGridView.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.EnableWithoutHeaderText; - this.filterGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.filterGridView.ContextMenuStrip = this.filterContextMenuStrip; - this.filterGridView.Dock = System.Windows.Forms.DockStyle.Fill; - this.filterGridView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; - this.filterGridView.EditModeMenuStrip = null; - this.filterGridView.ImeMode = System.Windows.Forms.ImeMode.Disable; - this.filterGridView.Location = new System.Drawing.Point(0, 0); - this.filterGridView.Margin = new System.Windows.Forms.Padding(0); - this.filterGridView.Name = "filterGridView"; - this.filterGridView.PaintWithOverlays = false; - this.filterGridView.ReadOnly = true; - this.filterGridView.RowHeadersVisible = false; - this.filterGridView.RowTemplate.Height = 15; - this.filterGridView.RowTemplate.ReadOnly = true; - this.filterGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.filterGridView.ShowCellErrors = false; - this.filterGridView.ShowCellToolTips = false; - this.filterGridView.ShowEditingIcon = false; - this.filterGridView.ShowRowErrors = false; - this.filterGridView.Size = new System.Drawing.Size(610, 173); - this.filterGridView.TabIndex = 1; - this.filterGridView.VirtualMode = true; - this.filterGridView.CellContextMenuStripNeeded += new System.Windows.Forms.DataGridViewCellContextMenuStripNeededEventHandler(this.OnFilterGridViewCellContextMenuStripNeeded); - this.filterGridView.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.OnFilterGridViewCellDoubleClick); - this.filterGridView.ColumnDividerDoubleClick += new System.Windows.Forms.DataGridViewColumnDividerDoubleClickEventHandler(this.OnFilterGridViewColumnDividerDoubleClick); - this.filterGridView.RowHeightInfoNeeded += new System.Windows.Forms.DataGridViewRowHeightInfoNeededEventHandler(this.OnFilterGridViewRowHeightInfoNeeded); - this.filterGridView.Enter += new System.EventHandler(this.OnFilterGridViewEnter); - this.filterGridView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnFilterGridViewKeyDown); - this.filterGridView.Leave += new System.EventHandler(this.OnFilterGridViewLeave); + filterGridView.AllowUserToAddRows = false; + filterGridView.AllowUserToDeleteRows = false; + filterGridView.AllowUserToOrderColumns = true; + filterGridView.AllowUserToResizeRows = false; + filterGridView.BackgroundColor = SystemColors.Window; + filterGridView.BorderStyle = BorderStyle.None; + filterGridView.CellBorderStyle = DataGridViewCellBorderStyle.None; + filterGridView.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText; + filterGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; + filterGridView.ContextMenuStrip = filterContextMenuStrip; + filterGridView.Dock = DockStyle.Fill; + filterGridView.EditMode = DataGridViewEditMode.EditProgrammatically; + filterGridView.EditModeMenuStrip = null; + filterGridView.ImeMode = ImeMode.Disable; + filterGridView.Location = new Point(0, 0); + filterGridView.Margin = new Padding(0); + filterGridView.Name = "filterGridView"; + filterGridView.PaintWithOverlays = false; + filterGridView.ReadOnly = true; + filterGridView.RowHeadersVisible = false; + filterGridView.RowHeadersWidth = 62; + filterGridView.RowTemplate.Height = 15; + filterGridView.RowTemplate.ReadOnly = true; + filterGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect; + filterGridView.ShowCellErrors = false; + filterGridView.ShowCellToolTips = false; + filterGridView.ShowEditingIcon = false; + filterGridView.ShowRowErrors = false; + filterGridView.Size = new Size(1473, 430); + filterGridView.TabIndex = 1; + filterGridView.VirtualMode = true; + filterGridView.CellContextMenuStripNeeded += OnFilterGridViewCellContextMenuStripNeeded; + filterGridView.CellDoubleClick += OnFilterGridViewCellDoubleClick; + filterGridView.ColumnDividerDoubleClick += OnFilterGridViewColumnDividerDoubleClick; + filterGridView.RowHeightInfoNeeded += OnFilterGridViewRowHeightInfoNeeded; + filterGridView.Enter += OnFilterGridViewEnter; + filterGridView.KeyDown += OnFilterGridViewKeyDown; + filterGridView.Leave += OnFilterGridViewLeave; // // filterContextMenuStrip // - this.filterContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.setBookmarksOnSelectedLinesToolStripMenuItem, - this.filterToTabToolStripMenuItem, - this.markFilterHitsInLogViewToolStripMenuItem}); - this.filterContextMenuStrip.Name = "filterContextMenuStrip"; - this.filterContextMenuStrip.Size = new System.Drawing.Size(243, 70); + filterContextMenuStrip.ImageScalingSize = new Size(24, 24); + filterContextMenuStrip.Items.AddRange(new ToolStripItem[] { setBookmarksOnSelectedLinesToolStripMenuItem, filterToTabToolStripMenuItem, markFilterHitsInLogViewToolStripMenuItem }); + filterContextMenuStrip.Name = "filterContextMenuStrip"; + filterContextMenuStrip.Size = new Size(286, 70); // // setBookmarksOnSelectedLinesToolStripMenuItem // - this.setBookmarksOnSelectedLinesToolStripMenuItem.Name = "setBookmarksOnSelectedLinesToolStripMenuItem"; - this.setBookmarksOnSelectedLinesToolStripMenuItem.Size = new System.Drawing.Size(242, 22); - this.setBookmarksOnSelectedLinesToolStripMenuItem.Text = "Set bookmarks on selected lines"; - this.setBookmarksOnSelectedLinesToolStripMenuItem.Click += new System.EventHandler(this.OnSetBookmarksOnSelectedLinesToolStripMenuItemClick); + setBookmarksOnSelectedLinesToolStripMenuItem.Name = "setBookmarksOnSelectedLinesToolStripMenuItem"; + setBookmarksOnSelectedLinesToolStripMenuItem.Size = new Size(285, 22); + setBookmarksOnSelectedLinesToolStripMenuItem.Text = "Set bookmarks on selected lines"; + setBookmarksOnSelectedLinesToolStripMenuItem.Click += OnSetBookmarksOnSelectedLinesToolStripMenuItemClick; // // filterToTabToolStripMenuItem // - this.filterToTabToolStripMenuItem.Name = "filterToTabToolStripMenuItem"; - this.filterToTabToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) - | System.Windows.Forms.Keys.T))); - this.filterToTabToolStripMenuItem.Size = new System.Drawing.Size(242, 22); - this.filterToTabToolStripMenuItem.Text = "Filter to new tab"; - this.filterToTabToolStripMenuItem.Click += new System.EventHandler(this.OnFilterToTabToolStripMenuItemClick); + filterToTabToolStripMenuItem.Name = "filterToTabToolStripMenuItem"; + filterToTabToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.Shift | Keys.T; + filterToTabToolStripMenuItem.Size = new Size(285, 22); + filterToTabToolStripMenuItem.Text = "Filter to new tab"; + filterToTabToolStripMenuItem.Click += OnFilterToTabToolStripMenuItemClick; // // markFilterHitsInLogViewToolStripMenuItem // - this.markFilterHitsInLogViewToolStripMenuItem.Name = "markFilterHitsInLogViewToolStripMenuItem"; - this.markFilterHitsInLogViewToolStripMenuItem.Size = new System.Drawing.Size(242, 22); - this.markFilterHitsInLogViewToolStripMenuItem.Text = "Mark filter hits in log view"; - this.markFilterHitsInLogViewToolStripMenuItem.Click += new System.EventHandler(this.OnMarkFilterHitsInLogViewToolStripMenuItemClick); + markFilterHitsInLogViewToolStripMenuItem.Name = "markFilterHitsInLogViewToolStripMenuItem"; + markFilterHitsInLogViewToolStripMenuItem.Size = new Size(285, 22); + markFilterHitsInLogViewToolStripMenuItem.Text = "Mark filter hits in log view"; + markFilterHitsInLogViewToolStripMenuItem.Click += OnMarkFilterHitsInLogViewToolStripMenuItemClick; // // highlightSplitContainerBackPanel // - this.highlightSplitContainerBackPanel.Controls.Add(this.hideFilterListOnLoadCheckBox); - this.highlightSplitContainerBackPanel.Controls.Add(this.filterDownButton); - this.highlightSplitContainerBackPanel.Controls.Add(this.filterUpButton); - this.highlightSplitContainerBackPanel.Controls.Add(this.filterOnLoadCheckBox); - this.highlightSplitContainerBackPanel.Controls.Add(this.saveFilterButton); - this.highlightSplitContainerBackPanel.Controls.Add(this.deleteFilterButton); - this.highlightSplitContainerBackPanel.Controls.Add(this.filterListBox); - this.highlightSplitContainerBackPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.highlightSplitContainerBackPanel.Location = new System.Drawing.Point(0, 0); - this.highlightSplitContainerBackPanel.Name = "highlightSplitContainerBackPanel"; - this.highlightSplitContainerBackPanel.Size = new System.Drawing.Size(363, 173); - this.highlightSplitContainerBackPanel.TabIndex = 1; + highlightSplitContainerBackPanel.Controls.Add(hideFilterListOnLoadCheckBox); + highlightSplitContainerBackPanel.Controls.Add(filterDownButton); + highlightSplitContainerBackPanel.Controls.Add(filterUpButton); + highlightSplitContainerBackPanel.Controls.Add(filterOnLoadCheckBox); + highlightSplitContainerBackPanel.Controls.Add(saveFilterButton); + highlightSplitContainerBackPanel.Controls.Add(deleteFilterButton); + highlightSplitContainerBackPanel.Controls.Add(filterListBox); + highlightSplitContainerBackPanel.Dock = DockStyle.Fill; + highlightSplitContainerBackPanel.Location = new Point(0, 0); + highlightSplitContainerBackPanel.Name = "highlightSplitContainerBackPanel"; + highlightSplitContainerBackPanel.Size = new Size(348, 430); + highlightSplitContainerBackPanel.TabIndex = 1; // // hideFilterListOnLoadCheckBox // - this.hideFilterListOnLoadCheckBox.AutoSize = true; - this.hideFilterListOnLoadCheckBox.Location = new System.Drawing.Point(287, 134); - this.hideFilterListOnLoadCheckBox.Name = "hideFilterListOnLoadCheckBox"; - this.hideFilterListOnLoadCheckBox.Size = new System.Drawing.Size(71, 17); - this.hideFilterListOnLoadCheckBox.TabIndex = 20; - this.hideFilterListOnLoadCheckBox.Text = "Auto hide"; - this.helpToolTip.SetToolTip(this.hideFilterListOnLoadCheckBox, "Hides the filter list after loading a filter"); - this.hideFilterListOnLoadCheckBox.UseVisualStyleBackColor = true; - this.hideFilterListOnLoadCheckBox.MouseClick += new System.Windows.Forms.MouseEventHandler(this.OnHideFilterListOnLoadCheckBoxMouseClick); + hideFilterListOnLoadCheckBox.AutoSize = true; + hideFilterListOnLoadCheckBox.Location = new Point(258, 147); + hideFilterListOnLoadCheckBox.Name = "hideFilterListOnLoadCheckBox"; + hideFilterListOnLoadCheckBox.Size = new Size(71, 17); + hideFilterListOnLoadCheckBox.TabIndex = 20; + hideFilterListOnLoadCheckBox.Text = "Auto hide"; + helpToolTip.SetToolTip(hideFilterListOnLoadCheckBox, "Hides the filter list after loading a filter"); + hideFilterListOnLoadCheckBox.UseVisualStyleBackColor = true; + hideFilterListOnLoadCheckBox.MouseClick += OnHideFilterListOnLoadCheckBoxMouseClick; // // filterDownButton // - this.filterDownButton.Image = global::LogExpert.Properties.Resources.ArrowDown; - this.filterDownButton.Location = new System.Drawing.Point(325, 70); - this.filterDownButton.Name = "filterDownButton"; - this.filterDownButton.Size = new System.Drawing.Size(35, 23); - this.filterDownButton.TabIndex = 19; - this.helpToolTip.SetToolTip(this.filterDownButton, "Move the selected entry down in the list"); - this.filterDownButton.UseVisualStyleBackColor = true; - this.filterDownButton.Click += new System.EventHandler(this.OnFilterDownButtonClick); + filterDownButton.BackgroundImage = Resources.ArrowDown; + filterDownButton.BackgroundImageLayout = ImageLayout.Stretch; + filterDownButton.Location = new Point(296, 85); + filterDownButton.Name = "filterDownButton"; + filterDownButton.Size = new Size(35, 35); + filterDownButton.TabIndex = 19; + helpToolTip.SetToolTip(filterDownButton, "Move the selected entry down in the list"); + filterDownButton.UseVisualStyleBackColor = true; + filterDownButton.SizeChanged += OnButtonSizeChanged; + filterDownButton.Click += OnFilterDownButtonClick; // // filterUpButton // - this.filterUpButton.Image = global::LogExpert.Properties.Resources.ArrowUp; - this.filterUpButton.Location = new System.Drawing.Point(287, 70); - this.filterUpButton.Name = "filterUpButton"; - this.filterUpButton.Size = new System.Drawing.Size(35, 23); - this.filterUpButton.TabIndex = 18; - this.helpToolTip.SetToolTip(this.filterUpButton, "Move the selected entry up in the list"); - this.filterUpButton.UseVisualStyleBackColor = true; - this.filterUpButton.Click += new System.EventHandler(this.OnFilterUpButtonClick); + filterUpButton.BackgroundImage = Resources.ArrowUp; + filterUpButton.BackgroundImageLayout = ImageLayout.Stretch; + filterUpButton.Location = new Point(258, 85); + filterUpButton.Name = "filterUpButton"; + filterUpButton.Size = new Size(35, 35); + filterUpButton.TabIndex = 18; + helpToolTip.SetToolTip(filterUpButton, "Move the selected entry up in the list"); + filterUpButton.UseVisualStyleBackColor = true; + filterUpButton.SizeChanged += OnButtonSizeChanged; + filterUpButton.Click += OnFilterUpButtonClick; // // filterOnLoadCheckBox // - this.filterOnLoadCheckBox.AutoSize = true; - this.filterOnLoadCheckBox.Location = new System.Drawing.Point(287, 110); - this.filterOnLoadCheckBox.Name = "filterOnLoadCheckBox"; - this.filterOnLoadCheckBox.Size = new System.Drawing.Size(71, 17); - this.filterOnLoadCheckBox.TabIndex = 17; - this.filterOnLoadCheckBox.Text = "Auto start"; - this.helpToolTip.SetToolTip(this.filterOnLoadCheckBox, "Start immediate filtering after loading a saved filter"); - this.filterOnLoadCheckBox.UseVisualStyleBackColor = true; - this.filterOnLoadCheckBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.OnFilterOnLoadCheckBoxKeyPress); - this.filterOnLoadCheckBox.MouseClick += new System.Windows.Forms.MouseEventHandler(this.OnFilterOnLoadCheckBoxMouseClick); + filterOnLoadCheckBox.AutoSize = true; + filterOnLoadCheckBox.Location = new Point(258, 123); + filterOnLoadCheckBox.Name = "filterOnLoadCheckBox"; + filterOnLoadCheckBox.Size = new Size(71, 17); + filterOnLoadCheckBox.TabIndex = 17; + filterOnLoadCheckBox.Text = "Auto start"; + helpToolTip.SetToolTip(filterOnLoadCheckBox, "Start immediate filtering after loading a saved filter"); + filterOnLoadCheckBox.UseVisualStyleBackColor = true; + filterOnLoadCheckBox.KeyPress += OnFilterOnLoadCheckBoxKeyPress; + filterOnLoadCheckBox.MouseClick += OnFilterOnLoadCheckBoxMouseClick; // // saveFilterButton // - this.saveFilterButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.saveFilterButton.Location = new System.Drawing.Point(287, 11); - this.saveFilterButton.Name = "saveFilterButton"; - this.saveFilterButton.Size = new System.Drawing.Size(73, 23); - this.saveFilterButton.TabIndex = 16; - this.saveFilterButton.Text = "Save filter"; - this.saveFilterButton.UseVisualStyleBackColor = true; - this.saveFilterButton.Click += new System.EventHandler(this.OnSaveFilterButtonClick); + saveFilterButton.Location = new Point(258, 11); + saveFilterButton.Name = "saveFilterButton"; + saveFilterButton.Size = new Size(75, 35); + saveFilterButton.TabIndex = 16; + saveFilterButton.Text = "Save filter"; + saveFilterButton.UseVisualStyleBackColor = true; + saveFilterButton.Click += OnSaveFilterButtonClick; // // deleteFilterButton // - this.deleteFilterButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.deleteFilterButton.Location = new System.Drawing.Point(287, 40); - this.deleteFilterButton.Name = "deleteFilterButton"; - this.deleteFilterButton.Size = new System.Drawing.Size(73, 23); - this.deleteFilterButton.TabIndex = 3; - this.deleteFilterButton.Text = "Delete"; - this.deleteFilterButton.UseVisualStyleBackColor = true; - this.deleteFilterButton.Click += new System.EventHandler(this.OnDeleteFilterButtonClick); + deleteFilterButton.Location = new Point(258, 47); + deleteFilterButton.Name = "deleteFilterButton"; + deleteFilterButton.Size = new Size(75, 35); + deleteFilterButton.TabIndex = 3; + deleteFilterButton.Text = "Delete"; + deleteFilterButton.UseVisualStyleBackColor = true; + deleteFilterButton.Click += OnDeleteFilterButtonClick; // // filterListBox // - this.filterListBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.filterListBox.ContextMenuStrip = this.filterListContextMenuStrip; - this.filterListBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.filterListBox.FormattingEnabled = true; - this.filterListBox.IntegralHeight = false; - this.filterListBox.Location = new System.Drawing.Point(3, 3); - this.filterListBox.Name = "filterListBox"; - this.filterListBox.Size = new System.Drawing.Size(278, 168); - this.filterListBox.TabIndex = 0; - this.helpToolTip.SetToolTip(this.filterListBox, "Doubleclick to load a saved filter"); - this.filterListBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.OnFilterListBoxDrawItem); - this.filterListBox.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.OnFilterListBoxMouseDoubleClick); + filterListBox.ContextMenuStrip = filterListContextMenuStrip; + filterListBox.Dock = DockStyle.Left; + filterListBox.DrawMode = DrawMode.OwnerDrawFixed; + filterListBox.Font = new Font("Courier New", 12F, FontStyle.Regular, GraphicsUnit.Point, 0); + filterListBox.FormattingEnabled = true; + filterListBox.IntegralHeight = false; + filterListBox.ItemHeight = 25; + filterListBox.Location = new Point(0, 0); + filterListBox.Name = "filterListBox"; + filterListBox.Size = new Size(252, 430); + filterListBox.TabIndex = 0; + helpToolTip.SetToolTip(filterListBox, "Doubleclick to load a saved filter"); + filterListBox.DrawItem += OnFilterListBoxDrawItem; + filterListBox.MouseDoubleClick += OnFilterListBoxMouseDoubleClick; // // filterListContextMenuStrip // - this.filterListContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.colorToolStripMenuItem}); - this.filterListContextMenuStrip.Name = "filterListContextMenuStrip"; - this.filterListContextMenuStrip.Size = new System.Drawing.Size(113, 26); + filterListContextMenuStrip.ImageScalingSize = new Size(24, 24); + filterListContextMenuStrip.Items.AddRange(new ToolStripItem[] { colorToolStripMenuItem }); + filterListContextMenuStrip.Name = "filterListContextMenuStrip"; + filterListContextMenuStrip.Size = new Size(113, 26); // // colorToolStripMenuItem // - this.colorToolStripMenuItem.Name = "colorToolStripMenuItem"; - this.colorToolStripMenuItem.Size = new System.Drawing.Size(112, 22); - this.colorToolStripMenuItem.Text = "Color..."; - this.colorToolStripMenuItem.Click += new System.EventHandler(this.OnColorToolStripMenuItemClick); + colorToolStripMenuItem.Name = "colorToolStripMenuItem"; + colorToolStripMenuItem.Size = new Size(112, 22); + colorToolStripMenuItem.Text = "Color..."; + colorToolStripMenuItem.Click += OnColorToolStripMenuItemClick; // // pnlFilterInput // - this.pnlFilterInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.pnlFilterInput.Controls.Add(this.filterSplitContainer); - this.pnlFilterInput.Location = new System.Drawing.Point(3, 2); - this.pnlFilterInput.Name = "pnlFilterInput"; - this.pnlFilterInput.Size = new System.Drawing.Size(1007, 32); - this.pnlFilterInput.TabIndex = 0; + pnlFilterInput.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + pnlFilterInput.Controls.Add(filterSplitContainer); + pnlFilterInput.Location = new Point(3, 2); + pnlFilterInput.Name = "pnlFilterInput"; + pnlFilterInput.Size = new Size(1855, 46); + pnlFilterInput.TabIndex = 0; // // filterSplitContainer // - this.filterSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill; - this.filterSplitContainer.Location = new System.Drawing.Point(0, 0); - this.filterSplitContainer.Name = "filterSplitContainer"; + filterSplitContainer.Dock = DockStyle.Fill; + filterSplitContainer.Location = new Point(0, 0); + filterSplitContainer.Name = "filterSplitContainer"; // // filterSplitContainer.Panel1 // - this.filterSplitContainer.Panel1.Controls.Add(this.lblTextFilter); - this.filterSplitContainer.Panel1.Controls.Add(this.filterComboBox); - this.filterSplitContainer.Panel1MinSize = 200; + filterSplitContainer.Panel1.Controls.Add(filterComboBox); + filterSplitContainer.Panel1.Controls.Add(lblTextFilter); + filterSplitContainer.Panel1MinSize = 200; // // filterSplitContainer.Panel2 // - this.filterSplitContainer.Panel2.Controls.Add(this.advancedButton); - this.filterSplitContainer.Panel2.Controls.Add(this.syncFilterCheckBox); - this.filterSplitContainer.Panel2.Controls.Add(this.lblFilterCount); - this.filterSplitContainer.Panel2.Controls.Add(this.filterTailCheckBox); - this.filterSplitContainer.Panel2.Controls.Add(this.filterRegexCheckBox); - this.filterSplitContainer.Panel2.Controls.Add(this.filterCaseSensitiveCheckBox); - this.filterSplitContainer.Panel2.Controls.Add(this.filterSearchButton); - this.filterSplitContainer.Panel2MinSize = 550; - this.filterSplitContainer.Size = new System.Drawing.Size(1007, 32); - this.filterSplitContainer.SplitterDistance = 324; - this.filterSplitContainer.TabIndex = 11; - this.filterSplitContainer.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.OnFilterSplitContainerMouseDoubleClick); - this.filterSplitContainer.MouseDown += new System.Windows.Forms.MouseEventHandler(this.OnFilterSplitContainerMouseDown); - this.filterSplitContainer.MouseMove += new System.Windows.Forms.MouseEventHandler(this.OnFilterSplitContainerMouseMove); - this.filterSplitContainer.MouseUp += new System.Windows.Forms.MouseEventHandler(this.OnFilterSplitContainerMouseUp); + filterSplitContainer.Panel2.Controls.Add(advancedButton); + filterSplitContainer.Panel2.Controls.Add(syncFilterCheckBox); + filterSplitContainer.Panel2.Controls.Add(lblFilterCount); + filterSplitContainer.Panel2.Controls.Add(filterTailCheckBox); + filterSplitContainer.Panel2.Controls.Add(filterRegexCheckBox); + filterSplitContainer.Panel2.Controls.Add(filterCaseSensitiveCheckBox); + filterSplitContainer.Panel2.Controls.Add(filterSearchButton); + filterSplitContainer.Panel2MinSize = 550; + filterSplitContainer.Size = new Size(1855, 46); + filterSplitContainer.SplitterDistance = 518; + filterSplitContainer.TabIndex = 11; + filterSplitContainer.MouseDoubleClick += OnFilterSplitContainerMouseDoubleClick; + filterSplitContainer.MouseDown += OnFilterSplitContainerMouseDown; + filterSplitContainer.MouseMove += OnFilterSplitContainerMouseMove; + filterSplitContainer.MouseUp += OnFilterSplitContainerMouseUp; // - // lblTextFilter + // filterComboBox // - this.lblTextFilter.AutoSize = true; - this.lblTextFilter.Location = new System.Drawing.Point(5, 9); - this.lblTextFilter.Name = "lblTextFilter"; - this.lblTextFilter.Size = new System.Drawing.Size(53, 13); - this.lblTextFilter.TabIndex = 3; - this.lblTextFilter.Text = "Text &filter:"; + filterComboBox.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + filterComboBox.Font = new Font("Courier New", 12F, FontStyle.Regular, GraphicsUnit.Point, 0); + filterComboBox.FormattingEnabled = true; + filterComboBox.Location = new Point(89, 5); + filterComboBox.Name = "filterComboBox"; + filterComboBox.Size = new Size(426, 26); + filterComboBox.TabIndex = 4; + helpToolTip.SetToolTip(filterComboBox, "Search string for the filter"); + filterComboBox.TextChanged += OnFilterComboBoxTextChanged; + filterComboBox.KeyDown += OnFilterComboBoxKeyDown; // - // filterComboBox + // lblTextFilter // - this.filterComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.filterComboBox.FormattingEnabled = true; - this.filterComboBox.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.filterComboBox.Location = new System.Drawing.Point(93, 3); - this.filterComboBox.Name = "filterComboBox"; - this.filterComboBox.Size = new System.Drawing.Size(213, 28); - this.filterComboBox.TabIndex = 4; - this.helpToolTip.SetToolTip(this.filterComboBox, "Search string for the filter"); - this.filterComboBox.TextChanged += new System.EventHandler(this.OnFilterComboBoxTextChanged); - this.filterComboBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnFilterComboBoxKeyDown); + lblTextFilter.AutoSize = true; + lblTextFilter.Location = new Point(5, 5); + lblTextFilter.Name = "lblTextFilter"; + lblTextFilter.Size = new Size(53, 13); + lblTextFilter.TabIndex = 3; + lblTextFilter.Text = "Text &filter:"; // // advancedButton // - this.advancedButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.advancedButton.Image = global::LogExpert.Properties.Resources.AdvancedIcon2; - this.advancedButton.ImageAlign = System.Drawing.ContentAlignment.BottomRight; - this.advancedButton.Location = new System.Drawing.Point(363, 5); - this.advancedButton.Name = "advancedButton"; - this.advancedButton.Size = new System.Drawing.Size(110, 21); - this.advancedButton.TabIndex = 17; - this.advancedButton.Text = "Show advanced..."; - this.helpToolTip.SetToolTip(this.advancedButton, "Togge the advanced filter options panel"); - this.advancedButton.UseVisualStyleBackColor = true; - this.advancedButton.Click += new System.EventHandler(this.OnAdvancedButtonClick); + advancedButton.DialogResult = DialogResult.Cancel; + advancedButton.Image = (Image)resources.GetObject("advancedButton.Image"); + advancedButton.ImageAlign = ContentAlignment.MiddleRight; + advancedButton.Location = new Point(539, 5); + advancedButton.Name = "advancedButton"; + advancedButton.Size = new Size(110, 35); + advancedButton.TabIndex = 17; + advancedButton.Text = "Show advanced..."; + helpToolTip.SetToolTip(advancedButton, "Toggel the advanced filter options panel"); + advancedButton.UseVisualStyleBackColor = true; + advancedButton.Click += OnAdvancedButtonClick; // // syncFilterCheckBox // - this.syncFilterCheckBox.AutoSize = true; - this.syncFilterCheckBox.Location = new System.Drawing.Point(306, 7); - this.syncFilterCheckBox.Name = "syncFilterCheckBox"; - this.syncFilterCheckBox.Size = new System.Drawing.Size(50, 17); - this.syncFilterCheckBox.TabIndex = 16; - this.syncFilterCheckBox.Text = "Sync"; - this.helpToolTip.SetToolTip(this.syncFilterCheckBox, "Sync the current selected line in the filter view to the selection in the log fil" + - "e view"); - this.syncFilterCheckBox.UseVisualStyleBackColor = true; - this.syncFilterCheckBox.CheckedChanged += new System.EventHandler(this.OnSyncFilterCheckBoxCheckedChanged); + syncFilterCheckBox.AutoSize = true; + syncFilterCheckBox.Location = new Point(467, 5); + syncFilterCheckBox.Name = "syncFilterCheckBox"; + syncFilterCheckBox.Size = new Size(50, 17); + syncFilterCheckBox.TabIndex = 16; + syncFilterCheckBox.Text = "Sync"; + helpToolTip.SetToolTip(syncFilterCheckBox, "Sync the current selected line in the filter view to the selection in the log file view"); + syncFilterCheckBox.UseVisualStyleBackColor = true; + syncFilterCheckBox.CheckedChanged += OnSyncFilterCheckBoxCheckedChanged; // // lblFilterCount // - this.lblFilterCount.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.lblFilterCount.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - this.lblFilterCount.Location = new System.Drawing.Point(605, 5); - this.lblFilterCount.Name = "lblFilterCount"; - this.lblFilterCount.Size = new System.Drawing.Size(71, 21); - this.lblFilterCount.TabIndex = 15; - this.lblFilterCount.Text = "0"; - this.lblFilterCount.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + lblFilterCount.Anchor = AnchorStyles.Right; + lblFilterCount.BorderStyle = BorderStyle.Fixed3D; + lblFilterCount.Location = new Point(1259, 8); + lblFilterCount.Name = "lblFilterCount"; + lblFilterCount.Size = new Size(71, 21); + lblFilterCount.TabIndex = 15; + lblFilterCount.Text = "0"; + lblFilterCount.TextAlign = ContentAlignment.MiddleRight; // // filterTailCheckBox // - this.filterTailCheckBox.AutoSize = true; - this.filterTailCheckBox.Location = new System.Drawing.Point(235, 7); - this.filterTailCheckBox.Name = "filterTailCheckBox"; - this.filterTailCheckBox.Size = new System.Drawing.Size(64, 17); - this.filterTailCheckBox.TabIndex = 14; - this.filterTailCheckBox.Text = "Filter tail"; - this.helpToolTip.SetToolTip(this.filterTailCheckBox, "Filter tailed file content (keeps filter view up to date on file changes)"); - this.filterTailCheckBox.UseVisualStyleBackColor = true; + filterTailCheckBox.AutoSize = true; + filterTailCheckBox.Location = new Point(367, 5); + filterTailCheckBox.Name = "filterTailCheckBox"; + filterTailCheckBox.Size = new Size(64, 17); + filterTailCheckBox.TabIndex = 14; + filterTailCheckBox.Text = "Filter tail"; + helpToolTip.SetToolTip(filterTailCheckBox, "Filter tailed file content (keeps filter view up to date on file changes)"); + filterTailCheckBox.UseVisualStyleBackColor = true; // // filterRegexCheckBox // - this.filterRegexCheckBox.AutoSize = true; - this.filterRegexCheckBox.Location = new System.Drawing.Point(172, 7); - this.filterRegexCheckBox.Name = "filterRegexCheckBox"; - this.filterRegexCheckBox.Size = new System.Drawing.Size(57, 17); - this.filterRegexCheckBox.TabIndex = 13; - this.filterRegexCheckBox.Text = "Regex"; - this.helpToolTip.SetToolTip(this.filterRegexCheckBox, "Use regular expressions. (right-click for RegEx helper window)"); - this.filterRegexCheckBox.UseVisualStyleBackColor = true; - this.filterRegexCheckBox.CheckedChanged += new System.EventHandler(this.OnFilterRegexCheckBoxCheckedChanged); - this.filterRegexCheckBox.MouseUp += new System.Windows.Forms.MouseEventHandler(this.OnFilterRegexCheckBoxMouseUp); + filterRegexCheckBox.AutoSize = true; + filterRegexCheckBox.Location = new Point(283, 5); + filterRegexCheckBox.Name = "filterRegexCheckBox"; + filterRegexCheckBox.Size = new Size(57, 17); + filterRegexCheckBox.TabIndex = 13; + filterRegexCheckBox.Text = "Regex"; + helpToolTip.SetToolTip(filterRegexCheckBox, "Use regular expressions. (right-click for RegEx helper window)"); + filterRegexCheckBox.UseVisualStyleBackColor = true; + filterRegexCheckBox.CheckedChanged += OnFilterRegexCheckBoxCheckedChanged; + filterRegexCheckBox.MouseUp += OnFilterRegexCheckBoxMouseUp; // // filterCaseSensitiveCheckBox // - this.filterCaseSensitiveCheckBox.AutoSize = true; - this.filterCaseSensitiveCheckBox.Location = new System.Drawing.Point(72, 7); - this.filterCaseSensitiveCheckBox.Name = "filterCaseSensitiveCheckBox"; - this.filterCaseSensitiveCheckBox.Size = new System.Drawing.Size(94, 17); - this.filterCaseSensitiveCheckBox.TabIndex = 12; - this.filterCaseSensitiveCheckBox.Text = "Case sensitive"; - this.helpToolTip.SetToolTip(this.filterCaseSensitiveCheckBox, "Makes the filter case sensitive"); - this.filterCaseSensitiveCheckBox.UseVisualStyleBackColor = true; - this.filterCaseSensitiveCheckBox.CheckedChanged += new System.EventHandler(this.OnFilterCaseSensitiveCheckBoxCheckedChanged); + filterCaseSensitiveCheckBox.AutoSize = true; + filterCaseSensitiveCheckBox.Location = new Point(137, 5); + filterCaseSensitiveCheckBox.Name = "filterCaseSensitiveCheckBox"; + filterCaseSensitiveCheckBox.Size = new Size(94, 17); + filterCaseSensitiveCheckBox.TabIndex = 12; + filterCaseSensitiveCheckBox.Text = "Case sensitive"; + helpToolTip.SetToolTip(filterCaseSensitiveCheckBox, "Makes the filter case sensitive"); + filterCaseSensitiveCheckBox.UseVisualStyleBackColor = true; + filterCaseSensitiveCheckBox.CheckedChanged += OnFilterCaseSensitiveCheckBoxCheckedChanged; // // filterSearchButton // - this.filterSearchButton.Image = global::LogExpert.Properties.Resources.AdvancedIcon2; - this.filterSearchButton.ImageAlign = System.Drawing.ContentAlignment.BottomRight; - this.filterSearchButton.Location = new System.Drawing.Point(18, 5); - this.filterSearchButton.Name = "filterSearchButton"; - this.filterSearchButton.Size = new System.Drawing.Size(50, 21); - this.filterSearchButton.TabIndex = 11; - this.filterSearchButton.Text = "Search"; - this.helpToolTip.SetToolTip(this.filterSearchButton, "Start the filter search"); - this.filterSearchButton.UseVisualStyleBackColor = true; - this.filterSearchButton.Click += new System.EventHandler(this.OnFilterSearchButtonClick); + filterSearchButton.Image = (Image)resources.GetObject("filterSearchButton.Image"); + filterSearchButton.ImageAlign = ContentAlignment.MiddleRight; + filterSearchButton.Location = new Point(3, 5); + filterSearchButton.Name = "filterSearchButton"; + filterSearchButton.Size = new Size(128, 35); + filterSearchButton.TabIndex = 11; + filterSearchButton.Text = "Search"; + helpToolTip.SetToolTip(filterSearchButton, "Start the filter search"); + filterSearchButton.UseVisualStyleBackColor = true; + filterSearchButton.Click += OnFilterSearchButtonClick; // // bookmarkContextMenuStrip // - this.bookmarkContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.deleteBookmarksToolStripMenuItem}); - this.bookmarkContextMenuStrip.Name = "bookmarkContextMenuStrip"; - this.bookmarkContextMenuStrip.Size = new System.Drawing.Size(68, 26); + bookmarkContextMenuStrip.ImageScalingSize = new Size(24, 24); + bookmarkContextMenuStrip.Items.AddRange(new ToolStripItem[] { deleteBookmarksToolStripMenuItem }); + bookmarkContextMenuStrip.Name = "bookmarkContextMenuStrip"; + bookmarkContextMenuStrip.Size = new Size(68, 26); // // deleteBookmarksToolStripMenuItem // - this.deleteBookmarksToolStripMenuItem.Name = "deleteBookmarksToolStripMenuItem"; - this.deleteBookmarksToolStripMenuItem.Size = new System.Drawing.Size(67, 22); + deleteBookmarksToolStripMenuItem.Name = "deleteBookmarksToolStripMenuItem"; + deleteBookmarksToolStripMenuItem.Size = new Size(67, 22); // // columnContextMenuStrip // - this.columnContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.freezeLeftColumnsUntilHereToolStripMenuItem, - this.toolStripSeparator3, - this.moveToLastColumnToolStripMenuItem, - this.moveLeftToolStripMenuItem, - this.moveRightToolStripMenuItem, - this.toolStripSeparator5, - this.hideColumnToolStripMenuItem, - this.restoreColumnsToolStripMenuItem, - this.toolStripSeparator6, - this.allColumnsToolStripMenuItem}); - this.columnContextMenuStrip.Name = "columnContextMenuStrip"; - this.columnContextMenuStrip.Size = new System.Drawing.Size(230, 176); - this.columnContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.OnColumnContextMenuStripOpening); + columnContextMenuStrip.ImageScalingSize = new Size(24, 24); + columnContextMenuStrip.Items.AddRange(new ToolStripItem[] { freezeLeftColumnsUntilHereToolStripMenuItem, moveToLastColumnToolStripMenuItem, moveLeftToolStripMenuItem, moveRightToolStripMenuItem, hideColumnToolStripMenuItem, restoreColumnsToolStripMenuItem, allColumnsToolStripMenuItem }); + columnContextMenuStrip.Name = "columnContextMenuStrip"; + columnContextMenuStrip.Size = new Size(230, 158); + columnContextMenuStrip.Opening += OnColumnContextMenuStripOpening; // // freezeLeftColumnsUntilHereToolStripMenuItem // - this.freezeLeftColumnsUntilHereToolStripMenuItem.Name = "freezeLeftColumnsUntilHereToolStripMenuItem"; - this.freezeLeftColumnsUntilHereToolStripMenuItem.Size = new System.Drawing.Size(229, 22); - this.freezeLeftColumnsUntilHereToolStripMenuItem.Text = "Freeze left columns until here"; - this.freezeLeftColumnsUntilHereToolStripMenuItem.Click += new System.EventHandler(this.OnFreezeLeftColumnsUntilHereToolStripMenuItemClick); - // - // toolStripSeparator3 - // - this.toolStripSeparator3.Name = "toolStripSeparator3"; - this.toolStripSeparator3.Size = new System.Drawing.Size(226, 6); + freezeLeftColumnsUntilHereToolStripMenuItem.Name = "freezeLeftColumnsUntilHereToolStripMenuItem"; + freezeLeftColumnsUntilHereToolStripMenuItem.Size = new Size(229, 22); + freezeLeftColumnsUntilHereToolStripMenuItem.Text = "Freeze left columns until here"; + freezeLeftColumnsUntilHereToolStripMenuItem.Click += OnFreezeLeftColumnsUntilHereToolStripMenuItemClick; // // moveToLastColumnToolStripMenuItem // - this.moveToLastColumnToolStripMenuItem.Name = "moveToLastColumnToolStripMenuItem"; - this.moveToLastColumnToolStripMenuItem.Size = new System.Drawing.Size(229, 22); - this.moveToLastColumnToolStripMenuItem.Text = "Move to last column"; - this.moveToLastColumnToolStripMenuItem.ToolTipText = "Move this column to the last position"; - this.moveToLastColumnToolStripMenuItem.Click += new System.EventHandler(this.OnMoveToLastColumnToolStripMenuItemClick); + moveToLastColumnToolStripMenuItem.Name = "moveToLastColumnToolStripMenuItem"; + moveToLastColumnToolStripMenuItem.Size = new Size(229, 22); + moveToLastColumnToolStripMenuItem.Text = "Move to last column"; + moveToLastColumnToolStripMenuItem.ToolTipText = "Move this column to the last position"; + moveToLastColumnToolStripMenuItem.Click += OnMoveToLastColumnToolStripMenuItemClick; // // moveLeftToolStripMenuItem // - this.moveLeftToolStripMenuItem.Name = "moveLeftToolStripMenuItem"; - this.moveLeftToolStripMenuItem.Size = new System.Drawing.Size(229, 22); - this.moveLeftToolStripMenuItem.Text = "Move left"; - this.moveLeftToolStripMenuItem.Click += new System.EventHandler(this.OnMoveLeftToolStripMenuItemClick); + moveLeftToolStripMenuItem.Name = "moveLeftToolStripMenuItem"; + moveLeftToolStripMenuItem.Size = new Size(229, 22); + moveLeftToolStripMenuItem.Text = "Move left"; + moveLeftToolStripMenuItem.Click += OnMoveLeftToolStripMenuItemClick; // // moveRightToolStripMenuItem // - this.moveRightToolStripMenuItem.Name = "moveRightToolStripMenuItem"; - this.moveRightToolStripMenuItem.Size = new System.Drawing.Size(229, 22); - this.moveRightToolStripMenuItem.Text = "Move right"; - this.moveRightToolStripMenuItem.Click += new System.EventHandler(this.OnMoveRightToolStripMenuItemClick); - // - // toolStripSeparator5 - // - this.toolStripSeparator5.Name = "toolStripSeparator5"; - this.toolStripSeparator5.Size = new System.Drawing.Size(226, 6); + moveRightToolStripMenuItem.Name = "moveRightToolStripMenuItem"; + moveRightToolStripMenuItem.Size = new Size(229, 22); + moveRightToolStripMenuItem.Text = "Move right"; + moveRightToolStripMenuItem.Click += OnMoveRightToolStripMenuItemClick; // // hideColumnToolStripMenuItem // - this.hideColumnToolStripMenuItem.Name = "hideColumnToolStripMenuItem"; - this.hideColumnToolStripMenuItem.Size = new System.Drawing.Size(229, 22); - this.hideColumnToolStripMenuItem.Text = "Hide column"; - this.hideColumnToolStripMenuItem.ToolTipText = "Hide this column"; - this.hideColumnToolStripMenuItem.Click += new System.EventHandler(this.OnHideColumnToolStripMenuItemClick); + hideColumnToolStripMenuItem.Name = "hideColumnToolStripMenuItem"; + hideColumnToolStripMenuItem.Size = new Size(229, 22); + hideColumnToolStripMenuItem.Text = "Hide column"; + hideColumnToolStripMenuItem.ToolTipText = "Hide this column"; + hideColumnToolStripMenuItem.Click += OnHideColumnToolStripMenuItemClick; // // restoreColumnsToolStripMenuItem // - this.restoreColumnsToolStripMenuItem.Name = "restoreColumnsToolStripMenuItem"; - this.restoreColumnsToolStripMenuItem.Size = new System.Drawing.Size(229, 22); - this.restoreColumnsToolStripMenuItem.Text = "Restore columns"; - this.restoreColumnsToolStripMenuItem.Click += new System.EventHandler(this.OnRestoreColumnsToolStripMenuItemClick); - // - // toolStripSeparator6 - // - this.toolStripSeparator6.Name = "toolStripSeparator6"; - this.toolStripSeparator6.Size = new System.Drawing.Size(266, 6); + restoreColumnsToolStripMenuItem.Name = "restoreColumnsToolStripMenuItem"; + restoreColumnsToolStripMenuItem.Size = new Size(229, 22); + restoreColumnsToolStripMenuItem.Text = "Restore columns"; + restoreColumnsToolStripMenuItem.Click += OnRestoreColumnsToolStripMenuItemClick; // // allColumnsToolStripMenuItem // - this.allColumnsToolStripMenuItem.Name = "allColumnsToolStripMenuItem"; - this.allColumnsToolStripMenuItem.Size = new System.Drawing.Size(229, 22); - this.allColumnsToolStripMenuItem.Text = "Scroll to column..."; + allColumnsToolStripMenuItem.Name = "allColumnsToolStripMenuItem"; + allColumnsToolStripMenuItem.Size = new Size(229, 22); + allColumnsToolStripMenuItem.Text = "Scroll to column..."; // // editModeContextMenuStrip // - this.editModeContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.editModecopyToolStripMenuItem, - this.highlightSelectionInLogFileToolStripMenuItem, - this.highlightSelectionInLogFilewordModeToolStripMenuItem, - this.filterForSelectionToolStripMenuItem, - this.setSelectedTextAsBookmarkCommentToolStripMenuItem}); - this.editModeContextMenuStrip.Name = "editModeContextMenuStrip"; - this.editModeContextMenuStrip.Size = new System.Drawing.Size(344, 114); + editModeContextMenuStrip.ImageScalingSize = new Size(24, 24); + editModeContextMenuStrip.Items.AddRange(new ToolStripItem[] { editModecopyToolStripMenuItem, highlightSelectionInLogFileToolStripMenuItem, highlightSelectionInLogFilewordModeToolStripMenuItem, filterForSelectionToolStripMenuItem, setSelectedTextAsBookmarkCommentToolStripMenuItem }); + editModeContextMenuStrip.Name = "editModeContextMenuStrip"; + editModeContextMenuStrip.Size = new Size(346, 114); // // editModecopyToolStripMenuItem // - this.editModecopyToolStripMenuItem.Name = "editModecopyToolStripMenuItem"; - this.editModecopyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); - this.editModecopyToolStripMenuItem.Size = new System.Drawing.Size(343, 22); - this.editModecopyToolStripMenuItem.Text = "Copy"; - this.editModecopyToolStripMenuItem.Click += new System.EventHandler(this.OnEditModeCopyToolStripMenuItemClick); + editModecopyToolStripMenuItem.Name = "editModecopyToolStripMenuItem"; + editModecopyToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.C; + editModecopyToolStripMenuItem.Size = new Size(345, 22); + editModecopyToolStripMenuItem.Text = "Copy"; + editModecopyToolStripMenuItem.Click += OnEditModeCopyToolStripMenuItemClick; // // highlightSelectionInLogFileToolStripMenuItem // - this.highlightSelectionInLogFileToolStripMenuItem.Name = "highlightSelectionInLogFileToolStripMenuItem"; - this.highlightSelectionInLogFileToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.H))); - this.highlightSelectionInLogFileToolStripMenuItem.Size = new System.Drawing.Size(343, 22); - this.highlightSelectionInLogFileToolStripMenuItem.Text = "Highlight selection in log file (full line)"; - this.highlightSelectionInLogFileToolStripMenuItem.Click += new System.EventHandler(this.OnHighlightSelectionInLogFileToolStripMenuItemClick); + highlightSelectionInLogFileToolStripMenuItem.Name = "highlightSelectionInLogFileToolStripMenuItem"; + highlightSelectionInLogFileToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.H; + highlightSelectionInLogFileToolStripMenuItem.Size = new Size(345, 22); + highlightSelectionInLogFileToolStripMenuItem.Text = "Highlight selection in log file (full line)"; + highlightSelectionInLogFileToolStripMenuItem.Click += OnHighlightSelectionInLogFileToolStripMenuItemClick; // // highlightSelectionInLogFilewordModeToolStripMenuItem // - this.highlightSelectionInLogFilewordModeToolStripMenuItem.Name = "highlightSelectionInLogFilewordModeToolStripMenuItem"; - this.highlightSelectionInLogFilewordModeToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.W))); - this.highlightSelectionInLogFilewordModeToolStripMenuItem.Size = new System.Drawing.Size(343, 22); - this.highlightSelectionInLogFilewordModeToolStripMenuItem.Text = "Highlight selection in log file (word mode)"; - this.highlightSelectionInLogFilewordModeToolStripMenuItem.Click += new System.EventHandler(this.OnHighlightSelectionInLogFilewordModeToolStripMenuItemClick); + highlightSelectionInLogFilewordModeToolStripMenuItem.Name = "highlightSelectionInLogFilewordModeToolStripMenuItem"; + highlightSelectionInLogFilewordModeToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.W; + highlightSelectionInLogFilewordModeToolStripMenuItem.Size = new Size(345, 22); + highlightSelectionInLogFilewordModeToolStripMenuItem.Text = "Highlight selection in log file (word mode)"; + highlightSelectionInLogFilewordModeToolStripMenuItem.Click += OnHighlightSelectionInLogFilewordModeToolStripMenuItemClick; // // filterForSelectionToolStripMenuItem // - this.filterForSelectionToolStripMenuItem.Name = "filterForSelectionToolStripMenuItem"; - this.filterForSelectionToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F))); - this.filterForSelectionToolStripMenuItem.Size = new System.Drawing.Size(343, 22); - this.filterForSelectionToolStripMenuItem.Text = "Filter for selection"; - this.filterForSelectionToolStripMenuItem.Click += new System.EventHandler(this.OnFilterForSelectionToolStripMenuItemClick); + filterForSelectionToolStripMenuItem.Name = "filterForSelectionToolStripMenuItem"; + filterForSelectionToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.F; + filterForSelectionToolStripMenuItem.Size = new Size(345, 22); + filterForSelectionToolStripMenuItem.Text = "Filter for selection"; + filterForSelectionToolStripMenuItem.Click += OnFilterForSelectionToolStripMenuItemClick; // // setSelectedTextAsBookmarkCommentToolStripMenuItem // - this.setSelectedTextAsBookmarkCommentToolStripMenuItem.Name = "setSelectedTextAsBookmarkCommentToolStripMenuItem"; - this.setSelectedTextAsBookmarkCommentToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.B))); - this.setSelectedTextAsBookmarkCommentToolStripMenuItem.Size = new System.Drawing.Size(343, 22); - this.setSelectedTextAsBookmarkCommentToolStripMenuItem.Text = "Set selected text as bookmark comment"; - this.setSelectedTextAsBookmarkCommentToolStripMenuItem.Click += new System.EventHandler(this.OnSetSelectedTextAsBookmarkCommentToolStripMenuItemClick); + setSelectedTextAsBookmarkCommentToolStripMenuItem.Name = "setSelectedTextAsBookmarkCommentToolStripMenuItem"; + setSelectedTextAsBookmarkCommentToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.B; + setSelectedTextAsBookmarkCommentToolStripMenuItem.Size = new Size(345, 22); + setSelectedTextAsBookmarkCommentToolStripMenuItem.Text = "Set selected text as bookmark comment"; + setSelectedTextAsBookmarkCommentToolStripMenuItem.Click += OnSetSelectedTextAsBookmarkCommentToolStripMenuItemClick; // // LogWindow // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1014, 656); - this.ControlBox = false; - this.Controls.Add(this.splitContainerLogWindow); - this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Margin = new System.Windows.Forms.Padding(0); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "LogWindow"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.SizeChanged += new System.EventHandler(this.OnLogWindowSizeChanged); - this.Enter += new System.EventHandler(this.OnLogWindowEnter); - this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnLogWindowKeyDown); - this.Leave += new System.EventHandler(this.OnLogWindowLeave); - this.splitContainerLogWindow.Panel1.ResumeLayout(false); - this.splitContainerLogWindow.Panel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.splitContainerLogWindow)).EndInit(); - this.splitContainerLogWindow.ResumeLayout(false); - this.tableLayoutPanel1.ResumeLayout(false); - this.columnFinderPanel.ResumeLayout(false); - this.columnFinderPanel.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); - this.dataGridContextMenuStrip.ResumeLayout(false); - this.advancedBackPanel.ResumeLayout(false); - this.advancedFilterSplitContainer.Panel1.ResumeLayout(false); - this.advancedFilterSplitContainer.Panel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.advancedFilterSplitContainer)).EndInit(); - this.advancedFilterSplitContainer.ResumeLayout(false); - this.pnlProFilter.ResumeLayout(false); - this.pnlProFilter.PerformLayout(); - this.highlightSplitContainer.Panel1.ResumeLayout(false); - this.highlightSplitContainer.Panel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.highlightSplitContainer)).EndInit(); - this.highlightSplitContainer.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.filterGridView)).EndInit(); - this.filterContextMenuStrip.ResumeLayout(false); - this.highlightSplitContainerBackPanel.ResumeLayout(false); - this.highlightSplitContainerBackPanel.PerformLayout(); - this.filterListContextMenuStrip.ResumeLayout(false); - this.pnlFilterInput.ResumeLayout(false); - this.filterSplitContainer.Panel1.ResumeLayout(false); - this.filterSplitContainer.Panel1.PerformLayout(); - this.filterSplitContainer.Panel2.ResumeLayout(false); - this.filterSplitContainer.Panel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.filterSplitContainer)).EndInit(); - this.filterSplitContainer.ResumeLayout(false); - this.bookmarkContextMenuStrip.ResumeLayout(false); - this.columnContextMenuStrip.ResumeLayout(false); - this.editModeContextMenuStrip.ResumeLayout(false); - this.ResumeLayout(false); - - } + ClientSize = new Size(1862, 1104); + ControlBox = false; + Controls.Add(splitContainerLogWindow); + Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular, GraphicsUnit.Point, 0); + FormBorderStyle = FormBorderStyle.None; + Icon = (Icon)resources.GetObject("$this.Icon"); + Margin = new Padding(0); + MaximizeBox = false; + MinimizeBox = false; + Name = "LogWindow"; + ShowIcon = false; + ShowInTaskbar = false; + SizeGripStyle = SizeGripStyle.Hide; + SizeChanged += OnLogWindowSizeChanged; + Enter += OnLogWindowEnter; + KeyDown += OnLogWindowKeyDown; + Leave += OnLogWindowLeave; + splitContainerLogWindow.Panel1.ResumeLayout(false); + splitContainerLogWindow.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)splitContainerLogWindow).EndInit(); + splitContainerLogWindow.ResumeLayout(false); + tableLayoutPanel1.ResumeLayout(false); + columnFinderPanel.ResumeLayout(false); + columnFinderPanel.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); + dataGridContextMenuStrip.ResumeLayout(false); + advancedBackPanel.ResumeLayout(false); + advancedFilterSplitContainer.Panel1.ResumeLayout(false); + advancedFilterSplitContainer.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)advancedFilterSplitContainer).EndInit(); + advancedFilterSplitContainer.ResumeLayout(false); + pnlProFilter.ResumeLayout(false); + pnlProFilter.PerformLayout(); + panelBackgroundAdvancedFilterSplitContainer.ResumeLayout(false); + highlightSplitContainer.Panel1.ResumeLayout(false); + highlightSplitContainer.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)highlightSplitContainer).EndInit(); + highlightSplitContainer.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)filterGridView).EndInit(); + filterContextMenuStrip.ResumeLayout(false); + highlightSplitContainerBackPanel.ResumeLayout(false); + highlightSplitContainerBackPanel.PerformLayout(); + filterListContextMenuStrip.ResumeLayout(false); + pnlFilterInput.ResumeLayout(false); + filterSplitContainer.Panel1.ResumeLayout(false); + filterSplitContainer.Panel1.PerformLayout(); + filterSplitContainer.Panel2.ResumeLayout(false); + filterSplitContainer.Panel2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)filterSplitContainer).EndInit(); + filterSplitContainer.ResumeLayout(false); + bookmarkContextMenuStrip.ResumeLayout(false); + columnContextMenuStrip.ResumeLayout(false); + editModeContextMenuStrip.ResumeLayout(false); + ResumeLayout(false); + } - #endregion + #endregion - private System.Windows.Forms.SplitContainer splitContainerLogWindow; + private System.Windows.Forms.SplitContainer splitContainerLogWindow; private System.Windows.Forms.Panel pnlFilterInput; private BufferedDataGridView dataGridView; private BufferedDataGridView filterGridView; @@ -1320,6 +1253,7 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox filterRegexCheckBox; private System.Windows.Forms.CheckBox filterCaseSensitiveCheckBox; private System.Windows.Forms.Button filterSearchButton; + private System.Windows.Forms.Panel panelBackgroundAdvancedFilterSplitContainer; private MenuToolStripSeparatorExtension toolStripSeparator1; private MenuToolStripSeparatorExtension toolStripSeparator2; private MenuToolStripSeparatorExtension toolStripSeparator3; diff --git a/src/LogExpert/Controls/LogWindow/LogWindow.resx b/src/LogExpert/Controls/LogWindow/LogWindow.resx index 7a284cf3..df7aeccf 100644 --- a/src/LogExpert/Controls/LogWindow/LogWindow.resx +++ b/src/LogExpert/Controls/LogWindow/LogWindow.resx @@ -1,17 +1,17 @@ - @@ -129,6 +129,25 @@ 862, 21 + + + + iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + vAAADrwBlbxySQAAAM1JREFUOE/dlDsKQkEMRYO1jZU7EAS3YG1h51ZsdSdWIoLrcBla2dhZ2PvhPiYQ + rplMsLDwwBS5n8C8gSfyT0xF5EVnwqEsF1q0FZE9aRsuRWgpopfMdaSDhWb+3ApUQGfBovLNQjCudfWV + syB7o/mD5rcxeFnMV9I6cceig7ewqkM40MwhT1NczxOt5vkWeEcWR5WSLvM8S9WH0WcxKhSWUWYdmQHo + DFi0ZK5qQfbBoocunrFhWJXMk42IOT2Sd4ZcyoJf3N0sOnHgJ7wBih1ZgqnoK8MAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + vAAADrwBlbxySQAAAM1JREFUOE/dlDsKQkEMRYO1jZU7EAS3YG1h51ZsdSdWIoLrcBla2dhZ2PvhPiYQ + rplMsLDwwBS5n8C8gSfyT0xF5EVnwqEsF1q0FZE9aRsuRWgpopfMdaSDhWb+3ApUQGfBovLNQjCudfWV + syB7o/mD5rcxeFnMV9I6cceig7ewqkM40MwhT1NczxOt5vkWeEcWR5WSLvM8S9WH0WcxKhSWUWYdmQHo + DFi0ZK5qQfbBoocunrFhWJXMk42IOT2Sd4ZcyoJf3N0sOnHgJ7wBih1ZgqnoK8MAAAAASUVORK5CYII= + + 261, 21 @@ -141,7 +160,6 @@ 70 - AAABAAEAEBAQAAAABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAABAA diff --git a/src/LogExpert/Controls/LogWindow/LogWindowEventHandlers.cs b/src/LogExpert/Controls/LogWindow/LogWindowEventHandlers.cs index 88c2db91..d61d9d26 100644 --- a/src/LogExpert/Controls/LogWindow/LogWindowEventHandlers.cs +++ b/src/LogExpert/Controls/LogWindow/LogWindowEventHandlers.cs @@ -1,10 +1,5 @@ #region -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; using LogExpert.Classes; using LogExpert.Classes.Filter; using LogExpert.Classes.Highlight; @@ -16,6 +11,12 @@ using LogExpert.Extensions; using LogExpert.Interface; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + #endregion namespace LogExpert.Controls.LogWindow @@ -142,7 +143,10 @@ private void OnLogFileReaderFinishedLoading(object sender, EventArgs e) _externaLoadingFinishedEvent.Set(); _timeSpreadCalc.SetLineCount(_logFileReader.LineCount); - if (_reloadMemento != null) Invoke(new PositionAfterReloadFx(PositionAfterReload), _reloadMemento); + if (_reloadMemento != null) + { + Invoke(new PositionAfterReloadFx(PositionAfterReload), _reloadMemento); + } if (filterTailCheckBox.Checked) { @@ -174,11 +178,13 @@ private void OnLogFileReaderRespawned(object sender, EventArgs e) private void OnLogWindowClosing(object sender, CancelEventArgs e) { if (Preferences.askForClose) + { if (MessageBox.Show("Sure to close?", "LogExpert", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { e.Cancel = true; return; } + } SavePersistenceData(false); CloseLogWindow(); @@ -211,7 +217,10 @@ private void OnLogFileReaderLoadFile(object sender, LoadFileEventArgs e) return; } - if (!_isLoading) return; + if (!_isLoading) + { + return; + } UpdateProgressCallback callback = UpdateProgress; BeginInvoke(callback, e); @@ -248,16 +257,21 @@ private void OnDataGridViewCellValueNeeded(object sender, DataGridViewCellValueE // Only support add new columns for now. // TODO: Support reload all columns? if (CurrentColumnizer != null && CurrentColumnizer.GetColumnCount() > startCount) + { for (int i = startCount; i < CurrentColumnizer.GetColumnCount(); i++) { var colName = CurrentColumnizer.GetColumnNames()[i]; dataGridView.Columns.Add(PaintHelper.CreateTitleColumn(colName)); } + } } private void OnDataGridViewCellValuePushed(object sender, DataGridViewCellValueEventArgs e) { - if (!CurrentColumnizer.IsTimeshiftImplemented()) return; + if (!CurrentColumnizer.IsTimeshiftImplemented()) + { + return; + } ILogLine line = _logFileReader.GetLogLine(e.RowIndex); int offset = CurrentColumnizer.GetTimeOffset(); @@ -265,17 +279,23 @@ private void OnDataGridViewCellValuePushed(object sender, DataGridViewCellValueE ColumnizerCallbackObject.LineNum = e.RowIndex; IColumnizedLogLine cols = CurrentColumnizer.SplitLine(ColumnizerCallbackObject, line); CurrentColumnizer.SetTimeOffset(offset); - if (cols.ColumnValues.Length <= e.ColumnIndex - 2) return; + if (cols.ColumnValues.Length <= e.ColumnIndex - 2) + { + return; + } string oldValue = cols.ColumnValues[e.ColumnIndex - 2].FullValue; string newValue = (string)e.Value; //string oldValue = (string) this.dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value; CurrentColumnizer.PushValue(ColumnizerCallbackObject, e.ColumnIndex - 2, newValue, oldValue); dataGridView.Refresh(); - TimeSpan timeSpan = new TimeSpan(CurrentColumnizer.GetTimeOffset() * TimeSpan.TicksPerMillisecond); + TimeSpan timeSpan = new(CurrentColumnizer.GetTimeOffset() * TimeSpan.TicksPerMillisecond); string span = timeSpan.ToString(); int index = span.LastIndexOf('.'); - if (index > 0) span = span.Substring(0, index + 4); + if (index > 0) + { + span = span.Substring(0, index + 4); + } SetTimeshiftValue(span); SendGuiStateUpdate(); @@ -292,9 +312,15 @@ private void OnDataGridViewCurrentCellChanged(object sender, EventArgs e) { _statusEventArgs.CurrentLineNum = dataGridView.CurrentRow.Index + 1; SendStatusLineUpdate(); - if (syncFilterCheckBox.Checked) SyncFilterGridPos(); + if (syncFilterCheckBox.Checked) + { + SyncFilterGridPos(); + } - if (CurrentColumnizer.IsTimeshiftImplemented() && Preferences.timestampControl) SyncTimestampDisplay(); + if (CurrentColumnizer.IsTimeshiftImplemented() && Preferences.timestampControl) + { + SyncTimestampDisplay(); + } //MethodInvoker invoker = new MethodInvoker(DisplayCurrentFileOnStatusline); //invoker.BeginInvoke(null, null); @@ -354,14 +380,14 @@ private void OnFilterGridViewCellPainting(object sender, DataGridViewCellPaintin } int lineNum = _filterResultList[e.RowIndex]; - ILogLine line = _logFileReader.GetLogLineWithWait(lineNum); + ILogLine line = _logFileReader.GetLogLineWithWait(lineNum).Result; if (line != null) { HilightEntry entry = FindFirstNoWordMatchHilightEntry(line); e.Graphics.SetClip(e.CellBounds); if ((e.State & DataGridViewElementStates.Selected) == DataGridViewElementStates.Selected) { - Color backColor = LogExpert.Config.ColorMode.DockBackgroundColor; + Color backColor = e.CellStyle.SelectionBackColor; Brush brush; if (gridView.Focused) { @@ -369,7 +395,7 @@ private void OnFilterGridViewCellPainting(object sender, DataGridViewCellPaintin } else { - Color color = backColor; + Color color = Color.FromArgb(255, 170, 170, 170); brush = new SolidBrush(color); } @@ -378,8 +404,7 @@ private void OnFilterGridViewCellPainting(object sender, DataGridViewCellPaintin } else { - Color bgColor = LogExpert.Config.ColorMode.DockBackgroundColor; - Color foreColor = LogExpert.Config.ColorMode.ForeColor; + Color bgColor = Color.White; // paint direct filter hits with different bg color //if (this.filterParams.SpreadEnabled && this.filterHitList.Contains(lineNum)) //{ @@ -387,28 +412,37 @@ private void OnFilterGridViewCellPainting(object sender, DataGridViewCellPaintin //} if (!DebugOptions.disableWordHighlight) { - if (entry != null) bgColor = entry.BackgroundColor; + if (entry != null) + { + bgColor = entry.BackgroundColor; + } } else { - if (entry != null) bgColor = entry.BackgroundColor; + if (entry != null) + { + bgColor = entry.BackgroundColor; + } } e.CellStyle.BackColor = bgColor; - e.CellStyle.ForeColor = foreColor; // Not working? - e.PaintBackground(e.ClipBounds, false); } if (DebugOptions.disableWordHighlight) + { e.PaintContent(e.CellBounds); + } else + { PaintCell(e, filterGridView, false, entry); + } if (e.ColumnIndex == 0) + { if (_bookmarkProvider.IsBookmarkAtLine(lineNum)) { - Rectangle r = new Rectangle(e.CellBounds.Left + 2, e.CellBounds.Top + 2, 6, 6); + Rectangle r = new(e.CellBounds.Left + 2, e.CellBounds.Top + 2, 6, 6); r = e.CellBounds; r.Inflate(-2, -2); Brush brush = new SolidBrush(BookmarkColor); @@ -417,17 +451,18 @@ private void OnFilterGridViewCellPainting(object sender, DataGridViewCellPaintin Bookmark bookmark = _bookmarkProvider.GetBookmarkForLine(lineNum); if (bookmark.Text.Length > 0) { - StringFormat format = new StringFormat(); + StringFormat format = new(); format.LineAlignment = StringAlignment.Center; format.Alignment = StringAlignment.Center; Brush brush2 = new SolidBrush(Color.FromArgb(255, 190, 100, 0)); - Font font = new Font("Verdana", Preferences.fontSize, FontStyle.Bold); + Font font = new("Verdana", Preferences.fontSize, FontStyle.Bold); e.Graphics.DrawString("!", font, brush2, new RectangleF(r.Left, r.Top, r.Width, r.Height), format); font.Dispose(); brush2.Dispose(); } } + } e.Paint(e.CellBounds, DataGridViewPaintParts.Border); e.Handled = true; @@ -453,7 +488,10 @@ private void OnFilterGridViewRowHeightInfoNeeded(object sender, DataGridViewRowH private void OnFilterComboBoxKeyDown(object sender, KeyEventArgs e) { - if (e.KeyCode == Keys.Enter) FilterSearch(); + if (e.KeyCode == Keys.Enter) + { + FilterSearch(); + } } private void OnFilterGridViewColumnDividerDoubleClick(object sender, @@ -492,14 +530,20 @@ private void OnDataGridViewScroll(object sender, ScrollEventArgs e) if (dataGridView.DisplayedRowCount(false) + dataGridView.FirstDisplayedScrollingRowIndex >= dataGridView.RowCount) { //this.guiStateArgs.FollowTail = true; - if (!_guiStateArgs.FollowTail) FollowTailChanged(true, false); + if (!_guiStateArgs.FollowTail) + { + FollowTailChanged(true, false); + } OnTailFollowed(EventArgs.Empty); } else { //this.guiStateArgs.FollowTail = false; - if (_guiStateArgs.FollowTail) FollowTailChanged(false, false); + if (_guiStateArgs.FollowTail) + { + FollowTailChanged(false, false); + } } SendGuiStateUpdate(); @@ -511,16 +555,16 @@ private void OnFilterGridViewKeyDown(object sender, KeyEventArgs e) switch (e.KeyCode) { case Keys.Enter: - { - if (filterGridView.CurrentCellAddress.Y >= 0 && filterGridView.CurrentCellAddress.Y < _filterResultList.Count) { - int lineNum = _filterResultList[filterGridView.CurrentCellAddress.Y]; - SelectLine(lineNum, false, true); - e.Handled = true; - } + if (filterGridView.CurrentCellAddress.Y >= 0 && filterGridView.CurrentCellAddress.Y < _filterResultList.Count) + { + int lineNum = _filterResultList[filterGridView.CurrentCellAddress.Y]; + SelectLine(lineNum, false, true); + e.Handled = true; + } - break; - } + break; + } case Keys.Tab when e.Modifiers == Keys.None: dataGridView.Focus(); e.Handled = true; @@ -533,11 +577,11 @@ private void OnDataGridViewKeyDown(object sender, KeyEventArgs e) switch (e.KeyCode) { case Keys.Tab when e.Modifiers == Keys.None: - { - filterGridView.Focus(); - e.Handled = true; - break; - } + { + filterGridView.Focus(); + e.Handled = true; + break; + } } //switch (e.KeyCode) @@ -552,17 +596,26 @@ private void OnDataGridViewKeyDown(object sender, KeyEventArgs e) private void OnDataGridViewPreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { - if (e.KeyCode == Keys.Tab && e.Control) e.IsInputKey = true; + if (e.KeyCode == Keys.Tab && e.Control) + { + e.IsInputKey = true; + } } private void OnDataGridViewCellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { - if (dataGridView.CurrentCell != null) dataGridView.BeginEdit(false); + if (dataGridView.CurrentCell != null) + { + dataGridView.BeginEdit(false); + } } private void OnSyncFilterCheckBoxCheckedChanged(object sender, EventArgs e) { - if (syncFilterCheckBox.Checked) SyncFilterGridPos(); + if (syncFilterCheckBox.Checked) + { + SyncFilterGridPos(); + } } private void OnDataGridViewLeave(object sender, EventArgs e) @@ -646,7 +699,7 @@ private void OnPipeDisconnected(object sender, EventArgs e) { _filterPipeList.Remove((FilterPipe)sender); if (_filterPipeList.Count == 0) - // reset naming counter to 0 if no more open filter tabs for this source window + // reset naming counter to 0 if no more open filter tabs for this source window { _filterPipeNameCounter = 0; } @@ -711,9 +764,15 @@ private void OnFilterSplitContainerMouseDoubleClick(object sender, MouseEventArg private void OnDataGridContextMenuStripOpening(object sender, CancelEventArgs e) { int lineNum = -1; - if (dataGridView.CurrentRow != null) lineNum = dataGridView.CurrentRow.Index; + if (dataGridView.CurrentRow != null) + { + lineNum = dataGridView.CurrentRow.Index; + } - if (lineNum == -1) return; + if (lineNum == -1) + { + return; + } int refLineNum = lineNum; @@ -730,8 +789,12 @@ private void OnDataGridContextMenuStripOpening(object sender, CancelEventArgs e) // Remove all "old" plugin entries int index = dataGridContextMenuStrip.Items.IndexOf(pluginSeparator); if (index > 0) + { for (int i = index + 1; i < dataGridContextMenuStrip.Items.Count;) + { dataGridContextMenuStrip.Items.RemoveAt(i); + } + } // Add plugin entries bool isAdded = false; @@ -741,15 +804,18 @@ private void OnDataGridContextMenuStripOpening(object sender, CancelEventArgs e) IList lines = GetSelectedContent(); foreach (IContextMenuEntry entry in PluginRegistry.GetInstance().RegisteredContextMenuPlugins) { - LogExpertCallback callback = new LogExpertCallback(this); - ContextMenuPluginEventArgs evArgs = new ContextMenuPluginEventArgs(entry, lines, CurrentColumnizer, callback); + LogExpertCallback callback = new(this); + ContextMenuPluginEventArgs evArgs = new(entry, lines, CurrentColumnizer, callback); EventHandler ev = OnHandlePluginContextMenu; //MenuItem item = this.dataGridView.ContextMenu.MenuItems.Add(entry.GetMenuText(line, this.CurrentColumnizer, callback), ev); string menuText = entry.GetMenuText(lines, CurrentColumnizer, callback); if (menuText != null) { bool disabled = menuText.StartsWith("_"); - if (disabled) menuText = menuText.Substring(1); + if (disabled) + { + menuText = menuText.Substring(1); + } ToolStripItem item = dataGridContextMenuStrip.Items.Add(menuText, null, ev); item.Tag = evArgs; @@ -772,7 +838,7 @@ private void OnDataGridContextMenuStripOpening(object sender, CancelEventArgs e) syncTimestampsToToolStripMenuItem.Enabled = true; syncTimestampsToToolStripMenuItem.DropDownItems.Clear(); EventHandler ev = OnHandleSyncContextMenu; - Font italicFont = new Font(syncTimestampsToToolStripMenuItem.Font.FontFamily, syncTimestampsToToolStripMenuItem.Font.Size, FontStyle.Italic); + Font italicFont = new(syncTimestampsToToolStripMenuItem.Font.FontFamily, syncTimestampsToToolStripMenuItem.Font.Size, FontStyle.Italic); foreach (WindowFileEntry fileEntry in list) { @@ -820,7 +886,7 @@ private void OnHandleSyncContextMenu(object sender, EventArgs args) FreeSlaveFromTimesync(entry.LogWindow); } else - //AddSlaveToTimesync(entry.LogWindow); + //AddSlaveToTimesync(entry.LogWindow); { AddOtherWindowToTimesync(entry.LogWindow); } @@ -904,10 +970,10 @@ private void OnColumnRestrictCheckBoxCheckedChanged(object sender, EventArgs e) CheckForFilterDirty(); } - private void OncolumnButtonClick(object sender, EventArgs e) + private void OnColumnButtonClick(object sender, EventArgs e) { _filterParams.currentColumnizer = _currentColumnizer; - FilterColumnChooser chooser = new FilterColumnChooser(_filterParams); + FilterColumnChooser chooser = new(_filterParams); if (chooser.ShowDialog() == DialogResult.OK) { columnNamesLabel.Text = CalculateColumnNames(_filterParams); @@ -955,7 +1021,10 @@ private void OnDataGridViewCellContextMenuStripNeeded(object sender, DataGridVie private void OnFilterGridViewCellContextMenuStripNeeded(object sender, DataGridViewCellContextMenuStripNeededEventArgs e) { - if (e.ContextMenuStrip == columnContextMenuStrip) _selectedCol = e.ColumnIndex; + if (e.ContextMenuStrip == columnContextMenuStrip) + { + _selectedCol = e.ColumnIndex; + } } private void OnColumnContextMenuStripOpening(object sender, CancelEventArgs e) @@ -963,7 +1032,10 @@ private void OnColumnContextMenuStripOpening(object sender, CancelEventArgs e) Control ctl = columnContextMenuStrip.SourceControl; DataGridView gridView = ctl as DataGridView; bool frozen = false; - if (_freezeStateMap.ContainsKey(ctl)) frozen = _freezeStateMap[ctl]; + if (_freezeStateMap.ContainsKey(ctl)) + { + frozen = _freezeStateMap[ctl]; + } freezeLeftColumnsUntilHereToolStripMenuItem.Checked = frozen; @@ -1002,7 +1074,7 @@ private void OnColumnContextMenuStripOpening(object sender, CancelEventArgs e) DataGridViewColumn colLast = gridView.Columns[gridView.Columns.Count - 1]; moveToLastColumnToolStripMenuItem.Enabled = colLast != null && colLast.Frozen == col.Frozen; - // Fill context menu with column names + // Fill context menu with column names // EventHandler ev = OnHandleColumnItemContextMenu; allColumnsToolStripMenuItem.DropDownItems.Clear(); @@ -1051,7 +1123,10 @@ private void OnMoveToLastColumnToolStripMenuItemClick(object sender, EventArgs e { DataGridView gridView = columnContextMenuStrip.SourceControl as DataGridView; DataGridViewColumn col = gridView.Columns[_selectedCol]; - if (col != null) col.DisplayIndex = gridView.Columns.Count - 1; + if (col != null) + { + col.DisplayIndex = gridView.Columns.Count - 1; + } } private void OnMoveLeftToolStripMenuItemClick(object sender, EventArgs e) @@ -1068,7 +1143,10 @@ private void OnMoveRightToolStripMenuItemClick(object sender, EventArgs e) { DataGridView gridView = columnContextMenuStrip.SourceControl as DataGridView; DataGridViewColumn col = gridView.Columns[_selectedCol]; - if (col != null && col.DisplayIndex < gridView.Columns.Count - 1) col.DisplayIndex = col.DisplayIndex + 1; + if (col != null && col.DisplayIndex < gridView.Columns.Count - 1) + { + col.DisplayIndex = col.DisplayIndex + 1; + } } private void OnHideColumnToolStripMenuItemClick(object sender, EventArgs e) @@ -1081,7 +1159,10 @@ private void OnHideColumnToolStripMenuItemClick(object sender, EventArgs e) private void OnRestoreColumnsToolStripMenuItemClick(object sender, EventArgs e) { DataGridView gridView = columnContextMenuStrip.SourceControl as DataGridView; - foreach (DataGridViewColumn col in gridView.Columns) col.Visible = true; + foreach (DataGridViewColumn col in gridView.Columns) + { + col.Visible = true; + } } private void OnTimeSpreadingControlLineSelected(object sender, SelectLineEventArgs e) @@ -1098,7 +1179,7 @@ private void OnHighlightSelectionInLogFileToolStripMenuItemClick(object sender, { if (dataGridView.EditingControl is DataGridViewTextBoxEditingControl ctl) { - HilightEntry he = new HilightEntry(ctl.SelectedText, Color.Red, Color.Yellow, false, true, false, false, false, false, null, false); + HilightEntry he = new(ctl.SelectedText, Color.Red, Color.Yellow, false, true, false, false, false, false, null, false); lock (_tempHighlightEntryListLock) { _tempHighlightEntryList.Add(he); @@ -1114,7 +1195,7 @@ private void OnHighlightSelectionInLogFilewordModeToolStripMenuItemClick(object { if (dataGridView.EditingControl is DataGridViewTextBoxEditingControl ctl) { - HilightEntry he = new HilightEntry(ctl.SelectedText, Color.Red, Color.Yellow, false, true, false, false, false, false, null, true); + HilightEntry he = new(ctl.SelectedText, Color.Red, Color.Yellow, false, true, false, false, false, false, null, true); lock (_tempHighlightEntryListLock) { _tempHighlightEntryList.Add(he); @@ -1185,7 +1266,10 @@ private void OnDataGridViewCellClick(object sender, DataGridViewCellEventArgs e) private void OnDataGridViewCellDoubleClick(object sender, DataGridViewCellEventArgs e) { - if (e.ColumnIndex == 0) ToggleBookmark(); + if (e.ColumnIndex == 0) + { + ToggleBookmark(); + } } private void OnDataGridViewOverlayDoubleClicked(object sender, OverlayEventArgs e) @@ -1197,7 +1281,7 @@ private void OnFilterRegexCheckBoxMouseUp(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { - RegexHelperDialog dlg = new RegexHelperDialog(); + RegexHelperDialog dlg = new(); dlg.Owner = this; dlg.CaseSensitive = filterCaseSensitiveCheckBox.Checked; dlg.Pattern = filterComboBox.Text; @@ -1236,7 +1320,10 @@ private void OnDeleteFilterButtonClick(object sender, EventArgs e) FilterParams filterParams = (FilterParams)filterListBox.Items[index]; ConfigManager.Settings.filterList.Remove(filterParams); OnFilterListChanged(this); - if (filterListBox.Items.Count > 0) filterListBox.SelectedIndex = filterListBox.Items.Count - 1; + if (filterListBox.Items.Count > 0) + { + filterListBox.SelectedIndex = filterListBox.Items.Count - 1; + } } } @@ -1257,6 +1344,11 @@ private void OnFilterUpButtonClick(object sender, EventArgs e) private void OnFilterDownButtonClick(object sender, EventArgs e) { int i = filterListBox.SelectedIndex; + if (i < 0) + { + return; + } + if (i < filterListBox.Items.Count - 1) { FilterParams filterParams = (FilterParams)filterListBox.Items[i]; @@ -1282,9 +1374,15 @@ private void OnFilterListBoxMouseDoubleClick(object sender, MouseEventArgs e) CheckForFilterDirty(); filterSearchButton.Image = _searchButtonImage; saveFilterButton.Enabled = false; - if (hideFilterListOnLoadCheckBox.Checked) ToggleHighlightPanel(false); + if (hideFilterListOnLoadCheckBox.Checked) + { + ToggleHighlightPanel(false); + } - if (filterOnLoadCheckBox.Checked) FilterSearch(); + if (filterOnLoadCheckBox.Checked) + { + FilterSearch(); + } } } @@ -1294,7 +1392,7 @@ private void OnFilterListBoxDrawItem(object sender, DrawItemEventArgs e) if (e.Index >= 0) { FilterParams filterParams = (FilterParams)filterListBox.Items[e.Index]; - Rectangle rectangle = new Rectangle(0, e.Bounds.Top, e.Bounds.Width, e.Bounds.Height); + Rectangle rectangle = new(0, e.Bounds.Top, e.Bounds.Width, e.Bounds.Height); Brush brush; @@ -1321,7 +1419,7 @@ private void OnColorToolStripMenuItemClick(object sender, EventArgs e) if (i < filterListBox.Items.Count && i >= 0) { FilterParams filterParams = (FilterParams)filterListBox.Items[i]; - ColorDialog dlg = new ColorDialog(); + ColorDialog dlg = new(); dlg.CustomColors = new[] { filterParams.color.ToArgb() }; dlg.Color = filterParams.color; if (dlg.ShowDialog() == DialogResult.OK) @@ -1401,11 +1499,13 @@ private void OnTimeSyncListWindowRemoved(object sender, EventArgs e) lock (_timeSyncListLock) { if (syncList.Count == 0 || syncList.Count == 1 && syncList.Contains(this)) + { if (syncList == TimeSyncList) { TimeSyncList = null; OnSyncModeChanged(); } + } } } @@ -1421,7 +1521,7 @@ private void OnSplitContainerSplitterMoved(object sender, SplitterEventArgs e) private void OnMarkFilterHitsInLogViewToolStripMenuItemClick(object sender, EventArgs e) { - SearchParams p = new SearchParams(); + SearchParams p = new(); p.searchText = _filterParams.searchText; p.isRegex = _filterParams.isRegex; p.isCaseSensitive = _filterParams.isCaseSensitive; @@ -1449,9 +1549,15 @@ private void OnColumnComboBoxKeyDown(object sender, KeyEventArgs e) private void OnColumnComboBoxPreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { - if (e.KeyCode == Keys.Down && e.Modifiers == Keys.Alt) columnComboBox.DroppedDown = true; + if (e.KeyCode == Keys.Down && e.Modifiers == Keys.Alt) + { + columnComboBox.DroppedDown = true; + } - if (e.KeyCode == Keys.Enter) e.IsInputKey = true; + if (e.KeyCode == Keys.Enter) + { + e.IsInputKey = true; + } } private void OnBookmarkProviderBookmarkRemoved(object sender, EventArgs e) @@ -1500,6 +1606,10 @@ private void OnDataGridViewRowUnshared(object sender, DataGridViewRowEventArgs e #endregion #endregion - + + private void MeasureItem(object sender, MeasureItemEventArgs e) + { + e.ItemHeight = filterListBox.Font.Height; + } } -} \ No newline at end of file +} diff --git a/src/LogExpert/Controls/LogWindow/LogWindowPrivate.cs b/src/LogExpert/Controls/LogWindow/LogWindowPrivate.cs index 4e61ac96..14c1c94b 100644 --- a/src/LogExpert/Controls/LogWindow/LogWindowPrivate.cs +++ b/src/LogExpert/Controls/LogWindow/LogWindowPrivate.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Runtime.Remoting.Messaging; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading; -using System.Windows.Forms; -using LogExpert.Classes; +using LogExpert.Classes; using LogExpert.Classes.Columnizer; using LogExpert.Classes.Filter; using LogExpert.Classes.Highlight; @@ -21,6 +10,19 @@ using LogExpert.Entities.EventArgs; using LogExpert.Interface; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Globalization; +using System.IO; +using System.Linq; +//using System.Runtime.Remoting.Messaging; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; + namespace LogExpert.Controls.LogWindow { public partial class LogWindow @@ -50,6 +52,30 @@ private void UnRegisterLogFileReaderEvents() } } + private void CreateDefaultViewStyle() + { + DataGridViewCellStyle dataGridViewCellStyleMainGrid = new(); + DataGridViewCellStyle dataGridViewCellStyleFilterGrid = new(); + + dataGridViewCellStyleMainGrid.Alignment = DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyleMainGrid.BackColor = SystemColors.Window; + dataGridViewCellStyleMainGrid.Font = new Font("Courier New", 8.25F, FontStyle.Regular, GraphicsUnit.Point, 0); + dataGridViewCellStyleMainGrid.ForeColor = SystemColors.ControlText; + dataGridViewCellStyleMainGrid.SelectionBackColor = SystemColors.Highlight; + dataGridViewCellStyleMainGrid.SelectionForeColor = SystemColors.HighlightText; + dataGridViewCellStyleMainGrid.WrapMode = DataGridViewTriState.False; + dataGridView.DefaultCellStyle = dataGridViewCellStyleMainGrid; + + dataGridViewCellStyleFilterGrid.Alignment = DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyleFilterGrid.BackColor = SystemColors.Window; + dataGridViewCellStyleFilterGrid.Font = new Font("Courier New", 8.25F, FontStyle.Regular, GraphicsUnit.Point, 0); + dataGridViewCellStyleFilterGrid.ForeColor = SystemColors.ControlText; + dataGridViewCellStyleFilterGrid.SelectionBackColor = SystemColors.Highlight; + dataGridViewCellStyleFilterGrid.SelectionForeColor = SystemColors.HighlightText; + dataGridViewCellStyleFilterGrid.WrapMode = DataGridViewTriState.False; + filterGridView.DefaultCellStyle = dataGridViewCellStyleFilterGrid; + } + private bool LoadPersistenceOptions() { if (InvokeRequired) @@ -85,7 +111,7 @@ private bool LoadPersistenceOptions() _multiFileOptions = new MultiFileOptions(); _multiFileOptions.FormatPattern = persistenceData.multiFilePattern; _multiFileOptions.MaxDayTry = persistenceData.multiFileMaxDays; - + if (string.IsNullOrEmpty(_multiFileOptions.FormatPattern)) { _multiFileOptions = ObjectClone.Clone(Preferences.multiFileOptions); @@ -262,11 +288,11 @@ private void RestoreFilterTabs(PersistenceData persistenceData) { FilterParams persistFilterParams = data.filterParams; ReInitFilterParams(persistFilterParams); - List filterResultList = new List(); + List filterResultList = []; //List lastFilterResultList = new List(); - List filterHitList = new List(); + List filterHitList = []; Filter(persistFilterParams, filterResultList, _lastFilterLinesList, filterHitList); - FilterPipe pipe = new FilterPipe(persistFilterParams.CreateCopy(), this); + FilterPipe pipe = new(persistFilterParams.CreateCopy(), this); WritePipeToTab(pipe, filterResultList, data.persistenceData.tabName, data.persistenceData); } } @@ -468,7 +494,7 @@ private void ReloadNewFile() SavePersistenceData(false); _loadingFinishedEvent.Reset(); _externaLoadingFinishedEvent.Reset(); - Thread reloadFinishedThread = new Thread(ReloadFinishedThreadFx); + Thread reloadFinishedThread = new(ReloadFinishedThreadFx); reloadFinishedThread.IsBackground = true; reloadFinishedThread.Start(); LoadFile(FileName, EncodingOptions); @@ -617,7 +643,7 @@ private void LogEventWorker() } UpdateGridCallback callback = UpdateGrid; - Invoke(callback, new object[] { e }); + Invoke(callback, [e]); CheckFilterAndHighlight(e); _timeSpreadCalc.SetLineCount(e.LineCount); } @@ -627,8 +653,9 @@ private void LogEventWorker() private void StopLogEventWorkerThread() { _logEventArgsEvent.Set(); - _logEventHandlerThread.Abort(); - _logEventHandlerThread.Join(); + cts.Cancel(); + //_logEventHandlerThread.Abort(); + //_logEventHandlerThread.Join(); } private void OnFileSizeChanged(LogEventArgs e) @@ -698,7 +725,7 @@ private void UpdateGrid(LogEventArgs e) } _statusEventArgs.LineCount = e.LineCount; - statusLineFileSize(e.FileSize); + StatusLineFileSize(e.FileSize); if (!_isLoading) { @@ -748,7 +775,7 @@ private void CheckFilterAndHighlight(LogEventArgs e) } bool firstStopTail = true; - ColumnizerCallback callback = new ColumnizerCallback(this); + ColumnizerCallback callback = new(this); bool filterLineAdded = false; for (int i = filterStart; i < e.LineCount; ++i) { @@ -790,7 +817,7 @@ private void CheckFilterAndHighlight(LogEventArgs e) FollowTailChanged(false, true); if (firstStopTail && wasFollow) { - Invoke(new SelectLineFx(SelectAndEnsureVisible), new object[] { i, false }); + Invoke(new SelectLineFx(SelectAndEnsureVisible), [i, false]); firstStopTail = false; } } @@ -839,7 +866,7 @@ private void CheckFilterAndHighlight(LogEventArgs e) FollowTailChanged(false, true); if (firstStopTail && wasFollow) { - Invoke(new SelectLineFx(SelectAndEnsureVisible), new object[] { i, false }); + Invoke(new SelectLineFx(SelectAndEnsureVisible), [i, false]); firstStopTail = false; } } @@ -860,7 +887,7 @@ private void CheckFilterAndHighlight(LogEventArgs e) private void LaunchHighlightPlugins(IList matchingList, int lineNum) { - LogExpertCallback callback = new LogExpertCallback(this); + LogExpertCallback callback = new(this); callback.LineNum = lineNum; foreach (HilightEntry entry in matchingList) { @@ -949,7 +976,7 @@ private void SetColumnizerInternal(ILogLineColumnizer columnizer) Type oldColType = _filterParams.currentColumnizer?.GetType(); Type newColType = columnizer?.GetType(); - + if (oldColType != newColType && _filterParams.columnRestrict && _filterParams.isFilterTail) { _filterParams.columnList.Clear(); @@ -1103,7 +1130,7 @@ private void PaintHighlightedCell(DataGridViewCellPaintingEventArgs e, DataGridV matchList.RemoveAt(50); } - HilightMatchEntry hme = new HilightMatchEntry(); + HilightMatchEntry hme = new(); hme.StartPos = 0; hme.Length = column.DisplayValue.Length; hme.HilightEntry = new HilightEntry(column.DisplayValue, @@ -1119,7 +1146,7 @@ private void PaintHighlightedCell(DataGridViewCellPaintingEventArgs e, DataGridV matchList = MergeHighlightMatchEntries(matchList, hme); int leftPad = e.CellStyle.Padding.Left; - RectangleF rect = new RectangleF(e.CellBounds.Left + leftPad, e.CellBounds.Top, e.CellBounds.Width, + RectangleF rect = new(e.CellBounds.Left + leftPad, e.CellBounds.Top, e.CellBounds.Width, e.CellBounds.Height); Rectangle borderWidths = PaintHelper.BorderWidths(e.AdvancedBorderStyle); Rectangle valBounds = e.CellBounds; @@ -1150,7 +1177,7 @@ private void PaintHighlightedCell(DataGridViewCellPaintingEventArgs e, DataGridV //TextRenderer.DrawText(e.Graphics, e.Value as String, e.CellStyle.Font, valBounds, Color.FromKnownColor(KnownColor.Black), flags); Point wordPos = valBounds.Location; - Size proposedSize = new Size(valBounds.Width, valBounds.Height); + Size proposedSize = new(valBounds.Width, valBounds.Height); Rectangle r = gridView.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, true); e.Graphics.SetClip(e.CellBounds); @@ -1164,7 +1191,7 @@ private void PaintHighlightedCell(DataGridViewCellPaintingEventArgs e, DataGridV string matchWord = column.DisplayValue.Substring(matchEntry.StartPos, matchEntry.Length); Size wordSize = TextRenderer.MeasureText(e.Graphics, matchWord, font, proposedSize, flags); wordSize.Height = e.CellBounds.Height; - Rectangle wordRect = new Rectangle(wordPos, wordSize); + Rectangle wordRect = new(wordPos, wordSize); Color foreColor = matchEntry.HilightEntry.ForegroundColor; if ((e.State & DataGridViewElementStates.Selected) != DataGridViewElementStates.Selected) @@ -1175,7 +1202,8 @@ private void PaintHighlightedCell(DataGridViewCellPaintingEventArgs e, DataGridV } } - if (foreColor == System.Drawing.Color.Black) { + if (foreColor == System.Drawing.Color.Black) + { foreColor = LogExpert.Config.ColorMode.ForeColor; } @@ -1235,7 +1263,7 @@ private IList MergeHighlightMatchEntries(IList MergeHighlightMatchEntries(IList hilig MatchCollection matches = entry.Regex.Matches(line.Text); foreach (Match match in matches) { - HilightMatchEntry me = new HilightMatchEntry(); + HilightMatchEntry me = new(); me.HilightEntry = entry; me.StartPos = match.Index; me.Length = match.Length; @@ -1344,7 +1372,7 @@ private void GetHighlightEntryMatches(ITextValue line, IList hilig { if (CheckHighlightEntryMatch(entry, line)) { - HilightMatchEntry me = new HilightMatchEntry(); + HilightMatchEntry me = new(); me.HilightEntry = entry; me.StartPos = 0; me.Length = line.Text.Length; @@ -1382,7 +1410,7 @@ private void GetHilightActions(IList matchingList, out bool noLed, } } - bookmarkComment.TrimEnd(new char[] { '\r', '\n' }); + bookmarkComment = bookmarkComment.TrimEnd(['\r', '\n']); } private void StopTimespreadThread() @@ -1393,9 +1421,10 @@ private void StopTimespreadThread() private void StopTimestampSyncThread() { _shouldTimestampDisplaySyncingCancel = true; - _timeShiftSyncWakeupEvent.Set(); - _timeShiftSyncThread.Abort(); - _timeShiftSyncThread.Join(); + //_timeShiftSyncWakeupEvent.Set(); + //_timeShiftSyncThread.Abort(); + //_timeShiftSyncThread.Join(); + cts.Cancel(); } private void SyncTimestampDisplay() @@ -1470,9 +1499,7 @@ private void SyncTimestampDisplayWorker() int row2 = dataGridView.SelectedRows[1].Index; if (row1 > row2) { - int tmp = row1; - row1 = row2; - row2 = tmp; + (row2, row1) = (row1, row2); } int refLine = row1; @@ -1534,7 +1561,7 @@ private void SyncFilterGridPos() } } - private void statusLineFileSize(long size) + private void StatusLineFileSize(long size) { _statusEventArgs.FileSize = size; SendStatusLineUpdate(); @@ -1595,7 +1622,7 @@ private int Search(SearchParams searchParams) if (searchParams.isRegex) { - Regex rex = new Regex(searchParams.searchText, + Regex rex = new(searchParams.searchText, searchParams.isCaseSensitive ? RegexOptions.None : RegexOptions.IgnoreCase); if (rex.IsMatch(line.FullLine)) { @@ -1606,7 +1633,7 @@ private int Search(SearchParams searchParams) { if (!searchParams.isCaseSensitive) { - if (line.FullLine.ToLower().Contains(lowerSearchText)) + if (line.FullLine.Contains(lowerSearchText, StringComparison.CurrentCultureIgnoreCase)) { return lineNum; } @@ -1640,7 +1667,7 @@ private int Search(SearchParams searchParams) { if (!Disposing) { - Invoke(progressFx, new object[] { count }); + Invoke(progressFx, [count]); } } catch (ObjectDisposedException ex) // can occur when closing the app while searching @@ -1651,34 +1678,6 @@ private int Search(SearchParams searchParams) } } - private void SearchComplete(IAsyncResult result) - { - if (Disposing) - { - return; - } - - try - { - Invoke(new MethodInvoker(ResetProgressBar)); - AsyncResult ar = (AsyncResult)result; - SearchFx fx = (SearchFx)ar.AsyncDelegate; - int line = fx.EndInvoke(result); - _guiStateArgs.MenuEnabled = true; - GuiStateUpdate(this, _guiStateArgs); - if (line == -1) - { - return; - } - - dataGridView.Invoke(new SelectLineFx((line1, triggerSyncCall) => SelectLine(line1, triggerSyncCall, true)), line, true); - } - catch (Exception ex) // in the case the windows is already destroyed - { - _logger.Warn(ex); - } - } - private void ResetProgressBar() { _progressEventArgs.Value = _progressEventArgs.MaxValue; @@ -1846,7 +1845,7 @@ private void ShiftBookmarks(int offset) private void ShiftRowHeightList(int offset) { - SortedList newList = new SortedList(); + SortedList newList = []; foreach (RowHeightEntry entry in _rowHeightList.Values) { int line = entry.LineNum - offset; @@ -1948,7 +1947,7 @@ private void FilterSearch() FilterSearch(filterComboBox.Text); } - private void FilterSearch(string text) + private async void FilterSearch(string text) { FireCancelHandlers(); // make sure that there's no other filter running (maybe from filter restore) @@ -2029,17 +2028,25 @@ private void FilterSearch(string text) SendProgressBarUpdate(); Settings settings = ConfigManager.Settings; - FilterFx fx; - fx = settings.preferences.multiThreadFilter ? MultiThreadedFilter : new FilterFx(Filter); - fx.BeginInvoke(_filterParams, _filterResultList, _lastFilterLinesList, _filterHitList, FilterComplete, null); + + //FilterFx fx = settings.preferences.multiThreadFilter ? MultiThreadedFilter : new FilterFx(Filter); + FilterFxAction = settings.preferences.multiThreadFilter ? MultiThreadedFilter : Filter; + + //Task.Run(() => fx.Invoke(_filterParams, _filterResultList, _lastFilterLinesList, _filterHitList)); + Task filterFxActionTask = Task.Run(() => Filter(_filterParams, _filterResultList, _lastFilterLinesList, _filterHitList)); + + await filterFxActionTask; + FilterComplete(); + + //fx.BeginInvoke(_filterParams, _filterResultList, _lastFilterLinesList, _filterHitList, FilterComplete, null); CheckForFilterDirty(); } private void MultiThreadedFilter(FilterParams filterParams, List filterResultLines, List lastFilterLinesList, List filterHitList) { - ColumnizerCallback callback = new ColumnizerCallback(this); - FilterStarter fs = new FilterStarter(callback, Environment.ProcessorCount + 2); + ColumnizerCallback callback = new(this); + FilterStarter fs = new(callback, Environment.ProcessorCount + 2); fs.FilterHitList = _filterHitList; fs.FilterResultLines = _filterResultList; fs.LastFilterLinesList = _lastFilterLinesList; @@ -2071,7 +2078,7 @@ private void Filter(FilterParams filterParams, List filterResultLines, List filterParams.Reset(); int lineNum = 0; //AddFilterLineFx addFx = new AddFilterLineFx(AddFilterLine); - ColumnizerCallback callback = new ColumnizerCallback(this); + ColumnizerCallback callback = new(this); while (true) { ILogLine line = _logFileReader.GetLogLine(lineNum); @@ -2303,6 +2310,14 @@ private void UpdateProgressBar(int value) SendProgressBarUpdate(); } + private void FilterComplete() + { + if (!IsDisposed && !_waitingForClose && !Disposing) + { + Invoke(new MethodInvoker(ResetStatusAfterFilter)); + } + } + private void FilterComplete(IAsyncResult result) { if (!IsDisposed && !_waitingForClose && !Disposing) @@ -2350,9 +2365,9 @@ private void ClearFilterList() filterGridView.SuspendLayout(); filterGridView.RowCount = 0; lblFilterCount.Text = "0"; - _filterResultList = new List(); - _lastFilterLinesList = new List(); - _filterHitList = new List(); + _filterResultList = []; + _lastFilterLinesList = []; + _filterHitList = []; //this.filterGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.DisplayedCells); filterGridView.ResumeLayout(); } @@ -2376,7 +2391,7 @@ private void ClearBookmarkList() private void ShiftFilterLines(int offset) { - List newFilterList = new List(); + List newFilterList = []; lock (_filterResultList) { foreach (int lineNum in _filterResultList) @@ -2391,7 +2406,7 @@ private void ShiftFilterLines(int offset) _filterResultList = newFilterList; } - newFilterList = new List(); + newFilterList = []; foreach (int lineNum in _filterHitList) { int line = lineNum - offset; @@ -2619,7 +2634,7 @@ private void ShowAdvancedFilterPanel(bool show) } advancedFilterSplitContainer.Panel1Collapsed = !show; - advancedFilterSplitContainer.SplitterDistance = 54; + advancedFilterSplitContainer.SplitterDistance = FILTER_ADVANCED_SPLITTER_DISTANCE; _showAdvanced = show; } @@ -2644,7 +2659,7 @@ private void FilterToTab() private void WriteFilterToTab() { - FilterPipe pipe = new FilterPipe(_filterParams.CreateCopy(), this); + FilterPipe pipe = new(_filterParams.CreateCopy(), this); lock (_filterResultList) { string namePrefix = "->F"; @@ -2684,7 +2699,7 @@ private void WritePipeToTab(FilterPipe pipe, IList lineNumberList, string n pipe.Closed += OnPipeDisconnected; int count = 0; pipe.OpenFile(); - LogExpertCallback callback = new LogExpertCallback(this); + LogExpertCallback callback = new(this); foreach (int i in lineNumberList) { if (_shouldCancel) @@ -2748,9 +2763,10 @@ private void WriteFilterToTabFinished(FilterPipe pipe, string name, PersistenceD /// Used to create a new tab and pipe the given content into it. /// /// + /// internal void WritePipeTab(IList lineEntryList, string title) { - FilterPipe pipe = new FilterPipe(new FilterParams(), this); + FilterPipe pipe = new(new FilterParams(), this); pipe.IsStopped = true; pipe.Closed += OnPipeDisconnected; pipe.OpenFile(); @@ -2760,7 +2776,7 @@ internal void WritePipeTab(IList lineEntryList, string title) } pipe.CloseFile(); - Invoke(new WriteFilterToTabFinishedFx(WriteFilterToTabFinished), new object[] { pipe, title, null }); + Invoke(new WriteFilterToTabFinishedFx(WriteFilterToTabFinished), [pipe, title, null]); } private void FilterRestore(LogWindow newWin, PersistenceData persistenceData) @@ -2771,14 +2787,14 @@ private void FilterRestore(LogWindow newWin, PersistenceData persistenceData) if (columnizer != null) { SetColumnizerFx fx = newWin.ForceColumnizer; - newWin.Invoke(fx, new object[] { columnizer }); + newWin.Invoke(fx, [columnizer]); } else { _logger.Warn("FilterRestore(): Columnizer {0} not found", persistenceData.columnizerName); } - newWin.BeginInvoke(new RestoreFiltersFx(newWin.RestoreFilters), new object[] { persistenceData }); + newWin.BeginInvoke(new RestoreFiltersFx(newWin.RestoreFilters), [persistenceData]); } private void ProcessFilterPipes(int lineNum) @@ -2789,7 +2805,7 @@ private void ProcessFilterPipes(int lineNum) return; } - ColumnizerCallback callback = new ColumnizerCallback(this); + ColumnizerCallback callback = new(this); callback.LineNum = lineNum; IList deleteList = new List(); lock (_filterPipeList) @@ -2846,7 +2862,7 @@ private void CopyMarkedLinesToClipboard() } else { - List lineNumList = new List(); + List lineNumList = []; foreach (DataGridViewRow row in dataGridView.SelectedRows) { if (row.Index != -1) @@ -2856,8 +2872,8 @@ private void CopyMarkedLinesToClipboard() } lineNumList.Sort(); - StringBuilder clipText = new StringBuilder(); - LogExpertCallback callback = new LogExpertCallback(this); + StringBuilder clipText = new(); + LogExpertCallback callback = new(this); var xmlColumnizer = _currentColumnizer as ILogLineXmlColumnizer; @@ -2917,7 +2933,7 @@ private IList GetSelectedContent() { if (dataGridView.SelectionMode == DataGridViewSelectionMode.FullRowSelect) { - List lineNumList = new List(); + List lineNumList = []; foreach (DataGridViewRow row in dataGridView.SelectedRows) { if (row.Index != -1) @@ -2933,9 +2949,9 @@ private IList GetSelectedContent() return new List(); } - /* ======================================================================== - * Timestamp stuff - * =======================================================================*/ + /* ======================================================================== + * Timestamp stuff + * =======================================================================*/ private void SetTimestampLimits() { @@ -2962,7 +2978,7 @@ private void AdjustHighlightSplitterWidth() private void BookmarkComment(Bookmark bookmark) { - BookmarkCommentDlg dlg = new BookmarkCommentDlg(); + BookmarkCommentDlg dlg = new(); dlg.Comment = bookmark.Text; if (dlg.ShowDialog() == DialogResult.OK) { @@ -3003,7 +3019,7 @@ private string CalculateColumnNames(FilterParams filter) private void ApplyFrozenState(DataGridView gridView) { - SortedDictionary dict = new SortedDictionary(); + SortedDictionary dict = []; foreach (DataGridViewColumn col in gridView.Columns) { dict.Add(col.DisplayIndex, col); @@ -3071,8 +3087,8 @@ private void TestStatistic(PatternArgs patternArgs) PrepareDict(); ResetCache(num); - Dictionary processedLinesDict = new Dictionary(); - List blockList = new List(); + Dictionary processedLinesDict = []; + List blockList = []; int blockId = 0; _isSearching = true; _shouldCancel = false; @@ -3186,7 +3202,7 @@ private PatternBlock DetectBlock(int startNum, int startLineToSearch, int maxBlo return null; } - PatternBlock block = new PatternBlock(); + PatternBlock block = new(); block.startLine = startNum; int srcLine = block.startLine; block.targetStart = targetLine; @@ -3194,7 +3210,7 @@ private PatternBlock DetectBlock(int startNum, int startLineToSearch, int maxBlo block.srcLines.Add(srcLine, srcLine); //block.targetLines.Add(targetLine, targetLine); int len = 0; - QualityInfo qi = new QualityInfo(); + QualityInfo qi = new(); qi.quality = block.weigth; block.qualityInfoList[targetLine] = qi; @@ -3262,8 +3278,8 @@ private PatternBlock DetectBlock(int startNum, int startLineToSearch, int maxBlo private void PrepareDict() { _lineHashList.Clear(); - Regex regex = new Regex("\\d"); - Regex regex2 = new Regex("\\S"); + Regex regex = new("\\d"); + Regex regex2 = new("\\S"); int num = _logFileReader.LineCount; for (int i = 0; i < num; ++i) @@ -3402,7 +3418,7 @@ private string GetMsgForLine(int i) { ILogLine line = _logFileReader.GetLogLine(i); ILogLineColumnizer columnizer = CurrentColumnizer; - ColumnizerCallback callback = new ColumnizerCallback(this); + ColumnizerCallback callback = new(this); IColumnizedLogLine cols = columnizer.SplitLine(callback, line); return cols.ColumnValues.Last().FullValue; } @@ -3511,9 +3527,9 @@ private void AddBookmarkComment(string text) private void MarkCurrentFilterRange() { _filterParams.rangeSearchText = filterRangeComboBox.Text; - ColumnizerCallback callback = new ColumnizerCallback(this); - RangeFinder rangeFinder = new RangeFinder(_filterParams, callback); - Range range = rangeFinder.FindRange(dataGridView.CurrentCellAddress.Y); + ColumnizerCallback callback = new(this); + RangeFinder rangeFinder = new(_filterParams, callback); + Entities.Range range = rangeFinder.FindRange(dataGridView.CurrentCellAddress.Y); if (range != null) { SetCellSelectionMode(false); @@ -3541,7 +3557,9 @@ private void RemoveTempHighlights() private void ToggleHighlightPanel(bool open) { highlightSplitContainer.Panel2Collapsed = !open; - btnToggleHighlightPanel.Image = open ? _panelCloseButtonImage : _panelOpenButtonImage; + btnToggleHighlightPanel.Image = open + ? new Bitmap(_panelCloseButtonImage, new Size(btnToggleHighlightPanel.Size.Height, btnToggleHighlightPanel.Size.Height)) + : new Bitmap(_panelOpenButtonImage, new Size(btnToggleHighlightPanel.Size.Height, btnToggleHighlightPanel.Size.Height)); } private void SetBookmarksForSelectedFilterLines() @@ -3643,7 +3661,7 @@ private void OnSyncModeChanged() private void AddSearchHitHighlightEntry(SearchParams para) { - HilightEntry he = new HilightEntry(para.searchText, + HilightEntry he = new(para.searchText, Color.Red, Color.Yellow, para.isRegex, para.isCaseSensitive, @@ -3666,7 +3684,7 @@ private void RemoveAllSearchHighlightEntries() { lock (_tempHighlightEntryListLock) { - List newList = new List(); + List newList = []; foreach (HilightEntry he in _tempHighlightEntryList) { if (!he.IsSearchHit) @@ -3710,6 +3728,6 @@ private void SelectColumn() } #endregion - + } } \ No newline at end of file diff --git a/src/LogExpert/Controls/LogWindow/LogWindowsPublic.cs b/src/LogExpert/Controls/LogWindow/LogWindowsPublic.cs index b996e9cf..73804a4a 100644 --- a/src/LogExpert/Controls/LogWindow/LogWindowsPublic.cs +++ b/src/LogExpert/Controls/LogWindow/LogWindowsPublic.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.IO; -using System.Text; -using System.Windows.Forms; -using LogExpert.Classes; +using LogExpert.Classes; using LogExpert.Classes.Bookmark; using LogExpert.Classes.Columnizer; using LogExpert.Classes.Filter; @@ -14,6 +8,14 @@ using LogExpert.Config; using LogExpert.Entities; using LogExpert.Entities.EventArgs; + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; //using System.Linq; namespace LogExpert.Controls.LogWindow @@ -43,7 +45,7 @@ public void LoadFile(string fileName, EncodingOptions encodingOptions) // this flag will enable find a columnizer automatically. // Current solution is not elegant. // Since the refactory will involving a lot of work, we can plan it in the future. - // One possible solution is, using raw file stream to read the sample lines to help + // One possible solution is, using raw file stream to read the sample lines to help // the ColumnizerPicker to determine the priority. // bool isUsingDefaultColumnizer = false; @@ -76,7 +78,7 @@ public void LoadFile(string fileName, EncodingOptions encodingOptions) } _columnCache = new ColumnCache(); - + try { _logFileReader = new LogfileReader(fileName, EncodingOptions, IsMultiFile, Preferences.bufferCount, Preferences.linesPerBuffer, _multiFileOptions); @@ -86,7 +88,7 @@ public void LoadFile(string fileName, EncodingOptions encodingOptions) { _logger.Error(lfe); MessageBox.Show("Cannot load file\n" + lfe.Message, "LogExpert"); - BeginInvoke(new FunctionWith1BoolParam(Close), true); + _ = BeginInvoke(new FunctionWith1BoolParam(Close), true); _isLoadError = true; return; } @@ -110,11 +112,11 @@ public void LoadFile(string fileName, EncodingOptions encodingOptions) { _logFileReader.PreProcessColumnizer = null; } - + RegisterLogFileReaderEvents(); _logger.Info($"Loading logfile: {fileName}"); - _logFileReader.startMonitoring(); - + _logFileReader.StartMonitoring(); + if (isUsingDefaultColumnizer) { if (Preferences.autoPick) @@ -145,18 +147,18 @@ public void LoadFilesAsMulti(string[] fileNames, EncodingOptions encodingOptions if (_logFileReader != null) { - _logFileReader.stopMonitoring(); + _logFileReader.StopMonitoring(); UnRegisterLogFileReaderEvents(); } EncodingOptions = encodingOptions; _columnCache = new ColumnCache(); - + _logFileReader = new LogfileReader(fileNames, EncodingOptions, Preferences.bufferCount, Preferences.linesPerBuffer, _multiFileOptions); _logFileReader.UseNewReader = !Preferences.useLegacyReader; RegisterLogFileReaderEvents(); - _logFileReader.startMonitoring(); - FileName = fileNames[fileNames.Length - 1]; + _logFileReader.StartMonitoring(); + FileName = fileNames[^1]; _fileNames = fileNames; IsMultiFile = true; //if (this.isTempFile) @@ -205,7 +207,7 @@ public string SavePersistenceData(bool force) public PersistenceData GetPersistenceData() { - PersistenceData persistenceData = new PersistenceData(); + PersistenceData persistenceData = new(); persistenceData.bookmarkList = _bookmarkProvider.BookmarkList; persistenceData.rowHeightList = _rowHeightList; persistenceData.multiFile = IsMultiFile; @@ -223,16 +225,15 @@ public PersistenceData GetPersistenceData() persistenceData.columnizerName = CurrentColumnizer.GetName(); persistenceData.lineCount = _logFileReader.LineCount; _filterParams.isFilterTail = filterTailCheckBox.Checked; // this option doesnt need a press on 'search' - + if (Preferences.saveFilters) { - List filterList = new List(); - filterList.Add(_filterParams); + List filterList = [_filterParams]; persistenceData.filterParamsList = filterList; foreach (FilterPipe filterPipe in _filterPipeList) { - FilterTabData data = new FilterTabData(); + FilterTabData data = new(); data.persistenceData = filterPipe.OwnLogWindow.GetPersistenceData(); data.filterParams = filterPipe.FilterParams; persistenceData.filterTabDataList.Add(data); @@ -252,7 +253,7 @@ public PersistenceData GetPersistenceData() //persistenceData.showBookmarkCommentColumn = this.bookmarkWindow.ShowBookmarkCommentColumn; persistenceData.filterSaveListVisible = !highlightSplitContainer.Panel2Collapsed; persistenceData.encoding = _logFileReader.CurrentEncoding; - + return persistenceData; } @@ -331,7 +332,7 @@ public void ColumnizerConfigChanged() public void SetColumnizer(ILogLineColumnizer columnizer, DataGridView gridView) { - PaintHelper.SetColumnizer(columnizer,gridView); + PaintHelper.SetColumnizer(columnizer, gridView); gridView.Refresh(); AutoResizeColumns(gridView); @@ -371,7 +372,7 @@ public IColumn GetCellValue(int rowIndex, int columnIndex) if (columnIndex == 2) { - return cols.ColumnValues[cols.ColumnValues.Length - 1]; + return cols.ColumnValues[^1]; } return Column.EmptyColumn; @@ -393,19 +394,19 @@ public void CellPainting(DataGridView gridView, int rowIndex, DataGridViewCellPa return; } - ILogLine line = _logFileReader.GetLogLineWithWait(rowIndex); + ILogLine line = _logFileReader.GetLogLineWithWait(rowIndex).Result; if (line != null) { HilightEntry entry = FindFirstNoWordMatchHilightEntry(line); e.Graphics.SetClip(e.CellBounds); - + if ((e.State & DataGridViewElementStates.Selected) == DataGridViewElementStates.Selected) { - Color backColor = LogExpert.Config.ColorMode.BackgroundColor; + Color backColor = ColorMode.BackgroundColor; Brush brush; - + if (gridView.Focused) { brush = new SolidBrush(e.CellStyle.SelectionBackColor); @@ -421,7 +422,7 @@ public void CellPainting(DataGridView gridView, int rowIndex, DataGridViewCellPa } else { - Color bgColor = LogExpert.Config.ColorMode.DockBackgroundColor; + Color bgColor = ColorMode.DockBackgroundColor; if (!DebugOptions.disableWordHighlight) { @@ -438,8 +439,8 @@ public void CellPainting(DataGridView gridView, int rowIndex, DataGridViewCellPa } } - e.CellStyle.BackColor = bgColor; - + e.CellStyle.BackColor = bgColor; + e.PaintBackground(e.ClipBounds, false); } @@ -463,14 +464,14 @@ public void CellPainting(DataGridView gridView, int rowIndex, DataGridViewCellPa e.Graphics.FillRectangle(brush, r); brush.Dispose(); Bookmark bookmark = _bookmarkProvider.GetBookmarkForLine(rowIndex); - + if (bookmark.Text.Length > 0) { - StringFormat format = new StringFormat(); + StringFormat format = new(); format.LineAlignment = StringAlignment.Center; format.Alignment = StringAlignment.Center; Brush brush2 = new SolidBrush(Color.FromArgb(255, 190, 100, 0)); - Font font = new Font("Courier New", Preferences.fontSize, FontStyle.Bold); + Font font = new("Courier New", Preferences.fontSize, FontStyle.Bold); e.Graphics.DrawString("i", font, brush2, new RectangleF(r.Left, r.Top, r.Width, r.Height), format); font.Dispose(); @@ -484,9 +485,9 @@ public void CellPainting(DataGridView gridView, int rowIndex, DataGridViewCellPa } } - public void dataGridView_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) + public void OnDataGridView_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) { - DataGridView gridView = (DataGridView) sender; + DataGridView gridView = (DataGridView)sender; CellPainting(gridView, e.RowIndex, e); } @@ -608,13 +609,38 @@ public void StartSearch() _progressEventArgs.Visible = true; SendProgressBarUpdate(); - SearchFx searchFx = Search; - searchFx.BeginInvoke(searchParams, SearchComplete, null); + Task.Run(() => Search(searchParams)).ContinueWith(SearchComplete); RemoveAllSearchHighlightEntries(); AddSearchHitHighlightEntry(searchParams); } + private void SearchComplete(Task task) + { + if (Disposing) + { + return; + } + + try + { + Invoke(new MethodInvoker(ResetProgressBar)); + int line = task.Result; + _guiStateArgs.MenuEnabled = true; + GuiStateUpdate(this, _guiStateArgs); + if (line == -1) + { + return; + } + + dataGridView.Invoke(new SelectLineFx((line1, triggerSyncCall) => SelectLine(line1, triggerSyncCall, true)), line, true); + } + catch (Exception ex) // in the case the windows is already destroyed + { + _logger.Warn(ex); + } + } + public void SelectLogLine(int line) { Invoke(new SelectLineFx((line1, triggerSyncCall) => SelectLine(line1, triggerSyncCall, true)), line, true); @@ -660,92 +686,92 @@ public void OnLogWindowKeyDown(object sender, KeyEventArgs e) switch (e.KeyCode) { case Keys.F3 when _parentLogTabWin.SearchParams?.searchText == null || _parentLogTabWin.SearchParams.searchText.Length == 0: - { - return; - } + { + return; + } case Keys.F3: - { - _parentLogTabWin.SearchParams.isFindNext = true; - _parentLogTabWin.SearchParams.isShiftF3Pressed = (e.Modifiers & Keys.Shift) == Keys.Shift; - StartSearch(); - break; - } - case Keys.Escape: - { - if (_isSearching) { - _shouldCancel = true; + _parentLogTabWin.SearchParams.isFindNext = true; + _parentLogTabWin.SearchParams.isShiftF3Pressed = (e.Modifiers & Keys.Shift) == Keys.Shift; + StartSearch(); + break; } + case Keys.Escape: + { + if (_isSearching) + { + _shouldCancel = true; + } - FireCancelHandlers(); - RemoveAllSearchHighlightEntries(); - break; - } + FireCancelHandlers(); + RemoveAllSearchHighlightEntries(); + break; + } case Keys.E when (e.Modifiers & Keys.Control) == Keys.Control: - { - StartEditMode(); - - break; - } + { + StartEditMode(); + + break; + } case Keys.Down when e.Modifiers == Keys.Alt: - { - int newLine = _logFileReader.GetNextMultiFileLine(dataGridView.CurrentCellAddress.Y); - - if (newLine != -1) { - SelectLine(newLine, false, true); + int newLine = _logFileReader.GetNextMultiFileLine(dataGridView.CurrentCellAddress.Y); + + if (newLine != -1) + { + SelectLine(newLine, false, true); + } + + e.Handled = true; + + break; } - - e.Handled = true; - - break; - } case Keys.Up when e.Modifiers == Keys.Alt: - { - int newLine = _logFileReader.GetPrevMultiFileLine(dataGridView.CurrentCellAddress.Y); - - if (newLine != -1) { - SelectLine(newLine - 1, false, true); + int newLine = _logFileReader.GetPrevMultiFileLine(dataGridView.CurrentCellAddress.Y); + + if (newLine != -1) + { + SelectLine(newLine - 1, false, true); + } + + e.Handled = true; + + break; } - - e.Handled = true; - - break; - } case Keys.Enter when dataGridView.Focused: - { - ChangeRowHeight(e.Shift); - e.Handled = true; - - break; - } + { + ChangeRowHeight(e.Shift); + e.Handled = true; + + break; + } case Keys.Back when dataGridView.Focused: - { - ChangeRowHeight(true); - e.Handled = true; - - break; - } + { + ChangeRowHeight(true); + e.Handled = true; + + break; + } case Keys.PageUp when e.Modifiers == Keys.Alt: - { - SelectPrevHighlightLine(); - e.Handled = true; - - break; - } + { + SelectPrevHighlightLine(); + e.Handled = true; + + break; + } case Keys.PageDown when e.Modifiers == Keys.Alt: - { - SelectNextHighlightLine(); - e.Handled = true; - - break; - } + { + SelectNextHighlightLine(); + e.Handled = true; + + break; + } case Keys.T when (e.Modifiers & Keys.Control) == Keys.Control && (e.Modifiers & Keys.Shift) == Keys.Shift: - { - FilterToTab(); - break; - } + { + FilterToTab(); + break; + } } } @@ -1050,7 +1076,7 @@ public void SetTimeshiftValue(string value) text = text.Substring(1); } TimeSpan timeSpan = TimeSpan.Parse(text); - int diff = (int) (timeSpan.Ticks / TimeSpan.TicksPerMillisecond); + int diff = (int)(timeSpan.Ticks / TimeSpan.TicksPerMillisecond); CurrentColumnizer.SetTimeOffset(diff); } catch (Exception) @@ -1268,7 +1294,7 @@ public void PreferencesChanged(Preferences newPreferences, bool isLoadTime, Sett { UpdateFilterHistoryFromSettings(); - if(isLoadTime) + if (isLoadTime) { AutoResizeFilterBox(); } @@ -1756,7 +1782,7 @@ public void AddToTimeSync(LogWindow master) lock (_timeSyncListLock) { if (IsTimeSynced && master.TimeSyncList != TimeSyncList) - // already synced but master has different sync list + // already synced but master has different sync list { FreeFromTimeSync(); } @@ -1788,7 +1814,5 @@ public void RefreshLogView() } #endregion - - } -} \ No newline at end of file +} diff --git a/src/LogExpert/Controls/PatternWindow.Designer.cs b/src/LogExpert/Controls/PatternWindow.Designer.cs index c295e7dd..7b211e99 100644 --- a/src/LogExpert/Controls/PatternWindow.Designer.cs +++ b/src/LogExpert/Controls/PatternWindow.Designer.cs @@ -372,8 +372,6 @@ private void InitializeComponent() // // PatternWindow // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(798, 165); this.Controls.Add(this.rangeLabel); this.Controls.Add(this.label3); diff --git a/src/LogExpert/Controls/PatternWindow.cs b/src/LogExpert/Controls/PatternWindow.cs index ff2a7212..52151bcd 100644 --- a/src/LogExpert/Controls/PatternWindow.cs +++ b/src/LogExpert/Controls/PatternWindow.cs @@ -11,12 +11,12 @@ public partial class PatternWindow : Form { #region Fields - private readonly List> blockList = new List>(); + private readonly List> blockList = []; private PatternBlock currentBlock; private List currentList; private readonly LogWindow.LogWindow logWindow; - private PatternArgs patternArgs = new PatternArgs(); + private PatternArgs patternArgs = new(); #endregion @@ -70,7 +70,7 @@ public void SetBlockList(List flatBlockList, PatternArgs patternAr { this.patternArgs = patternArgs; blockList.Clear(); - List singeList = new List(); + List singeList = []; //int blockId = -1; for (int i = 0; i < flatBlockList.Count; ++i) { @@ -105,7 +105,7 @@ public void SetColumnizer(ILogLineColumnizer columnizer) this.patternHitsDataGridView.Columns[0].Width = 20; this.contentDataGridView.Columns[0].Width = 20; - DataGridViewTextBoxColumn blockInfoColumn = new DataGridViewTextBoxColumn(); + DataGridViewTextBoxColumn blockInfoColumn = new(); blockInfoColumn.HeaderText = "Weight"; blockInfoColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.NotSet; blockInfoColumn.Resizable = DataGridViewTriState.False; @@ -113,7 +113,7 @@ public void SetColumnizer(ILogLineColumnizer columnizer) blockInfoColumn.ReadOnly = true; blockInfoColumn.Width = 50; - DataGridViewTextBoxColumn contentInfoColumn = new DataGridViewTextBoxColumn(); + DataGridViewTextBoxColumn contentInfoColumn = new(); contentInfoColumn.HeaderText = "Diff"; contentInfoColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.NotSet; contentInfoColumn.Resizable = DataGridViewTriState.False; @@ -127,7 +127,7 @@ public void SetColumnizer(ILogLineColumnizer columnizer) public void SetFont(string fontName, float fontSize) { - Font font = new Font(new FontFamily(fontName), fontSize); + Font font = new(new FontFamily(fontName), fontSize); int lineSpacing = font.FontFamily.GetLineSpacing(FontStyle.Regular); float lineSpacingPixel = font.Size * lineSpacing / font.FontFamily.GetEmHeight(FontStyle.Regular); @@ -219,7 +219,7 @@ private void patternHitsDataGridView_CellPainting(object sender, DataGridViewCel if (maxWeight > 0) { int width = (int) ((double) (int) e.Value / (double) maxWeight * (double) e.CellBounds.Width); - Rectangle rect = new Rectangle(e.CellBounds.X, e.CellBounds.Y, width, e.CellBounds.Height); + Rectangle rect = new(e.CellBounds.X, e.CellBounds.Y, width, e.CellBounds.Height); int alpha = 90 + (int) ((double) (int) e.Value / (double) maxWeight * (double) 165); Color color = Color.FromArgb(alpha, 170, 180, 150); Brush brush = new SolidBrush(color); diff --git a/src/LogExpert/Dialogs/AboutBox.Designer.cs b/src/LogExpert/Dialogs/AboutBox.Designer.cs index b81b8dc6..7b4365e2 100644 --- a/src/LogExpert/Dialogs/AboutBox.Designer.cs +++ b/src/LogExpert/Dialogs/AboutBox.Designer.cs @@ -1,6 +1,6 @@ namespace LogExpert.Dialogs { - partial class AboutBox + partial class AboutBox { /// /// Required designer variable. @@ -142,7 +142,7 @@ private void InitializeComponent() this.linkLabelURL.TabStop = true; this.linkLabelURL.Text = "https://github.com/zarunbal/LogExpert/"; this.linkLabelURL.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.linkLabelURL.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); + this.linkLabelURL.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.OnLinkLabelURLClicked); // // panel1 // @@ -169,7 +169,6 @@ private void InitializeComponent() // AboutBox // this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(942, 677); this.Controls.Add(this.tableLayoutPanel); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; diff --git a/src/LogExpert/Dialogs/AboutBox.cs b/src/LogExpert/Dialogs/AboutBox.cs index 92fe09ca..93ac90df 100644 --- a/src/LogExpert/Dialogs/AboutBox.cs +++ b/src/LogExpert/Dialogs/AboutBox.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.IO; using System.Reflection; using System.Windows.Forms; @@ -17,6 +17,7 @@ internal partial class AboutBox : Form public AboutBox() { InitializeComponent(); + _assembly = Assembly.GetExecutingAssembly(); Text = $@"About {AssemblyTitle}"; @@ -47,13 +48,13 @@ public string AssemblyTitle object[] attributes = _assembly.GetCustomAttributes(typeof(AssemblyTitleAttribute), false); if (attributes.Length > 0) { - AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute) attributes[0]; + AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0]; if (titleAttribute.Title != "") { return titleAttribute.Title; } } - return System.IO.Path.GetFileNameWithoutExtension(_assembly.CodeBase); + return Path.GetFileNameWithoutExtension(_assembly.Location); } } @@ -81,7 +82,7 @@ public string AssemblyDescription { return string.Empty; } - return ((AssemblyDescriptionAttribute) attributes[0]).Description; + return ((AssemblyDescriptionAttribute)attributes[0]).Description; } } @@ -94,7 +95,7 @@ public string AssemblyProduct { return string.Empty; } - return ((AssemblyProductAttribute) attributes[0]).Product; + return ((AssemblyProductAttribute)attributes[0]).Product; } } @@ -107,7 +108,7 @@ public string AssemblyCopyright { return string.Empty; } - return ((AssemblyCopyrightAttribute) attributes[0]).Copyright; + return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; } } @@ -115,7 +116,7 @@ public string AssemblyCopyright #region Events handler - private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + private void OnLinkLabelURLClicked(object sender, LinkLabelLinkClickedEventArgs e) { string target = e.Link.LinkData as string; System.Diagnostics.Process.Start(target); diff --git a/src/LogExpert/Dialogs/AllowOnlyOneInstanceErrorDialog.Designer.cs b/src/LogExpert/Dialogs/AllowOnlyOneInstanceErrorDialog.Designer.cs index d03d6dfa..e9f7f27f 100644 --- a/src/LogExpert/Dialogs/AllowOnlyOneInstanceErrorDialog.Designer.cs +++ b/src/LogExpert/Dialogs/AllowOnlyOneInstanceErrorDialog.Designer.cs @@ -76,8 +76,6 @@ private void InitializeComponent() // // AllowOnlyOneInstanceErrorDialog // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(293, 84); this.Controls.Add(this.labelErrorText); this.Controls.Add(this.buttonOk); diff --git a/src/LogExpert/Dialogs/BookmarkCommentDlg.Designer.cs b/src/LogExpert/Dialogs/BookmarkCommentDlg.Designer.cs index 11440a7b..fbb61e1f 100644 --- a/src/LogExpert/Dialogs/BookmarkCommentDlg.Designer.cs +++ b/src/LogExpert/Dialogs/BookmarkCommentDlg.Designer.cs @@ -66,8 +66,6 @@ private void InitializeComponent() // BookmarkCommentDlg // this.AcceptButton = this.okButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.cancelButton; this.ClientSize = new System.Drawing.Size(324, 115); this.Controls.Add(this.commentTextBox); diff --git a/src/LogExpert/Dialogs/BookmarkCommentDlg.cs b/src/LogExpert/Dialogs/BookmarkCommentDlg.cs index cec8fadb..bc533cfb 100644 --- a/src/LogExpert/Dialogs/BookmarkCommentDlg.cs +++ b/src/LogExpert/Dialogs/BookmarkCommentDlg.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; +using System.Drawing; using System.Windows.Forms; namespace LogExpert.Dialogs @@ -14,6 +9,9 @@ public partial class BookmarkCommentDlg : Form public BookmarkCommentDlg() { + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; + InitializeComponent(); } @@ -23,8 +21,8 @@ public BookmarkCommentDlg() public string Comment { - set { this.commentTextBox.Text = value; } - get { return this.commentTextBox.Text; } + set => commentTextBox.Text = value; + get => commentTextBox.Text; } #endregion diff --git a/src/LogExpert/Dialogs/BookmarkWindow.Designer.cs b/src/LogExpert/Dialogs/BookmarkWindow.Designer.cs index b0d50855..e0931cdd 100644 --- a/src/LogExpert/Dialogs/BookmarkWindow.Designer.cs +++ b/src/LogExpert/Dialogs/BookmarkWindow.Designer.cs @@ -154,8 +154,6 @@ private void InitializeComponent() { // // BookmarkWindow // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(717, 158); this.ControlBox = false; this.Controls.Add(this.splitContainer1); diff --git a/src/LogExpert/Dialogs/BookmarkWindow.cs b/src/LogExpert/Dialogs/BookmarkWindow.cs index 993383d6..7f92cee5 100644 --- a/src/LogExpert/Dialogs/BookmarkWindow.cs +++ b/src/LogExpert/Dialogs/BookmarkWindow.cs @@ -17,7 +17,7 @@ public partial class BookmarkWindow : DockContent, ISharedToolWindow, IBookmarkV #region Fields private static readonly ILogger _logger = LogManager.GetCurrentClassLogger(); - private readonly object paintLock = new object(); + private readonly object paintLock = new(); private IBookmarkData bookmarkData; private ILogPaintContext logPaintContext; @@ -30,6 +30,9 @@ public partial class BookmarkWindow : DockContent, ISharedToolWindow, IBookmarkV public BookmarkWindow() { InitializeComponent(); + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; + bookmarkDataGridView.CellValueNeeded += boomarkDataGridView_CellValueNeeded; bookmarkDataGridView.CellPainting += boomarkDataGridView_CellPainting; @@ -115,7 +118,7 @@ public void SetColumnizer(ILogLineColumnizer columnizer) bookmarkDataGridView.Columns[0].Width = 20; } - DataGridViewTextBoxColumn commentColumn = new DataGridViewTextBoxColumn(); + DataGridViewTextBoxColumn commentColumn = new(); commentColumn.HeaderText = "Bookmark Comment"; commentColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.None; commentColumn.Resizable = DataGridViewTriState.NotSet; @@ -247,7 +250,7 @@ protected override void OnPaint(PaintEventArgs e) Rectangle r = ClientRectangle; e.Graphics.FillRectangle(SystemBrushes.FromSystemColor(LogExpert.Config.ColorMode.BookmarksDefaultBackgroundColor), r); RectangleF rect = r; - StringFormat sf = new StringFormat(); + StringFormat sf = new(); sf.Alignment = StringAlignment.Center; sf.LineAlignment = StringAlignment.Center; e.Graphics.DrawString("No bookmarks in current file", SystemFonts.DialogFont, SystemBrushes.WindowText, r, sf); @@ -264,7 +267,7 @@ protected override void OnPaint(PaintEventArgs e) private void SetFont(string fontName, float fontSize) { - Font font = new Font(new FontFamily(fontName), fontSize); + Font font = new(new FontFamily(fontName), fontSize); bookmarkDataGridView.DefaultCellStyle.Font = font; bookmarkDataGridView.RowTemplate.Height = font.Height + 4; bookmarkDataGridView.Refresh(); @@ -304,7 +307,7 @@ private void CommentPainting(DataGridView gridView, int rowIndex, DataGridViewCe private void DeleteSelectedBookmarks() { - List lineNumList = new List(); + List lineNumList = []; foreach (DataGridViewRow row in bookmarkDataGridView.SelectedRows) { if (row.Index != -1) @@ -598,7 +601,7 @@ private void removeCommentsToolStripMenuItem_Click(object sender, EventArgs e) MessageBoxButtons.YesNo) == DialogResult.Yes) { - List lineNumList = new List(); + List lineNumList = []; foreach (DataGridViewRow row in bookmarkDataGridView.SelectedRows) { if (row.Index != -1) diff --git a/src/LogExpert/Dialogs/BufferedDataGridView.cs b/src/LogExpert/Dialogs/BufferedDataGridView.cs index 63dafa61..749c2c75 100644 --- a/src/LogExpert/Dialogs/BufferedDataGridView.cs +++ b/src/LogExpert/Dialogs/BufferedDataGridView.cs @@ -19,9 +19,9 @@ public partial class BufferedDataGridView : DataGridView private readonly Brush _brush; private readonly Color _bubbleColor = Color.FromArgb(160, 250, 250, 00); - private readonly Font _font = new Font("Arial", 10); + private readonly Font _font = new("Arial", 10); - private readonly SortedList _overlayList = new SortedList(); + private readonly SortedList _overlayList = []; private readonly Pen _pen; private readonly Brush _textBrush = new SolidBrush(Color.FromArgb(200, 0, 0, 90)); @@ -42,7 +42,7 @@ public BufferedDataGridView() InitializeComponent(); DoubleBuffered = true; - VirtualMode = true; + VirtualMode = true; } #endregion @@ -94,7 +94,7 @@ protected override void OnPaint(PaintEventArgs e) { if (PaintWithOverlays) { - PaintOverlays(e); + PaintOverlays(e); } else { @@ -104,7 +104,7 @@ protected override void OnPaint(PaintEventArgs e) catch (Exception ex) { _logger.Error(ex); - } + } } protected override void OnEditingControlShowing(DataGridViewEditingControlShowingEventArgs e) @@ -166,7 +166,7 @@ protected override void OnMouseMove(MouseEventArgs e) if (_isDrag) { Cursor = Cursors.Hand; - Size offset = new Size(e.X - _dragStartPoint.X, e.Y - _dragStartPoint.Y); + Size offset = new(e.X - _dragStartPoint.X, e.Y - _dragStartPoint.Y); _draggedOverlay.Bookmark.OverlayOffset = _oldOverlayOffset + offset; Refresh(); } @@ -227,18 +227,18 @@ private void PaintOverlays(PaintEventArgs e) myBuffer.Graphics.SetClip(ClientRectangle, CombineMode.Union); e.Graphics.SetClip(ClientRectangle, CombineMode.Union); - PaintEventArgs args = new PaintEventArgs(myBuffer.Graphics, e.ClipRectangle); + PaintEventArgs args = new(myBuffer.Graphics, e.ClipRectangle); base.OnPaint(args); - StringFormat format = new StringFormat(); + StringFormat format = new(); format.LineAlignment = StringAlignment.Center; format.Alignment = StringAlignment.Near; myBuffer.Graphics.SetClip(DisplayRectangle, CombineMode.Intersect); // Remove Columnheader from Clippingarea - Rectangle rectTableHeader = new Rectangle(DisplayRectangle.X, DisplayRectangle.Y, DisplayRectangle.Width, ColumnHeadersHeight); + Rectangle rectTableHeader = new(DisplayRectangle.X, DisplayRectangle.Y, DisplayRectangle.Width, ColumnHeadersHeight); myBuffer.Graphics.SetClip(rectTableHeader, CombineMode.Exclude); //e.Graphics.SetClip(rect, CombineMode.Union); @@ -248,7 +248,7 @@ private void PaintOverlays(PaintEventArgs e) foreach (BookmarkOverlay overlay in _overlayList.Values) { SizeF textSize = myBuffer.Graphics.MeasureString(overlay.Bookmark.Text, _font, 300); - Rectangle rectBubble = new Rectangle(overlay.Position, + Rectangle rectBubble = new(overlay.Position, new Size((int) textSize.Width, (int) textSize.Height)); rectBubble.Offset(60, -(rectBubble.Height + 40)); rectBubble.Inflate(3, 3); @@ -257,7 +257,7 @@ private void PaintOverlays(PaintEventArgs e) myBuffer.Graphics.SetClip(rectBubble, CombineMode.Union); // Bubble to clip myBuffer.Graphics.SetClip(rectTableHeader, CombineMode.Exclude); e.Graphics.SetClip(rectBubble, CombineMode.Union); - RectangleF textRect = new RectangleF(rectBubble.X, rectBubble.Y, rectBubble.Width, rectBubble.Height); + RectangleF textRect = new(rectBubble.X, rectBubble.Y, rectBubble.Width, rectBubble.Height); myBuffer.Graphics.FillRectangle(_brush, rectBubble); //myBuffer.Graphics.DrawLine(_pen, overlay.Position, new Point(rect.X, rect.Y + rect.Height / 2)); myBuffer.Graphics.DrawLine(_pen, overlay.Position, new Point(rectBubble.X, rectBubble.Y + rectBubble.Height)); @@ -340,4 +340,4 @@ protected virtual void OnOverlayDoubleClicked(OverlayEventArgs e) OverlayDoubleClicked?.Invoke(this, e); } } -} \ No newline at end of file +} diff --git a/src/LogExpert/Dialogs/ChooseIconDlg.Designer.cs b/src/LogExpert/Dialogs/ChooseIconDlg.Designer.cs index 635e9ad7..00cf7708 100644 --- a/src/LogExpert/Dialogs/ChooseIconDlg.Designer.cs +++ b/src/LogExpert/Dialogs/ChooseIconDlg.Designer.cs @@ -28,84 +28,89 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ChooseIconDlg)); - this.iconListView = new System.Windows.Forms.ListView(); - this.iconFileLabel = new System.Windows.Forms.Label(); - this.button1 = new System.Windows.Forms.Button(); - this.okButton = new System.Windows.Forms.Button(); - this.cancelButton = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // iconListView - // - this.iconListView.Alignment = System.Windows.Forms.ListViewAlignment.Left; - this.iconListView.AutoArrange = false; - this.iconListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; - this.iconListView.Location = new System.Drawing.Point(12, 41); - this.iconListView.MultiSelect = false; - this.iconListView.Name = "iconListView"; - this.iconListView.ShowGroups = false; - this.iconListView.Size = new System.Drawing.Size(354, 78); - this.iconListView.TabIndex = 0; - this.iconListView.UseCompatibleStateImageBehavior = false; - // - // iconFileLabel - // - this.iconFileLabel.Location = new System.Drawing.Point(12, 17); - this.iconFileLabel.Name = "iconFileLabel"; - this.iconFileLabel.Size = new System.Drawing.Size(274, 23); - this.iconFileLabel.TabIndex = 1; - this.iconFileLabel.Text = "label1"; - // - // button1 - // - this.button1.Location = new System.Drawing.Point(292, 12); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(75, 23); - this.button1.TabIndex = 2; - this.button1.Text = "Icon file..."; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // okButton - // - this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.okButton.Location = new System.Drawing.Point(211, 147); - this.okButton.Name = "okButton"; - this.okButton.Size = new System.Drawing.Size(75, 23); - this.okButton.TabIndex = 3; - this.okButton.Text = "OK"; - this.okButton.UseVisualStyleBackColor = true; - this.okButton.Click += new System.EventHandler(this.okButton_Click); - // - // cancelButton - // - this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.cancelButton.Location = new System.Drawing.Point(293, 147); - this.cancelButton.Name = "cancelButton"; - this.cancelButton.Size = new System.Drawing.Size(75, 23); - this.cancelButton.TabIndex = 4; - this.cancelButton.Text = "Cancel"; - this.cancelButton.UseVisualStyleBackColor = true; - // - // ChooseIconDlg - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(379, 181); - this.Controls.Add(this.cancelButton); - this.Controls.Add(this.okButton); - this.Controls.Add(this.button1); - this.Controls.Add(this.iconFileLabel); - this.Controls.Add(this.iconListView); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "ChooseIconDlg"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Choose Icon"; - this.Load += new System.EventHandler(this.ChooseIconDlg_Load); - this.ResumeLayout(false); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ChooseIconDlg)); + this.iconListView = new System.Windows.Forms.ListView(); + this.iconFileLabel = new System.Windows.Forms.Label(); + this.buttonChooseIconFile = new System.Windows.Forms.Button(); + this.okButton = new System.Windows.Forms.Button(); + this.cancelButton = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // iconListView + // + this.iconListView.Alignment = System.Windows.Forms.ListViewAlignment.Left; + this.iconListView.AutoArrange = false; + this.iconListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; + this.iconListView.HideSelection = false; + this.iconListView.Location = new System.Drawing.Point(18, 63); + this.iconListView.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.iconListView.MultiSelect = false; + this.iconListView.Name = "iconListView"; + this.iconListView.ShowGroups = false; + this.iconListView.Size = new System.Drawing.Size(529, 118); + this.iconListView.TabIndex = 0; + this.iconListView.UseCompatibleStateImageBehavior = false; + // + // iconFileLabel + // + this.iconFileLabel.Location = new System.Drawing.Point(18, 26); + this.iconFileLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.iconFileLabel.Name = "iconFileLabel"; + this.iconFileLabel.Size = new System.Drawing.Size(411, 35); + this.iconFileLabel.TabIndex = 1; + this.iconFileLabel.Text = "label1"; + // + // buttonChooseIconFile + // + this.buttonChooseIconFile.Location = new System.Drawing.Point(438, 18); + this.buttonChooseIconFile.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.buttonChooseIconFile.Name = "buttonChooseIconFile"; + this.buttonChooseIconFile.Size = new System.Drawing.Size(112, 35); + this.buttonChooseIconFile.TabIndex = 2; + this.buttonChooseIconFile.Text = "Icon file..."; + this.buttonChooseIconFile.UseVisualStyleBackColor = true; + this.buttonChooseIconFile.Click += new System.EventHandler(this.OnButtonChooseIconFileClick); + // + // okButton + // + this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; + this.okButton.Location = new System.Drawing.Point(316, 226); + this.okButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.okButton.Name = "okButton"; + this.okButton.Size = new System.Drawing.Size(112, 35); + this.okButton.TabIndex = 3; + this.okButton.Text = "OK"; + this.okButton.UseVisualStyleBackColor = true; + this.okButton.Click += new System.EventHandler(this.OnOkButtonClick); + // + // cancelButton + // + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.Location = new System.Drawing.Point(440, 226); + this.cancelButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(112, 35); + this.cancelButton.TabIndex = 4; + this.cancelButton.Text = "Cancel"; + this.cancelButton.UseVisualStyleBackColor = true; + // + // ChooseIconDlg + // + this.ClientSize = new System.Drawing.Size(568, 278); + this.Controls.Add(this.cancelButton); + this.Controls.Add(this.okButton); + this.Controls.Add(this.buttonChooseIconFile); + this.Controls.Add(this.iconFileLabel); + this.Controls.Add(this.iconListView); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ChooseIconDlg"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Choose Icon"; + this.Load += new System.EventHandler(this.ChooseIconDlg_Load); + this.ResumeLayout(false); } @@ -113,7 +118,7 @@ private void InitializeComponent() private System.Windows.Forms.ListView iconListView; private System.Windows.Forms.Label iconFileLabel; - private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button buttonChooseIconFile; private System.Windows.Forms.Button okButton; private System.Windows.Forms.Button cancelButton; } diff --git a/src/LogExpert/Dialogs/ChooseIconDlg.cs b/src/LogExpert/Dialogs/ChooseIconDlg.cs index 4681528a..69a8c606 100644 --- a/src/LogExpert/Dialogs/ChooseIconDlg.cs +++ b/src/LogExpert/Dialogs/ChooseIconDlg.cs @@ -1,9 +1,5 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; using System.Drawing; -using System.Text; using System.Windows.Forms; using System.IO; using LogExpert.Classes; @@ -21,7 +17,11 @@ public partial class ChooseIconDlg : Form public ChooseIconDlg(string fileName) { InitializeComponent(); - this.FileName = fileName; + + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; + + FileName = fileName; } #endregion @@ -38,32 +38,35 @@ public ChooseIconDlg(string fileName) private void FillIconList() { - this.iconListView.Items.Clear(); - Icon[,] icons = Win32.ExtractIcons(this.FileName); + iconListView.Items.Clear(); + + Icon[,] icons = Win32.ExtractIcons(FileName); + if (icons == null) { return; } - ImageList imageList = new ImageList(); + ImageList imageList = new(); + if (icons.GetLength(0) > 0) { imageList.ImageSize = icons[1, 0].Size; - this.iconListView.LargeImageList = imageList; + iconListView.LargeImageList = imageList; for (int i = 0; i < icons.GetLength(1); ++i) { imageList.Images.Add(icons[1, i]); - ListViewItem item = new ListViewItem(); + ListViewItem item = new(); item.ImageIndex = i; - this.iconListView.Items.Add(item); + iconListView.Items.Add(item); } } } private void DisposeIcons() { - ImageList imageList = this.iconListView.LargeImageList; - this.iconListView.LargeImageList = null; + ImageList imageList = iconListView.LargeImageList; + iconListView.LargeImageList = null; foreach (Image image in imageList.Images) { image.Dispose(); @@ -77,32 +80,34 @@ private void DisposeIcons() private void ChooseIconDlg_Load(object sender, EventArgs e) { FillIconList(); - this.iconFileLabel.Text = this.FileName; + iconFileLabel.Text = FileName; } - private void button1_Click(object sender, EventArgs e) + private void OnButtonChooseIconFileClick(object sender, EventArgs e) { - OpenFileDialog dlg = new OpenFileDialog(); + OpenFileDialog dlg = new(); dlg.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); - if (iconFileLabel.Text != null && iconFileLabel.Text.Length > 0) + + if (string.IsNullOrEmpty(iconFileLabel.Text) == false) { - FileInfo info = new FileInfo(iconFileLabel.Text); - if (info.Directory.Exists) + FileInfo info = new(iconFileLabel.Text); + if (info.Directory != null && info.Directory.Exists) { dlg.InitialDirectory = info.DirectoryName; } } + if (dlg.ShowDialog() == DialogResult.OK) { iconFileLabel.Text = dlg.FileName; - this.FileName = dlg.FileName; + FileName = dlg.FileName; FillIconList(); } } - private void okButton_Click(object sender, EventArgs e) + private void OnOkButtonClick(object sender, EventArgs e) { - this.IconIndex = this.iconListView.SelectedIndices.Count > 0 ? this.iconListView.SelectedIndices[0] : -1; + IconIndex = iconListView.SelectedIndices.Count > 0 ? iconListView.SelectedIndices[0] : -1; ; DisposeIcons(); } diff --git a/src/LogExpert/Dialogs/ChooseIconDlg.resx b/src/LogExpert/Dialogs/ChooseIconDlg.resx index 20cf2a6f..2de0ae4d 100644 --- a/src/LogExpert/Dialogs/ChooseIconDlg.resx +++ b/src/LogExpert/Dialogs/ChooseIconDlg.resx @@ -112,12 +112,12 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + AAABAAEAEBAQAAAABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAABAA diff --git a/src/LogExpert/Dialogs/ColorComboBox.cs b/src/LogExpert/Dialogs/ColorComboBox.cs index b5f5be5f..434529b1 100644 --- a/src/LogExpert/Dialogs/ColorComboBox.cs +++ b/src/LogExpert/Dialogs/ColorComboBox.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -//using System.Linq; -using System.Text; -using System.Windows.Forms; +using System.Windows.Forms; using System.Drawing; using System.Drawing.Drawing2D; @@ -12,7 +8,7 @@ public class ColorComboBox : ComboBox { #region Fields - private System.Drawing.Color customColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.Black); + private Color _customColor = Color.FromKnownColor(KnownColor.Black); #endregion @@ -20,29 +16,29 @@ public class ColorComboBox : ComboBox public ColorComboBox() { - this.DrawMode = DrawMode.OwnerDrawFixed; - this.DrawItem += new DrawItemEventHandler(ColorComboBox_DrawItem); + DrawMode = DrawMode.OwnerDrawFixed; + DrawItem += OnColorComboBoxDrawItem; // add color presets - if (!this.DesignMode) + if (!DesignMode) { - this.Items.Add(this.customColor); - this.Items.Add(System.Drawing.Color.Black); - this.Items.Add(System.Drawing.Color.White); - this.Items.Add(System.Drawing.Color.Gray); - this.Items.Add(System.Drawing.Color.DarkGray); - this.Items.Add(System.Drawing.Color.Blue); - this.Items.Add(System.Drawing.Color.LightBlue); - this.Items.Add(System.Drawing.Color.DarkBlue); - this.Items.Add(System.Drawing.Color.Green); - this.Items.Add(System.Drawing.Color.LightGreen); - this.Items.Add(System.Drawing.Color.DarkGreen); - this.Items.Add(System.Drawing.Color.Olive); - this.Items.Add(System.Drawing.Color.Red); - this.Items.Add(System.Drawing.Color.Pink); - this.Items.Add(System.Drawing.Color.Purple); - this.Items.Add(System.Drawing.Color.IndianRed); - this.Items.Add(System.Drawing.Color.DarkCyan); - this.Items.Add(System.Drawing.Color.Yellow); + Items.Add(_customColor); + Items.Add(Color.Black); + Items.Add(Color.White); + Items.Add(Color.Gray); + Items.Add(Color.DarkGray); + Items.Add(Color.Blue); + Items.Add(Color.LightBlue); + Items.Add(Color.DarkBlue); + Items.Add(Color.Green); + Items.Add(Color.LightGreen); + Items.Add(Color.DarkGreen); + Items.Add(Color.Olive); + Items.Add(Color.Red); + Items.Add(Color.Pink); + Items.Add(Color.Purple); + Items.Add(Color.IndianRed); + Items.Add(Color.DarkCyan); + Items.Add(Color.Yellow); } } @@ -52,47 +48,45 @@ public ColorComboBox() public Color CustomColor { - get { return this.customColor; } + get => _customColor; set { - this.customColor = value; - this.Items.RemoveAt(0); - this.Items.Insert(0, this.customColor); + _customColor = value; + Items.RemoveAt(0); + Items.Insert(0, _customColor); } } - public Color SelectedColor - { - get { return (Color) (this.SelectedIndex != -1 ? this.Items[this.SelectedIndex] : null); } - } + public Color SelectedColor => (Color) (SelectedIndex != -1 ? Items[SelectedIndex] : null); #endregion #region Events handler - private void ColorComboBox_DrawItem(object sender, DrawItemEventArgs e) + private void OnColorComboBoxDrawItem(object sender, DrawItemEventArgs e) { e.DrawBackground(); if (e.Index >= 0) { - Rectangle rectangle = new Rectangle(4, e.Bounds.Top + 2, 30, e.Bounds.Height - 4); + Rectangle rectangle = new(4, e.Bounds.Top + 2, 30, e.Bounds.Height - 4); Color rectColor = (Color) Items[e.Index]; e.Graphics.FillRectangle(new SolidBrush(rectColor), rectangle); - e.Graphics.DrawRectangle(System.Drawing.Pens.Black, rectangle); + e.Graphics.DrawRectangle(Pens.Black, rectangle); + if (e.Index == 0) { - e.Graphics.DrawString("Custom", e.Font, System.Drawing.Brushes.Black, + e.Graphics.DrawString("Custom", e.Font, Brushes.Black, new PointF(42, e.Bounds.Top + 2)); } else { - e.Graphics.DrawString(((Color) Items[e.Index]).Name, e.Font, System.Drawing.Brushes.Black, + e.Graphics.DrawString(((Color) Items[e.Index]).Name, e.Font, Brushes.Black, new PointF(42, e.Bounds.Top + 2)); } + if (!Enabled) { - HatchBrush brush = new HatchBrush(HatchStyle.Percent50, Color.LightGray, - Color.FromArgb(10, Color.LightGray)); + HatchBrush brush = new(HatchStyle.Percent50, Color.LightGray, Color.FromArgb(10, Color.LightGray)); rectangle.Inflate(1, 1); e.Graphics.FillRectangle(brush, rectangle); brush.Dispose(); diff --git a/src/LogExpert/Dialogs/DateTimeDragControl.Designer.cs b/src/LogExpert/Dialogs/DateTimeDragControl.Designer.cs index e88fb93c..9a769909 100644 --- a/src/LogExpert/Dialogs/DateTimeDragControl.Designer.cs +++ b/src/LogExpert/Dialogs/DateTimeDragControl.Designer.cs @@ -32,8 +32,6 @@ private void InitializeComponent() // // DateTimeDragControl // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "DateTimeDragControl"; this.Size = new System.Drawing.Size(142, 57); diff --git a/src/LogExpert/Dialogs/DateTimeDragControl.cs b/src/LogExpert/Dialogs/DateTimeDragControl.cs index 659990b6..b424e4a2 100644 --- a/src/LogExpert/Dialogs/DateTimeDragControl.cs +++ b/src/LogExpert/Dialogs/DateTimeDragControl.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; +using System.Data; using System.Drawing; using System.Globalization; using System.Linq; @@ -21,25 +22,26 @@ public partial class DateTimeDragControl : UserControl #region Fields private const int NO_DIGIT_DRAGGED = -1; - private int addedValue = 0; + private int _addedValue; - private DateTime dateTime = new DateTime(); - private readonly IList digitRects = new List(); - private readonly StringFormat digitsFormat = new StringFormat(); - private int _draggedDigit = NO_DIGIT_DRAGGED; + + private DateTime _dateTime; + private readonly IList _digitRects = new List(); + private readonly StringFormat _digitsFormat = new(); + private int _draggedDigit; public DragOrientations dragOrientation = DragOrientations.Vertical; - private readonly ToolStripItem item1 = new ToolStripMenuItem(); - private readonly ToolStripItem item2 = new ToolStripMenuItem(); - private readonly ToolStripItem item3 = new ToolStripMenuItem(); + private readonly ToolStripItem toolStripItemHorizontalDrag = new ToolStripMenuItem(); + private readonly ToolStripItem toolStripItemVerticalDrag = new ToolStripMenuItem(); + private readonly ToolStripItem toolStripItemVerticalInvertedDrag = new ToolStripMenuItem(); - private int oldValue = 0; + private int _oldValue; private string[] _dateParts; - private int startMouseX = 0; - private int startMouseY = 0; + private int _startMouseX; + private int _startMouseY; #endregion @@ -52,10 +54,13 @@ public DateTimeDragControl() { InitializeComponent(); - digitsFormat.LineAlignment = StringAlignment.Center; - digitsFormat.Alignment = StringAlignment.Near; - digitsFormat.Trimming = StringTrimming.None; - digitsFormat.FormatFlags = StringFormatFlags.FitBlackBox | StringFormatFlags.NoClip | StringFormatFlags.NoWrap; + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; + + _digitsFormat.LineAlignment = StringAlignment.Center; + _digitsFormat.Alignment = StringAlignment.Near; + _digitsFormat.Trimming = StringTrimming.None; + _digitsFormat.FormatFlags = StringFormatFlags.FitBlackBox | StringFormatFlags.NoClip | StringFormatFlags.NoWrap; _draggedDigit = NO_DIGIT_DRAGGED; } @@ -85,7 +90,7 @@ public DateTimeDragControl() public DragOrientations DragOrientation { - get { return dragOrientation; } + get => dragOrientation; set { dragOrientation = value; @@ -97,17 +102,18 @@ public DragOrientations DragOrientation public DateTime DateTime { - get { return dateTime.Subtract(TimeSpan.FromMilliseconds(dateTime.Millisecond)); } + get => _dateTime.Subtract(TimeSpan.FromMilliseconds(_dateTime.Millisecond)); set { - dateTime = value; - if (dateTime < MinDateTime) + _dateTime = value; + + if (_dateTime < MinDateTime) { - dateTime = MinDateTime; + _dateTime = MinDateTime; } - if (dateTime > MaxDateTime) + if (_dateTime > MaxDateTime) { - dateTime = MaxDateTime; + _dateTime = MaxDateTime; } } } @@ -119,9 +125,9 @@ public DateTime DateTime // Returns the index of the rectangle (digitRects) under the mouse cursor private int DetermineDraggedDigit(MouseEventArgs e) { - for (int i = 0; i < digitRects.Count; ++i) + for (int i = 0; i < _digitRects.Count; ++i) { - if (digitRects[i].Contains(e.Location) && Token.IsDatePart(_dateParts[i])) + if (_digitRects[i].Contains(e.Location) && Token.IsDatePart(_dateParts[i])) { return i; } @@ -133,36 +139,34 @@ private int DetermineDraggedDigit(MouseEventArgs e) // Return the value corresponding to current dragged digit private int GetDraggedValue() { - var datePart = _dateParts[_draggedDigit]; + string datePart = _dateParts[_draggedDigit]; if (datePart.StartsWith("y", StringComparison.OrdinalIgnoreCase)) { - return dateTime.Year; - } - else if (datePart.StartsWith("M")) - { - return dateTime.Month; + return _dateTime.Year; } - else if (datePart.StartsWith("d", StringComparison.OrdinalIgnoreCase)) - { - return dateTime.Day; - } - else if (datePart.StartsWith("h", StringComparison.OrdinalIgnoreCase)) + + if (datePart.StartsWith("M")) { - return dateTime.Hour; + return _dateTime.Month; } - else if (datePart.StartsWith("m")) + + if (datePart.StartsWith("d", StringComparison.OrdinalIgnoreCase)) { - return dateTime.Minute; + return _dateTime.Day; } - else if (datePart.StartsWith("s", StringComparison.OrdinalIgnoreCase)) + + if (datePart.StartsWith("h", StringComparison.OrdinalIgnoreCase)) { - return dateTime.Second; + return _dateTime.Hour; } - else + + if (datePart.StartsWith("m")) { - return NO_DIGIT_DRAGGED; + return _dateTime.Minute; } + + return datePart.StartsWith("s", StringComparison.OrdinalIgnoreCase) ? _dateTime.Second : NO_DIGIT_DRAGGED; } private bool SetDraggedValue(int delta) @@ -175,31 +179,31 @@ private bool SetDraggedValue(int delta) bool changed = true; try { - var datePart = _dateParts[_draggedDigit]; + string datePart = _dateParts[_draggedDigit]; if (datePart.StartsWith("y", StringComparison.OrdinalIgnoreCase)) { - dateTime = dateTime.AddYears(delta); + _dateTime = _dateTime.AddYears(delta); } else if (datePart.StartsWith("M")) { - dateTime = dateTime.AddMonths(delta); + _dateTime = _dateTime.AddMonths(delta); } else if (datePart.StartsWith("d", StringComparison.OrdinalIgnoreCase)) { - dateTime = dateTime.AddDays(delta); + _dateTime = _dateTime.AddDays(delta); } else if (datePart.StartsWith("h", StringComparison.OrdinalIgnoreCase)) { - dateTime = dateTime.AddHours(delta); + _dateTime = _dateTime.AddHours(delta); } else if (datePart.StartsWith("m")) { - dateTime = dateTime.AddMinutes(delta); + _dateTime = _dateTime.AddMinutes(delta); } else if (datePart.StartsWith("s", StringComparison.OrdinalIgnoreCase)) { - dateTime = dateTime.AddSeconds(delta); + _dateTime = _dateTime.AddSeconds(delta); } } catch (Exception) @@ -207,14 +211,14 @@ private bool SetDraggedValue(int delta) // invalid value dragged } - if (dateTime > MaxDateTime) + if (_dateTime > MaxDateTime) { - dateTime = MaxDateTime; + _dateTime = MaxDateTime; changed = false; } - if (dateTime < MinDateTime) + if (_dateTime < MinDateTime) { - dateTime = MinDateTime; + _dateTime = MinDateTime; changed = false; } @@ -225,36 +229,32 @@ private void InitCustomRects(Section dateSection) { _dateParts = dateSection .GeneralTextDateDurationParts - .Select(p => DateFormatPartAdjuster.AdjustDateTimeFormatPart(p)) + .Select(DateFormatPartAdjuster.AdjustDateTimeFormatPart) .ToArray(); Rectangle rect = ClientRectangle; int oneCharWidth = rect.Width / _dateParts.Sum(s => s.Length); int left = rect.Left; - digitRects.Clear(); - for (var i = 0; i < _dateParts.Length; i++) + _digitRects.Clear(); + + foreach (string datePart in _dateParts) { - var datePart = _dateParts[i]; - var s = datePart.Length * oneCharWidth; - digitRects.Add(new Rectangle(left, rect.Top, s, rect.Height)); + int s = datePart.Length * oneCharWidth; + _digitRects.Add(new Rectangle(left, rect.Top, s, rect.Height)); left += s; } } - private void InitDigiRects() + private void InitDigitRects() { CultureInfo culture = System.Threading.Thread.CurrentThread.CurrentCulture; - var datePattern = string.Concat( - culture.DateTimeFormat.ShortDatePattern, - " ", - culture.DateTimeFormat.LongTimePattern - ); + string datePattern = string.Concat(culture.DateTimeFormat.ShortDatePattern, " ", culture.DateTimeFormat.LongTimePattern); - var sections = Parser.ParseSections(datePattern, out bool syntaxError); - var dateSection = sections.FirstOrDefault(); + List
sections = Parser.ParseSections(datePattern, out _); + Section dateSection = sections.FirstOrDefault(); if (dateSection == null) { @@ -271,7 +271,7 @@ private void InitDigiRects() private void DateTimeDragControl_Load(object sender, EventArgs e) { - InitDigiRects(); + InitDigitRects(); BuildContextualMenu(); } @@ -301,29 +301,32 @@ private void BuildContextualMenu() { ContextMenuStrip = new ContextMenuStrip(); ContextMenuStrip.Name = "Timestamp selector"; - ContextMenuStrip.Items.Add(item1); - ContextMenuStrip.Items.Add(item2); - ContextMenuStrip.Items.Add(item3); - item1.Click += new EventHandler(item1_Click); - item1.Text = "Drag horizontal"; - item2.Click += new EventHandler(item2_Click); - item2.Text = "Drag vertical"; - item3.Click += new EventHandler(item3_Click); - item3.Text = "Drag vertical inverted"; - - ContextMenuStrip.Opening += new CancelEventHandler(ContextMenuStrip_Opening); + ContextMenuStrip.Items.Add(toolStripItemHorizontalDrag); + ContextMenuStrip.Items.Add(toolStripItemVerticalDrag); + ContextMenuStrip.Items.Add(toolStripItemVerticalInvertedDrag); + + toolStripItemHorizontalDrag.Click += OnToolStripItemHorizontalDragClick; + toolStripItemHorizontalDrag.Text = "Drag horizontal"; + + toolStripItemVerticalDrag.Click += OnToolStripItemVerticalDragClick; + toolStripItemVerticalDrag.Text = "Drag vertical"; + + toolStripItemVerticalInvertedDrag.Click += OnToolStripItemVerticalInvertedDragClick; + toolStripItemVerticalInvertedDrag.Text = "Drag vertical inverted"; + + ContextMenuStrip.Opening += OnContextMenuStripOpening; UpdateContextMenu(); } private void UpdateContextMenu() { - item1.Enabled = DragOrientation != DragOrientations.Horizontal; - item2.Enabled = DragOrientation != DragOrientations.Vertical; - item3.Enabled = DragOrientation != DragOrientations.InvertedVertical; + toolStripItemHorizontalDrag.Enabled = DragOrientation != DragOrientations.Horizontal; + toolStripItemVerticalDrag.Enabled = DragOrientation != DragOrientations.Vertical; + toolStripItemVerticalInvertedDrag.Enabled = DragOrientation != DragOrientations.InvertedVertical; } - private void ContextMenuStrip_Opening(object sender, CancelEventArgs e) + private void OnContextMenuStripOpening(object sender, CancelEventArgs e) { if (Capture) { @@ -331,28 +334,28 @@ private void ContextMenuStrip_Opening(object sender, CancelEventArgs e) } } - private void item1_Click(object sender, EventArgs e) + private void OnToolStripItemHorizontalDragClick(object sender, EventArgs e) { DragOrientation = DragOrientations.Horizontal; - item1.Enabled = false; - item2.Enabled = true; - item3.Enabled = true; + toolStripItemHorizontalDrag.Enabled = false; + toolStripItemVerticalDrag.Enabled = true; + toolStripItemVerticalInvertedDrag.Enabled = true; } - private void item2_Click(object sender, EventArgs e) + private void OnToolStripItemVerticalDragClick(object sender, EventArgs e) { DragOrientation = DragOrientations.Vertical; - item1.Enabled = true; - item2.Enabled = false; - item3.Enabled = true; + toolStripItemHorizontalDrag.Enabled = true; + toolStripItemVerticalDrag.Enabled = false; + toolStripItemVerticalInvertedDrag.Enabled = true; } - private void item3_Click(object sender, EventArgs e) + private void OnToolStripItemVerticalInvertedDragClick(object sender, EventArgs e) { DragOrientation = DragOrientations.InvertedVertical; - item1.Enabled = true; - item2.Enabled = true; - item3.Enabled = false; + toolStripItemHorizontalDrag.Enabled = true; + toolStripItemVerticalDrag.Enabled = true; + toolStripItemVerticalInvertedDrag.Enabled = false; } #endregion @@ -368,24 +371,24 @@ protected override void OnPaint(PaintEventArgs e) { if (_draggedDigit != NO_DIGIT_DRAGGED) { - e.Graphics.FillRectangle(hoverBrush, digitRects[_draggedDigit]); + e.Graphics.FillRectangle(hoverBrush, _digitRects[_draggedDigit]); } } // Display current value with user-defined date format and fixed time format ("HH:mm:ss") using (Brush brush = new SolidBrush(Color.Black)) { - for (var i = 0; i < _dateParts.Length; i++) + for (int i = 0; i < _dateParts.Length; i++) { - var datePart = _dateParts[i]; - var rect = digitRects[i]; + string datePart = _dateParts[i]; + Rectangle rect = _digitRects[i]; string value; if (Token.IsDatePart(datePart)) { try { - value = dateTime.ToString("-" + datePart + "-"); + value = _dateTime.ToString("-" + datePart + "-"); value = value.Substring(1, value.Length - 2); } catch @@ -398,14 +401,14 @@ protected override void OnPaint(PaintEventArgs e) value = datePart; } - e.Graphics.DrawString(value, Font, brush, rect, digitsFormat); + e.Graphics.DrawString(value, Font, brush, rect, _digitsFormat); } } } private void DateTimeDragControl_Resize(object sender, EventArgs e) { - InitDigiRects(); + InitDigitRects(); } #endregion @@ -424,10 +427,10 @@ protected override void OnMouseDown(MouseEventArgs e) return; } Capture = true; - startMouseY = e.Y; - startMouseX = e.X; - oldValue = GetDraggedValue(); - addedValue = 0; + _startMouseY = e.Y; + _startMouseX = e.X; + _oldValue = GetDraggedValue(); + _addedValue = 0; } else if (e.Button == MouseButtons.Right && Capture) { @@ -450,7 +453,7 @@ protected override void OnMouseUp(MouseEventArgs e) _draggedDigit = NO_DIGIT_DRAGGED; Invalidate(); // repaint without the selected item - OnValueChanged(new EventArgs()); + OnValueChanged(EventArgs.Empty); } protected override void OnMouseMove(MouseEventArgs e) @@ -463,42 +466,53 @@ protected override void OnMouseMove(MouseEventArgs e) } int diff; - if (DragOrientation == DragOrientations.Vertical) + switch (DragOrientation) { - diff = startMouseY - e.Y; + case DragOrientations.Vertical: + { + diff = _startMouseY - e.Y; + break; + } + case DragOrientations.InvertedVertical: + { + diff = _startMouseY + e.Y; + break; + } + default: + { + diff = e.X - _startMouseX; + break; + } } - else if (DragOrientation == DragOrientations.InvertedVertical) + + int delta = diff / 5 - _addedValue; // one unit per 5 pixels move + + if (delta == 0) { - diff = startMouseY + e.Y; + return; } - else + + if (SetDraggedValue(delta)) { - diff = e.X - startMouseX; + _addedValue += delta; } - int delta = diff / 5 - addedValue; // one unit per 5 pixels move - - if (delta != 0) - { - if (SetDraggedValue(delta)) - { - addedValue += delta; - } - Invalidate(); + Invalidate(); - OnValueDragged(new EventArgs()); - } + OnValueDragged(EventArgs.Empty); } private void DateTimeDragControl_MouseLeave(object sender, EventArgs e) { - if (!Capture) + if (Capture) { - _draggedDigit = NO_DIGIT_DRAGGED; - Refresh(); + return; } + + _draggedDigit = NO_DIGIT_DRAGGED; + Refresh(); } #endregion } -} \ No newline at end of file +} diff --git a/src/LogExpert/Dialogs/ExceptionWindow.Designer.cs b/src/LogExpert/Dialogs/ExceptionWindow.Designer.cs index 54bdf319..3fbdc6e0 100644 --- a/src/LogExpert/Dialogs/ExceptionWindow.Designer.cs +++ b/src/LogExpert/Dialogs/ExceptionWindow.Designer.cs @@ -81,8 +81,6 @@ private void InitializeComponent() // // ExceptionWindow // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.okButton; this.ClientSize = new System.Drawing.Size(464, 300); this.Controls.Add(this.copyButton); diff --git a/src/LogExpert/Dialogs/ExceptionWindow.cs b/src/LogExpert/Dialogs/ExceptionWindow.cs index 7cacd94a..4d557602 100644 --- a/src/LogExpert/Dialogs/ExceptionWindow.cs +++ b/src/LogExpert/Dialogs/ExceptionWindow.cs @@ -1,9 +1,5 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; using System.Drawing; -using System.Text; using System.Windows.Forms; namespace LogExpert.Dialogs @@ -12,8 +8,9 @@ public partial class ExceptionWindow : Form { #region Fields - private readonly string errorText; - private readonly string stackTrace; + private readonly string _errorText; + + private readonly string _stackTrace; #endregion @@ -22,10 +19,15 @@ public partial class ExceptionWindow : Form public ExceptionWindow(string errorText, string stackTrace) { InitializeComponent(); - this.errorText = errorText; - this.stackTrace = stackTrace; - this.stackTraceTextBox.Text = this.errorText + "\n\n" + this.stackTrace; - this.stackTraceTextBox.Select(0, 0); + + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; + + _errorText = errorText; + _stackTrace = stackTrace; + + stackTraceTextBox.Text = _errorText + @"\n\n" + _stackTrace; + stackTraceTextBox.Select(0, 0); } #endregion @@ -34,7 +36,7 @@ public ExceptionWindow(string errorText, string stackTrace) private void CopyToClipboard() { - Clipboard.SetText(this.errorText + "\n\n" + this.stackTrace); + Clipboard.SetText(_errorText + @"\n\n" + _stackTrace); } #endregion diff --git a/src/LogExpert/Dialogs/FilterColumnChooser.Designer.cs b/src/LogExpert/Dialogs/FilterColumnChooser.Designer.cs index 18708e59..6936b914 100644 --- a/src/LogExpert/Dialogs/FilterColumnChooser.Designer.cs +++ b/src/LogExpert/Dialogs/FilterColumnChooser.Designer.cs @@ -28,188 +28,191 @@ protected override void Dispose(bool disposing) ///
private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FilterColumnChooser)); - this.columnListBox = new System.Windows.Forms.CheckedListBox(); - this.okButton = new System.Windows.Forms.Button(); - this.toolTipEmptyColumnNoHit = new System.Windows.Forms.ToolTip(this.components); - this.emptyColumnNoHitRadioButton = new System.Windows.Forms.RadioButton(); - this.toolTipListBox = new System.Windows.Forms.ToolTip(this.components); - this.exactMatchCheckBox = new System.Windows.Forms.CheckBox(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.emptyColumnUsePrevRadioButton = new System.Windows.Forms.RadioButton(); - this.emptyColumnHitRadioButton = new System.Windows.Forms.RadioButton(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.toolTipSearchHit = new System.Windows.Forms.ToolTip(this.components); - this.toolTipPrevContent = new System.Windows.Forms.ToolTip(this.components); - this.toolTipExactMatch = new System.Windows.Forms.ToolTip(this.components); - this.cancelButton = new System.Windows.Forms.Button(); - this.groupBox1.SuspendLayout(); - this.groupBox2.SuspendLayout(); - this.SuspendLayout(); - // - // columnListBox - // - this.columnListBox.CheckOnClick = true; - this.columnListBox.FormattingEnabled = true; - this.columnListBox.Location = new System.Drawing.Point(3, 3); - this.columnListBox.Name = "columnListBox"; - this.columnListBox.Size = new System.Drawing.Size(150, 139); - this.columnListBox.TabIndex = 0; - this.toolTipListBox.SetToolTip(this.columnListBox, "Choose one ore more columns to restrict the search operations to the selected col" + - "umns."); - // - // okButton - // - this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.okButton.Location = new System.Drawing.Point(3, 291); - this.okButton.Name = "okButton"; - this.okButton.Size = new System.Drawing.Size(75, 23); - this.okButton.TabIndex = 2; - this.okButton.Text = "OK"; - this.okButton.UseVisualStyleBackColor = true; - this.okButton.Click += new System.EventHandler(this.okButton_Click); - // - // toolTipEmptyColumnNoHit - // - this.toolTipEmptyColumnNoHit.ToolTipTitle = "Empty column"; - // - // emptyColumnNoHitRadioButton - // - this.emptyColumnNoHitRadioButton.AutoSize = true; - this.emptyColumnNoHitRadioButton.Location = new System.Drawing.Point(6, 19); - this.emptyColumnNoHitRadioButton.Name = "emptyColumnNoHitRadioButton"; - this.emptyColumnNoHitRadioButton.Size = new System.Drawing.Size(53, 17); - this.emptyColumnNoHitRadioButton.TabIndex = 0; - this.emptyColumnNoHitRadioButton.TabStop = true; - this.emptyColumnNoHitRadioButton.Text = "No hit"; - this.toolTipEmptyColumnNoHit.SetToolTip(this.emptyColumnNoHitRadioButton, "No search hit on empty columns"); - this.emptyColumnNoHitRadioButton.UseVisualStyleBackColor = true; - // - // toolTipListBox - // - this.toolTipListBox.ToolTipTitle = "Columns"; - // - // exactMatchCheckBox - // - this.exactMatchCheckBox.AutoSize = true; - this.exactMatchCheckBox.Location = new System.Drawing.Point(6, 12); - this.exactMatchCheckBox.Name = "exactMatchCheckBox"; - this.exactMatchCheckBox.Size = new System.Drawing.Size(85, 17); - this.exactMatchCheckBox.TabIndex = 4; - this.exactMatchCheckBox.Text = "Exact match"; - this.toolTipExactMatch.SetToolTip(this.exactMatchCheckBox, "If selected, the search string must match exactly (no substring search)"); - this.exactMatchCheckBox.UseVisualStyleBackColor = true; - // - // groupBox1 - // - this.groupBox1.Controls.Add(this.emptyColumnUsePrevRadioButton); - this.groupBox1.Controls.Add(this.emptyColumnHitRadioButton); - this.groupBox1.Controls.Add(this.emptyColumnNoHitRadioButton); - this.groupBox1.Location = new System.Drawing.Point(3, 188); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(147, 97); - this.groupBox1.TabIndex = 5; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "On empty columns"; - // - // emptyColumnUsePrevRadioButton - // - this.emptyColumnUsePrevRadioButton.AutoSize = true; - this.emptyColumnUsePrevRadioButton.Location = new System.Drawing.Point(6, 65); - this.emptyColumnUsePrevRadioButton.Name = "emptyColumnUsePrevRadioButton"; - this.emptyColumnUsePrevRadioButton.Size = new System.Drawing.Size(107, 17); - this.emptyColumnUsePrevRadioButton.TabIndex = 2; - this.emptyColumnUsePrevRadioButton.TabStop = true; - this.emptyColumnUsePrevRadioButton.Text = "Use prev content"; - this.toolTipPrevContent.SetToolTip(this.emptyColumnUsePrevRadioButton, "An empty column will be a search hit if the previous non-empty column was a searc" + - "h hit"); - this.emptyColumnUsePrevRadioButton.UseVisualStyleBackColor = true; - // - // emptyColumnHitRadioButton - // - this.emptyColumnHitRadioButton.AutoSize = true; - this.emptyColumnHitRadioButton.Location = new System.Drawing.Point(6, 42); - this.emptyColumnHitRadioButton.Name = "emptyColumnHitRadioButton"; - this.emptyColumnHitRadioButton.Size = new System.Drawing.Size(73, 17); - this.emptyColumnHitRadioButton.TabIndex = 1; - this.emptyColumnHitRadioButton.TabStop = true; - this.emptyColumnHitRadioButton.Text = "Search hit"; - this.toolTipSearchHit.SetToolTip(this.emptyColumnHitRadioButton, "An empty column will always be a search hit"); - this.emptyColumnHitRadioButton.UseVisualStyleBackColor = true; - // - // groupBox2 - // - this.groupBox2.Controls.Add(this.exactMatchCheckBox); - this.groupBox2.Location = new System.Drawing.Point(3, 148); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(147, 34); - this.groupBox2.TabIndex = 6; - this.groupBox2.TabStop = false; - // - // toolTipSearchHit - // - this.toolTipSearchHit.ToolTipTitle = "Empty column"; - // - // toolTipPrevContent - // - this.toolTipPrevContent.ToolTipTitle = "Empty column"; - // - // toolTipExactMatch - // - this.toolTipExactMatch.ToolTipTitle = "Exact match"; - // - // cancelButton - // - this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.cancelButton.Location = new System.Drawing.Point(90, 291); - this.cancelButton.Name = "cancelButton"; - this.cancelButton.Size = new System.Drawing.Size(60, 23); - this.cancelButton.TabIndex = 7; - this.cancelButton.Text = "Cancel"; - this.cancelButton.UseVisualStyleBackColor = true; - // - // FilterColumnChooser - // - this.AcceptButton = this.okButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.cancelButton; - this.ClientSize = new System.Drawing.Size(157, 319); - this.Controls.Add(this.cancelButton); - this.Controls.Add(this.groupBox2); - this.Controls.Add(this.groupBox1); - this.Controls.Add(this.okButton); - this.Controls.Add(this.columnListBox); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Name = "FilterColumnChooser"; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Columns"; - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); - this.groupBox2.ResumeLayout(false); - this.groupBox2.PerformLayout(); - this.ResumeLayout(false); + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FilterColumnChooser)); + this.columnListBox = new System.Windows.Forms.CheckedListBox(); + this.buttonOk = new System.Windows.Forms.Button(); + this.toolTipEmptyColumnNoHit = new System.Windows.Forms.ToolTip(this.components); + this.emptyColumnNoHitRadioButton = new System.Windows.Forms.RadioButton(); + this.toolTipListBox = new System.Windows.Forms.ToolTip(this.components); + this.checkBoxExactMatch = new System.Windows.Forms.CheckBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.emptyColumnUsePrevRadioButton = new System.Windows.Forms.RadioButton(); + this.emptyColumnHitRadioButton = new System.Windows.Forms.RadioButton(); + this.groupBoxExectMatch = new System.Windows.Forms.GroupBox(); + this.toolTipSearchHit = new System.Windows.Forms.ToolTip(this.components); + this.toolTipPrevContent = new System.Windows.Forms.ToolTip(this.components); + this.toolTipExactMatch = new System.Windows.Forms.ToolTip(this.components); + this.buttonCancel = new System.Windows.Forms.Button(); + this.groupBox1.SuspendLayout(); + this.groupBoxExectMatch.SuspendLayout(); + this.SuspendLayout(); + // + // columnListBox + // + this.columnListBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.columnListBox.CheckOnClick = true; + this.columnListBox.Font = new System.Drawing.Font("Courier New", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.columnListBox.FormattingEnabled = true; + this.columnListBox.Location = new System.Drawing.Point(3, 3); + this.columnListBox.Name = "columnListBox"; + this.columnListBox.Size = new System.Drawing.Size(177, 119); + this.columnListBox.TabIndex = 0; + this.toolTipListBox.SetToolTip(this.columnListBox, "Choose one ore more columns to restrict the search operations to the selected col" + + "umns."); + // + // buttonOk + // + this.buttonOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this.buttonOk.Location = new System.Drawing.Point(3, 309); + this.buttonOk.Name = "buttonOk"; + this.buttonOk.Size = new System.Drawing.Size(75, 23); + this.buttonOk.TabIndex = 2; + this.buttonOk.Text = "OK"; + this.buttonOk.UseVisualStyleBackColor = true; + this.buttonOk.Click += new System.EventHandler(this.OnOkButtonClick); + // + // toolTipEmptyColumnNoHit + // + this.toolTipEmptyColumnNoHit.ToolTipTitle = "Empty column"; + // + // emptyColumnNoHitRadioButton + // + this.emptyColumnNoHitRadioButton.AutoSize = true; + this.emptyColumnNoHitRadioButton.Location = new System.Drawing.Point(6, 21); + this.emptyColumnNoHitRadioButton.Name = "emptyColumnNoHitRadioButton"; + this.emptyColumnNoHitRadioButton.Size = new System.Drawing.Size(75, 24); + this.emptyColumnNoHitRadioButton.TabIndex = 0; + this.emptyColumnNoHitRadioButton.TabStop = true; + this.emptyColumnNoHitRadioButton.Text = "No hit"; + this.toolTipEmptyColumnNoHit.SetToolTip(this.emptyColumnNoHitRadioButton, "No search hit on empty columns"); + this.emptyColumnNoHitRadioButton.UseVisualStyleBackColor = true; + // + // toolTipListBox + // + this.toolTipListBox.ToolTipTitle = "Columns"; + // + // checkBoxExactMatch + // + this.checkBoxExactMatch.AutoSize = true; + this.checkBoxExactMatch.Location = new System.Drawing.Point(9, 11); + this.checkBoxExactMatch.Name = "checkBoxExactMatch"; + this.checkBoxExactMatch.Size = new System.Drawing.Size(123, 24); + this.checkBoxExactMatch.TabIndex = 4; + this.checkBoxExactMatch.Text = "Exact match"; + this.toolTipExactMatch.SetToolTip(this.checkBoxExactMatch, "If selected, the search string must match exactly (no substring search)"); + this.checkBoxExactMatch.UseVisualStyleBackColor = true; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.emptyColumnUsePrevRadioButton); + this.groupBox1.Controls.Add(this.emptyColumnHitRadioButton); + this.groupBox1.Controls.Add(this.emptyColumnNoHitRadioButton); + this.groupBox1.Location = new System.Drawing.Point(3, 177); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(177, 108); + this.groupBox1.TabIndex = 5; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "On empty columns"; + // + // emptyColumnUsePrevRadioButton + // + this.emptyColumnUsePrevRadioButton.AutoSize = true; + this.emptyColumnUsePrevRadioButton.Location = new System.Drawing.Point(6, 76); + this.emptyColumnUsePrevRadioButton.Name = "emptyColumnUsePrevRadioButton"; + this.emptyColumnUsePrevRadioButton.Size = new System.Drawing.Size(155, 24); + this.emptyColumnUsePrevRadioButton.TabIndex = 2; + this.emptyColumnUsePrevRadioButton.TabStop = true; + this.emptyColumnUsePrevRadioButton.Text = "Use prev content"; + this.toolTipPrevContent.SetToolTip(this.emptyColumnUsePrevRadioButton, "An empty column will be a search hit if the previous non-empty column was a searc" + + "h hit"); + this.emptyColumnUsePrevRadioButton.UseVisualStyleBackColor = true; + // + // emptyColumnHitRadioButton + // + this.emptyColumnHitRadioButton.AutoSize = true; + this.emptyColumnHitRadioButton.Location = new System.Drawing.Point(6, 49); + this.emptyColumnHitRadioButton.Name = "emptyColumnHitRadioButton"; + this.emptyColumnHitRadioButton.Size = new System.Drawing.Size(106, 24); + this.emptyColumnHitRadioButton.TabIndex = 1; + this.emptyColumnHitRadioButton.TabStop = true; + this.emptyColumnHitRadioButton.Text = "Search hit"; + this.toolTipSearchHit.SetToolTip(this.emptyColumnHitRadioButton, "An empty column will always be a search hit"); + this.emptyColumnHitRadioButton.UseVisualStyleBackColor = true; + // + // groupBoxExectMatch + // + this.groupBoxExectMatch.Controls.Add(this.checkBoxExactMatch); + this.groupBoxExectMatch.Location = new System.Drawing.Point(3, 130); + this.groupBoxExectMatch.Name = "groupBoxExectMatch"; + this.groupBoxExectMatch.Size = new System.Drawing.Size(177, 41); + this.groupBoxExectMatch.TabIndex = 6; + this.groupBoxExectMatch.TabStop = false; + // + // toolTipSearchHit + // + this.toolTipSearchHit.ToolTipTitle = "Empty column"; + // + // toolTipPrevContent + // + this.toolTipPrevContent.ToolTipTitle = "Empty column"; + // + // toolTipExactMatch + // + this.toolTipExactMatch.ToolTipTitle = "Exact match"; + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(104, 309); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(75, 23); + this.buttonCancel.TabIndex = 7; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + // + // FilterColumnChooser + // + this.AcceptButton = this.buttonOk; + this.CancelButton = this.buttonCancel; + this.ClientSize = new System.Drawing.Size(184, 335); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.groupBoxExectMatch); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.buttonOk); + this.Controls.Add(this.columnListBox); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Name = "FilterColumnChooser"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Columns"; + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBoxExectMatch.ResumeLayout(false); + this.groupBoxExectMatch.PerformLayout(); + this.ResumeLayout(false); } #endregion private System.Windows.Forms.CheckedListBox columnListBox; - private System.Windows.Forms.Button okButton; + private System.Windows.Forms.Button buttonOk; private System.Windows.Forms.ToolTip toolTipEmptyColumnNoHit; private System.Windows.Forms.ToolTip toolTipListBox; - private System.Windows.Forms.CheckBox exactMatchCheckBox; + private System.Windows.Forms.CheckBox checkBoxExactMatch; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.RadioButton emptyColumnUsePrevRadioButton; private System.Windows.Forms.RadioButton emptyColumnHitRadioButton; private System.Windows.Forms.RadioButton emptyColumnNoHitRadioButton; - private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.GroupBox groupBoxExectMatch; private System.Windows.Forms.ToolTip toolTipExactMatch; private System.Windows.Forms.ToolTip toolTipSearchHit; private System.Windows.Forms.ToolTip toolTipPrevContent; - private System.Windows.Forms.Button cancelButton; + private System.Windows.Forms.Button buttonCancel; } } \ No newline at end of file diff --git a/src/LogExpert/Dialogs/FilterColumnChooser.cs b/src/LogExpert/Dialogs/FilterColumnChooser.cs index 735d7269..dffb2a95 100644 --- a/src/LogExpert/Dialogs/FilterColumnChooser.cs +++ b/src/LogExpert/Dialogs/FilterColumnChooser.cs @@ -1,9 +1,5 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; using System.Drawing; -using System.Text; using System.Windows.Forms; using LogExpert.Classes.Filter; @@ -13,8 +9,8 @@ public partial class FilterColumnChooser : Form { #region Fields - private readonly ILogLineColumnizer columnizer; - private readonly FilterParams filterParams; + private readonly ILogLineColumnizer _columnizer; + private readonly FilterParams _filterParams; #endregion @@ -24,8 +20,14 @@ public FilterColumnChooser(FilterParams filterParams) { InitializeComponent(); - this.columnizer = filterParams.currentColumnizer; - this.filterParams = filterParams; + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; + + columnListBox.ItemHeight = columnListBox.Font.Height; + + _columnizer = filterParams.currentColumnizer; + _filterParams = filterParams; + Init(); } @@ -35,33 +37,34 @@ public FilterColumnChooser(FilterParams filterParams) private void Init() { - int count = this.columnizer.GetColumnCount(); - string[] names = this.columnizer.GetColumnNames(); + int count = _columnizer.GetColumnCount(); + string[] names = _columnizer.GetColumnNames(); + for (int i = 0; i < count; ++i) { - this.columnListBox.Items.Add(names[i], filterParams.columnList.Contains(i)); + columnListBox.Items.Add(names[i], _filterParams.columnList.Contains(i)); } - this.emptyColumnUsePrevRadioButton.Checked = this.filterParams.emptyColumnUsePrev; - this.emptyColumnHitRadioButton.Checked = this.filterParams.emptyColumnHit; - this.emptyColumnNoHitRadioButton.Checked = - !this.filterParams.emptyColumnHit && !this.filterParams.emptyColumnUsePrev; - this.exactMatchCheckBox.Checked = this.filterParams.exactColumnMatch; + + emptyColumnUsePrevRadioButton.Checked = _filterParams.emptyColumnUsePrev; + emptyColumnHitRadioButton.Checked = _filterParams.emptyColumnHit; + emptyColumnNoHitRadioButton.Checked = _filterParams.emptyColumnHit == false && _filterParams.emptyColumnUsePrev == false; + checkBoxExactMatch.Checked = _filterParams.exactColumnMatch; } #endregion #region Events handler - private void okButton_Click(object sender, EventArgs e) + private void OnOkButtonClick(object sender, EventArgs e) { - this.filterParams.columnList.Clear(); - foreach (int colNum in this.columnListBox.CheckedIndices) + _filterParams.columnList.Clear(); + foreach (int colNum in columnListBox.CheckedIndices) { - this.filterParams.columnList.Add(colNum); + _filterParams.columnList.Add(colNum); } - this.filterParams.emptyColumnUsePrev = this.emptyColumnUsePrevRadioButton.Checked; - this.filterParams.emptyColumnHit = this.emptyColumnHitRadioButton.Checked; - this.filterParams.exactColumnMatch = this.exactMatchCheckBox.Checked; + _filterParams.emptyColumnUsePrev = emptyColumnUsePrevRadioButton.Checked; + _filterParams.emptyColumnHit = emptyColumnHitRadioButton.Checked; + _filterParams.exactColumnMatch = checkBoxExactMatch.Checked; } #endregion diff --git a/src/LogExpert/Dialogs/FilterColumnChooser.resx b/src/LogExpert/Dialogs/FilterColumnChooser.resx index 6e226bef..bfab700f 100644 --- a/src/LogExpert/Dialogs/FilterColumnChooser.resx +++ b/src/LogExpert/Dialogs/FilterColumnChooser.resx @@ -112,30 +112,30 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + 184, 17 - + 17, 17 - + 611, 17 - + 454, 17 - + 312, 17 - + 71 - + AAABAAEAEBAQAAAABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAABAA diff --git a/src/LogExpert/Dialogs/FilterSelectorForm.Designer.cs b/src/LogExpert/Dialogs/FilterSelectorForm.Designer.cs index c5cb6c3b..6b01e99f 100644 --- a/src/LogExpert/Dialogs/FilterSelectorForm.Designer.cs +++ b/src/LogExpert/Dialogs/FilterSelectorForm.Designer.cs @@ -115,8 +115,6 @@ private void InitializeComponent() // FilterSelectorForm // this.AcceptButton = this.okButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.cancelButton; this.ClientSize = new System.Drawing.Size(322, 232); this.Controls.Add(this.configButton); diff --git a/src/LogExpert/Dialogs/FilterSelectorForm.cs b/src/LogExpert/Dialogs/FilterSelectorForm.cs index 3ab6d868..05297708 100644 --- a/src/LogExpert/Dialogs/FilterSelectorForm.cs +++ b/src/LogExpert/Dialogs/FilterSelectorForm.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Drawing; using System.Windows.Forms; using LogExpert.Config; @@ -21,12 +22,17 @@ public FilterSelectorForm(IList existingColumnizerList, ILog SelectedColumnizer = currentColumnizer; _callback = callback; InitializeComponent(); + + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; + filterComboBox.SelectedIndexChanged += OnFilterComboBoxSelectedIndexChanged; // for the currently selected columnizer use the current instance and not the template instance from // columnizer registry. This ensures that changes made in columnizer config dialogs // will apply to the current instance _columnizerList = new List(); + foreach (ILogLineColumnizer col in existingColumnizerList) { _columnizerList.Add(col.GetType() == SelectedColumnizer.GetType() ? SelectedColumnizer : col); diff --git a/src/LogExpert/Dialogs/GotoLineDialog.Designer.cs b/src/LogExpert/Dialogs/GotoLineDialog.Designer.cs index c27f50bd..7e99ca2d 100644 --- a/src/LogExpert/Dialogs/GotoLineDialog.Designer.cs +++ b/src/LogExpert/Dialogs/GotoLineDialog.Designer.cs @@ -28,78 +28,81 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.label1 = new System.Windows.Forms.Label(); - this.okButton = new System.Windows.Forms.Button(); - this.cancelButton = new System.Windows.Forms.Button(); - this.lineNumberTextBox = new System.Windows.Forms.TextBox(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 30); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(68, 13); - this.label1.TabIndex = 0; - this.label1.Text = "Line number:"; - // - // okButton - // - this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.okButton.Location = new System.Drawing.Point(15, 76); - this.okButton.Name = "okButton"; - this.okButton.Size = new System.Drawing.Size(75, 23); - this.okButton.TabIndex = 2; - this.okButton.Text = "OK"; - this.okButton.UseVisualStyleBackColor = true; - this.okButton.Click += new System.EventHandler(this.okButton_Click); - // - // cancelButton - // - this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.cancelButton.Location = new System.Drawing.Point(107, 76); - this.cancelButton.Name = "cancelButton"; - this.cancelButton.Size = new System.Drawing.Size(75, 23); - this.cancelButton.TabIndex = 3; - this.cancelButton.Text = "Cancel"; - this.cancelButton.UseVisualStyleBackColor = true; - // - // lineNumberTextBox - // - this.lineNumberTextBox.Location = new System.Drawing.Point(82, 27); - this.lineNumberTextBox.Name = "lineNumberTextBox"; - this.lineNumberTextBox.Size = new System.Drawing.Size(100, 20); - this.lineNumberTextBox.TabIndex = 0; - // - // GotoLineDialog - // - this.AcceptButton = this.okButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.cancelButton; - this.ClientSize = new System.Drawing.Size(201, 109); - this.Controls.Add(this.lineNumberTextBox); - this.Controls.Add(this.cancelButton); - this.Controls.Add(this.okButton); - this.Controls.Add(this.label1); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "GotoLineDialog"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Go to line"; - this.Load += new System.EventHandler(this.GotoLineDialog_Load); - this.ResumeLayout(false); - this.PerformLayout(); + this.labelLineNumber = new System.Windows.Forms.Label(); + this.buttonOk = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.lineNumberTextBox = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // labelLineNumber + // + this.labelLineNumber.AutoSize = true; + this.labelLineNumber.Location = new System.Drawing.Point(12, 30); + this.labelLineNumber.Name = "labelLineNumber"; + this.labelLineNumber.Size = new System.Drawing.Size(101, 20); + this.labelLineNumber.TabIndex = 0; + this.labelLineNumber.Text = "Line number:"; + // + // buttonOk + // + this.buttonOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonOk.AutoSize = true; + this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this.buttonOk.Location = new System.Drawing.Point(15, 90); + this.buttonOk.Name = "buttonOk"; + this.buttonOk.Size = new System.Drawing.Size(75, 30); + this.buttonOk.TabIndex = 2; + this.buttonOk.Text = "OK"; + this.buttonOk.UseVisualStyleBackColor = true; + this.buttonOk.Click += new System.EventHandler(this.okButton_Click); + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.AutoSize = true; + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(149, 90); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(75, 30); + this.buttonCancel.TabIndex = 3; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + // + // lineNumberTextBox + // + this.lineNumberTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.lineNumberTextBox.Location = new System.Drawing.Point(124, 27); + this.lineNumberTextBox.Name = "lineNumberTextBox"; + this.lineNumberTextBox.Size = new System.Drawing.Size(100, 26); + this.lineNumberTextBox.TabIndex = 0; + // + // GotoLineDialog + // + this.AcceptButton = this.buttonOk; + this.CancelButton = this.buttonCancel; + this.ClientSize = new System.Drawing.Size(243, 130); + this.Controls.Add(this.lineNumberTextBox); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOk); + this.Controls.Add(this.labelLineNumber); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "GotoLineDialog"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Go to line"; + this.Load += new System.EventHandler(this.GotoLineDialog_Load); + this.ResumeLayout(false); + this.PerformLayout(); } #endregion - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Button okButton; - private System.Windows.Forms.Button cancelButton; + private System.Windows.Forms.Label labelLineNumber; + private System.Windows.Forms.Button buttonOk; + private System.Windows.Forms.Button buttonCancel; private System.Windows.Forms.TextBox lineNumberTextBox; } } \ No newline at end of file diff --git a/src/LogExpert/Dialogs/GotoLineDialog.cs b/src/LogExpert/Dialogs/GotoLineDialog.cs index 55375f7c..622a1ccb 100644 --- a/src/LogExpert/Dialogs/GotoLineDialog.cs +++ b/src/LogExpert/Dialogs/GotoLineDialog.cs @@ -1,10 +1,5 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; using System.Drawing; -//using System.Linq; -using System.Text; using System.Windows.Forms; namespace LogExpert.Dialogs @@ -20,7 +15,11 @@ public partial class GotoLineDialog : Form public GotoLineDialog(Form parent) { InitializeComponent(); - this.Owner = parent; + + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; + + Owner = parent; } #endregion @@ -41,11 +40,11 @@ private void okButton_Click(object sender, EventArgs e) { try { - this.Line = int.Parse(this.lineNumberTextBox.Text); + Line = int.Parse(lineNumberTextBox.Text); } catch (Exception) { - this.Line = -1; + Line = -1; } } diff --git a/src/LogExpert/Dialogs/GotoLineDialog.resx b/src/LogExpert/Dialogs/GotoLineDialog.resx index ff31a6db..c7e0d4bd 100644 --- a/src/LogExpert/Dialogs/GotoLineDialog.resx +++ b/src/LogExpert/Dialogs/GotoLineDialog.resx @@ -112,9 +112,9 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 \ No newline at end of file diff --git a/src/LogExpert/Dialogs/HighlightDialog.Designer.cs b/src/LogExpert/Dialogs/HighlightDialog.Designer.cs index 4998ef43..f3c92b7a 100644 --- a/src/LogExpert/Dialogs/HighlightDialog.Designer.cs +++ b/src/LogExpert/Dialogs/HighlightDialog.Designer.cs @@ -1,4 +1,7 @@ -namespace LogExpert.Dialogs +using LogExpert.Properties; +using System.Drawing; + +namespace LogExpert.Dialogs { partial class HighlightDialog { @@ -28,742 +31,671 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); + components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HighlightDialog)); - this.listBoxHighlight = new System.Windows.Forms.ListBox(); - this.buttonAdd = new System.Windows.Forms.Button(); - this.buttonDelete = new System.Windows.Forms.Button(); - this.buttonMoveUp = new System.Windows.Forms.Button(); - this.buttonMoveDown = new System.Windows.Forms.Button(); - this.labelForgroundColor = new System.Windows.Forms.Label(); - this.labelBackgroundColor = new System.Windows.Forms.Label(); - this.buttonOk = new System.Windows.Forms.Button(); - this.buttonCancel = new System.Windows.Forms.Button(); - this.textBoxSearchString = new System.Windows.Forms.TextBox(); - this.labelSearchString = new System.Windows.Forms.Label(); - this.buttonApply = new System.Windows.Forms.Button(); - this.buttonCustomForeColor = new System.Windows.Forms.Button(); - this.buttonCustomBackColor = new System.Windows.Forms.Button(); - this.checkBoxRegex = new System.Windows.Forms.CheckBox(); - this.checkBoxCaseSensitive = new System.Windows.Forms.CheckBox(); - this.checkBoxDontDirtyLed = new System.Windows.Forms.CheckBox(); - this.groupBoxLineMatchCriteria = new System.Windows.Forms.GroupBox(); - this.groupBoxColoring = new System.Windows.Forms.GroupBox(); - this.checkBoxNoBackground = new System.Windows.Forms.CheckBox(); - this.checkBoxBold = new System.Windows.Forms.CheckBox(); - this.checkBoxWordMatch = new System.Windows.Forms.CheckBox(); - this.colorBoxForeground = new LogExpert.Dialogs.ColorComboBox(); - this.colorBoxBackground = new LogExpert.Dialogs.ColorComboBox(); - this.groupBoxActions = new System.Windows.Forms.GroupBox(); - this.buttonBookmarkComment = new System.Windows.Forms.Button(); - this.buttonPlugin = new System.Windows.Forms.Button(); - this.checkBoxPlugin = new System.Windows.Forms.CheckBox(); - this.checkBoxStopTail = new System.Windows.Forms.CheckBox(); - this.checkBoxBookmark = new System.Windows.Forms.CheckBox(); - this.helpProvider = new System.Windows.Forms.HelpProvider(); - this.groupBox4 = new System.Windows.Forms.GroupBox(); - this.buttonImportGroup = new System.Windows.Forms.Button(); - this.buttonMoveGroupDown = new System.Windows.Forms.Button(); - this.buttonMoveGroupUp = new System.Windows.Forms.Button(); - this.labelAssignNamesToGroups = new System.Windows.Forms.Label(); - this.buttonCopyGroup = new System.Windows.Forms.Button(); - this.buttonDeleteGroup = new System.Windows.Forms.Button(); - this.buttonNewGroup = new System.Windows.Forms.Button(); - this.comboBoxGroups = new System.Windows.Forms.ComboBox(); - this.toolTip = new System.Windows.Forms.ToolTip(this.components); - this.buttonExportGroup = new System.Windows.Forms.Button(); - this.groupBoxLineMatchCriteria.SuspendLayout(); - this.groupBoxColoring.SuspendLayout(); - this.groupBoxActions.SuspendLayout(); - this.groupBox4.SuspendLayout(); - this.SuspendLayout(); + listBoxHighlight = new System.Windows.Forms.ListBox(); + btnAdd = new System.Windows.Forms.Button(); + btnDelete = new System.Windows.Forms.Button(); + btnMoveUp = new System.Windows.Forms.Button(); + btnMoveDown = new System.Windows.Forms.Button(); + labelForgroundColor = new System.Windows.Forms.Label(); + labelBackgroundColor = new System.Windows.Forms.Label(); + btnOk = new System.Windows.Forms.Button(); + btnCancel = new System.Windows.Forms.Button(); + textBoxSearchString = new System.Windows.Forms.TextBox(); + labelSearchString = new System.Windows.Forms.Label(); + btnApply = new System.Windows.Forms.Button(); + btnCustomForeColor = new System.Windows.Forms.Button(); + btnCustomBackColor = new System.Windows.Forms.Button(); + checkBoxRegex = new System.Windows.Forms.CheckBox(); + checkBoxCaseSensitive = new System.Windows.Forms.CheckBox(); + checkBoxDontDirtyLed = new System.Windows.Forms.CheckBox(); + groupBoxLineMatchCriteria = new System.Windows.Forms.GroupBox(); + groupBoxColoring = new System.Windows.Forms.GroupBox(); + checkBoxNoBackground = new System.Windows.Forms.CheckBox(); + checkBoxBold = new System.Windows.Forms.CheckBox(); + checkBoxWordMatch = new System.Windows.Forms.CheckBox(); + colorBoxForeground = new ColorComboBox(); + colorBoxBackground = new ColorComboBox(); + groupBoxActions = new System.Windows.Forms.GroupBox(); + btnBookmarkComment = new System.Windows.Forms.Button(); + btnSelectPlugin = new System.Windows.Forms.Button(); + checkBoxPlugin = new System.Windows.Forms.CheckBox(); + checkBoxStopTail = new System.Windows.Forms.CheckBox(); + checkBoxBookmark = new System.Windows.Forms.CheckBox(); + helpProvider = new System.Windows.Forms.HelpProvider(); + groupBox4 = new System.Windows.Forms.GroupBox(); + btnImportGroup = new System.Windows.Forms.Button(); + btnExportGroup = new System.Windows.Forms.Button(); + btnMoveGroupDown = new System.Windows.Forms.Button(); + btnMoveGroupUp = new System.Windows.Forms.Button(); + labelAssignNamesToGroups = new System.Windows.Forms.Label(); + btnCopyGroup = new System.Windows.Forms.Button(); + btnDeleteGroup = new System.Windows.Forms.Button(); + btnNewGroup = new System.Windows.Forms.Button(); + comboBoxGroups = new System.Windows.Forms.ComboBox(); + toolTip = new System.Windows.Forms.ToolTip(components); + pnlBackground = new System.Windows.Forms.Panel(); + groupBoxLineMatchCriteria.SuspendLayout(); + groupBoxColoring.SuspendLayout(); + groupBoxActions.SuspendLayout(); + groupBox4.SuspendLayout(); + pnlBackground.SuspendLayout(); + SuspendLayout(); // // listBoxHighlight // - this.listBoxHighlight.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.listBoxHighlight.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.listBoxHighlight.FormattingEnabled = true; - this.listBoxHighlight.Location = new System.Drawing.Point(32, 160); - this.listBoxHighlight.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.listBoxHighlight.Name = "listBoxHighlight"; - this.listBoxHighlight.Size = new System.Drawing.Size(634, 264); - this.listBoxHighlight.TabIndex = 0; - this.listBoxHighlight.SelectedIndexChanged += new System.EventHandler(this.OnHighlightListBoxSelectedIndexChanged); - // - // buttonAdd - // - this.buttonAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonAdd.Location = new System.Drawing.Point(676, 218); - this.buttonAdd.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.buttonAdd.Name = "buttonAdd"; - this.buttonAdd.Size = new System.Drawing.Size(138, 35); - this.buttonAdd.TabIndex = 1; - this.buttonAdd.Text = "&Add"; - this.toolTip.SetToolTip(this.buttonAdd, "Create a new hilight item from information below"); - this.buttonAdd.UseVisualStyleBackColor = true; - this.buttonAdd.Click += new System.EventHandler(this.OnAddButtonClick); - // - // buttonDelete - // - this.buttonDelete.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonDelete.Location = new System.Drawing.Point(676, 263); - this.buttonDelete.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.buttonDelete.Name = "buttonDelete"; - this.buttonDelete.Size = new System.Drawing.Size(138, 35); - this.buttonDelete.TabIndex = 2; - this.buttonDelete.Text = "D&elete"; - this.toolTip.SetToolTip(this.buttonDelete, "Delete the current hilight"); - this.buttonDelete.UseVisualStyleBackColor = true; - this.buttonDelete.Click += new System.EventHandler(this.OnDeleteButtonClick); - // - // buttonMoveUp - // - this.buttonMoveUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonMoveUp.Location = new System.Drawing.Point(676, 160); - this.buttonMoveUp.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.buttonMoveUp.Name = "buttonMoveUp"; - this.buttonMoveUp.Size = new System.Drawing.Size(68, 35); - this.buttonMoveUp.TabIndex = 3; - this.buttonMoveUp.Text = "&Up"; - this.toolTip.SetToolTip(this.buttonMoveUp, "Move the current hilight one position up"); - this.buttonMoveUp.UseVisualStyleBackColor = true; - this.buttonMoveUp.Click += new System.EventHandler(this.OnMoveUpButtonClick); - // - // buttonMoveDown - // - this.buttonMoveDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonMoveDown.Location = new System.Drawing.Point(747, 160); - this.buttonMoveDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.buttonMoveDown.Name = "buttonMoveDown"; - this.buttonMoveDown.Size = new System.Drawing.Size(68, 35); - this.buttonMoveDown.TabIndex = 4; - this.buttonMoveDown.Text = "&Down"; - this.toolTip.SetToolTip(this.buttonMoveDown, "Move the current hilight one position down"); - this.buttonMoveDown.UseVisualStyleBackColor = true; - this.buttonMoveDown.Click += new System.EventHandler(this.OnMoveDownButtonClick); + listBoxHighlight.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + listBoxHighlight.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + listBoxHighlight.FormattingEnabled = true; + listBoxHighlight.Location = new Point(32, 160); + listBoxHighlight.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + listBoxHighlight.Name = "listBoxHighlight"; + listBoxHighlight.Size = new Size(487, 228); + listBoxHighlight.TabIndex = 0; + listBoxHighlight.SelectedIndexChanged += OnListBoxHighlightSelectedIndexChanged; + // + // btnAdd + // + btnAdd.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; + btnAdd.Location = new Point(529, 218); + btnAdd.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + btnAdd.Name = "btnAdd"; + btnAdd.Size = new Size(158, 35); + btnAdd.TabIndex = 1; + btnAdd.Text = "&Add"; + toolTip.SetToolTip(btnAdd, "Create a new hilight item from information below"); + btnAdd.UseVisualStyleBackColor = true; + btnAdd.Click += OnAddButtonClick; + // + // btnDelete + // + btnDelete.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; + btnDelete.Location = new Point(529, 263); + btnDelete.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + btnDelete.Name = "btnDelete"; + btnDelete.Size = new Size(158, 35); + btnDelete.TabIndex = 2; + btnDelete.Text = "D&elete"; + toolTip.SetToolTip(btnDelete, "Delete the current hilight"); + btnDelete.UseVisualStyleBackColor = true; + btnDelete.Click += OnDeleteButtonClick; + // + // btnMoveUp + // + btnMoveUp.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; + btnMoveUp.Location = new Point(529, 160); + btnMoveUp.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + btnMoveUp.Name = "btnMoveUp"; + btnMoveUp.Size = new Size(75, 35); + btnMoveUp.TabIndex = 3; + btnMoveUp.Text = "&Up"; + toolTip.SetToolTip(btnMoveUp, "Move the current hilight one position up"); + btnMoveUp.UseVisualStyleBackColor = true; + btnMoveUp.Click += OnBtnMoveUpClick; + // + // btnMoveDown + // + btnMoveDown.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; + btnMoveDown.Location = new Point(612, 160); + btnMoveDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + btnMoveDown.Name = "btnMoveDown"; + btnMoveDown.Size = new Size(75, 35); + btnMoveDown.TabIndex = 4; + btnMoveDown.Text = "&Down"; + toolTip.SetToolTip(btnMoveDown, "Move the current hilight one position down"); + btnMoveDown.UseVisualStyleBackColor = true; + btnMoveDown.Click += OnBtnMoveDownClick; // // labelForgroundColor // - this.labelForgroundColor.AutoSize = true; - this.labelForgroundColor.Location = new System.Drawing.Point(9, 38); - this.labelForgroundColor.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.labelForgroundColor.Name = "labelForgroundColor"; - this.labelForgroundColor.Size = new System.Drawing.Size(130, 20); - this.labelForgroundColor.TabIndex = 6; - this.labelForgroundColor.Text = "Foreground color"; + labelForgroundColor.AutoSize = true; + labelForgroundColor.Location = new Point(9, 38); + labelForgroundColor.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + labelForgroundColor.Name = "labelForgroundColor"; + labelForgroundColor.Size = new Size(99, 15); + labelForgroundColor.TabIndex = 6; + labelForgroundColor.Text = "Foreground color"; // // labelBackgroundColor // - this.labelBackgroundColor.AutoSize = true; - this.labelBackgroundColor.Location = new System.Drawing.Point(9, 115); - this.labelBackgroundColor.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.labelBackgroundColor.Name = "labelBackgroundColor"; - this.labelBackgroundColor.Size = new System.Drawing.Size(133, 20); - this.labelBackgroundColor.TabIndex = 8; - this.labelBackgroundColor.Text = "Background color"; - // - // buttonOk - // - this.buttonOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK; - this.buttonOk.Location = new System.Drawing.Point(596, 849); - this.buttonOk.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.buttonOk.Name = "buttonOk"; - this.buttonOk.Size = new System.Drawing.Size(112, 35); - this.buttonOk.TabIndex = 9; - this.buttonOk.Text = "OK"; - this.buttonOk.UseVisualStyleBackColor = true; - this.buttonOk.Click += new System.EventHandler(this.OnOkButtonClick); - // - // buttonCancel - // - this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(723, 849); - this.buttonCancel.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.buttonCancel.Name = "buttonCancel"; - this.buttonCancel.Size = new System.Drawing.Size(112, 35); - this.buttonCancel.TabIndex = 10; - this.buttonCancel.Text = "Cancel"; - this.buttonCancel.UseVisualStyleBackColor = true; + labelBackgroundColor.AutoSize = true; + labelBackgroundColor.Location = new Point(9, 115); + labelBackgroundColor.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + labelBackgroundColor.Name = "labelBackgroundColor"; + labelBackgroundColor.Size = new Size(101, 15); + labelBackgroundColor.TabIndex = 8; + labelBackgroundColor.Text = "Background color"; + // + // btnOk + // + btnOk.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + btnOk.DialogResult = System.Windows.Forms.DialogResult.OK; + btnOk.Location = new Point(449, 832); + btnOk.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + btnOk.Name = "btnOk"; + btnOk.Size = new Size(112, 35); + btnOk.TabIndex = 9; + btnOk.Text = "OK"; + btnOk.UseVisualStyleBackColor = true; + btnOk.Click += OnBtnOkClick; + // + // btnCancel + // + btnCancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + btnCancel.Location = new Point(576, 832); + btnCancel.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + btnCancel.Name = "btnCancel"; + btnCancel.Size = new Size(112, 35); + btnCancel.TabIndex = 10; + btnCancel.Text = "Cancel"; + btnCancel.UseVisualStyleBackColor = true; // // textBoxSearchString // - this.textBoxSearchString.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxSearchString.Location = new System.Drawing.Point(9, 55); - this.textBoxSearchString.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.textBoxSearchString.Name = "textBoxSearchString"; - this.textBoxSearchString.Size = new System.Drawing.Size(786, 26); - this.textBoxSearchString.TabIndex = 11; - this.textBoxSearchString.TextChanged += new System.EventHandler(this.ChangeToDirty); + textBoxSearchString.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + textBoxSearchString.Location = new Point(9, 55); + textBoxSearchString.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + textBoxSearchString.Name = "textBoxSearchString"; + textBoxSearchString.Size = new Size(639, 23); + textBoxSearchString.TabIndex = 11; + textBoxSearchString.TextChanged += ChangeToDirty; // // labelSearchString // - this.labelSearchString.AutoSize = true; - this.labelSearchString.Location = new System.Drawing.Point(9, 31); - this.labelSearchString.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.labelSearchString.Name = "labelSearchString"; - this.labelSearchString.Size = new System.Drawing.Size(107, 20); - this.labelSearchString.TabIndex = 12; - this.labelSearchString.Text = "Search string:"; - // - // buttonApply - // - this.buttonApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonApply.Enabled = false; - this.buttonApply.Image = global::LogExpert.Properties.Resources.AdvancedIcon2; - this.buttonApply.ImageAlign = System.Drawing.ContentAlignment.BottomRight; - this.buttonApply.Location = new System.Drawing.Point(676, 308); - this.buttonApply.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.buttonApply.Name = "buttonApply"; - this.buttonApply.Size = new System.Drawing.Size(138, 35); - this.buttonApply.TabIndex = 13; - this.buttonApply.Text = "A&pply"; - this.toolTip.SetToolTip(this.buttonApply, "Apply changes below to current hiligth"); - this.buttonApply.UseVisualStyleBackColor = true; - this.buttonApply.Click += new System.EventHandler(this.OnApplyButtonClick); - // - // buttonCustomForeColor - // - this.buttonCustomForeColor.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonCustomForeColor.Location = new System.Drawing.Point(394, 60); - this.buttonCustomForeColor.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.buttonCustomForeColor.Name = "buttonCustomForeColor"; - this.buttonCustomForeColor.Size = new System.Drawing.Size(78, 35); - this.buttonCustomForeColor.TabIndex = 14; - this.buttonCustomForeColor.Text = "Custom"; - this.toolTip.SetToolTip(this.buttonCustomForeColor, "Pick a custom foreground color"); - this.buttonCustomForeColor.UseVisualStyleBackColor = true; - this.buttonCustomForeColor.Click += new System.EventHandler(this.OnCustomForeColorButtonClick); - // - // buttonCustomBackColor - // - this.buttonCustomBackColor.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonCustomBackColor.Location = new System.Drawing.Point(394, 137); - this.buttonCustomBackColor.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.buttonCustomBackColor.Name = "buttonCustomBackColor"; - this.buttonCustomBackColor.Size = new System.Drawing.Size(78, 35); - this.buttonCustomBackColor.TabIndex = 15; - this.buttonCustomBackColor.Text = "Custom"; - this.toolTip.SetToolTip(this.buttonCustomBackColor, "Pick a custom background color"); - this.buttonCustomBackColor.UseVisualStyleBackColor = true; - this.buttonCustomBackColor.Click += new System.EventHandler(this.OnCustomBackColorButtonClick); + labelSearchString.AutoSize = true; + labelSearchString.Location = new Point(9, 31); + labelSearchString.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + labelSearchString.Name = "labelSearchString"; + labelSearchString.Size = new Size(78, 15); + labelSearchString.TabIndex = 12; + labelSearchString.Text = "Search string:"; + // + // btnApply + // + btnApply.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; + btnApply.Enabled = false; + btnApply.Image = (Image)resources.GetObject("btnApply.Image"); + btnApply.ImageAlign = ContentAlignment.MiddleRight; + btnApply.Location = new Point(529, 308); + btnApply.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + btnApply.Name = "btnApply"; + btnApply.Size = new Size(158, 35); + btnApply.TabIndex = 13; + btnApply.Text = "A&pply"; + toolTip.SetToolTip(btnApply, "Apply changes below to current hiligth"); + btnApply.UseVisualStyleBackColor = true; + btnApply.Click += OnBtnApplyClick; + // + // btnCustomForeColor + // + btnCustomForeColor.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; + btnCustomForeColor.Location = new Point(247, 60); + btnCustomForeColor.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + btnCustomForeColor.Name = "btnCustomForeColor"; + btnCustomForeColor.Size = new Size(78, 35); + btnCustomForeColor.TabIndex = 14; + btnCustomForeColor.Text = "Custom"; + toolTip.SetToolTip(btnCustomForeColor, "Pick a custom foreground color"); + btnCustomForeColor.UseVisualStyleBackColor = true; + btnCustomForeColor.Click += OnBtnCustomForeColorClick; + // + // btnCustomBackColor + // + btnCustomBackColor.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; + btnCustomBackColor.Location = new Point(247, 137); + btnCustomBackColor.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + btnCustomBackColor.Name = "btnCustomBackColor"; + btnCustomBackColor.Size = new Size(78, 35); + btnCustomBackColor.TabIndex = 15; + btnCustomBackColor.Text = "Custom"; + toolTip.SetToolTip(btnCustomBackColor, "Pick a custom background color"); + btnCustomBackColor.UseVisualStyleBackColor = true; + btnCustomBackColor.Click += OnBtnCustomBackColorClick; // // checkBoxRegex // - this.checkBoxRegex.AutoSize = true; - this.checkBoxRegex.Location = new System.Drawing.Point(180, 95); - this.checkBoxRegex.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.checkBoxRegex.Name = "checkBoxRegex"; - this.checkBoxRegex.Size = new System.Drawing.Size(83, 24); - this.checkBoxRegex.TabIndex = 16; - this.checkBoxRegex.Text = "RegEx"; - this.toolTip.SetToolTip(this.checkBoxRegex, "Whether the string is a regular expresion"); - this.checkBoxRegex.UseVisualStyleBackColor = true; - this.checkBoxRegex.CheckedChanged += new System.EventHandler(this.ChangeToDirty); - this.checkBoxRegex.MouseUp += new System.Windows.Forms.MouseEventHandler(this.OnRegexCheckBoxMouseUp); + checkBoxRegex.AutoSize = true; + checkBoxRegex.Location = new Point(180, 95); + checkBoxRegex.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + checkBoxRegex.Name = "checkBoxRegex"; + checkBoxRegex.Size = new Size(57, 19); + checkBoxRegex.TabIndex = 16; + checkBoxRegex.Text = "RegEx"; + toolTip.SetToolTip(checkBoxRegex, "Whether the string is a regular expresion"); + checkBoxRegex.UseVisualStyleBackColor = true; + checkBoxRegex.CheckedChanged += ChangeToDirty; + checkBoxRegex.MouseUp += OnChkBoxRegexMouseUp; // // checkBoxCaseSensitive // - this.checkBoxCaseSensitive.AutoSize = true; - this.checkBoxCaseSensitive.Location = new System.Drawing.Point(14, 95); - this.checkBoxCaseSensitive.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.checkBoxCaseSensitive.Name = "checkBoxCaseSensitive"; - this.checkBoxCaseSensitive.Size = new System.Drawing.Size(137, 24); - this.checkBoxCaseSensitive.TabIndex = 17; - this.checkBoxCaseSensitive.Text = "Case sensitive"; - this.toolTip.SetToolTip(this.checkBoxCaseSensitive, "Whether the string will match uppercases and lowercases"); - this.checkBoxCaseSensitive.UseVisualStyleBackColor = true; - this.checkBoxCaseSensitive.CheckedChanged += new System.EventHandler(this.ChangeToDirty); + checkBoxCaseSensitive.AutoSize = true; + checkBoxCaseSensitive.Location = new Point(14, 95); + checkBoxCaseSensitive.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + checkBoxCaseSensitive.Name = "checkBoxCaseSensitive"; + checkBoxCaseSensitive.Size = new Size(99, 19); + checkBoxCaseSensitive.TabIndex = 17; + checkBoxCaseSensitive.Text = "Case sensitive"; + toolTip.SetToolTip(checkBoxCaseSensitive, "Whether the string will match uppercases and lowercases"); + checkBoxCaseSensitive.UseVisualStyleBackColor = true; + checkBoxCaseSensitive.CheckedChanged += ChangeToDirty; // // checkBoxDontDirtyLed // - this.checkBoxDontDirtyLed.AutoSize = true; - this.checkBoxDontDirtyLed.Location = new System.Drawing.Point(15, 38); - this.checkBoxDontDirtyLed.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.checkBoxDontDirtyLed.Name = "checkBoxDontDirtyLed"; - this.checkBoxDontDirtyLed.Size = new System.Drawing.Size(157, 24); - this.checkBoxDontDirtyLed.TabIndex = 18; - this.checkBoxDontDirtyLed.Text = "Don\'t lit dirty LED"; - this.toolTip.SetToolTip(this.checkBoxDontDirtyLed, "When matching a line, don\'t mark the page as \"dirty\""); - this.checkBoxDontDirtyLed.UseVisualStyleBackColor = true; - this.checkBoxDontDirtyLed.CheckedChanged += new System.EventHandler(this.ChangeToDirty); + checkBoxDontDirtyLed.AutoSize = true; + checkBoxDontDirtyLed.Location = new Point(15, 38); + checkBoxDontDirtyLed.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + checkBoxDontDirtyLed.Name = "checkBoxDontDirtyLed"; + checkBoxDontDirtyLed.Size = new Size(118, 19); + checkBoxDontDirtyLed.TabIndex = 18; + checkBoxDontDirtyLed.Text = "Don't lit dirty LED"; + toolTip.SetToolTip(checkBoxDontDirtyLed, "When matching a line, don't mark the page as \"dirty\""); + checkBoxDontDirtyLed.UseVisualStyleBackColor = true; + checkBoxDontDirtyLed.CheckedChanged += ChangeToDirty; // // groupBoxLineMatchCriteria // - this.groupBoxLineMatchCriteria.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBoxLineMatchCriteria.Controls.Add(this.textBoxSearchString); - this.groupBoxLineMatchCriteria.Controls.Add(this.labelSearchString); - this.groupBoxLineMatchCriteria.Controls.Add(this.checkBoxRegex); - this.groupBoxLineMatchCriteria.Controls.Add(this.checkBoxCaseSensitive); - this.groupBoxLineMatchCriteria.Location = new System.Drawing.Point(18, 454); - this.groupBoxLineMatchCriteria.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.groupBoxLineMatchCriteria.Name = "groupBoxLineMatchCriteria"; - this.groupBoxLineMatchCriteria.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.groupBoxLineMatchCriteria.Size = new System.Drawing.Size(818, 135); - this.groupBoxLineMatchCriteria.TabIndex = 19; - this.groupBoxLineMatchCriteria.TabStop = false; - this.groupBoxLineMatchCriteria.Text = "Line match criteria"; + groupBoxLineMatchCriteria.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + groupBoxLineMatchCriteria.Controls.Add(textBoxSearchString); + groupBoxLineMatchCriteria.Controls.Add(labelSearchString); + groupBoxLineMatchCriteria.Controls.Add(checkBoxRegex); + groupBoxLineMatchCriteria.Controls.Add(checkBoxCaseSensitive); + groupBoxLineMatchCriteria.Location = new Point(18, 437); + groupBoxLineMatchCriteria.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + groupBoxLineMatchCriteria.Name = "groupBoxLineMatchCriteria"; + groupBoxLineMatchCriteria.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + groupBoxLineMatchCriteria.Size = new Size(671, 135); + groupBoxLineMatchCriteria.TabIndex = 19; + groupBoxLineMatchCriteria.TabStop = false; + groupBoxLineMatchCriteria.Text = "Line match criteria"; // // groupBoxColoring // - this.groupBoxColoring.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBoxColoring.Controls.Add(this.checkBoxNoBackground); - this.groupBoxColoring.Controls.Add(this.checkBoxBold); - this.groupBoxColoring.Controls.Add(this.checkBoxWordMatch); - this.groupBoxColoring.Controls.Add(this.labelForgroundColor); - this.groupBoxColoring.Controls.Add(this.colorBoxForeground); - this.groupBoxColoring.Controls.Add(this.buttonCustomForeColor); - this.groupBoxColoring.Controls.Add(this.buttonCustomBackColor); - this.groupBoxColoring.Controls.Add(this.labelBackgroundColor); - this.groupBoxColoring.Controls.Add(this.colorBoxBackground); - this.groupBoxColoring.Location = new System.Drawing.Point(18, 598); - this.groupBoxColoring.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.groupBoxColoring.Name = "groupBoxColoring"; - this.groupBoxColoring.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.groupBoxColoring.Size = new System.Drawing.Size(496, 286); - this.groupBoxColoring.TabIndex = 20; - this.groupBoxColoring.TabStop = false; - this.groupBoxColoring.Text = "Coloring"; + groupBoxColoring.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + groupBoxColoring.Controls.Add(checkBoxNoBackground); + groupBoxColoring.Controls.Add(checkBoxBold); + groupBoxColoring.Controls.Add(checkBoxWordMatch); + groupBoxColoring.Controls.Add(labelForgroundColor); + groupBoxColoring.Controls.Add(colorBoxForeground); + groupBoxColoring.Controls.Add(btnCustomForeColor); + groupBoxColoring.Controls.Add(btnCustomBackColor); + groupBoxColoring.Controls.Add(labelBackgroundColor); + groupBoxColoring.Controls.Add(colorBoxBackground); + groupBoxColoring.Location = new Point(18, 581); + groupBoxColoring.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + groupBoxColoring.Name = "groupBoxColoring"; + groupBoxColoring.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + groupBoxColoring.Size = new Size(349, 286); + groupBoxColoring.TabIndex = 20; + groupBoxColoring.TabStop = false; + groupBoxColoring.Text = "Coloring"; // // checkBoxNoBackground // - this.checkBoxNoBackground.AutoSize = true; - this.checkBoxNoBackground.Enabled = false; - this.checkBoxNoBackground.Location = new System.Drawing.Point(141, 240); - this.checkBoxNoBackground.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.checkBoxNoBackground.Name = "checkBoxNoBackground"; - this.checkBoxNoBackground.Size = new System.Drawing.Size(145, 24); - this.checkBoxNoBackground.TabIndex = 18; - this.checkBoxNoBackground.Text = "No Background"; - this.toolTip.SetToolTip(this.checkBoxNoBackground, "Don\'t set the background color"); - this.checkBoxNoBackground.UseVisualStyleBackColor = true; - this.checkBoxNoBackground.CheckedChanged += new System.EventHandler(this.OnNoBackgroundCheckBoxCheckedChanged); + checkBoxNoBackground.AutoSize = true; + checkBoxNoBackground.Enabled = false; + checkBoxNoBackground.Location = new Point(141, 240); + checkBoxNoBackground.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + checkBoxNoBackground.Name = "checkBoxNoBackground"; + checkBoxNoBackground.Size = new Size(109, 19); + checkBoxNoBackground.TabIndex = 18; + checkBoxNoBackground.Text = "No Background"; + toolTip.SetToolTip(checkBoxNoBackground, "Don't set the background color"); + checkBoxNoBackground.UseVisualStyleBackColor = true; + checkBoxNoBackground.CheckedChanged += OnChkBoxNoBackgroundCheckedChanged; // // checkBoxBold // - this.checkBoxBold.AutoSize = true; - this.checkBoxBold.Location = new System.Drawing.Point(9, 205); - this.checkBoxBold.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.checkBoxBold.Name = "checkBoxBold"; - this.checkBoxBold.Size = new System.Drawing.Size(67, 24); - this.checkBoxBold.TabIndex = 17; - this.checkBoxBold.Text = "Bold"; - this.toolTip.SetToolTip(this.checkBoxBold, "Display the line in bold characters"); - this.checkBoxBold.UseVisualStyleBackColor = true; - this.checkBoxBold.CheckedChanged += new System.EventHandler(this.OnBoldCheckBoxCheckedChanged); + checkBoxBold.AutoSize = true; + checkBoxBold.Location = new Point(9, 205); + checkBoxBold.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + checkBoxBold.Name = "checkBoxBold"; + checkBoxBold.Size = new Size(50, 19); + checkBoxBold.TabIndex = 17; + checkBoxBold.Text = "Bold"; + toolTip.SetToolTip(checkBoxBold, "Display the line in bold characters"); + checkBoxBold.UseVisualStyleBackColor = true; + checkBoxBold.CheckedChanged += OnChkBoxBoldCheckedChanged; // // checkBoxWordMatch // - this.checkBoxWordMatch.AutoSize = true; - this.checkBoxWordMatch.Location = new System.Drawing.Point(9, 240); - this.checkBoxWordMatch.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.checkBoxWordMatch.Name = "checkBoxWordMatch"; - this.checkBoxWordMatch.Size = new System.Drawing.Size(117, 24); - this.checkBoxWordMatch.TabIndex = 16; - this.checkBoxWordMatch.Text = "Word mode"; - this.toolTip.SetToolTip(this.checkBoxWordMatch, "Don\'t highlight the whole line but only the matching keywords"); - this.checkBoxWordMatch.UseVisualStyleBackColor = true; - this.checkBoxWordMatch.CheckedChanged += new System.EventHandler(this.OnWordMatchCheckBoxCheckedChanged); + checkBoxWordMatch.AutoSize = true; + checkBoxWordMatch.Location = new Point(9, 240); + checkBoxWordMatch.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + checkBoxWordMatch.Name = "checkBoxWordMatch"; + checkBoxWordMatch.Size = new Size(89, 19); + checkBoxWordMatch.TabIndex = 16; + checkBoxWordMatch.Text = "Word mode"; + toolTip.SetToolTip(checkBoxWordMatch, "Don't highlight the whole line but only the matching keywords"); + checkBoxWordMatch.UseVisualStyleBackColor = true; + checkBoxWordMatch.CheckedChanged += OnChkBoxWordMatchCheckedChanged; // // colorBoxForeground // - this.colorBoxForeground.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.colorBoxForeground.CustomColor = System.Drawing.Color.Black; - this.colorBoxForeground.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.colorBoxForeground.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.colorBoxForeground.FormattingEnabled = true; - this.colorBoxForeground.Items.AddRange(new object[] { - System.Drawing.Color.Black, - System.Drawing.Color.Black, - System.Drawing.Color.White, - System.Drawing.Color.Gray, - System.Drawing.Color.DarkGray, - System.Drawing.Color.Blue, - System.Drawing.Color.LightBlue, - System.Drawing.Color.DarkBlue, - System.Drawing.Color.Green, - System.Drawing.Color.LightGreen, - System.Drawing.Color.DarkGreen, - System.Drawing.Color.Olive, - System.Drawing.Color.Red, - System.Drawing.Color.Pink, - System.Drawing.Color.Purple, - System.Drawing.Color.IndianRed, - System.Drawing.Color.DarkCyan, - System.Drawing.Color.Yellow, - System.Drawing.Color.Black, - System.Drawing.Color.Black, - System.Drawing.Color.White, - System.Drawing.Color.Gray, - System.Drawing.Color.DarkGray, - System.Drawing.Color.Blue, - System.Drawing.Color.LightBlue, - System.Drawing.Color.DarkBlue, - System.Drawing.Color.Green, - System.Drawing.Color.LightGreen, - System.Drawing.Color.DarkGreen, - System.Drawing.Color.Olive, - System.Drawing.Color.Red, - System.Drawing.Color.Pink, - System.Drawing.Color.Purple, - System.Drawing.Color.IndianRed, - System.Drawing.Color.DarkCyan, - System.Drawing.Color.Yellow}); - this.colorBoxForeground.Location = new System.Drawing.Point(8, 63); - this.colorBoxForeground.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.colorBoxForeground.Name = "colorBoxForeground"; - this.colorBoxForeground.Size = new System.Drawing.Size(376, 27); - this.colorBoxForeground.TabIndex = 5; - this.colorBoxForeground.SelectedIndexChanged += new System.EventHandler(this.ChangeToDirty); + colorBoxForeground.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + colorBoxForeground.CustomColor = Color.Black; + colorBoxForeground.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + colorBoxForeground.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + colorBoxForeground.FormattingEnabled = true; + colorBoxForeground.Items.AddRange(new object[] { Color.Black, Color.Black, Color.White, Color.Gray, Color.DarkGray, Color.Blue, Color.LightBlue, Color.DarkBlue, Color.Green, Color.LightGreen, Color.DarkGreen, Color.Olive, Color.Red, Color.Pink, Color.Purple, Color.IndianRed, Color.DarkCyan, Color.Yellow, Color.Black, Color.Black, Color.White, Color.Gray, Color.DarkGray, Color.Blue, Color.LightBlue, Color.DarkBlue, Color.Green, Color.LightGreen, Color.DarkGreen, Color.Olive, Color.Red, Color.Pink, Color.Purple, Color.IndianRed, Color.DarkCyan, Color.Yellow, Color.Black, Color.Black, Color.White, Color.Gray, Color.DarkGray, Color.Blue, Color.LightBlue, Color.DarkBlue, Color.Green, Color.LightGreen, Color.DarkGreen, Color.Olive, Color.Red, Color.Pink, Color.Purple, Color.IndianRed, Color.DarkCyan, Color.Yellow, Color.Black, Color.Black, Color.White, Color.Gray, Color.DarkGray, Color.Blue, Color.LightBlue, Color.DarkBlue, Color.Green, Color.LightGreen, Color.DarkGreen, Color.Olive, Color.Red, Color.Pink, Color.Purple, Color.IndianRed, Color.DarkCyan, Color.Yellow }); + colorBoxForeground.Location = new Point(8, 63); + colorBoxForeground.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + colorBoxForeground.Name = "colorBoxForeground"; + colorBoxForeground.Size = new Size(229, 24); + colorBoxForeground.TabIndex = 5; + colorBoxForeground.SelectedIndexChanged += ChangeToDirty; // // colorBoxBackground // - this.colorBoxBackground.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.colorBoxBackground.CustomColor = System.Drawing.Color.Black; - this.colorBoxBackground.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.colorBoxBackground.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.colorBoxBackground.FormattingEnabled = true; - this.colorBoxBackground.Items.AddRange(new object[] { - System.Drawing.Color.Black, - System.Drawing.Color.Black, - System.Drawing.Color.White, - System.Drawing.Color.Gray, - System.Drawing.Color.DarkGray, - System.Drawing.Color.Blue, - System.Drawing.Color.LightBlue, - System.Drawing.Color.DarkBlue, - System.Drawing.Color.Green, - System.Drawing.Color.LightGreen, - System.Drawing.Color.DarkGreen, - System.Drawing.Color.Olive, - System.Drawing.Color.Red, - System.Drawing.Color.Pink, - System.Drawing.Color.Purple, - System.Drawing.Color.IndianRed, - System.Drawing.Color.DarkCyan, - System.Drawing.Color.Yellow, - System.Drawing.Color.Black, - System.Drawing.Color.Black, - System.Drawing.Color.White, - System.Drawing.Color.Gray, - System.Drawing.Color.DarkGray, - System.Drawing.Color.Blue, - System.Drawing.Color.LightBlue, - System.Drawing.Color.DarkBlue, - System.Drawing.Color.Green, - System.Drawing.Color.LightGreen, - System.Drawing.Color.DarkGreen, - System.Drawing.Color.Olive, - System.Drawing.Color.Red, - System.Drawing.Color.Pink, - System.Drawing.Color.Purple, - System.Drawing.Color.IndianRed, - System.Drawing.Color.DarkCyan, - System.Drawing.Color.Yellow}); - this.colorBoxBackground.Location = new System.Drawing.Point(9, 140); - this.colorBoxBackground.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.colorBoxBackground.Name = "colorBoxBackground"; - this.colorBoxBackground.Size = new System.Drawing.Size(376, 27); - this.colorBoxBackground.TabIndex = 7; - this.colorBoxBackground.SelectedIndexChanged += new System.EventHandler(this.ChangeToDirty); + colorBoxBackground.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + colorBoxBackground.CustomColor = Color.Black; + colorBoxBackground.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + colorBoxBackground.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + colorBoxBackground.FormattingEnabled = true; + colorBoxBackground.Items.AddRange(new object[] { Color.Black, Color.Black, Color.White, Color.Gray, Color.DarkGray, Color.Blue, Color.LightBlue, Color.DarkBlue, Color.Green, Color.LightGreen, Color.DarkGreen, Color.Olive, Color.Red, Color.Pink, Color.Purple, Color.IndianRed, Color.DarkCyan, Color.Yellow, Color.Black, Color.Black, Color.White, Color.Gray, Color.DarkGray, Color.Blue, Color.LightBlue, Color.DarkBlue, Color.Green, Color.LightGreen, Color.DarkGreen, Color.Olive, Color.Red, Color.Pink, Color.Purple, Color.IndianRed, Color.DarkCyan, Color.Yellow, Color.Black, Color.Black, Color.White, Color.Gray, Color.DarkGray, Color.Blue, Color.LightBlue, Color.DarkBlue, Color.Green, Color.LightGreen, Color.DarkGreen, Color.Olive, Color.Red, Color.Pink, Color.Purple, Color.IndianRed, Color.DarkCyan, Color.Yellow, Color.Black, Color.Black, Color.White, Color.Gray, Color.DarkGray, Color.Blue, Color.LightBlue, Color.DarkBlue, Color.Green, Color.LightGreen, Color.DarkGreen, Color.Olive, Color.Red, Color.Pink, Color.Purple, Color.IndianRed, Color.DarkCyan, Color.Yellow }); + colorBoxBackground.Location = new Point(9, 140); + colorBoxBackground.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + colorBoxBackground.Name = "colorBoxBackground"; + colorBoxBackground.Size = new Size(229, 24); + colorBoxBackground.TabIndex = 7; + colorBoxBackground.SelectedIndexChanged += ChangeToDirty; // // groupBoxActions // - this.groupBoxActions.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.groupBoxActions.Controls.Add(this.buttonBookmarkComment); - this.groupBoxActions.Controls.Add(this.buttonPlugin); - this.groupBoxActions.Controls.Add(this.checkBoxPlugin); - this.groupBoxActions.Controls.Add(this.checkBoxStopTail); - this.groupBoxActions.Controls.Add(this.checkBoxBookmark); - this.groupBoxActions.Controls.Add(this.checkBoxDontDirtyLed); - this.groupBoxActions.Location = new System.Drawing.Point(524, 598); - this.groupBoxActions.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.groupBoxActions.Name = "groupBoxActions"; - this.groupBoxActions.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.groupBoxActions.Size = new System.Drawing.Size(312, 195); - this.groupBoxActions.TabIndex = 21; - this.groupBoxActions.TabStop = false; - this.groupBoxActions.Text = "Actions"; - // - // buttonBookmarkComment - // - this.buttonBookmarkComment.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonBookmarkComment.Location = new System.Drawing.Point(210, 69); - this.buttonBookmarkComment.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.buttonBookmarkComment.Name = "buttonBookmarkComment"; - this.buttonBookmarkComment.Size = new System.Drawing.Size(81, 31); - this.buttonBookmarkComment.TabIndex = 23; - this.buttonBookmarkComment.Text = "Text..."; - this.buttonBookmarkComment.UseVisualStyleBackColor = true; - this.buttonBookmarkComment.Click += new System.EventHandler(this.OnBookmarkCommentButtonClick); - // - // buttonPlugin - // - this.buttonPlugin.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonPlugin.Location = new System.Drawing.Point(210, 143); - this.buttonPlugin.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.buttonPlugin.Name = "buttonPlugin"; - this.buttonPlugin.Size = new System.Drawing.Size(81, 31); - this.buttonPlugin.TabIndex = 22; - this.buttonPlugin.Text = "Select..."; - this.buttonPlugin.UseVisualStyleBackColor = true; - this.buttonPlugin.Click += new System.EventHandler(this.OnPluginButtonClick); + groupBoxActions.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + groupBoxActions.Controls.Add(btnBookmarkComment); + groupBoxActions.Controls.Add(btnSelectPlugin); + groupBoxActions.Controls.Add(checkBoxPlugin); + groupBoxActions.Controls.Add(checkBoxStopTail); + groupBoxActions.Controls.Add(checkBoxBookmark); + groupBoxActions.Controls.Add(checkBoxDontDirtyLed); + groupBoxActions.Location = new Point(377, 581); + groupBoxActions.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + groupBoxActions.Name = "groupBoxActions"; + groupBoxActions.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + groupBoxActions.Size = new Size(312, 195); + groupBoxActions.TabIndex = 21; + groupBoxActions.TabStop = false; + groupBoxActions.Text = "Actions"; + // + // btnBookmarkComment + // + btnBookmarkComment.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; + btnBookmarkComment.Location = new Point(210, 69); + btnBookmarkComment.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + btnBookmarkComment.Name = "btnBookmarkComment"; + btnBookmarkComment.Size = new Size(81, 31); + btnBookmarkComment.TabIndex = 23; + btnBookmarkComment.Text = "Text..."; + btnBookmarkComment.UseVisualStyleBackColor = true; + btnBookmarkComment.Click += OnBtnBookmarkCommentClick; + // + // btnSelectPlugin + // + btnSelectPlugin.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; + btnSelectPlugin.Location = new Point(210, 143); + btnSelectPlugin.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + btnSelectPlugin.Name = "btnSelectPlugin"; + btnSelectPlugin.Size = new Size(81, 31); + btnSelectPlugin.TabIndex = 22; + btnSelectPlugin.Text = "Select..."; + btnSelectPlugin.UseVisualStyleBackColor = true; + btnSelectPlugin.Click += OnPluginButtonClick; // // checkBoxPlugin // - this.checkBoxPlugin.AutoSize = true; - this.checkBoxPlugin.Location = new System.Drawing.Point(15, 148); - this.checkBoxPlugin.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.checkBoxPlugin.Name = "checkBoxPlugin"; - this.checkBoxPlugin.Size = new System.Drawing.Size(78, 24); - this.checkBoxPlugin.TabIndex = 21; - this.checkBoxPlugin.Text = "Plugin"; - this.toolTip.SetToolTip(this.checkBoxPlugin, "When matching a line, call a keyword action plugin"); - this.checkBoxPlugin.UseVisualStyleBackColor = true; - this.checkBoxPlugin.CheckedChanged += new System.EventHandler(this.OnPluginCheckBoxCheckedChanged); + checkBoxPlugin.AutoSize = true; + checkBoxPlugin.Location = new Point(15, 148); + checkBoxPlugin.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + checkBoxPlugin.Name = "checkBoxPlugin"; + checkBoxPlugin.Size = new Size(60, 19); + checkBoxPlugin.TabIndex = 21; + checkBoxPlugin.Text = "Plugin"; + toolTip.SetToolTip(checkBoxPlugin, "When matching a line, call a keyword action plugin"); + checkBoxPlugin.UseVisualStyleBackColor = true; + checkBoxPlugin.CheckedChanged += OnChkBoxPluginCheckedChanged; // // checkBoxStopTail // - this.checkBoxStopTail.AutoSize = true; - this.checkBoxStopTail.Location = new System.Drawing.Point(15, 111); - this.checkBoxStopTail.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.checkBoxStopTail.Name = "checkBoxStopTail"; - this.checkBoxStopTail.Size = new System.Drawing.Size(146, 24); - this.checkBoxStopTail.TabIndex = 20; - this.checkBoxStopTail.Text = "Stop Follow Tail"; - this.toolTip.SetToolTip(this.checkBoxStopTail, "When matching a line, stop automatic scrolling"); - this.checkBoxStopTail.UseVisualStyleBackColor = true; - this.checkBoxStopTail.CheckedChanged += new System.EventHandler(this.ChangeToDirty); + checkBoxStopTail.AutoSize = true; + checkBoxStopTail.Location = new Point(15, 111); + checkBoxStopTail.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + checkBoxStopTail.Name = "checkBoxStopTail"; + checkBoxStopTail.Size = new Size(109, 19); + checkBoxStopTail.TabIndex = 20; + checkBoxStopTail.Text = "Stop Follow Tail"; + toolTip.SetToolTip(checkBoxStopTail, "When matching a line, stop automatic scrolling"); + checkBoxStopTail.UseVisualStyleBackColor = true; + checkBoxStopTail.CheckedChanged += ChangeToDirty; // // checkBoxBookmark // - this.checkBoxBookmark.AutoSize = true; - this.checkBoxBookmark.Location = new System.Drawing.Point(15, 74); - this.checkBoxBookmark.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.checkBoxBookmark.Name = "checkBoxBookmark"; - this.checkBoxBookmark.Size = new System.Drawing.Size(134, 24); - this.checkBoxBookmark.TabIndex = 19; - this.checkBoxBookmark.Text = "Set bookmark"; - this.toolTip.SetToolTip(this.checkBoxBookmark, "When matching a line, create a new bookmark for it"); - this.checkBoxBookmark.UseVisualStyleBackColor = true; - this.checkBoxBookmark.CheckedChanged += new System.EventHandler(this.ChangeToDirty); + checkBoxBookmark.AutoSize = true; + checkBoxBookmark.Location = new Point(15, 74); + checkBoxBookmark.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + checkBoxBookmark.Name = "checkBoxBookmark"; + checkBoxBookmark.Size = new Size(99, 19); + checkBoxBookmark.TabIndex = 19; + checkBoxBookmark.Text = "Set bookmark"; + toolTip.SetToolTip(checkBoxBookmark, "When matching a line, create a new bookmark for it"); + checkBoxBookmark.UseVisualStyleBackColor = true; + checkBoxBookmark.CheckedChanged += ChangeToDirty; // // helpProvider // - this.helpProvider.HelpNamespace = "LogExpert.chm"; - this.helpProvider.Tag = ""; + helpProvider.HelpNamespace = "LogExpert.chm"; + helpProvider.Tag = ""; // // groupBox4 // - this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox4.Controls.Add(this.buttonImportGroup); - this.groupBox4.Controls.Add(this.buttonExportGroup); - this.groupBox4.Controls.Add(this.buttonMoveGroupDown); - this.groupBox4.Controls.Add(this.buttonMoveGroupUp); - this.groupBox4.Controls.Add(this.labelAssignNamesToGroups); - this.groupBox4.Controls.Add(this.buttonCopyGroup); - this.groupBox4.Controls.Add(this.buttonDeleteGroup); - this.groupBox4.Controls.Add(this.buttonNewGroup); - this.groupBox4.Controls.Add(this.comboBoxGroups); - this.groupBox4.Location = new System.Drawing.Point(18, 5); - this.groupBox4.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.groupBox4.Name = "groupBox4"; - this.groupBox4.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.groupBox4.Size = new System.Drawing.Size(818, 129); - this.groupBox4.TabIndex = 22; - this.groupBox4.TabStop = false; - this.groupBox4.Text = "Groups"; - // - // buttonImportGroup - // - this.buttonImportGroup.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonImportGroup.Location = new System.Drawing.Point(516, 29); - this.buttonImportGroup.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.buttonImportGroup.Name = "buttonImportGroup"; - this.buttonImportGroup.Size = new System.Drawing.Size(68, 35); - this.buttonImportGroup.TabIndex = 7; - this.buttonImportGroup.Text = "Import"; - this.toolTip.SetToolTip(this.buttonImportGroup, "Import highlight groups"); - this.buttonImportGroup.UseVisualStyleBackColor = true; - this.buttonImportGroup.Click += new System.EventHandler(this.OnImportGroupButtonClick); - // - // buttonMoveGroupDown - // - this.buttonMoveGroupDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonMoveGroupDown.Location = new System.Drawing.Point(729, 75); - this.buttonMoveGroupDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.buttonMoveGroupDown.Name = "buttonMoveGroupDown"; - this.buttonMoveGroupDown.Size = new System.Drawing.Size(68, 35); - this.buttonMoveGroupDown.TabIndex = 6; - this.buttonMoveGroupDown.Text = "Down"; - this.toolTip.SetToolTip(this.buttonMoveGroupDown, "Move the current hilight group one position down"); - this.buttonMoveGroupDown.UseVisualStyleBackColor = true; - this.buttonMoveGroupDown.Click += new System.EventHandler(this.OnGroupDownButtonClick); - // - // buttonMoveGroupUp - // - this.buttonMoveGroupUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonMoveGroupUp.Location = new System.Drawing.Point(658, 75); - this.buttonMoveGroupUp.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.buttonMoveGroupUp.Name = "buttonMoveGroupUp"; - this.buttonMoveGroupUp.Size = new System.Drawing.Size(68, 35); - this.buttonMoveGroupUp.TabIndex = 5; - this.buttonMoveGroupUp.Text = "Up"; - this.toolTip.SetToolTip(this.buttonMoveGroupUp, "Move the current hilight group one position up"); - this.buttonMoveGroupUp.UseVisualStyleBackColor = true; - this.buttonMoveGroupUp.Click += new System.EventHandler(this.OnGroupUpButtonClick); + groupBox4.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + groupBox4.Controls.Add(btnImportGroup); + groupBox4.Controls.Add(btnExportGroup); + groupBox4.Controls.Add(btnMoveGroupDown); + groupBox4.Controls.Add(btnMoveGroupUp); + groupBox4.Controls.Add(labelAssignNamesToGroups); + groupBox4.Controls.Add(btnCopyGroup); + groupBox4.Controls.Add(btnDeleteGroup); + groupBox4.Controls.Add(btnNewGroup); + groupBox4.Controls.Add(comboBoxGroups); + groupBox4.Location = new Point(18, 5); + groupBox4.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + groupBox4.Name = "groupBox4"; + groupBox4.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + groupBox4.Size = new Size(671, 129); + groupBox4.TabIndex = 22; + groupBox4.TabStop = false; + groupBox4.Text = "Groups"; + // + // btnImportGroup + // + btnImportGroup.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + btnImportGroup.Location = new Point(333, 26); + btnImportGroup.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + btnImportGroup.Name = "btnImportGroup"; + btnImportGroup.Size = new Size(75, 35); + btnImportGroup.TabIndex = 7; + btnImportGroup.Text = "Import"; + toolTip.SetToolTip(btnImportGroup, "Import highlight groups"); + btnImportGroup.UseVisualStyleBackColor = true; + btnImportGroup.Click += OnBtnImportGroupClick; + // + // btnExportGroup + // + btnExportGroup.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + btnExportGroup.Location = new Point(333, 75); + btnExportGroup.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + btnExportGroup.Name = "btnExportGroup"; + btnExportGroup.Size = new Size(75, 35); + btnExportGroup.TabIndex = 8; + btnExportGroup.Text = "Export"; + toolTip.SetToolTip(btnExportGroup, "Export highlight groups"); + btnExportGroup.UseVisualStyleBackColor = true; + btnExportGroup.Click += OnBtnExportGroupClick; + // + // btnMoveGroupDown + // + btnMoveGroupDown.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; + btnMoveGroupDown.Location = new Point(582, 75); + btnMoveGroupDown.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + btnMoveGroupDown.Name = "btnMoveGroupDown"; + btnMoveGroupDown.Size = new Size(75, 35); + btnMoveGroupDown.TabIndex = 6; + btnMoveGroupDown.Text = "Down"; + toolTip.SetToolTip(btnMoveGroupDown, "Move the current hilight group one position down"); + btnMoveGroupDown.UseVisualStyleBackColor = true; + btnMoveGroupDown.Click += OnBtnGroupDownClick; + // + // btnMoveGroupUp + // + btnMoveGroupUp.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; + btnMoveGroupUp.Location = new Point(499, 75); + btnMoveGroupUp.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + btnMoveGroupUp.Name = "btnMoveGroupUp"; + btnMoveGroupUp.Size = new Size(75, 35); + btnMoveGroupUp.TabIndex = 5; + btnMoveGroupUp.Text = "Up"; + toolTip.SetToolTip(btnMoveGroupUp, "Move the current hilight group one position up"); + btnMoveGroupUp.UseVisualStyleBackColor = true; + btnMoveGroupUp.Click += OnBtnGroupUpClick; // // labelAssignNamesToGroups // - this.labelAssignNamesToGroups.AutoSize = true; - this.labelAssignNamesToGroups.Location = new System.Drawing.Point(9, 88); - this.labelAssignNamesToGroups.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.labelAssignNamesToGroups.Name = "labelAssignNamesToGroups"; - this.labelAssignNamesToGroups.Size = new System.Drawing.Size(372, 20); - this.labelAssignNamesToGroups.TabIndex = 4; - this.labelAssignNamesToGroups.Text = "You can assign groups to file names in the settings."; - // - // buttonCopyGroup - // - this.buttonCopyGroup.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonCopyGroup.Location = new System.Drawing.Point(729, 29); - this.buttonCopyGroup.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.buttonCopyGroup.Name = "buttonCopyGroup"; - this.buttonCopyGroup.Size = new System.Drawing.Size(68, 35); - this.buttonCopyGroup.TabIndex = 3; - this.buttonCopyGroup.Text = "Copy"; - this.toolTip.SetToolTip(this.buttonCopyGroup, "Copy the current hilight group into a new one"); - this.buttonCopyGroup.UseVisualStyleBackColor = true; - this.buttonCopyGroup.Click += new System.EventHandler(this.OnCopyGroupButtonClick); - // - // buttonDeleteGroup - // - this.buttonDeleteGroup.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonDeleteGroup.Location = new System.Drawing.Point(658, 29); - this.buttonDeleteGroup.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.buttonDeleteGroup.Name = "buttonDeleteGroup"; - this.buttonDeleteGroup.Size = new System.Drawing.Size(68, 35); - this.buttonDeleteGroup.TabIndex = 2; - this.buttonDeleteGroup.Text = "Del"; - this.toolTip.SetToolTip(this.buttonDeleteGroup, "Delete the current hilight group"); - this.buttonDeleteGroup.UseVisualStyleBackColor = true; - this.buttonDeleteGroup.Click += new System.EventHandler(this.OnDelGroupButtonClick); - // - // buttonNewGroup - // - this.buttonNewGroup.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonNewGroup.Location = new System.Drawing.Point(592, 29); - this.buttonNewGroup.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.buttonNewGroup.Name = "buttonNewGroup"; - this.buttonNewGroup.Size = new System.Drawing.Size(63, 35); - this.buttonNewGroup.TabIndex = 1; - this.buttonNewGroup.Text = "New group"; - this.toolTip.SetToolTip(this.buttonNewGroup, "Create a new empty hilight group"); - this.buttonNewGroup.UseVisualStyleBackColor = true; - this.buttonNewGroup.Click += new System.EventHandler(this.OnNewGroupButtonClick); + labelAssignNamesToGroups.AutoSize = true; + labelAssignNamesToGroups.Location = new Point(9, 88); + labelAssignNamesToGroups.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + labelAssignNamesToGroups.Name = "labelAssignNamesToGroups"; + labelAssignNamesToGroups.Size = new Size(276, 15); + labelAssignNamesToGroups.TabIndex = 4; + labelAssignNamesToGroups.Text = "You can assign groups to file names in the settings."; + // + // btnCopyGroup + // + btnCopyGroup.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + btnCopyGroup.Location = new Point(582, 26); + btnCopyGroup.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + btnCopyGroup.Name = "btnCopyGroup"; + btnCopyGroup.Size = new Size(75, 35); + btnCopyGroup.TabIndex = 3; + btnCopyGroup.Text = "Copy"; + toolTip.SetToolTip(btnCopyGroup, "Copy the current hilight group into a new one"); + btnCopyGroup.UseVisualStyleBackColor = true; + btnCopyGroup.Click += OnBtnCopyGroupClick; + // + // btnDeleteGroup + // + btnDeleteGroup.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + btnDeleteGroup.Location = new Point(499, 26); + btnDeleteGroup.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + btnDeleteGroup.Name = "btnDeleteGroup"; + btnDeleteGroup.Size = new Size(75, 35); + btnDeleteGroup.TabIndex = 2; + btnDeleteGroup.Text = "Del"; + toolTip.SetToolTip(btnDeleteGroup, "Delete the current hilight group"); + btnDeleteGroup.UseVisualStyleBackColor = true; + btnDeleteGroup.Click += OnBtnDelGroupClick; + // + // btnNewGroup + // + btnNewGroup.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + btnNewGroup.Location = new Point(416, 26); + btnNewGroup.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + btnNewGroup.Name = "btnNewGroup"; + btnNewGroup.Size = new Size(75, 35); + btnNewGroup.TabIndex = 1; + btnNewGroup.Text = "New group"; + btnNewGroup.TextAlign = ContentAlignment.MiddleLeft; + toolTip.SetToolTip(btnNewGroup, "Create a new empty hilight group"); + btnNewGroup.UseVisualStyleBackColor = true; + btnNewGroup.Click += OnBtnNewGroupClick; // // comboBoxGroups // - this.comboBoxGroups.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.comboBoxGroups.DisplayMember = "GroupName"; - this.comboBoxGroups.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.comboBoxGroups.Location = new System.Drawing.Point(14, 32); - this.comboBoxGroups.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.comboBoxGroups.Name = "comboBoxGroups"; - this.comboBoxGroups.Size = new System.Drawing.Size(481, 27); - this.comboBoxGroups.TabIndex = 0; - this.toolTip.SetToolTip(this.comboBoxGroups, "Choose a group to create different highlight settings. Type in a name to change i" + - "n the name of a group."); - this.comboBoxGroups.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.OnGroupComboBoxDrawItem); - this.comboBoxGroups.SelectionChangeCommitted += new System.EventHandler(this.OnGroupComboBoxSelectionChangeCommitted); - this.comboBoxGroups.TextUpdate += new System.EventHandler(this.OnGroupComboBoxTextUpdate); - // - // buttonExportGroup - // - this.buttonExportGroup.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonExportGroup.Location = new System.Drawing.Point(516, 75); - this.buttonExportGroup.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.buttonExportGroup.Name = "buttonExportGroup"; - this.buttonExportGroup.Size = new System.Drawing.Size(68, 35); - this.buttonExportGroup.TabIndex = 8; - this.buttonExportGroup.Text = "Export"; - this.toolTip.SetToolTip(this.buttonExportGroup, "Export highlight groups"); - this.buttonExportGroup.UseVisualStyleBackColor = true; - this.buttonExportGroup.Click += new System.EventHandler(this.OnButtonExportGroupClick); + comboBoxGroups.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + comboBoxGroups.DisplayMember = "GroupName"; + comboBoxGroups.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + comboBoxGroups.Location = new Point(14, 32); + comboBoxGroups.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + comboBoxGroups.Name = "comboBoxGroups"; + comboBoxGroups.Size = new Size(311, 24); + comboBoxGroups.TabIndex = 0; + toolTip.SetToolTip(comboBoxGroups, "Choose a group to create different highlight settings. Type in a name to change in the name of a group."); + comboBoxGroups.DrawItem += OnCmbBoxGroupDrawItem; + comboBoxGroups.SelectionChangeCommitted += OnCmbBoxGroupSelectionChangeCommitted; + comboBoxGroups.TextUpdate += OnCmbBoxGroupTextUpdate; + // + // pnlBackground + // + pnlBackground.AutoScroll = true; + pnlBackground.Controls.Add(listBoxHighlight); + pnlBackground.Controls.Add(btnAdd); + pnlBackground.Controls.Add(btnDelete); + pnlBackground.Controls.Add(btnMoveUp); + pnlBackground.Controls.Add(btnMoveDown); + pnlBackground.Controls.Add(btnOk); + pnlBackground.Controls.Add(btnCancel); + pnlBackground.Controls.Add(btnApply); + pnlBackground.Controls.Add(groupBoxLineMatchCriteria); + pnlBackground.Controls.Add(groupBoxColoring); + pnlBackground.Controls.Add(groupBoxActions); + pnlBackground.Controls.Add(groupBox4); + pnlBackground.Dock = System.Windows.Forms.DockStyle.Fill; + pnlBackground.Location = new Point(0, 0); + pnlBackground.Name = "pnlBackground"; + pnlBackground.Size = new Size(708, 895); + pnlBackground.TabIndex = 23; // // HighlightDialog // - this.AcceptButton = this.buttonOk; - this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.buttonCancel; - this.ClientSize = new System.Drawing.Size(855, 912); - this.Controls.Add(this.groupBox4); - this.Controls.Add(this.groupBoxActions); - this.Controls.Add(this.groupBoxColoring); - this.Controls.Add(this.groupBoxLineMatchCriteria); - this.Controls.Add(this.buttonApply); - this.Controls.Add(this.buttonCancel); - this.Controls.Add(this.buttonOk); - this.Controls.Add(this.buttonMoveDown); - this.Controls.Add(this.buttonMoveUp); - this.Controls.Add(this.buttonDelete); - this.Controls.Add(this.buttonAdd); - this.Controls.Add(this.listBoxHighlight); - this.DoubleBuffered = true; - this.helpProvider.SetHelpKeyword(this, "Highlighting.htm"); - this.helpProvider.SetHelpNavigator(this, System.Windows.Forms.HelpNavigator.Topic); - this.helpProvider.SetHelpString(this, ""); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(660, 934); - this.Name = "HighlightDialog"; - this.helpProvider.SetShowHelp(this, true); - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Highlighting and action triggers"; - this.Shown += new System.EventHandler(this.OnHighlightDialogShown); - this.groupBoxLineMatchCriteria.ResumeLayout(false); - this.groupBoxLineMatchCriteria.PerformLayout(); - this.groupBoxColoring.ResumeLayout(false); - this.groupBoxColoring.PerformLayout(); - this.groupBoxActions.ResumeLayout(false); - this.groupBoxActions.PerformLayout(); - this.groupBox4.ResumeLayout(false); - this.groupBox4.PerformLayout(); - this.ResumeLayout(false); - + AcceptButton = btnOk; + CancelButton = btnCancel; + ClientSize = new Size(708, 895); + Controls.Add(pnlBackground); + DoubleBuffered = true; + helpProvider.SetHelpKeyword(this, "Highlighting.htm"); + helpProvider.SetHelpNavigator(this, System.Windows.Forms.HelpNavigator.Topic); + helpProvider.SetHelpString(this, ""); + Icon = (Icon)resources.GetObject("$this.Icon"); + Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + MaximizeBox = false; + MinimizeBox = false; + MinimumSize = new Size(660, 934); + Name = "HighlightDialog"; + helpProvider.SetShowHelp(this, true); + StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + Text = "Highlighting and action triggers"; + Shown += OnHighlightDialogShown; + groupBoxLineMatchCriteria.ResumeLayout(false); + groupBoxLineMatchCriteria.PerformLayout(); + groupBoxColoring.ResumeLayout(false); + groupBoxColoring.PerformLayout(); + groupBoxActions.ResumeLayout(false); + groupBoxActions.PerformLayout(); + groupBox4.ResumeLayout(false); + groupBox4.PerformLayout(); + pnlBackground.ResumeLayout(false); + ResumeLayout(false); } #endregion private System.Windows.Forms.ListBox listBoxHighlight; - private System.Windows.Forms.Button buttonAdd; - private System.Windows.Forms.Button buttonDelete; - private System.Windows.Forms.Button buttonMoveUp; - private System.Windows.Forms.Button buttonMoveDown; + private System.Windows.Forms.Button btnAdd; + private System.Windows.Forms.Button btnDelete; + private System.Windows.Forms.Button btnMoveUp; + private System.Windows.Forms.Button btnMoveDown; private ColorComboBox colorBoxForeground; private System.Windows.Forms.Label labelForgroundColor; private ColorComboBox colorBoxBackground; private System.Windows.Forms.Label labelBackgroundColor; - private System.Windows.Forms.Button buttonOk; - private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.Button btnOk; + private System.Windows.Forms.Button btnCancel; private System.Windows.Forms.TextBox textBoxSearchString; private System.Windows.Forms.Label labelSearchString; - private System.Windows.Forms.Button buttonApply; - private System.Windows.Forms.Button buttonCustomForeColor; - private System.Windows.Forms.Button buttonCustomBackColor; + private System.Windows.Forms.Button btnApply; + private System.Windows.Forms.Button btnCustomForeColor; + private System.Windows.Forms.Button btnCustomBackColor; private System.Windows.Forms.CheckBox checkBoxRegex; private System.Windows.Forms.CheckBox checkBoxCaseSensitive; private System.Windows.Forms.CheckBox checkBoxDontDirtyLed; @@ -774,21 +706,22 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox checkBoxStopTail; private System.Windows.Forms.HelpProvider helpProvider; private System.Windows.Forms.CheckBox checkBoxPlugin; - private System.Windows.Forms.Button buttonPlugin; - private System.Windows.Forms.Button buttonBookmarkComment; + private System.Windows.Forms.Button btnSelectPlugin; + private System.Windows.Forms.Button btnBookmarkComment; private System.Windows.Forms.GroupBox groupBox4; private System.Windows.Forms.ComboBox comboBoxGroups; - private System.Windows.Forms.Button buttonDeleteGroup; - private System.Windows.Forms.Button buttonNewGroup; - private System.Windows.Forms.Button buttonCopyGroup; + private System.Windows.Forms.Button btnDeleteGroup; + private System.Windows.Forms.Button btnNewGroup; + private System.Windows.Forms.Button btnCopyGroup; private System.Windows.Forms.ToolTip toolTip; private System.Windows.Forms.Label labelAssignNamesToGroups; - private System.Windows.Forms.Button buttonMoveGroupUp; - private System.Windows.Forms.Button buttonMoveGroupDown; + private System.Windows.Forms.Button btnMoveGroupUp; + private System.Windows.Forms.Button btnMoveGroupDown; private System.Windows.Forms.CheckBox checkBoxWordMatch; private System.Windows.Forms.CheckBox checkBoxBold; private System.Windows.Forms.CheckBox checkBoxNoBackground; - private System.Windows.Forms.Button buttonImportGroup; - private System.Windows.Forms.Button buttonExportGroup; + private System.Windows.Forms.Button btnImportGroup; + private System.Windows.Forms.Button btnExportGroup; + private System.Windows.Forms.Panel pnlBackground; } } \ No newline at end of file diff --git a/src/LogExpert/Dialogs/HighlightDialog.cs b/src/LogExpert/Dialogs/HighlightDialog.cs index ecd1b6b6..7e3fe906 100644 --- a/src/LogExpert/Dialogs/HighlightDialog.cs +++ b/src/LogExpert/Dialogs/HighlightDialog.cs @@ -15,32 +15,36 @@ namespace LogExpert.Dialogs { public partial class HighlightDialog : Form { - #region Fields - private static readonly ILogger _logger = LogManager.GetCurrentClassLogger(); + #region Private Fields + private readonly Image _applyButtonImage; private string _bookmarkComment; - private ActionEntry _currentActionEntry = new ActionEntry(); + private ActionEntry _currentActionEntry = new(); private HilightGroup _currentGroup; private List _highlightGroupList; #endregion - #region cTor + #region Ctor public HighlightDialog() { InitializeComponent(); + + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; + Load += OnHighlightDialogLoad; listBoxHighlight.DrawItem += OnHighlightListBoxDrawItem; - _applyButtonImage = buttonApply.Image; - buttonApply.Image = null; + _applyButtonImage = btnApply.Image; + btnApply.Image = null; } #endregion - #region Properties + #region Properties / Indexers public List HighlightGroupList { @@ -52,326 +56,296 @@ public List HighlightGroupList public string PreSelectedGroupName { get; set; } - private bool IsDirty => buttonApply.Image == _applyButtonImage; + private bool IsDirty => btnApply.Image == _applyButtonImage; #endregion - #region Private Methods + #region Event handling Methods - private void AddNewEntry() + private void OnAddButtonClick(object sender, EventArgs e) { - { - try - { - CheckRegex(); - - // Create a new entry - HilightEntry entry = new HilightEntry( - textBoxSearchString.Text, - colorBoxForeground.SelectedColor, - colorBoxBackground.SelectedColor, - checkBoxRegex.Checked, - checkBoxCaseSensitive.Checked, - checkBoxDontDirtyLed.Checked, - checkBoxStopTail.Checked, - checkBoxBookmark.Checked, - checkBoxPlugin.Checked, - _currentActionEntry, - checkBoxWordMatch.Checked); - - entry.IsBold = checkBoxBold.Checked; - entry.NoBackground = checkBoxNoBackground.Checked; - listBoxHighlight.Items.Add(entry); + AddNewEntry(); + Dirty(); + } - // Select the newly created item - _currentGroup.HilightEntryList.Add(entry); - listBoxHighlight.SelectedItem = entry; - } - catch (Exception ex) - { - _logger.Error(ex, "Error during add of highlight entry"); - MessageBox.Show($"Error during add of entry.\r\n{ex.Message}"); - } - } + private void OnBtnApplyClick(object sender, EventArgs e) + { + SaveEntry(); } - private void InitData() + private void OnBtnBookmarkCommentClick(object sender, EventArgs e) { - const string def = "[Default]"; - if (HighlightGroupList == null) + BookmarkCommentDlg dlg = new(); + dlg.Comment = _bookmarkComment; + if (dlg.ShowDialog() == DialogResult.OK) { - HighlightGroupList = new List(); + _bookmarkComment = dlg.Comment; + Dirty(); } + } - if (HighlightGroupList.Count == 0) + private void OnBtnCopyGroupClick(object sender, EventArgs e) + { + if (comboBoxGroups.SelectedIndex >= 0 && comboBoxGroups.SelectedIndex < HighlightGroupList.Count) { - HilightGroup highlightGroup = new HilightGroup - { - GroupName = def, - HilightEntryList = new List() - }; - - HighlightGroupList.Add(highlightGroup); + HilightGroup newGroup = ObjectClone.Clone(HighlightGroupList[comboBoxGroups.SelectedIndex]); + newGroup.GroupName = "Copy of " + newGroup.GroupName; + HighlightGroupList.Add(newGroup); + FillGroupComboBox(); + SelectGroup(HighlightGroupList.Count - 1); } + } - FillGroupComboBox(); + private void OnBtnCustomBackColorClick(object sender, EventArgs e) + { + ChooseColor(colorBoxBackground); + Dirty(); + } - _currentGroup = null; - string groupToSelect = PreSelectedGroupName; - if (string.IsNullOrEmpty(groupToSelect)) + private void OnBtnCustomForeColorClick(object sender, EventArgs e) + { + ChooseColor(colorBoxForeground); + Dirty(); + } + + private void OnBtnDelGroupClick(object sender, EventArgs e) + { + // the last group cannot be deleted + if (HighlightGroupList.Count == 1) { - groupToSelect = def; + return; } - foreach (HilightGroup group in HighlightGroupList) + if (comboBoxGroups.SelectedIndex >= 0 && comboBoxGroups.SelectedIndex < HighlightGroupList.Count) { - if (group.GroupName.Equals(groupToSelect)) + int index = comboBoxGroups.SelectedIndex; + HighlightGroupList.RemoveAt(comboBoxGroups.SelectedIndex); + FillGroupComboBox(); + if (index < HighlightGroupList.Count) { - _currentGroup = group; - comboBoxGroups.SelectedValue = group; - comboBoxGroups.SelectedIndex = HighlightGroupList.IndexOf(group); - break; + SelectGroup(index); + } + else + { + SelectGroup(HighlightGroupList.Count - 1); } } + } - ReEvaluateGroupButtonStates(); + private void OnBtnExportGroupClick(object sender, EventArgs e) + { + //SaveFileDialog dlg = new SaveFileDialog(); + //dlg.Title = @"Export Settings to file"; + //dlg.DefaultExt = "json"; + //dlg.AddExtension = true; + //dlg.Filter = @"Settings (*.json)|*.json|All files (*.*)|*.*"; - FillHighlightListBox(); + //DialogResult result = dlg.ShowDialog(); + + //if (result == DialogResult.OK) + //{ + // FileInfo fileInfo = new FileInfo(dlg.FileName); + // ConfigManager.Export(fileInfo); + //} } - private void FillHighlightListBox() + private void OnBtnGroupDownClick(object sender, EventArgs e) { - listBoxHighlight.Items.Clear(); - if (_currentGroup != null) + int index = comboBoxGroups.SelectedIndex; + if (index > -1 && index < _highlightGroupList.Count - 1) { - foreach (HilightEntry entry in _currentGroup.HilightEntryList) - { - listBoxHighlight.Items.Add(entry); - } + _highlightGroupList.Reverse(index, 2); + comboBoxGroups.Refresh(); + FillGroupComboBox(); + SelectGroup(index + 1); } } - private void SaveEntry() + private void OnBtnGroupUpClick(object sender, EventArgs e) { - try - { - CheckRegex(); - - HilightEntry entry = (HilightEntry)listBoxHighlight.SelectedItem; - - entry.ForegroundColor = (Color)colorBoxForeground.SelectedItem; - entry.BackgroundColor = (Color)colorBoxBackground.SelectedItem; - entry.SearchText = textBoxSearchString.Text; - entry.IsRegEx = checkBoxRegex.Checked; - entry.IsCaseSensitive = checkBoxCaseSensitive.Checked; - buttonApply.Enabled = false; - buttonApply.Image = null; - entry.IsLedSwitch = checkBoxDontDirtyLed.Checked; - entry.IsSetBookmark = checkBoxBookmark.Checked; - entry.IsStopTail = checkBoxStopTail.Checked; - entry.IsActionEntry = checkBoxPlugin.Checked; - entry.ActionEntry = _currentActionEntry.Copy(); - entry.BookmarkComment = _bookmarkComment; - entry.IsWordMatch = checkBoxWordMatch.Checked; - entry.IsBold = checkBoxBold.Checked; - entry.NoBackground = checkBoxNoBackground.Checked; - listBoxHighlight.Refresh(); - } - catch (Exception ex) + int index = comboBoxGroups.SelectedIndex; + if (index > 0) { - _logger.Error(ex, "Error during save of save highlight entry"); - MessageBox.Show($"Error during save of entry.\r\n{ex.Message}"); + _highlightGroupList.Reverse(index - 1, 2); + comboBoxGroups.Refresh(); + FillGroupComboBox(); + SelectGroup(index - 1); } } - private void CheckRegex() + private void OnBtnImportGroupClick(object sender, EventArgs e) { - if (checkBoxRegex.Checked) + ImportSettingsDialog dlg = new(); + + foreach (Control ctl in dlg.groupBoxImportOptions.Controls) { - if (string.IsNullOrWhiteSpace(textBoxSearchString.Text)) + if (ctl.Tag != null) { - throw new ArgumentException("Regex value is null or whitespace"); + ((CheckBox)ctl).Checked = false; } - - // ReSharper disable once ReturnValueOfPureMethodIsNotUsed - Regex.IsMatch("", textBoxSearchString.Text); } - } - private void StartEditEntry() - { - HilightEntry entry = (HilightEntry)listBoxHighlight.SelectedItem; + dlg.checkBoxHighlightSettings.Checked = true; + dlg.checkBoxKeepExistingSettings.Checked = true; - if (entry != null) + if (dlg.ShowDialog() != DialogResult.OK) { - textBoxSearchString.Text = entry.SearchText; + return; + } - colorBoxForeground.CustomColor = entry.ForegroundColor; - colorBoxBackground.CustomColor = entry.BackgroundColor; + if (string.IsNullOrWhiteSpace(dlg.FileName)) + { + return; + } - if (colorBoxForeground.Items.Contains(entry.ForegroundColor)) - { - colorBoxForeground.SelectedIndex = colorBoxForeground.Items.Cast().ToList().LastIndexOf(entry.ForegroundColor); - } - else - { - colorBoxForeground.SelectedItem = entry.ForegroundColor; - } + Cursor.Current = Cursors.WaitCursor; - if (colorBoxForeground.Items.Contains(entry.ForegroundColor)) - { - colorBoxBackground.SelectedIndex = colorBoxBackground.Items.Cast().ToList().LastIndexOf(entry.BackgroundColor); - } - else - { - colorBoxBackground.SelectedItem = entry.BackgroundColor; - } + FileInfo fileInfo; - checkBoxRegex.Checked = entry.IsRegEx; - checkBoxCaseSensitive.Checked = entry.IsCaseSensitive; - checkBoxDontDirtyLed.Checked = entry.IsLedSwitch; - checkBoxBookmark.Checked = entry.IsSetBookmark; - checkBoxStopTail.Checked = entry.IsStopTail; - checkBoxPlugin.Checked = entry.IsActionEntry; - buttonPlugin.Enabled = checkBoxPlugin.Checked; - buttonBookmarkComment.Enabled = checkBoxBookmark.Checked; - _currentActionEntry = entry.ActionEntry != null ? entry.ActionEntry.Copy() : new ActionEntry(); - _bookmarkComment = entry.BookmarkComment; - checkBoxWordMatch.Checked = entry.IsWordMatch; - checkBoxBold.Checked = entry.IsBold; - checkBoxNoBackground.Checked = entry.NoBackground; + try + { + fileInfo = new FileInfo(dlg.FileName); + } + catch (Exception ex) + { + MessageBox.Show(this, $@"Settings could not be imported: {ex}", @"LogExpert"); + _logger.Error($"Error while trying to access file: {dlg.FileName}: {ex}"); + return; } - buttonApply.Enabled = false; - buttonApply.Image = null; + ConfigManager.Import(fileInfo, dlg.ImportFlags); + Cursor.Current = Cursors.Default; + + _highlightGroupList = ConfigManager.Settings.hilightGroupList; - ReEvaluateHighlightButtonStates(); + FillGroupComboBox(); + + MessageBox.Show(this, @"Settings imported", @"LogExpert"); } - private void Dirty() + private void OnBtnMoveDownClick(object sender, EventArgs e) { int index = listBoxHighlight.SelectedIndex; - if (index > -1) + if (index > -1 && index < listBoxHighlight.Items.Count - 1) { - buttonApply.Enabled = true; - buttonApply.Image = _applyButtonImage; + object item = listBoxHighlight.SelectedItem; + listBoxHighlight.Items.RemoveAt(index); + listBoxHighlight.Items.Insert(index + 1, item); + listBoxHighlight.SelectedIndex = index + 1; + _currentGroup.HilightEntryList.Reverse(index, 2); } - - buttonAdd.Enabled = textBoxSearchString.Text.Length > 0; } - private void ChooseColor(ColorComboBox comboBox) + private void OnBtnMoveUpClick(object sender, EventArgs e) { - ColorDialog colorDialog = new ColorDialog(); - colorDialog.AllowFullOpen = true; - colorDialog.ShowHelp = false; - colorDialog.Color = comboBox.CustomColor; - if (colorDialog.ShowDialog() == DialogResult.OK) + int index = listBoxHighlight.SelectedIndex; + if (index > 0) { - comboBox.CustomColor = colorDialog.Color; - comboBox.SelectedIndex = 0; + object item = listBoxHighlight.SelectedItem; + listBoxHighlight.Items.RemoveAt(index); // will also clear the selection + listBoxHighlight.Items.Insert(index - 1, item); + listBoxHighlight.SelectedIndex = index - 1; // restore the selection + _currentGroup.HilightEntryList.Reverse(index - 1, 2); } } - private void SelectGroup(int index) + private void OnBtnNewGroupClick(object sender, EventArgs e) { - if (index >= 0 && index < HighlightGroupList.Count) + // Propose a unique name + const string baseName = "New group"; + string name = baseName; + bool uniqueName = false; + int i = 1; + while (!uniqueName) { - _currentGroup = HighlightGroupList[index]; - comboBoxGroups.Items[index] = _currentGroup; - comboBoxGroups.SelectedIndex = index; - comboBoxGroups.SelectedItem = _currentGroup; - FillHighlightListBox(); - } - else - { - comboBoxGroups.SelectedItem = null; - _currentGroup = null; - listBoxHighlight.Items.Clear(); + uniqueName = HighlightGroupList.FindIndex(delegate(HilightGroup g) { return g.GroupName == name; }) < + 0; + if (!uniqueName) + { + name = $"{baseName} #{i++}"; + } } - ReEvaluateHighlightButtonStates(); - ReEvaluateGroupButtonStates(); + HilightGroup newGroup = new() { GroupName = name }; + HighlightGroupList.Add(newGroup); + FillGroupComboBox(); + SelectGroup(HighlightGroupList.Count - 1); } - private void FillGroupComboBox() + private void OnBtnOkClick(object sender, EventArgs e) { - SelectGroup(-1); - - comboBoxGroups.Items.Clear(); - - foreach (HilightGroup group in HighlightGroupList) + // Apply pending changes if closing the form. + if (IsDirty) { - comboBoxGroups.Items.Add(group); + // cannot call 'this.applyButton.PerformClick();' because it prohibits the OK button to terminate the dialog + OnBtnApplyClick(btnApply, EventArgs.Empty); } - - ReEvaluateGroupButtonStates(); } - private void ReEvaluateHighlightButtonStates() + private void OnChkBoxBoldCheckedChanged(object sender, EventArgs e) { - // Refresh button states based on the selection in the combobox - bool atLeastOneSelected = listBoxHighlight.SelectedItem != null; - bool moreThanOne = listBoxHighlight.Items.Count > 1; - bool firstSelected = atLeastOneSelected && listBoxHighlight.SelectedIndex == 0; - bool lastSelected = atLeastOneSelected && - listBoxHighlight.SelectedIndex == listBoxHighlight.Items.Count - 1; - - buttonDelete.Enabled = atLeastOneSelected; - buttonMoveUp.Enabled = atLeastOneSelected && moreThanOne && !firstSelected; - buttonMoveDown.Enabled = atLeastOneSelected && moreThanOne && !lastSelected; + Dirty(); } - private void ReEvaluateGroupButtonStates() + private void OnChkBoxNoBackgroundCheckedChanged(object sender, EventArgs e) { - // Refresh button states based on the selection in the combobox - bool atLeastOneSelected = comboBoxGroups.SelectedItem != null; - bool moreThanOne = comboBoxGroups.Items.Count > 1; - bool firstSelected = atLeastOneSelected && comboBoxGroups.SelectedIndex == 0; - bool lastSelected = atLeastOneSelected && - comboBoxGroups.SelectedIndex == comboBoxGroups.Items.Count - 1; - - buttonDeleteGroup.Enabled = atLeastOneSelected; - buttonCopyGroup.Enabled = atLeastOneSelected; - buttonMoveGroupUp.Enabled = atLeastOneSelected && moreThanOne && !firstSelected; - buttonMoveGroupDown.Enabled = atLeastOneSelected && moreThanOne && !lastSelected; + colorBoxBackground.Enabled = !checkBoxNoBackground.Checked; + btnCustomBackColor.Enabled = !checkBoxNoBackground.Checked; + Dirty(); } - #endregion - - #region Events handler - - private void OnHighlightDialogLoad(object sender, EventArgs e) + private void OnChkBoxPluginCheckedChanged(object sender, EventArgs e) { - colorBoxForeground.SelectedIndex = 1; - colorBoxBackground.SelectedIndex = 2; - buttonApply.Enabled = false; - buttonApply.Image = null; - buttonBookmarkComment.Enabled = false; - buttonPlugin.Enabled = false; + Dirty(); + btnSelectPlugin.Enabled = checkBoxPlugin.Checked; + } - ReEvaluateHighlightButtonStates(); + private void OnChkBoxRegexMouseUp(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Right) + { + RegexHelperDialog dlg = new(); + dlg.Owner = this; + dlg.CaseSensitive = checkBoxCaseSensitive.Checked; + dlg.Pattern = textBoxSearchString.Text; + DialogResult res = dlg.ShowDialog(); + if (res == DialogResult.OK) + { + checkBoxCaseSensitive.Checked = dlg.CaseSensitive; + textBoxSearchString.Text = dlg.Pattern; + } + } } - private void OnHighlightDialogShown(object sender, EventArgs e) + private void OnChkBoxWordMatchCheckedChanged(object sender, EventArgs e) { - InitData(); + Dirty(); + checkBoxNoBackground.Enabled = checkBoxWordMatch.Checked; } - private void OnOkButtonClick(object sender, EventArgs e) + private void OnCmbBoxGroupDrawItem(object sender, DrawItemEventArgs e) { - // Apply pending changes if closing the form. - if (IsDirty) + e.DrawBackground(); + if (e.Index >= 0) { - // cannot call 'this.applyButton.PerformClick();' because it prohibits the OK button to terminate the dialog - OnApplyButtonClick(buttonApply, EventArgs.Empty); + HilightGroup group = HighlightGroupList[e.Index]; + Rectangle rectangle = new(0, e.Bounds.Top, e.Bounds.Width, e.Bounds.Height); + + Brush brush = new SolidBrush(SystemColors.ControlText); + e.Graphics.DrawString(group.GroupName, e.Font, brush, new PointF(rectangle.Left, rectangle.Top)); + e.DrawFocusRectangle(); + brush.Dispose(); } } - private void OnAddButtonClick(object sender, EventArgs e) + private void OnCmbBoxGroupSelectionChangeCommitted(object sender, EventArgs e) { - AddNewEntry(); - Dirty(); + SelectGroup(comboBoxGroups.SelectedIndex); + } + + private void OnCmbBoxGroupTextUpdate(object sender, EventArgs e) + { + _currentGroup.GroupName = comboBoxGroups.Text; } private void OnDeleteButtonClick(object sender, EventArgs e) @@ -398,13 +372,30 @@ private void OnDeleteButtonClick(object sender, EventArgs e) } } + private void OnHighlightDialogLoad(object sender, EventArgs e) + { + colorBoxForeground.SelectedIndex = 1; + colorBoxBackground.SelectedIndex = 2; + btnApply.Enabled = false; + btnApply.Image = null; + btnBookmarkComment.Enabled = false; + btnSelectPlugin.Enabled = false; + + ReEvaluateHighlightButtonStates(); + } + + private void OnHighlightDialogShown(object sender, EventArgs e) + { + InitData(); + } + private void OnHighlightListBoxDrawItem(object sender, DrawItemEventArgs e) { e.DrawBackground(); if (e.Index >= 0) { HilightEntry entry = (HilightEntry)listBoxHighlight.Items[e.Index]; - Rectangle rectangle = new Rectangle(0, e.Bounds.Top, e.Bounds.Width, e.Bounds.Height); + Rectangle rectangle = new(0, e.Bounds.Top, e.Bounds.Width, e.Bounds.Height); if ((e.State & DrawItemState.Selected) != DrawItemState.Selected) { @@ -418,67 +409,59 @@ private void OnHighlightListBoxDrawItem(object sender, DrawItemEventArgs e) } } - private void OnApplyButtonClick(object sender, EventArgs e) - { - SaveEntry(); - } - - private void OnHighlightListBoxSelectedIndexChanged(object sender, EventArgs e) + private void OnListBoxHighlightSelectedIndexChanged(object sender, EventArgs e) { StartEditEntry(); } - private void OnMoveUpButtonClick(object sender, EventArgs e) + private void OnPluginButtonClick(object sender, EventArgs e) { - int index = listBoxHighlight.SelectedIndex; - if (index > 0) - { - object item = listBoxHighlight.SelectedItem; - listBoxHighlight.Items.RemoveAt(index); // will also clear the selection - listBoxHighlight.Items.Insert(index - 1, item); - listBoxHighlight.SelectedIndex = index - 1; // restore the selection - _currentGroup.HilightEntryList.Reverse(index - 1, 2); - } - } + KeywordActionDlg dlg = new(_currentActionEntry, KeywordActionList); - private void OnMoveDownButtonClick(object sender, EventArgs e) - { - int index = listBoxHighlight.SelectedIndex; - if (index > -1 && index < listBoxHighlight.Items.Count - 1) + if (dlg.ShowDialog() == DialogResult.OK) { - object item = listBoxHighlight.SelectedItem; - listBoxHighlight.Items.RemoveAt(index); - listBoxHighlight.Items.Insert(index + 1, item); - listBoxHighlight.SelectedIndex = index + 1; - _currentGroup.HilightEntryList.Reverse(index, 2); + _currentActionEntry = dlg.ActionEntry; + Dirty(); } } - private void OnCustomForeColorButtonClick(object sender, EventArgs e) - { - ChooseColor(colorBoxForeground); - Dirty(); - } + #endregion - private void OnCustomBackColorButtonClick(object sender, EventArgs e) - { - ChooseColor(colorBoxBackground); - Dirty(); - } + #region Private Methods - private void OnRegexCheckBoxMouseUp(object sender, MouseEventArgs e) + private void AddNewEntry() { - if (e.Button == MouseButtons.Right) { - RegexHelperDialog dlg = new RegexHelperDialog(); - dlg.Owner = this; - dlg.CaseSensitive = checkBoxCaseSensitive.Checked; - dlg.Pattern = textBoxSearchString.Text; - DialogResult res = dlg.ShowDialog(); - if (res == DialogResult.OK) + try { - checkBoxCaseSensitive.Checked = dlg.CaseSensitive; - textBoxSearchString.Text = dlg.Pattern; + CheckRegex(); + + // Create a new entry + HilightEntry entry = new( + textBoxSearchString.Text, + colorBoxForeground.SelectedColor, + colorBoxBackground.SelectedColor, + checkBoxRegex.Checked, + checkBoxCaseSensitive.Checked, + checkBoxDontDirtyLed.Checked, + checkBoxStopTail.Checked, + checkBoxBookmark.Checked, + checkBoxPlugin.Checked, + _currentActionEntry, + checkBoxWordMatch.Checked); + + entry.IsBold = checkBoxBold.Checked; + entry.NoBackground = checkBoxNoBackground.Checked; + listBoxHighlight.Items.Add(entry); + + // Select the newly created item + _currentGroup.HilightEntryList.Add(entry); + listBoxHighlight.SelectedItem = entry; + } + catch (Exception ex) + { + _logger.Error(ex, "Error during add of highlight entry"); + MessageBox.Show($"Error during add of entry.\r\n{ex.Message}"); } } } @@ -488,213 +471,246 @@ private void ChangeToDirty(object sender, EventArgs e) Dirty(); } - private void OnPluginCheckBoxCheckedChanged(object sender, EventArgs e) + private void CheckRegex() { - Dirty(); - buttonPlugin.Enabled = checkBoxPlugin.Checked; + if (checkBoxRegex.Checked) + { + if (string.IsNullOrWhiteSpace(textBoxSearchString.Text)) + { + throw new ArgumentException("Regex value is null or whitespace"); + } + + // ReSharper disable once ReturnValueOfPureMethodIsNotUsed + Regex.IsMatch("", textBoxSearchString.Text); + } } - private void OnPluginButtonClick(object sender, EventArgs e) + private void ChooseColor(ColorComboBox comboBox) { - KeywordActionDlg dlg = new KeywordActionDlg(_currentActionEntry, KeywordActionList); - if (dlg.ShowDialog() == DialogResult.OK) + ColorDialog colorDialog = new(); + colorDialog.AllowFullOpen = true; + colorDialog.ShowHelp = false; + colorDialog.Color = comboBox.CustomColor; + if (colorDialog.ShowDialog() == DialogResult.OK) { - _currentActionEntry = dlg.ActionEntry; - Dirty(); + comboBox.CustomColor = colorDialog.Color; + comboBox.SelectedIndex = 0; } } - private void OnBookmarkCommentButtonClick(object sender, EventArgs e) + private void Dirty() { - BookmarkCommentDlg dlg = new BookmarkCommentDlg(); - dlg.Comment = _bookmarkComment; - if (dlg.ShowDialog() == DialogResult.OK) + int index = listBoxHighlight.SelectedIndex; + if (index > -1) { - _bookmarkComment = dlg.Comment; - Dirty(); + btnApply.Enabled = true; + btnApply.Image = _applyButtonImage; } + + btnAdd.Enabled = textBoxSearchString.Text.Length > 0; } - private void OnDelGroupButtonClick(object sender, EventArgs e) + private void FillGroupComboBox() { - // the last group cannot be deleted - if (HighlightGroupList.Count == 1) - { - return; - } + SelectGroup(-1); - if (comboBoxGroups.SelectedIndex >= 0 && comboBoxGroups.SelectedIndex < HighlightGroupList.Count) + comboBoxGroups.Items.Clear(); + + foreach (HilightGroup group in HighlightGroupList) { - int index = comboBoxGroups.SelectedIndex; - HighlightGroupList.RemoveAt(comboBoxGroups.SelectedIndex); - FillGroupComboBox(); - if (index < HighlightGroupList.Count) - { - SelectGroup(index); - } - else - { - SelectGroup(HighlightGroupList.Count - 1); - } + comboBoxGroups.Items.Add(group); } + + ReEvaluateGroupButtonStates(); } - private void OnImportGroupButtonClick(object sender, EventArgs e) + private void FillHighlightListBox() { - ImportSettingsDialog dlg = new ImportSettingsDialog(); - - foreach (Control ctl in dlg.groupBoxImportOptions.Controls) + listBoxHighlight.Items.Clear(); + if (_currentGroup != null) { - if (ctl.Tag != null) + foreach (HilightEntry entry in _currentGroup.HilightEntryList) { - ((CheckBox)ctl).Checked = false; + listBoxHighlight.Items.Add(entry); } } + } - dlg.checkBoxHighlightSettings.Checked = true; - dlg.checkBoxKeepExistingSettings.Checked = true; - - if (dlg.ShowDialog() != DialogResult.OK) + private void InitData() + { + const string def = "[Default]"; + if (HighlightGroupList == null) { - return; + HighlightGroupList = []; } - if (string.IsNullOrWhiteSpace(dlg.FileName)) + if (HighlightGroupList.Count == 0) { - return; - } - - Cursor.Current = Cursors.WaitCursor; - - FileInfo fileInfo; + HilightGroup highlightGroup = new() + { + GroupName = def, + HilightEntryList = [] + }; - try - { - fileInfo = new FileInfo(dlg.FileName); - } - catch (Exception ex) - { - MessageBox.Show(this, $@"Settings could not be imported: {ex}", @"LogExpert"); - _logger.Error($"Error while trying to access file: {dlg.FileName}: {ex}"); - return; + HighlightGroupList.Add(highlightGroup); } - ConfigManager.Import(fileInfo, dlg.ImportFlags); - Cursor.Current = Cursors.Default; - - _highlightGroupList = ConfigManager.Settings.hilightGroupList; - FillGroupComboBox(); - MessageBox.Show(this, @"Settings imported", @"LogExpert"); - } + _currentGroup = null; + string groupToSelect = PreSelectedGroupName; + if (string.IsNullOrEmpty(groupToSelect)) + { + groupToSelect = def; + } - private void OnNewGroupButtonClick(object sender, EventArgs e) - { - // Propose a unique name - const string baseName = "New group"; - string name = baseName; - bool uniqueName = false; - int i = 1; - while (!uniqueName) + foreach (HilightGroup group in HighlightGroupList) { - uniqueName = HighlightGroupList.FindIndex(delegate (HilightGroup g) { return g.GroupName == name; }) < - 0; - if (!uniqueName) + if (group.GroupName.Equals(groupToSelect)) { - name = $"{baseName} #{i++}"; + _currentGroup = group; + comboBoxGroups.SelectedValue = group; + comboBoxGroups.SelectedIndex = HighlightGroupList.IndexOf(group); + break; } } - HilightGroup newGroup = new HilightGroup() { GroupName = name }; - HighlightGroupList.Add(newGroup); - FillGroupComboBox(); - SelectGroup(HighlightGroupList.Count - 1); - } + ReEvaluateGroupButtonStates(); - private void OnCopyGroupButtonClick(object sender, EventArgs e) - { - if (comboBoxGroups.SelectedIndex >= 0 && comboBoxGroups.SelectedIndex < HighlightGroupList.Count) - { - HilightGroup newGroup = ObjectClone.Clone(HighlightGroupList[comboBoxGroups.SelectedIndex]); - newGroup.GroupName = "Copy of " + newGroup.GroupName; - HighlightGroupList.Add(newGroup); - FillGroupComboBox(); - SelectGroup(HighlightGroupList.Count - 1); - } + FillHighlightListBox(); } - private void OnGroupComboBoxDrawItem(object sender, DrawItemEventArgs e) + private void ReEvaluateGroupButtonStates() { - e.DrawBackground(); - if (e.Index >= 0) - { - HilightGroup group = HighlightGroupList[e.Index]; - Rectangle rectangle = new Rectangle(0, e.Bounds.Top, e.Bounds.Width, e.Bounds.Height); + // Refresh button states based on the selection in the combobox + bool atLeastOneSelected = comboBoxGroups.SelectedItem != null; + bool moreThanOne = comboBoxGroups.Items.Count > 1; + bool firstSelected = atLeastOneSelected && comboBoxGroups.SelectedIndex == 0; + bool lastSelected = atLeastOneSelected && comboBoxGroups.SelectedIndex == comboBoxGroups.Items.Count - 1; - Brush brush = new SolidBrush(SystemColors.ControlText); - e.Graphics.DrawString(group.GroupName, e.Font, brush, new PointF(rectangle.Left, rectangle.Top)); - e.DrawFocusRectangle(); - brush.Dispose(); - } + btnDeleteGroup.Enabled = atLeastOneSelected; + btnCopyGroup.Enabled = atLeastOneSelected; + btnMoveGroupUp.Enabled = atLeastOneSelected && moreThanOne && !firstSelected; + btnMoveGroupDown.Enabled = atLeastOneSelected && moreThanOne && !lastSelected; } - private void OnGroupComboBoxTextUpdate(object sender, EventArgs e) + private void ReEvaluateHighlightButtonStates() { - _currentGroup.GroupName = comboBoxGroups.Text; - } + // Refresh button states based on the selection in the combobox + bool atLeastOneSelected = listBoxHighlight.SelectedItem != null; + bool moreThanOne = listBoxHighlight.Items.Count > 1; + bool firstSelected = atLeastOneSelected && listBoxHighlight.SelectedIndex == 0; + bool lastSelected = atLeastOneSelected && listBoxHighlight.SelectedIndex == listBoxHighlight.Items.Count - 1; - private void OnGroupComboBoxSelectionChangeCommitted(object sender, EventArgs e) - { - SelectGroup(comboBoxGroups.SelectedIndex); + btnDelete.Enabled = atLeastOneSelected; + btnMoveUp.Enabled = atLeastOneSelected && moreThanOne && !firstSelected; + btnMoveDown.Enabled = atLeastOneSelected && moreThanOne && !lastSelected; } - private void OnGroupUpButtonClick(object sender, EventArgs e) + private void SaveEntry() { - int index = comboBoxGroups.SelectedIndex; - if (index > 0) + try { - _highlightGroupList.Reverse(index - 1, 2); - comboBoxGroups.Refresh(); - FillGroupComboBox(); - SelectGroup(index - 1); + CheckRegex(); + + HilightEntry entry = (HilightEntry)listBoxHighlight.SelectedItem; + + entry.ForegroundColor = (Color)colorBoxForeground.SelectedItem; + entry.BackgroundColor = (Color)colorBoxBackground.SelectedItem; + entry.SearchText = textBoxSearchString.Text; + entry.IsRegEx = checkBoxRegex.Checked; + entry.IsCaseSensitive = checkBoxCaseSensitive.Checked; + btnApply.Enabled = false; + btnApply.Image = null; + entry.IsLedSwitch = checkBoxDontDirtyLed.Checked; + entry.IsSetBookmark = checkBoxBookmark.Checked; + entry.IsStopTail = checkBoxStopTail.Checked; + entry.IsActionEntry = checkBoxPlugin.Checked; + entry.ActionEntry = _currentActionEntry.Copy(); + entry.BookmarkComment = _bookmarkComment; + entry.IsWordMatch = checkBoxWordMatch.Checked; + entry.IsBold = checkBoxBold.Checked; + entry.NoBackground = checkBoxNoBackground.Checked; + listBoxHighlight.Refresh(); + } + catch (Exception ex) + { + _logger.Error(ex, "Error during save of save highlight entry"); + MessageBox.Show($"Error during save of entry.\r\n{ex.Message}"); } } - private void OnGroupDownButtonClick(object sender, EventArgs e) + private void SelectGroup(int index) { - int index = comboBoxGroups.SelectedIndex; - if (index > -1 && index < _highlightGroupList.Count - 1) + if (index >= 0 && index < HighlightGroupList.Count) { - _highlightGroupList.Reverse(index, 2); - comboBoxGroups.Refresh(); - FillGroupComboBox(); - SelectGroup(index + 1); + _currentGroup = HighlightGroupList[index]; + comboBoxGroups.Items[index] = _currentGroup; + comboBoxGroups.SelectedIndex = index; + comboBoxGroups.SelectedItem = _currentGroup; + FillHighlightListBox(); + } + else + { + comboBoxGroups.SelectedItem = null; + _currentGroup = null; + listBoxHighlight.Items.Clear(); } - } - private void OnWordMatchCheckBoxCheckedChanged(object sender, EventArgs e) - { - Dirty(); - checkBoxNoBackground.Enabled = checkBoxWordMatch.Checked; + ReEvaluateHighlightButtonStates(); + ReEvaluateGroupButtonStates(); } - private void OnNoBackgroundCheckBoxCheckedChanged(object sender, EventArgs e) + private void StartEditEntry() { - colorBoxBackground.Enabled = !checkBoxNoBackground.Checked; - buttonCustomBackColor.Enabled = !checkBoxNoBackground.Checked; - Dirty(); - } + HilightEntry entry = (HilightEntry)listBoxHighlight.SelectedItem; - private void OnBoldCheckBoxCheckedChanged(object sender, EventArgs e) - { - Dirty(); - } - #endregion + if (entry != null) + { + textBoxSearchString.Text = entry.SearchText; - private void OnButtonExportGroupClick(object sender, EventArgs e) - { + colorBoxForeground.CustomColor = entry.ForegroundColor; + colorBoxBackground.CustomColor = entry.BackgroundColor; + if (colorBoxForeground.Items.Contains(entry.ForegroundColor)) + { + colorBoxForeground.SelectedIndex = colorBoxForeground.Items.Cast().ToList().LastIndexOf(entry.ForegroundColor); + } + else + { + colorBoxForeground.SelectedItem = entry.ForegroundColor; + } + + if (colorBoxForeground.Items.Contains(entry.ForegroundColor)) + { + colorBoxBackground.SelectedIndex = colorBoxBackground.Items.Cast().ToList().LastIndexOf(entry.BackgroundColor); + } + else + { + colorBoxBackground.SelectedItem = entry.BackgroundColor; + } + + checkBoxRegex.Checked = entry.IsRegEx; + checkBoxCaseSensitive.Checked = entry.IsCaseSensitive; + checkBoxDontDirtyLed.Checked = entry.IsLedSwitch; + checkBoxBookmark.Checked = entry.IsSetBookmark; + checkBoxStopTail.Checked = entry.IsStopTail; + checkBoxPlugin.Checked = entry.IsActionEntry; + btnSelectPlugin.Enabled = checkBoxPlugin.Checked; + btnBookmarkComment.Enabled = checkBoxBookmark.Checked; + _currentActionEntry = entry.ActionEntry != null ? entry.ActionEntry.Copy() : new ActionEntry(); + _bookmarkComment = entry.BookmarkComment; + checkBoxWordMatch.Checked = entry.IsWordMatch; + checkBoxBold.Checked = entry.IsBold; + checkBoxNoBackground.Checked = entry.NoBackground; + } + + btnApply.Enabled = false; + btnApply.Image = null; + + ReEvaluateHighlightButtonStates(); } + + #endregion } -} \ No newline at end of file +} diff --git a/src/LogExpert/Dialogs/HighlightDialog.resx b/src/LogExpert/Dialogs/HighlightDialog.resx index daf580bd..1a094326 100644 --- a/src/LogExpert/Dialogs/HighlightDialog.resx +++ b/src/LogExpert/Dialogs/HighlightDialog.resx @@ -1,17 +1,17 @@ - @@ -120,10 +120,24 @@ 144, 17 + + + + iVBORw0KGgoAAAANSUhEUgAAACMAAAAjCAYAAAAe2bNZAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAG8SURBVFhH7Ze/K0ZRGMe/5EdKShSbwb9gsdgYSMkgqywS + g52y2ClloJhNBqWI0aBkl0kWg0Fsfva8neft9O3c9z7nPedOfOoM7/1+n+95zr3vPfde4J8/wCKASwAv + AJ4AnACYY1OVvAL4MY57Ls7FY2AyGRcA9gEcArgJ6DIOOCwFDu9gQ4DuQF0S/RnChjNk1MgS4kjKSiou + QPO+WGjEQwWNKJo7y0IRVTUiyD5kzn+LMRto5wNe/gQLjBrbWGiCLZc1RMfHrQs2mQzseVmfLFrmWbKY + DGx6OR8sOkrnuXOGKxYi2C05I4p6JllQ9M8rzxqms2wldEYaNSKoT65GkGdnOGLBKy5qaCeiEUG9Cywo + 585wy4KjqKH1yEYE9Y+yoMwUTKb0Bhra9n7HbPON5qlTZmqlhpppRCibp4aaeljw6Ets5Nhad23sWrZ5 + 8XyzYEDzW1gIoeYRFohBPmBAXtoti62zEVtgRF5XNVduBjNalLMhzZMvjGj8hkzXtwDdvZMX54essWjg + NFcjityCfuAKGwKcUc07G1KYovCYMcBhuRgLTBYasv90cXGVyKNhHsAqgGUA02z4Jwe/XobopVEN3UwA + AAAASUVORK5CYII= + + 17, 17 - AAABAAEAEBAQAAAABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAABAA diff --git a/src/LogExpert/Dialogs/ImportSettingsDialog.Designer.cs b/src/LogExpert/Dialogs/ImportSettingsDialog.Designer.cs index da26071c..2203a049 100644 --- a/src/LogExpert/Dialogs/ImportSettingsDialog.Designer.cs +++ b/src/LogExpert/Dialogs/ImportSettingsDialog.Designer.cs @@ -185,8 +185,6 @@ private void InitializeComponent() // ImportSettingsDialog // this.AcceptButton = this.buttonOk; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.buttonCancel; this.ClientSize = new System.Drawing.Size(412, 224); this.Controls.Add(this.buttonCancel); diff --git a/src/LogExpert/Dialogs/ImportSettingsDialog.cs b/src/LogExpert/Dialogs/ImportSettingsDialog.cs index b2f5fca7..985d9d30 100644 --- a/src/LogExpert/Dialogs/ImportSettingsDialog.cs +++ b/src/LogExpert/Dialogs/ImportSettingsDialog.cs @@ -1,4 +1,5 @@ using System; +using System.Drawing; using System.Windows.Forms; using LogExpert.Config; @@ -15,6 +16,10 @@ public partial class ImportSettingsDialog : Form public ImportSettingsDialog() { InitializeComponent(); + + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; + } #endregion @@ -35,7 +40,7 @@ private void OnImportSettingsDialogLoad(object sender, EventArgs e) private void OnFileButtonClick(object sender, EventArgs e) { - OpenFileDialog dlg = new OpenFileDialog(); + OpenFileDialog dlg = new(); dlg.Title = "Load Settings from file"; dlg.DefaultExt = "json"; dlg.AddExtension = false; diff --git a/src/LogExpert/Dialogs/KeywordActionDlg.Designer.cs b/src/LogExpert/Dialogs/KeywordActionDlg.Designer.cs index 155e7b54..fe915e7c 100644 --- a/src/LogExpert/Dialogs/KeywordActionDlg.Designer.cs +++ b/src/LogExpert/Dialogs/KeywordActionDlg.Designer.cs @@ -28,103 +28,101 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(KeywordActionDlg)); - this.actionComboBox = new System.Windows.Forms.ComboBox(); - this.label1 = new System.Windows.Forms.Label(); - this.parameterTextBox = new System.Windows.Forms.TextBox(); - this.label2 = new System.Windows.Forms.Label(); - this.okButton = new System.Windows.Forms.Button(); - this.cancelButton = new System.Windows.Forms.Button(); - this.commentTextBox = new System.Windows.Forms.TextBox(); - this.SuspendLayout(); - // - // actionComboBox - // - this.actionComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.actionComboBox.FormattingEnabled = true; - this.actionComboBox.Location = new System.Drawing.Point(12, 36); - this.actionComboBox.Name = "actionComboBox"; - this.actionComboBox.Size = new System.Drawing.Size(329, 21); - this.actionComboBox.TabIndex = 0; - this.actionComboBox.SelectedIndexChanged += new System.EventHandler(this.actionComboBox_SelectedIndexChanged); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 20); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(114, 13); - this.label1.TabIndex = 1; - this.label1.Text = "Keyword action plugin:"; - // - // parameterTextBox - // - this.parameterTextBox.Location = new System.Drawing.Point(12, 188); - this.parameterTextBox.Name = "parameterTextBox"; - this.parameterTextBox.Size = new System.Drawing.Size(331, 20); - this.parameterTextBox.TabIndex = 2; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(12, 172); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(55, 13); - this.label2.TabIndex = 3; - this.label2.Text = "Parameter"; - // - // okButton - // - this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.okButton.Location = new System.Drawing.Point(166, 223); - this.okButton.Name = "okButton"; - this.okButton.Size = new System.Drawing.Size(75, 23); - this.okButton.TabIndex = 4; - this.okButton.Text = "OK"; - this.okButton.UseVisualStyleBackColor = true; - this.okButton.Click += new System.EventHandler(this.okButton_Click); - // - // cancelButton - // - this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.cancelButton.Location = new System.Drawing.Point(264, 223); - this.cancelButton.Name = "cancelButton"; - this.cancelButton.Size = new System.Drawing.Size(75, 23); - this.cancelButton.TabIndex = 5; - this.cancelButton.Text = "Cancel"; - this.cancelButton.UseVisualStyleBackColor = true; - // - // commentTextBox - // - this.commentTextBox.Location = new System.Drawing.Point(15, 64); - this.commentTextBox.Multiline = true; - this.commentTextBox.Name = "commentTextBox"; - this.commentTextBox.ReadOnly = true; - this.commentTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.commentTextBox.Size = new System.Drawing.Size(326, 95); - this.commentTextBox.TabIndex = 6; - // - // KeywordActionDlg - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.cancelButton; - this.ClientSize = new System.Drawing.Size(353, 258); - this.Controls.Add(this.commentTextBox); - this.Controls.Add(this.cancelButton); - this.Controls.Add(this.okButton); - this.Controls.Add(this.label2); - this.Controls.Add(this.parameterTextBox); - this.Controls.Add(this.label1); - this.Controls.Add(this.actionComboBox); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "KeywordActionDlg"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Keyword Action"; - this.ResumeLayout(false); - this.PerformLayout(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(KeywordActionDlg)); + this.actionComboBox = new System.Windows.Forms.ComboBox(); + this.label1 = new System.Windows.Forms.Label(); + this.parameterTextBox = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.buttonOk = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.commentTextBox = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // actionComboBox + // + this.actionComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.actionComboBox.FormattingEnabled = true; + this.actionComboBox.Location = new System.Drawing.Point(12, 36); + this.actionComboBox.Name = "actionComboBox"; + this.actionComboBox.Size = new System.Drawing.Size(329, 28); + this.actionComboBox.TabIndex = 0; + this.actionComboBox.SelectedIndexChanged += new System.EventHandler(this.actionComboBox_SelectedIndexChanged); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 20); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(166, 20); + this.label1.TabIndex = 1; + this.label1.Text = "Keyword action plugin:"; + // + // parameterTextBox + // + this.parameterTextBox.Location = new System.Drawing.Point(12, 188); + this.parameterTextBox.Name = "parameterTextBox"; + this.parameterTextBox.Size = new System.Drawing.Size(331, 26); + this.parameterTextBox.TabIndex = 2; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(12, 172); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(83, 20); + this.label2.TabIndex = 3; + this.label2.Text = "Parameter"; + // + // buttonOk + // + this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this.buttonOk.Location = new System.Drawing.Point(166, 223); + this.buttonOk.Name = "buttonOk"; + this.buttonOk.Size = new System.Drawing.Size(75, 23); + this.buttonOk.TabIndex = 4; + this.buttonOk.Text = "OK"; + this.buttonOk.UseVisualStyleBackColor = true; + this.buttonOk.Click += new System.EventHandler(this.OnOkButtonClick); + // + // buttonCancel + // + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(264, 223); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(75, 23); + this.buttonCancel.TabIndex = 5; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + // + // commentTextBox + // + this.commentTextBox.Location = new System.Drawing.Point(15, 64); + this.commentTextBox.Multiline = true; + this.commentTextBox.Name = "commentTextBox"; + this.commentTextBox.ReadOnly = true; + this.commentTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; + this.commentTextBox.Size = new System.Drawing.Size(326, 95); + this.commentTextBox.TabIndex = 6; + // + // KeywordActionDlg + // + this.CancelButton = this.buttonCancel; + this.ClientSize = new System.Drawing.Size(353, 258); + this.Controls.Add(this.commentTextBox); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOk); + this.Controls.Add(this.label2); + this.Controls.Add(this.parameterTextBox); + this.Controls.Add(this.label1); + this.Controls.Add(this.actionComboBox); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "KeywordActionDlg"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Keyword Action"; + this.ResumeLayout(false); + this.PerformLayout(); } @@ -134,8 +132,8 @@ private void InitializeComponent() private System.Windows.Forms.Label label1; private System.Windows.Forms.TextBox parameterTextBox; private System.Windows.Forms.Label label2; - private System.Windows.Forms.Button okButton; - private System.Windows.Forms.Button cancelButton; + private System.Windows.Forms.Button buttonOk; + private System.Windows.Forms.Button buttonCancel; private System.Windows.Forms.TextBox commentTextBox; } } \ No newline at end of file diff --git a/src/LogExpert/Dialogs/KeywordActionDlg.cs b/src/LogExpert/Dialogs/KeywordActionDlg.cs index 408740c3..932a4766 100644 --- a/src/LogExpert/Dialogs/KeywordActionDlg.cs +++ b/src/LogExpert/Dialogs/KeywordActionDlg.cs @@ -21,8 +21,9 @@ public partial class KeywordActionDlg : Form { #region Fields - private readonly IDictionary actionDict = new Dictionary(); - private IList keywordActionList; + private readonly IDictionary _actionDict = new Dictionary(); + + private IList _keywordActionList; #endregion @@ -30,27 +31,35 @@ public partial class KeywordActionDlg : Form public KeywordActionDlg(ActionEntry entry, IList actionList) { - this.keywordActionList = actionList; - this.ActionEntry = entry; + _keywordActionList = actionList; + ActionEntry = entry; + InitializeComponent(); - this.actionComboBox.Items.Clear(); + + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; + + actionComboBox.Items.Clear(); + foreach (IKeywordAction action in actionList) { - this.actionComboBox.Items.Add(action.GetName()); - this.actionDict[action.GetName()] = action; + actionComboBox.Items.Add(action.GetName()); + _actionDict[action.GetName()] = action; } - if (this.actionComboBox.Items.Count > 0) + + if (actionComboBox.Items.Count > 0) { - if (this.ActionEntry.pluginName != null && this.actionDict.ContainsKey(this.ActionEntry.pluginName)) + if (ActionEntry.pluginName != null && _actionDict.ContainsKey(ActionEntry.pluginName)) { - this.actionComboBox.SelectedItem = this.ActionEntry.pluginName; + actionComboBox.SelectedItem = ActionEntry.pluginName; } else { - this.actionComboBox.SelectedIndex = 0; + actionComboBox.SelectedIndex = 0; } } - this.parameterTextBox.Text = this.ActionEntry.actionParam; + + parameterTextBox.Text = ActionEntry.actionParam; } #endregion @@ -63,19 +72,19 @@ public KeywordActionDlg(ActionEntry entry, IList actionList) #region Events handler - private void okButton_Click(object sender, EventArgs e) + private void OnOkButtonClick(object sender, EventArgs e) { ActionEntry = new ActionEntry(); - ActionEntry.actionParam = this.parameterTextBox.Text; - if (this.actionDict.ContainsKey((string) this.actionComboBox.SelectedItem)) + ActionEntry.actionParam = parameterTextBox.Text; + if (_actionDict.ContainsKey((string) actionComboBox.SelectedItem)) { - ActionEntry.pluginName = (string) this.actionComboBox.SelectedItem; + ActionEntry.pluginName = (string) actionComboBox.SelectedItem; } } private void actionComboBox_SelectedIndexChanged(object sender, EventArgs e) { - this.commentTextBox.Text = this.actionDict[(string) this.actionComboBox.SelectedItem].GetDescription(); + commentTextBox.Text = _actionDict[(string) actionComboBox.SelectedItem].GetDescription(); } #endregion diff --git a/src/LogExpert/Dialogs/KeywordActionDlg.resx b/src/LogExpert/Dialogs/KeywordActionDlg.resx index 20cf2a6f..2de0ae4d 100644 --- a/src/LogExpert/Dialogs/KeywordActionDlg.resx +++ b/src/LogExpert/Dialogs/KeywordActionDlg.resx @@ -112,12 +112,12 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + AAABAAEAEBAQAAAABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAABAA diff --git a/src/LogExpert/Dialogs/LogCellEditingControl.cs b/src/LogExpert/Dialogs/LogCellEditingControl.cs index 95df502f..24a68ae0 100644 --- a/src/LogExpert/Dialogs/LogCellEditingControl.cs +++ b/src/LogExpert/Dialogs/LogCellEditingControl.cs @@ -18,7 +18,9 @@ public override bool EditingControlWantsInputKey(Keys key, bool dataGridViewWant case Keys.End: case Keys.PageDown: case Keys.PageUp: + { return true; + } } return !dataGridViewWantsInputKey; diff --git a/src/LogExpert/Dialogs/MultiFileMaskDialog.Designer.cs b/src/LogExpert/Dialogs/MultiFileMaskDialog.Designer.cs index b8e3c476..c6f7f554 100644 --- a/src/LogExpert/Dialogs/MultiFileMaskDialog.Designer.cs +++ b/src/LogExpert/Dialogs/MultiFileMaskDialog.Designer.cs @@ -28,167 +28,165 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MultiFileMaskDialog)); - this.label1 = new System.Windows.Forms.Label(); - this.fileNameLabel = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.maxDaysUpDown = new System.Windows.Forms.NumericUpDown(); - this.fileNamePatternTextBox = new System.Windows.Forms.TextBox(); - this.label3 = new System.Windows.Forms.Label(); - this.Settings = new System.Windows.Forms.GroupBox(); - this.syntaxHelpLabel = new System.Windows.Forms.Label(); - this.buttonOK = new System.Windows.Forms.Button(); - this.buttonCancel = new System.Windows.Forms.Button(); - ((System.ComponentModel.ISupportInitialize)(this.maxDaysUpDown)).BeginInit(); - this.Settings.SuspendLayout(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 13); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(102, 13); - this.label1.TabIndex = 0; - this.label1.Text = "MultiFile settings for:"; - // - // fileNameLabel - // - this.fileNameLabel.AutoSize = true; - this.fileNameLabel.Location = new System.Drawing.Point(111, 13); - this.fileNameLabel.Name = "fileNameLabel"; - this.fileNameLabel.Size = new System.Drawing.Size(61, 13); - this.fileNameLabel.TabIndex = 1; - this.fileNameLabel.Text = ""; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(6, 28); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(91, 13); - this.label2.TabIndex = 2; - this.label2.Text = "File name pattern:"; - // - // maxDaysUpDown - // - this.maxDaysUpDown.Location = new System.Drawing.Point(103, 51); - this.maxDaysUpDown.Maximum = new decimal(new int[] { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MultiFileMaskDialog)); + this.labelMultiSettingsFor = new System.Windows.Forms.Label(); + this.labelFileName = new System.Windows.Forms.Label(); + this.labelFileNamePattern = new System.Windows.Forms.Label(); + this.upDownMaxDays = new System.Windows.Forms.NumericUpDown(); + this.fileNamePatternTextBox = new System.Windows.Forms.TextBox(); + this.labelMaxDays = new System.Windows.Forms.Label(); + this.Settings = new System.Windows.Forms.GroupBox(); + this.syntaxHelpLabel = new System.Windows.Forms.Label(); + this.buttonOk = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.upDownMaxDays)).BeginInit(); + this.Settings.SuspendLayout(); + this.SuspendLayout(); + // + // labelMultiSettingsFor + // + this.labelMultiSettingsFor.AutoSize = true; + this.labelMultiSettingsFor.Location = new System.Drawing.Point(12, 13); + this.labelMultiSettingsFor.Name = "labelMultiSettingsFor"; + this.labelMultiSettingsFor.Size = new System.Drawing.Size(154, 20); + this.labelMultiSettingsFor.TabIndex = 0; + this.labelMultiSettingsFor.Text = "MultiFile settings for:"; + // + // labelFileName + // + this.labelFileName.AutoSize = true; + this.labelFileName.Location = new System.Drawing.Point(172, 13); + this.labelFileName.Name = "labelFileName"; + this.labelFileName.Size = new System.Drawing.Size(91, 20); + this.labelFileName.TabIndex = 1; + this.labelFileName.Text = ""; + // + // labelFileNamePattern + // + this.labelFileNamePattern.AutoSize = true; + this.labelFileNamePattern.Location = new System.Drawing.Point(6, 28); + this.labelFileNamePattern.Name = "labelFileNamePattern"; + this.labelFileNamePattern.Size = new System.Drawing.Size(137, 20); + this.labelFileNamePattern.TabIndex = 2; + this.labelFileNamePattern.Text = "File name pattern:"; + // + // upDownMaxDays + // + this.upDownMaxDays.Location = new System.Drawing.Point(91, 55); + this.upDownMaxDays.Maximum = new decimal(new int[] { 40, 0, 0, 0}); - this.maxDaysUpDown.Name = "maxDaysUpDown"; - this.maxDaysUpDown.Size = new System.Drawing.Size(49, 20); - this.maxDaysUpDown.TabIndex = 3; - this.maxDaysUpDown.Value = new decimal(new int[] { + this.upDownMaxDays.Name = "upDownMaxDays"; + this.upDownMaxDays.Size = new System.Drawing.Size(49, 26); + this.upDownMaxDays.TabIndex = 3; + this.upDownMaxDays.Value = new decimal(new int[] { 1, 0, 0, 0}); - // - // fileNamePatternTextBox - // - this.fileNamePatternTextBox.Location = new System.Drawing.Point(103, 25); - this.fileNamePatternTextBox.Name = "fileNamePatternTextBox"; - this.fileNamePatternTextBox.Size = new System.Drawing.Size(157, 20); - this.fileNamePatternTextBox.TabIndex = 4; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(6, 53); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(55, 13); - this.label3.TabIndex = 5; - this.label3.Text = "Max days:"; - // - // Settings - // - this.Settings.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.Settings.Controls.Add(this.label2); - this.Settings.Controls.Add(this.label3); - this.Settings.Controls.Add(this.maxDaysUpDown); - this.Settings.Controls.Add(this.fileNamePatternTextBox); - this.Settings.Location = new System.Drawing.Point(15, 39); - this.Settings.Name = "Settings"; - this.Settings.Size = new System.Drawing.Size(402, 88); - this.Settings.TabIndex = 6; - this.Settings.TabStop = false; - // - // syntaxHelpLabel - // - this.syntaxHelpLabel.Location = new System.Drawing.Point(15, 140); - this.syntaxHelpLabel.Name = "syntaxHelpLabel"; - this.syntaxHelpLabel.Size = new System.Drawing.Size(402, 194); - this.syntaxHelpLabel.TabIndex = 7; - this.syntaxHelpLabel.Text = "label4"; - // - // buttonOK - // - this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK; - this.buttonOK.Location = new System.Drawing.Point(261, 347); - this.buttonOK.Name = "buttonOK"; - this.buttonOK.Size = new System.Drawing.Size(75, 23); - this.buttonOK.TabIndex = 8; - this.buttonOK.Text = "OK"; - this.buttonOK.UseVisualStyleBackColor = true; - this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); - // - // buttonCancel - // - this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(342, 347); - this.buttonCancel.Name = "buttonCancel"; - this.buttonCancel.Size = new System.Drawing.Size(75, 23); - this.buttonCancel.TabIndex = 9; - this.buttonCancel.Text = "Cancel"; - this.buttonCancel.UseVisualStyleBackColor = true; - // - // MultiFileMaskDialog - // - this.AcceptButton = this.buttonOK; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.buttonCancel; - this.ClientSize = new System.Drawing.Size(434, 386); - this.Controls.Add(this.buttonCancel); - this.Controls.Add(this.buttonOK); - this.Controls.Add(this.syntaxHelpLabel); - this.Controls.Add(this.Settings); - this.Controls.Add(this.fileNameLabel); - this.Controls.Add(this.label1); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(329, 420); - this.Name = "MultiFileMaskDialog"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "MultiFile settings"; - this.TopMost = true; - this.Load += new System.EventHandler(this.MultiFileMaskDialog_Load); - ((System.ComponentModel.ISupportInitialize)(this.maxDaysUpDown)).EndInit(); - this.Settings.ResumeLayout(false); - this.Settings.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); + // + // fileNamePatternTextBox + // + this.fileNamePatternTextBox.Location = new System.Drawing.Point(149, 25); + this.fileNamePatternTextBox.Name = "fileNamePatternTextBox"; + this.fileNamePatternTextBox.Size = new System.Drawing.Size(247, 26); + this.fileNamePatternTextBox.TabIndex = 4; + // + // labelMaxDays + // + this.labelMaxDays.AutoSize = true; + this.labelMaxDays.Location = new System.Drawing.Point(6, 57); + this.labelMaxDays.Name = "labelMaxDays"; + this.labelMaxDays.Size = new System.Drawing.Size(79, 20); + this.labelMaxDays.TabIndex = 5; + this.labelMaxDays.Text = "Max days:"; + // + // Settings + // + this.Settings.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.Settings.Controls.Add(this.labelFileNamePattern); + this.Settings.Controls.Add(this.labelMaxDays); + this.Settings.Controls.Add(this.upDownMaxDays); + this.Settings.Controls.Add(this.fileNamePatternTextBox); + this.Settings.Location = new System.Drawing.Point(15, 39); + this.Settings.Name = "Settings"; + this.Settings.Size = new System.Drawing.Size(402, 98); + this.Settings.TabIndex = 6; + this.Settings.TabStop = false; + // + // syntaxHelpLabel + // + this.syntaxHelpLabel.Location = new System.Drawing.Point(15, 140); + this.syntaxHelpLabel.Name = "syntaxHelpLabel"; + this.syntaxHelpLabel.Size = new System.Drawing.Size(402, 194); + this.syntaxHelpLabel.TabIndex = 7; + this.syntaxHelpLabel.Text = "Syntax Help Label"; + // + // buttonOk + // + this.buttonOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this.buttonOk.Location = new System.Drawing.Point(261, 347); + this.buttonOk.Name = "buttonOk"; + this.buttonOk.Size = new System.Drawing.Size(75, 23); + this.buttonOk.TabIndex = 8; + this.buttonOk.Text = "OK"; + this.buttonOk.UseVisualStyleBackColor = true; + this.buttonOk.Click += new System.EventHandler(this.OnButtonOKClick); + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(342, 347); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(75, 23); + this.buttonCancel.TabIndex = 9; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + // + // MultiFileMaskDialog + // + this.AcceptButton = this.buttonOk; + this.CancelButton = this.buttonCancel; + this.ClientSize = new System.Drawing.Size(434, 386); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOk); + this.Controls.Add(this.syntaxHelpLabel); + this.Controls.Add(this.Settings); + this.Controls.Add(this.labelFileName); + this.Controls.Add(this.labelMultiSettingsFor); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(329, 420); + this.Name = "MultiFileMaskDialog"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "MultiFile settings"; + this.TopMost = true; + this.Load += new System.EventHandler(this.OnMultiFileMaskDialogLoad); + ((System.ComponentModel.ISupportInitialize)(this.upDownMaxDays)).EndInit(); + this.Settings.ResumeLayout(false); + this.Settings.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); } #endregion - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label fileNameLabel; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.NumericUpDown maxDaysUpDown; + private System.Windows.Forms.Label labelMultiSettingsFor; + private System.Windows.Forms.Label labelFileName; + private System.Windows.Forms.Label labelFileNamePattern; + private System.Windows.Forms.NumericUpDown upDownMaxDays; private System.Windows.Forms.TextBox fileNamePatternTextBox; - private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label labelMaxDays; private System.Windows.Forms.GroupBox Settings; private System.Windows.Forms.Label syntaxHelpLabel; - private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.Button buttonOk; private System.Windows.Forms.Button buttonCancel; } } \ No newline at end of file diff --git a/src/LogExpert/Dialogs/MultiFileMaskDialog.cs b/src/LogExpert/Dialogs/MultiFileMaskDialog.cs index d1fde540..c8c7ff8b 100644 --- a/src/LogExpert/Dialogs/MultiFileMaskDialog.cs +++ b/src/LogExpert/Dialogs/MultiFileMaskDialog.cs @@ -1,11 +1,6 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; using System.Drawing; -using System.Text; using System.Windows.Forms; -using System.IO; namespace LogExpert.Dialogs { @@ -20,7 +15,14 @@ public partial class MultiFileMaskDialog : Form public MultiFileMaskDialog(Form parent, string fileName) { InitializeComponent(); - this.syntaxHelpLabel.Text = "" + + + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; + + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; + + syntaxHelpLabel.Text = "" + "Pattern syntax:\n\n" + "* = any characters (wildcard)\n" + "$D() = Date pattern\n" + @@ -32,9 +34,8 @@ public MultiFileMaskDialog(Form parent, string fileName) "DD = day\n" + "MM = month\n" + "YY[YY] = year\n" + - "all other chars will be used as given" - ; - this.fileNameLabel.Text = fileName; + "all other chars will be used as given"; + labelFileName.Text = fileName; } #endregion @@ -49,16 +50,16 @@ public MultiFileMaskDialog(Form parent, string fileName) #region Events handler - private void buttonOK_Click(object sender, EventArgs e) + private void OnButtonOKClick(object sender, EventArgs e) { - this.FileNamePattern = this.fileNamePatternTextBox.Text; - this.MaxDays = (int) this.maxDaysUpDown.Value; + FileNamePattern = fileNamePatternTextBox.Text; + MaxDays = (int) upDownMaxDays.Value; } - private void MultiFileMaskDialog_Load(object sender, EventArgs e) + private void OnMultiFileMaskDialogLoad(object sender, EventArgs e) { - this.fileNamePatternTextBox.Text = this.FileNamePattern; - this.maxDaysUpDown.Value = this.MaxDays; + fileNamePatternTextBox.Text = FileNamePattern; + upDownMaxDays.Value = MaxDays; } #endregion diff --git a/src/LogExpert/Dialogs/MultiFileMaskDialog.resx b/src/LogExpert/Dialogs/MultiFileMaskDialog.resx index 20cf2a6f..2de0ae4d 100644 --- a/src/LogExpert/Dialogs/MultiFileMaskDialog.resx +++ b/src/LogExpert/Dialogs/MultiFileMaskDialog.resx @@ -112,12 +112,12 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + AAABAAEAEBAQAAAABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAABAA diff --git a/src/LogExpert/Dialogs/MultiLoadRequestDialog.Designer.cs b/src/LogExpert/Dialogs/MultiLoadRequestDialog.Designer.cs index 338a41e4..e6dadd63 100644 --- a/src/LogExpert/Dialogs/MultiLoadRequestDialog.Designer.cs +++ b/src/LogExpert/Dialogs/MultiLoadRequestDialog.Designer.cs @@ -28,64 +28,62 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.button1 = new System.Windows.Forms.Button(); - this.button2 = new System.Windows.Forms.Button(); - this.label1 = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // button1 - // - this.button1.DialogResult = System.Windows.Forms.DialogResult.Yes; - this.button1.Location = new System.Drawing.Point(12, 59); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(75, 23); - this.button1.TabIndex = 1; - this.button1.Text = "Single files"; - this.button1.UseVisualStyleBackColor = true; - // - // button2 - // - this.button2.DialogResult = System.Windows.Forms.DialogResult.No; - this.button2.Location = new System.Drawing.Point(114, 59); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(75, 23); - this.button2.TabIndex = 2; - this.button2.Text = "Multi file"; - this.button2.UseVisualStyleBackColor = true; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(48, 18); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(112, 13); - this.label1.TabIndex = 4; - this.label1.Text = "Choose loading mode:"; - // - // MultiLoadRequestDialog - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(206, 103); - this.Controls.Add(this.label1); - this.Controls.Add(this.button2); - this.Controls.Add(this.button1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "MultiLoadRequestDialog"; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Loading multiple files"; - this.ResumeLayout(false); - this.PerformLayout(); + this.buttonSingleMode = new System.Windows.Forms.Button(); + this.buttonMultiMode = new System.Windows.Forms.Button(); + this.labelChooseLoadingMode = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // buttonSingleMode + // + this.buttonSingleMode.DialogResult = System.Windows.Forms.DialogResult.Yes; + this.buttonSingleMode.Location = new System.Drawing.Point(12, 59); + this.buttonSingleMode.Name = "buttonSingleMode"; + this.buttonSingleMode.Size = new System.Drawing.Size(75, 23); + this.buttonSingleMode.TabIndex = 1; + this.buttonSingleMode.Text = "Single files"; + this.buttonSingleMode.UseVisualStyleBackColor = true; + // + // buttonMultiMode + // + this.buttonMultiMode.DialogResult = System.Windows.Forms.DialogResult.No; + this.buttonMultiMode.Location = new System.Drawing.Point(114, 59); + this.buttonMultiMode.Name = "buttonMultiMode"; + this.buttonMultiMode.Size = new System.Drawing.Size(75, 23); + this.buttonMultiMode.TabIndex = 2; + this.buttonMultiMode.Text = "Multi file"; + this.buttonMultiMode.UseVisualStyleBackColor = true; + // + // labelChooseLoadingMode + // + this.labelChooseLoadingMode.AutoSize = true; + this.labelChooseLoadingMode.Location = new System.Drawing.Point(48, 18); + this.labelChooseLoadingMode.Name = "labelChooseLoadingMode"; + this.labelChooseLoadingMode.Size = new System.Drawing.Size(167, 20); + this.labelChooseLoadingMode.TabIndex = 4; + this.labelChooseLoadingMode.Text = "Choose loading mode:"; + // + // MultiLoadRequestDialog + // + this.ClientSize = new System.Drawing.Size(237, 103); + this.Controls.Add(this.labelChooseLoadingMode); + this.Controls.Add(this.buttonMultiMode); + this.Controls.Add(this.buttonSingleMode); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "MultiLoadRequestDialog"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Loading multiple files"; + this.ResumeLayout(false); + this.PerformLayout(); } #endregion - private System.Windows.Forms.Button button1; - private System.Windows.Forms.Button button2; - private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button buttonSingleMode; + private System.Windows.Forms.Button buttonMultiMode; + private System.Windows.Forms.Label labelChooseLoadingMode; } } \ No newline at end of file diff --git a/src/LogExpert/Dialogs/MultiLoadRequestDialog.cs b/src/LogExpert/Dialogs/MultiLoadRequestDialog.cs index bbfdcf1b..1e9c94fb 100644 --- a/src/LogExpert/Dialogs/MultiLoadRequestDialog.cs +++ b/src/LogExpert/Dialogs/MultiLoadRequestDialog.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; +using System.Drawing; using System.Windows.Forms; namespace LogExpert.Dialogs @@ -15,6 +10,9 @@ public partial class MultiLoadRequestDialog : Form public MultiLoadRequestDialog() { InitializeComponent(); + + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; } #endregion diff --git a/src/LogExpert/Dialogs/MultiLoadRequestDialog.resx b/src/LogExpert/Dialogs/MultiLoadRequestDialog.resx index ff31a6db..c7e0d4bd 100644 --- a/src/LogExpert/Dialogs/MultiLoadRequestDialog.resx +++ b/src/LogExpert/Dialogs/MultiLoadRequestDialog.resx @@ -112,9 +112,9 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 \ No newline at end of file diff --git a/src/LogExpert/Dialogs/OpenUriDialog.Designer.cs b/src/LogExpert/Dialogs/OpenUriDialog.Designer.cs index 7a46ba57..1d0235f6 100644 --- a/src/LogExpert/Dialogs/OpenUriDialog.Designer.cs +++ b/src/LogExpert/Dialogs/OpenUriDialog.Designer.cs @@ -65,7 +65,7 @@ private void InitializeComponent() this.okButton.TabIndex = 2; this.okButton.Text = "OK"; this.okButton.UseVisualStyleBackColor = true; - this.okButton.Click += new System.EventHandler(this.OnOkButtonClick); + this.okButton.Click += new System.EventHandler(this.OnBtnOkClick); // // cancelButton // @@ -91,8 +91,6 @@ private void InitializeComponent() // OpenUriDialog // this.AcceptButton = this.okButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.cancelButton; this.ClientSize = new System.Drawing.Size(475, 162); this.Controls.Add(this.label2); diff --git a/src/LogExpert/Dialogs/OpenUriDialog.cs b/src/LogExpert/Dialogs/OpenUriDialog.cs index 64cb3a44..9c364f96 100644 --- a/src/LogExpert/Dialogs/OpenUriDialog.cs +++ b/src/LogExpert/Dialogs/OpenUriDialog.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Drawing; using System.Windows.Forms; namespace LogExpert.Dialogs @@ -15,6 +16,9 @@ public partial class OpenUriDialog : Form public OpenUriDialog() { InitializeComponent(); + + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; } #endregion @@ -41,7 +45,7 @@ private void OnOpenUriDialogLoad(object sender, EventArgs e) } } - private void OnOkButtonClick(object sender, EventArgs e) + private void OnBtnOkClick(object sender, EventArgs e) { UriHistory = new List(); foreach (object item in cmbUri.Items) diff --git a/src/LogExpert/Dialogs/OpenUriDialog.resx b/src/LogExpert/Dialogs/OpenUriDialog.resx index 20cf2a6f..2de0ae4d 100644 --- a/src/LogExpert/Dialogs/OpenUriDialog.resx +++ b/src/LogExpert/Dialogs/OpenUriDialog.resx @@ -112,12 +112,12 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + AAABAAEAEBAQAAAABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAABAA diff --git a/src/LogExpert/Dialogs/OverlayEventArgs.cs b/src/LogExpert/Dialogs/OverlayEventArgs.cs index 85b8361a..c2a9d0ca 100644 --- a/src/LogExpert/Dialogs/OverlayEventArgs.cs +++ b/src/LogExpert/Dialogs/OverlayEventArgs.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; using LogExpert.Entities; namespace LogExpert.Dialogs @@ -15,7 +13,7 @@ public class OverlayEventArgs : EventArgs public OverlayEventArgs(BookmarkOverlay overlay) { - this.BookmarkOverlay = overlay; + BookmarkOverlay = overlay; } #endregion diff --git a/src/LogExpert/Dialogs/ParamRequesterDialog.Designer.cs b/src/LogExpert/Dialogs/ParamRequesterDialog.Designer.cs index b46e3872..48fbbbba 100644 --- a/src/LogExpert/Dialogs/ParamRequesterDialog.Designer.cs +++ b/src/LogExpert/Dialogs/ParamRequesterDialog.Designer.cs @@ -28,80 +28,78 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.paramLabel = new System.Windows.Forms.Label(); - this.cancelButton = new System.Windows.Forms.Button(); - this.okButton = new System.Windows.Forms.Button(); - this.valueComboBox = new System.Windows.Forms.ComboBox(); - this.SuspendLayout(); - // - // paramLabel - // - this.paramLabel.AutoSize = true; - this.paramLabel.Location = new System.Drawing.Point(13, 32); - this.paramLabel.Name = "paramLabel"; - this.paramLabel.Size = new System.Drawing.Size(99, 13); - this.paramLabel.TabIndex = 0; - this.paramLabel.Text = "&Value for parameter"; - // - // cancelButton - // - this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.cancelButton.Location = new System.Drawing.Point(238, 88); - this.cancelButton.Name = "cancelButton"; - this.cancelButton.Size = new System.Drawing.Size(75, 23); - this.cancelButton.TabIndex = 3; - this.cancelButton.Text = "Cancel"; - this.cancelButton.UseVisualStyleBackColor = true; - // - // okButton - // - this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.okButton.Location = new System.Drawing.Point(148, 88); - this.okButton.Name = "okButton"; - this.okButton.Size = new System.Drawing.Size(75, 23); - this.okButton.TabIndex = 2; - this.okButton.Text = "OK"; - this.okButton.UseVisualStyleBackColor = true; - this.okButton.Click += new System.EventHandler(this.okButton_Click); - // - // valueComboBox - // - this.valueComboBox.FormattingEnabled = true; - this.valueComboBox.Location = new System.Drawing.Point(16, 48); - this.valueComboBox.Name = "valueComboBox"; - this.valueComboBox.Size = new System.Drawing.Size(297, 21); - this.valueComboBox.TabIndex = 1; - // - // ParamRequesterDialog - // - this.AcceptButton = this.okButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.cancelButton; - this.ClientSize = new System.Drawing.Size(332, 130); - this.Controls.Add(this.valueComboBox); - this.Controls.Add(this.okButton); - this.Controls.Add(this.cancelButton); - this.Controls.Add(this.paramLabel); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "ParamRequesterDialog"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Tool parameter"; - this.Shown += new System.EventHandler(this.ParamRequesterDialog_Shown); - this.ResumeLayout(false); - this.PerformLayout(); + this.labelValueForParameter = new System.Windows.Forms.Label(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.buttonOk = new System.Windows.Forms.Button(); + this.comboBoxValue = new System.Windows.Forms.ComboBox(); + this.SuspendLayout(); + // + // labelValueForParameter + // + this.labelValueForParameter.AutoSize = true; + this.labelValueForParameter.Location = new System.Drawing.Point(13, 25); + this.labelValueForParameter.Name = "labelValueForParameter"; + this.labelValueForParameter.Size = new System.Drawing.Size(154, 20); + this.labelValueForParameter.TabIndex = 0; + this.labelValueForParameter.Text = "&Value for parameter:"; + // + // buttonCancel + // + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(238, 88); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(75, 23); + this.buttonCancel.TabIndex = 3; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + // + // buttonOk + // + this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this.buttonOk.Location = new System.Drawing.Point(148, 88); + this.buttonOk.Name = "buttonOk"; + this.buttonOk.Size = new System.Drawing.Size(75, 23); + this.buttonOk.TabIndex = 2; + this.buttonOk.Text = "OK"; + this.buttonOk.UseVisualStyleBackColor = true; + this.buttonOk.Click += new System.EventHandler(this.okButton_Click); + // + // comboBoxValue + // + this.comboBoxValue.FormattingEnabled = true; + this.comboBoxValue.Location = new System.Drawing.Point(16, 48); + this.comboBoxValue.Name = "comboBoxValue"; + this.comboBoxValue.Size = new System.Drawing.Size(297, 28); + this.comboBoxValue.TabIndex = 1; + // + // ParamRequesterDialog + // + this.AcceptButton = this.buttonOk; + this.CancelButton = this.buttonCancel; + this.ClientSize = new System.Drawing.Size(332, 130); + this.Controls.Add(this.comboBoxValue); + this.Controls.Add(this.buttonOk); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.labelValueForParameter); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ParamRequesterDialog"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Tool parameter"; + this.Shown += new System.EventHandler(this.ParamRequesterDialog_Shown); + this.ResumeLayout(false); + this.PerformLayout(); } #endregion - private System.Windows.Forms.Label paramLabel; - private System.Windows.Forms.Button cancelButton; - private System.Windows.Forms.Button okButton; - private System.Windows.Forms.ComboBox valueComboBox; + private System.Windows.Forms.Label labelValueForParameter; + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.Button buttonOk; + private System.Windows.Forms.ComboBox comboBoxValue; } } \ No newline at end of file diff --git a/src/LogExpert/Dialogs/ParamRequesterDialog.cs b/src/LogExpert/Dialogs/ParamRequesterDialog.cs index 7f7d751a..21dca01e 100644 --- a/src/LogExpert/Dialogs/ParamRequesterDialog.cs +++ b/src/LogExpert/Dialogs/ParamRequesterDialog.cs @@ -19,6 +19,9 @@ public partial class ParamRequesterDialog : Form public ParamRequesterDialog() { InitializeComponent(); + + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; } #endregion @@ -37,20 +40,21 @@ public ParamRequesterDialog() private void ParamRequesterDialog_Shown(object sender, EventArgs e) { - this.paramLabel.Text = ParamName; - if (this.Values != null) + labelValueForParameter.Text = ParamName; + + if (Values != null) { - foreach (string value in this.Values) + foreach (string value in Values) { - this.valueComboBox.Items.Add(value); + comboBoxValue.Items.Add(value); } - this.valueComboBox.SelectedIndex = 0; + comboBoxValue.SelectedIndex = 0; } } private void okButton_Click(object sender, EventArgs e) { - this.ParamValue = this.valueComboBox.Text; + ParamValue = comboBoxValue.Text; } #endregion diff --git a/src/LogExpert/Dialogs/ParamRequesterDialog.resx b/src/LogExpert/Dialogs/ParamRequesterDialog.resx index ff31a6db..c7e0d4bd 100644 --- a/src/LogExpert/Dialogs/ParamRequesterDialog.resx +++ b/src/LogExpert/Dialogs/ParamRequesterDialog.resx @@ -112,9 +112,9 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 \ No newline at end of file diff --git a/src/LogExpert/Dialogs/ProjectLoadDlg.Designer.cs b/src/LogExpert/Dialogs/ProjectLoadDlg.Designer.cs index ee655823..66d59c89 100644 --- a/src/LogExpert/Dialogs/ProjectLoadDlg.Designer.cs +++ b/src/LogExpert/Dialogs/ProjectLoadDlg.Designer.cs @@ -28,95 +28,93 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ProjectLoadDlg)); - this.label1 = new System.Windows.Forms.Label(); - this.closeTabsButton = new System.Windows.Forms.Button(); - this.newWindowButton = new System.Windows.Forms.Button(); - this.ignoreButton = new System.Windows.Forms.Button(); - this.label2 = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // label1 - // - this.label1.Location = new System.Drawing.Point(12, 9); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(178, 41); - this.label1.TabIndex = 0; - this.label1.Text = "Restoring layout requires an empty workbench. \r\n\r\n"; - // - // closeTabsButton - // - this.closeTabsButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.closeTabsButton.Location = new System.Drawing.Point(43, 94); - this.closeTabsButton.Name = "closeTabsButton"; - this.closeTabsButton.Size = new System.Drawing.Size(113, 23); - this.closeTabsButton.TabIndex = 1; - this.closeTabsButton.Text = "Close existing tabs"; - this.closeTabsButton.UseVisualStyleBackColor = true; - this.closeTabsButton.Click += new System.EventHandler(this.closeTabsButton_Click); - // - // newWindowButton - // - this.newWindowButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.newWindowButton.Location = new System.Drawing.Point(43, 124); - this.newWindowButton.Name = "newWindowButton"; - this.newWindowButton.Size = new System.Drawing.Size(113, 23); - this.newWindowButton.TabIndex = 2; - this.newWindowButton.Text = "Open new window"; - this.newWindowButton.UseVisualStyleBackColor = true; - this.newWindowButton.Click += new System.EventHandler(this.newWindowButton_Click); - // - // ignoreButton - // - this.ignoreButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.ignoreButton.Location = new System.Drawing.Point(43, 154); - this.ignoreButton.Name = "ignoreButton"; - this.ignoreButton.Size = new System.Drawing.Size(113, 23); - this.ignoreButton.TabIndex = 3; - this.ignoreButton.Text = "Ignore layout data"; - this.ignoreButton.UseVisualStyleBackColor = true; - this.ignoreButton.Click += new System.EventHandler(this.ignoreButton_Click); - // - // label2 - // - this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(21, 66); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(157, 13); - this.label2.TabIndex = 4; - this.label2.Text = "Please choose how to proceed:"; - // - // ProjectLoadDlg - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(202, 196); - this.Controls.Add(this.label2); - this.Controls.Add(this.ignoreButton); - this.Controls.Add(this.newWindowButton); - this.Controls.Add(this.closeTabsButton); - this.Controls.Add(this.label1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "ProjectLoadDlg"; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Loading Session"; - this.ResumeLayout(false); - this.PerformLayout(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ProjectLoadDlg)); + this.labelInformational = new System.Windows.Forms.Label(); + this.buttonCloseTabs = new System.Windows.Forms.Button(); + this.buttonNewWindow = new System.Windows.Forms.Button(); + this.buttonIgnore = new System.Windows.Forms.Button(); + this.labelChooseHowToProceed = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // labelInformational + // + this.labelInformational.Location = new System.Drawing.Point(12, 9); + this.labelInformational.Name = "labelInformational"; + this.labelInformational.Size = new System.Drawing.Size(178, 41); + this.labelInformational.TabIndex = 0; + this.labelInformational.Text = "Restoring layout requires an empty workbench. \r\n\r\n"; + // + // buttonCloseTabs + // + this.buttonCloseTabs.DialogResult = System.Windows.Forms.DialogResult.OK; + this.buttonCloseTabs.Location = new System.Drawing.Point(43, 94); + this.buttonCloseTabs.Name = "buttonCloseTabs"; + this.buttonCloseTabs.Size = new System.Drawing.Size(113, 23); + this.buttonCloseTabs.TabIndex = 1; + this.buttonCloseTabs.Text = "Close existing tabs"; + this.buttonCloseTabs.UseVisualStyleBackColor = true; + this.buttonCloseTabs.Click += new System.EventHandler(this.OnButtonCloseTabsClick); + // + // buttonNewWindow + // + this.buttonNewWindow.DialogResult = System.Windows.Forms.DialogResult.OK; + this.buttonNewWindow.Location = new System.Drawing.Point(43, 124); + this.buttonNewWindow.Name = "buttonNewWindow"; + this.buttonNewWindow.Size = new System.Drawing.Size(113, 23); + this.buttonNewWindow.TabIndex = 2; + this.buttonNewWindow.Text = "Open new window"; + this.buttonNewWindow.UseVisualStyleBackColor = true; + this.buttonNewWindow.Click += new System.EventHandler(this.OnButtonNewWindowClick); + // + // buttonIgnore + // + this.buttonIgnore.DialogResult = System.Windows.Forms.DialogResult.OK; + this.buttonIgnore.Location = new System.Drawing.Point(43, 154); + this.buttonIgnore.Name = "buttonIgnore"; + this.buttonIgnore.Size = new System.Drawing.Size(113, 23); + this.buttonIgnore.TabIndex = 3; + this.buttonIgnore.Text = "Ignore layout data"; + this.buttonIgnore.UseVisualStyleBackColor = true; + this.buttonIgnore.Click += new System.EventHandler(this.OnButtonIgnoreClick); + // + // labelChooseHowToProceed + // + this.labelChooseHowToProceed.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.labelChooseHowToProceed.AutoSize = true; + this.labelChooseHowToProceed.Location = new System.Drawing.Point(21, 66); + this.labelChooseHowToProceed.Name = "labelChooseHowToProceed"; + this.labelChooseHowToProceed.Size = new System.Drawing.Size(230, 20); + this.labelChooseHowToProceed.TabIndex = 4; + this.labelChooseHowToProceed.Text = "Please choose how to proceed:"; + // + // ProjectLoadDlg + // + this.ClientSize = new System.Drawing.Size(258, 196); + this.Controls.Add(this.labelChooseHowToProceed); + this.Controls.Add(this.buttonIgnore); + this.Controls.Add(this.buttonNewWindow); + this.Controls.Add(this.buttonCloseTabs); + this.Controls.Add(this.labelInformational); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ProjectLoadDlg"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Loading Session"; + this.ResumeLayout(false); + this.PerformLayout(); } #endregion - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Button closeTabsButton; - private System.Windows.Forms.Button newWindowButton; - private System.Windows.Forms.Button ignoreButton; - private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label labelInformational; + private System.Windows.Forms.Button buttonCloseTabs; + private System.Windows.Forms.Button buttonNewWindow; + private System.Windows.Forms.Button buttonIgnore; + private System.Windows.Forms.Label labelChooseHowToProceed; } } \ No newline at end of file diff --git a/src/LogExpert/Dialogs/ProjectLoadDlg.cs b/src/LogExpert/Dialogs/ProjectLoadDlg.cs index b22a27a0..2a53437b 100644 --- a/src/LogExpert/Dialogs/ProjectLoadDlg.cs +++ b/src/LogExpert/Dialogs/ProjectLoadDlg.cs @@ -27,6 +27,9 @@ public partial class ProjectLoadDlg : Form public ProjectLoadDlg() { InitializeComponent(); + + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; } #endregion @@ -39,21 +42,21 @@ public ProjectLoadDlg() #region Events handler - private void closeTabsButton_Click(object sender, EventArgs e) + private void OnButtonCloseTabsClick(object sender, EventArgs e) { - this.ProjectLoadResult = ProjectLoadDlgResult.CloseTabs; + ProjectLoadResult = ProjectLoadDlgResult.CloseTabs; Close(); } - private void newWindowButton_Click(object sender, EventArgs e) + private void OnButtonNewWindowClick(object sender, EventArgs e) { - this.ProjectLoadResult = ProjectLoadDlgResult.NewWindow; + ProjectLoadResult = ProjectLoadDlgResult.NewWindow; Close(); } - private void ignoreButton_Click(object sender, EventArgs e) + private void OnButtonIgnoreClick(object sender, EventArgs e) { - this.ProjectLoadResult = ProjectLoadDlgResult.IgnoreLayout; + ProjectLoadResult = ProjectLoadDlgResult.IgnoreLayout; Close(); } diff --git a/src/LogExpert/Dialogs/ProjectLoadDlg.resx b/src/LogExpert/Dialogs/ProjectLoadDlg.resx index 20cf2a6f..2de0ae4d 100644 --- a/src/LogExpert/Dialogs/ProjectLoadDlg.resx +++ b/src/LogExpert/Dialogs/ProjectLoadDlg.resx @@ -112,12 +112,12 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + AAABAAEAEBAQAAAABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAABAA diff --git a/src/LogExpert/Dialogs/RegexHelperDialog.Designer.cs b/src/LogExpert/Dialogs/RegexHelperDialog.Designer.cs index 518b43aa..05fda035 100644 --- a/src/LogExpert/Dialogs/RegexHelperDialog.Designer.cs +++ b/src/LogExpert/Dialogs/RegexHelperDialog.Designer.cs @@ -28,170 +28,168 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.cancelButton = new System.Windows.Forms.Button(); - this.okButton = new System.Windows.Forms.Button(); - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.matchesTextBox = new System.Windows.Forms.TextBox(); - this.caseSensitiveCheckBox = new System.Windows.Forms.CheckBox(); - this.expressionComboBox = new System.Windows.Forms.ComboBox(); - this.testTextComboBox = new System.Windows.Forms.ComboBox(); - this.helpProvider1 = new System.Windows.Forms.HelpProvider(); - this.button1 = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // cancelButton - // - this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.cancelButton.Location = new System.Drawing.Point(345, 277); - this.cancelButton.Name = "cancelButton"; - this.cancelButton.Size = new System.Drawing.Size(75, 23); - this.cancelButton.TabIndex = 0; - this.cancelButton.Text = "Cancel"; - this.cancelButton.UseVisualStyleBackColor = true; - // - // okButton - // - this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.okButton.Location = new System.Drawing.Point(264, 277); - this.okButton.Name = "okButton"; - this.okButton.Size = new System.Drawing.Size(75, 23); - this.okButton.TabIndex = 1; - this.okButton.Text = "OK"; - this.okButton.UseVisualStyleBackColor = true; - this.okButton.Click += new System.EventHandler(this.okButton_Click); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(9, 14); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(61, 13); - this.label1.TabIndex = 3; - this.label1.Text = "Expression:"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(9, 88); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(51, 13); - this.label2.TabIndex = 5; - this.label2.Text = "Test text:"; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(9, 141); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(51, 13); - this.label3.TabIndex = 6; - this.label3.Text = "Matches:"; - // - // matchesTextBox - // - this.matchesTextBox.Location = new System.Drawing.Point(12, 157); - this.matchesTextBox.Multiline = true; - this.matchesTextBox.Name = "matchesTextBox"; - this.matchesTextBox.ReadOnly = true; - this.matchesTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.matchesTextBox.Size = new System.Drawing.Size(408, 73); - this.matchesTextBox.TabIndex = 7; - // - // caseSensitiveCheckBox - // - this.caseSensitiveCheckBox.AutoSize = true; - this.caseSensitiveCheckBox.Location = new System.Drawing.Point(13, 57); - this.caseSensitiveCheckBox.Name = "caseSensitiveCheckBox"; - this.caseSensitiveCheckBox.Size = new System.Drawing.Size(94, 17); - this.caseSensitiveCheckBox.TabIndex = 8; - this.caseSensitiveCheckBox.Text = "Case sensitive"; - this.caseSensitiveCheckBox.UseVisualStyleBackColor = true; - this.caseSensitiveCheckBox.CheckedChanged += new System.EventHandler(this.caseSensitiveCheckBox_CheckedChanged); - // - // expressionComboBox - // - this.expressionComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; - this.expressionComboBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; - this.expressionComboBox.FormattingEnabled = true; - this.expressionComboBox.Location = new System.Drawing.Point(13, 28); - this.expressionComboBox.Name = "expressionComboBox"; - this.expressionComboBox.Size = new System.Drawing.Size(407, 21); - this.expressionComboBox.TabIndex = 10; - this.expressionComboBox.TextChanged += new System.EventHandler(this.expressionComboBox_TextChanged); - // - // testTextComboBox - // - this.testTextComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; - this.testTextComboBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; - this.testTextComboBox.FormattingEnabled = true; - this.testTextComboBox.Location = new System.Drawing.Point(13, 104); - this.testTextComboBox.Name = "testTextComboBox"; - this.testTextComboBox.Size = new System.Drawing.Size(407, 21); - this.testTextComboBox.TabIndex = 11; - this.testTextComboBox.TextChanged += new System.EventHandler(this.testTextComboBox_TextChanged); - // - // helpProvider1 - // - this.helpProvider1.HelpNamespace = "LogExpert.chm"; - // - // button1 - // - this.helpProvider1.SetHelpKeyword(this.button1, "RegEx.htm"); - this.helpProvider1.SetHelpNavigator(this.button1, System.Windows.Forms.HelpNavigator.Topic); - this.button1.Location = new System.Drawing.Point(13, 277); - this.button1.Name = "button1"; - this.helpProvider1.SetShowHelp(this.button1, true); - this.button1.Size = new System.Drawing.Size(75, 23); - this.button1.TabIndex = 12; - this.button1.Text = "Help"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // RegexHelperDialog - // - this.AcceptButton = this.okButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.cancelButton; - this.ClientSize = new System.Drawing.Size(433, 312); - this.Controls.Add(this.button1); - this.Controls.Add(this.testTextComboBox); - this.Controls.Add(this.expressionComboBox); - this.Controls.Add(this.caseSensitiveCheckBox); - this.Controls.Add(this.matchesTextBox); - this.Controls.Add(this.label3); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); - this.Controls.Add(this.okButton); - this.Controls.Add(this.cancelButton); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.helpProvider1.SetHelpKeyword(this, "RegEx.htm"); - this.helpProvider1.SetHelpNavigator(this, System.Windows.Forms.HelpNavigator.Topic); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "RegexHelperDialog"; - this.helpProvider1.SetShowHelp(this, true); - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Regex-Helper"; - this.ResumeLayout(false); - this.PerformLayout(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.buttonOk = new System.Windows.Forms.Button(); + this.labelRegex = new System.Windows.Forms.Label(); + this.labelTestText = new System.Windows.Forms.Label(); + this.labelMatches = new System.Windows.Forms.Label(); + this.textBoxMatches = new System.Windows.Forms.TextBox(); + this.checkBoxCaseSensitive = new System.Windows.Forms.CheckBox(); + this.comboBoxRegex = new System.Windows.Forms.ComboBox(); + this.comboBoxTestText = new System.Windows.Forms.ComboBox(); + this.helpProvider1 = new System.Windows.Forms.HelpProvider(); + this.buttonHelp = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // buttonCancel + // + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(365, 371); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(75, 23); + this.buttonCancel.TabIndex = 0; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + // + // buttonOk + // + this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this.buttonOk.Location = new System.Drawing.Point(284, 371); + this.buttonOk.Name = "buttonOk"; + this.buttonOk.Size = new System.Drawing.Size(75, 23); + this.buttonOk.TabIndex = 1; + this.buttonOk.Text = "OK"; + this.buttonOk.UseVisualStyleBackColor = true; + this.buttonOk.Click += new System.EventHandler(this.OnButtonOkClick); + // + // labelRegex + // + this.labelRegex.AutoSize = true; + this.labelRegex.Location = new System.Drawing.Point(14, 14); + this.labelRegex.Name = "labelRegex"; + this.labelRegex.Size = new System.Drawing.Size(151, 20); + this.labelRegex.TabIndex = 3; + this.labelRegex.Text = "Regular Expression:"; + // + // labelTestText + // + this.labelTestText.AutoSize = true; + this.labelTestText.Location = new System.Drawing.Point(14, 98); + this.labelTestText.Name = "labelTestText"; + this.labelTestText.Size = new System.Drawing.Size(74, 20); + this.labelTestText.TabIndex = 5; + this.labelTestText.Text = "Test text:"; + // + // labelMatches + // + this.labelMatches.AutoSize = true; + this.labelMatches.Location = new System.Drawing.Point(14, 152); + this.labelMatches.Name = "labelMatches"; + this.labelMatches.Size = new System.Drawing.Size(74, 20); + this.labelMatches.TabIndex = 6; + this.labelMatches.Text = "Matches:"; + // + // textBoxMatches + // + this.textBoxMatches.Location = new System.Drawing.Point(12, 175); + this.textBoxMatches.Multiline = true; + this.textBoxMatches.Name = "textBoxMatches"; + this.textBoxMatches.ReadOnly = true; + this.textBoxMatches.ScrollBars = System.Windows.Forms.ScrollBars.Both; + this.textBoxMatches.Size = new System.Drawing.Size(428, 190); + this.textBoxMatches.TabIndex = 7; + // + // checkBoxCaseSensitive + // + this.checkBoxCaseSensitive.AutoSize = true; + this.checkBoxCaseSensitive.Location = new System.Drawing.Point(12, 71); + this.checkBoxCaseSensitive.Name = "checkBoxCaseSensitive"; + this.checkBoxCaseSensitive.Size = new System.Drawing.Size(137, 24); + this.checkBoxCaseSensitive.TabIndex = 8; + this.checkBoxCaseSensitive.Text = "Case sensitive"; + this.checkBoxCaseSensitive.UseVisualStyleBackColor = true; + this.checkBoxCaseSensitive.CheckedChanged += new System.EventHandler(this.OnCaseSensitiveCheckBoxCheckedChanged); + // + // comboBoxRegex + // + this.comboBoxRegex.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.comboBoxRegex.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.comboBoxRegex.FormattingEnabled = true; + this.comboBoxRegex.Location = new System.Drawing.Point(12, 37); + this.comboBoxRegex.Name = "comboBoxRegex"; + this.comboBoxRegex.Size = new System.Drawing.Size(428, 28); + this.comboBoxRegex.TabIndex = 10; + this.comboBoxRegex.TextChanged += new System.EventHandler(this.OnComboBoxRegexTextChanged); + // + // comboBoxTestText + // + this.comboBoxTestText.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.comboBoxTestText.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.comboBoxTestText.FormattingEnabled = true; + this.comboBoxTestText.Location = new System.Drawing.Point(12, 121); + this.comboBoxTestText.Name = "comboBoxTestText"; + this.comboBoxTestText.Size = new System.Drawing.Size(428, 28); + this.comboBoxTestText.TabIndex = 11; + this.comboBoxTestText.TextChanged += new System.EventHandler(this.OnComboBoxTestTextTextChanged); + // + // helpProvider1 + // + this.helpProvider1.HelpNamespace = "LogExpert.chm"; + // + // buttonHelp + // + this.helpProvider1.SetHelpKeyword(this.buttonHelp, "RegEx.htm"); + this.helpProvider1.SetHelpNavigator(this.buttonHelp, System.Windows.Forms.HelpNavigator.Topic); + this.buttonHelp.Location = new System.Drawing.Point(13, 371); + this.buttonHelp.Name = "buttonHelp"; + this.helpProvider1.SetShowHelp(this.buttonHelp, true); + this.buttonHelp.Size = new System.Drawing.Size(75, 23); + this.buttonHelp.TabIndex = 12; + this.buttonHelp.Text = "Help"; + this.buttonHelp.UseVisualStyleBackColor = true; + this.buttonHelp.Click += new System.EventHandler(this.OnButtonHelpClick); + // + // RegexHelperDialog + // + this.AcceptButton = this.buttonOk; + this.CancelButton = this.buttonCancel; + this.ClientSize = new System.Drawing.Size(452, 403); + this.Controls.Add(this.buttonHelp); + this.Controls.Add(this.comboBoxTestText); + this.Controls.Add(this.comboBoxRegex); + this.Controls.Add(this.checkBoxCaseSensitive); + this.Controls.Add(this.textBoxMatches); + this.Controls.Add(this.labelMatches); + this.Controls.Add(this.labelTestText); + this.Controls.Add(this.labelRegex); + this.Controls.Add(this.buttonOk); + this.Controls.Add(this.buttonCancel); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.helpProvider1.SetHelpKeyword(this, "RegEx.htm"); + this.helpProvider1.SetHelpNavigator(this, System.Windows.Forms.HelpNavigator.Topic); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "RegexHelperDialog"; + this.helpProvider1.SetShowHelp(this, true); + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Regex-Helper"; + this.ResumeLayout(false); + this.PerformLayout(); } #endregion - private System.Windows.Forms.Button cancelButton; - private System.Windows.Forms.Button okButton; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.TextBox matchesTextBox; - private System.Windows.Forms.CheckBox caseSensitiveCheckBox; - private System.Windows.Forms.ComboBox expressionComboBox; - private System.Windows.Forms.ComboBox testTextComboBox; + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.Button buttonOk; + private System.Windows.Forms.Label labelRegex; + private System.Windows.Forms.Label labelTestText; + private System.Windows.Forms.Label labelMatches; + private System.Windows.Forms.TextBox textBoxMatches; + private System.Windows.Forms.CheckBox checkBoxCaseSensitive; + private System.Windows.Forms.ComboBox comboBoxRegex; + private System.Windows.Forms.ComboBox comboBoxTestText; private System.Windows.Forms.HelpProvider helpProvider1; - private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button buttonHelp; } } \ No newline at end of file diff --git a/src/LogExpert/Dialogs/RegexHelperDialog.cs b/src/LogExpert/Dialogs/RegexHelperDialog.cs index 5e3440f7..83921af1 100644 --- a/src/LogExpert/Dialogs/RegexHelperDialog.cs +++ b/src/LogExpert/Dialogs/RegexHelperDialog.cs @@ -1,9 +1,5 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; using System.Drawing; -using System.Text; using System.Windows.Forms; using System.Text.RegularExpressions; using LogExpert.Config; @@ -15,7 +11,7 @@ public partial class RegexHelperDialog : Form #region Fields private static readonly int MAX_HISTORY = 30; - private bool caseSensitive = false; + private bool _caseSensitive; #endregion @@ -24,7 +20,11 @@ public partial class RegexHelperDialog : Form public RegexHelperDialog() { InitializeComponent(); - this.Load += new EventHandler(RegexHelperDialog_Load); + + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; + + Load += OnRegexHelperDialogLoad; } #endregion @@ -33,18 +33,18 @@ public RegexHelperDialog() public bool CaseSensitive { - get { return this.caseSensitive; } + get => _caseSensitive; set { - this.caseSensitive = value; - this.caseSensitiveCheckBox.Checked = value; + _caseSensitive = value; + checkBoxCaseSensitive.Checked = value; } } public string Pattern { - get { return this.expressionComboBox.Text; } - set { this.expressionComboBox.Text = value; } + get => comboBoxRegex.Text; + set => comboBoxRegex.Text = value; } #endregion @@ -53,53 +53,59 @@ public string Pattern private void UpdateMatches() { - this.matchesTextBox.Text = ""; + textBoxMatches.Text = ""; try { - Regex rex = new Regex(this.expressionComboBox.Text, - this.caseSensitive ? RegexOptions.None : RegexOptions.IgnoreCase); - MatchCollection matches = rex.Matches(this.testTextComboBox.Text); + Regex rex = new(comboBoxRegex.Text, _caseSensitive ? RegexOptions.None : RegexOptions.IgnoreCase); + MatchCollection matches = rex.Matches(comboBoxTestText.Text); + foreach (Match match in matches) { - this.matchesTextBox.Text += match.Value + "\r\n"; + textBoxMatches.Text += $"{match.Value}\r\n"; } } catch (ArgumentException) { - this.matchesTextBox.Text = "No valid regex pattern"; + textBoxMatches.Text = "No valid regex pattern"; } } private void LoadHistory() { RegexHistory history = ConfigManager.Settings.regexHistory; + if (history == null) { return; } - this.expressionComboBox.Items.Clear(); + + comboBoxRegex.Items.Clear(); foreach (string item in history.expressionHistoryList) { - this.expressionComboBox.Items.Add(item); + comboBoxRegex.Items.Add(item); } - this.testTextComboBox.Items.Clear(); + + comboBoxTestText.Items.Clear(); foreach (string item in history.testtextHistoryList) { - this.testTextComboBox.Items.Add(item); + comboBoxTestText.Items.Add(item); } } private void SaveHistory() { - RegexHistory history = new RegexHistory(); - foreach (string item in this.expressionComboBox.Items) + RegexHistory history = new(); + + foreach (string item in comboBoxRegex.Items) { history.expressionHistoryList.Add(item); } - foreach (string item in this.testTextComboBox.Items) + + foreach (string item in comboBoxTestText.Items) { history.testtextHistoryList.Add(item); } + ConfigManager.Settings.regexHistory = history; ConfigManager.Save(SettingsFlags.RegexHistory); } @@ -108,51 +114,51 @@ private void SaveHistory() #region Events handler - private void RegexHelperDialog_Load(object sender, EventArgs e) + private void OnRegexHelperDialogLoad(object sender, EventArgs e) { LoadHistory(); } - private void caseSensitiveCheckBox_CheckedChanged(object sender, EventArgs e) + private void OnCaseSensitiveCheckBoxCheckedChanged(object sender, EventArgs e) { - this.caseSensitive = this.caseSensitiveCheckBox.Checked; + _caseSensitive = checkBoxCaseSensitive.Checked; UpdateMatches(); } - private void okButton_Click(object sender, EventArgs e) + private void OnButtonOkClick(object sender, EventArgs e) { - string text = this.expressionComboBox.Text; - this.expressionComboBox.Items.Remove(text); - this.expressionComboBox.Items.Insert(0, text); + string text = comboBoxRegex.Text; + comboBoxRegex.Items.Remove(text); + comboBoxRegex.Items.Insert(0, text); - text = this.testTextComboBox.Text; - this.testTextComboBox.Items.Remove(text); - this.testTextComboBox.Items.Insert(0, text); + text = comboBoxTestText.Text; + comboBoxTestText.Items.Remove(text); + comboBoxTestText.Items.Insert(0, text); - if (this.expressionComboBox.Items.Count > MAX_HISTORY) + if (comboBoxRegex.Items.Count > MAX_HISTORY) { - this.expressionComboBox.Items.Remove(this.expressionComboBox.Items.Count - 1); + comboBoxRegex.Items.Remove(comboBoxRegex.Items.Count - 1); } - if (this.testTextComboBox.Items.Count > MAX_HISTORY) + if (comboBoxTestText.Items.Count > MAX_HISTORY) { - this.testTextComboBox.Items.Remove(this.testTextComboBox.Items.Count - 1); + comboBoxTestText.Items.Remove(comboBoxTestText.Items.Count - 1); } SaveHistory(); } - private void expressionComboBox_TextChanged(object sender, EventArgs e) + private void OnComboBoxRegexTextChanged(object sender, EventArgs e) { UpdateMatches(); } - private void testTextComboBox_TextChanged(object sender, EventArgs e) + private void OnComboBoxTestTextTextChanged(object sender, EventArgs e) { UpdateMatches(); } - private void button1_Click(object sender, EventArgs e) + private void OnButtonHelpClick(object sender, EventArgs e) { Help.ShowHelp(this, "LogExpert.chm", HelpNavigator.Topic, "RegEx.htm"); } diff --git a/src/LogExpert/Dialogs/RegexHelperDialog.resx b/src/LogExpert/Dialogs/RegexHelperDialog.resx index 7e44abcd..59775d45 100644 --- a/src/LogExpert/Dialogs/RegexHelperDialog.resx +++ b/src/LogExpert/Dialogs/RegexHelperDialog.resx @@ -112,12 +112,12 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + 17, 17 \ No newline at end of file diff --git a/src/LogExpert/Dialogs/SearchDialog.Designer.cs b/src/LogExpert/Dialogs/SearchDialog.Designer.cs index 83c1e2fb..8e93d131 100644 --- a/src/LogExpert/Dialogs/SearchDialog.Designer.cs +++ b/src/LogExpert/Dialogs/SearchDialog.Designer.cs @@ -28,226 +28,227 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.okButton = new System.Windows.Forms.Button(); - this.cancelButton = new System.Windows.Forms.Button(); - this.label1 = new System.Windows.Forms.Label(); - this.caseSensitiveCheckBox = new System.Windows.Forms.CheckBox(); - this.regexCheckBox = new System.Windows.Forms.CheckBox(); - this.regexHelperButton = new System.Windows.Forms.Button(); - this.fromTopRadioButton = new System.Windows.Forms.RadioButton(); - this.fromSelectedRadioButton = new System.Windows.Forms.RadioButton(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.groupBox3 = new System.Windows.Forms.GroupBox(); - this.backwardRadioButton = new System.Windows.Forms.RadioButton(); - this.forwardRadioButton = new System.Windows.Forms.RadioButton(); - this.searchComboBox = new System.Windows.Forms.ComboBox(); - this.helpProvider1 = new System.Windows.Forms.HelpProvider(); - this.groupBox1.SuspendLayout(); - this.groupBox2.SuspendLayout(); - this.groupBox3.SuspendLayout(); - this.SuspendLayout(); - // - // okButton - // - this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.okButton.Location = new System.Drawing.Point(221, 204); - this.okButton.Name = "okButton"; - this.okButton.Size = new System.Drawing.Size(75, 23); - this.okButton.TabIndex = 5; - this.okButton.Text = "OK"; - this.okButton.UseVisualStyleBackColor = true; - this.okButton.Click += new System.EventHandler(this.okButton_Click); - // - // cancelButton - // - this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.cancelButton.Location = new System.Drawing.Point(298, 204); - this.cancelButton.Name = "cancelButton"; - this.cancelButton.Size = new System.Drawing.Size(75, 23); - this.cancelButton.TabIndex = 6; - this.cancelButton.Text = "Cancel"; - this.cancelButton.UseVisualStyleBackColor = true; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(10, 9); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(59, 13); - this.label1.TabIndex = 0; - this.label1.Text = "&Search for:"; - // - // caseSensitiveCheckBox - // - this.caseSensitiveCheckBox.AutoSize = true; - this.caseSensitiveCheckBox.Location = new System.Drawing.Point(6, 19); - this.caseSensitiveCheckBox.Name = "caseSensitiveCheckBox"; - this.caseSensitiveCheckBox.Size = new System.Drawing.Size(94, 17); - this.caseSensitiveCheckBox.TabIndex = 4; - this.caseSensitiveCheckBox.Text = "&Case sensitive"; - this.caseSensitiveCheckBox.UseVisualStyleBackColor = true; - // - // regexCheckBox - // - this.regexCheckBox.AutoSize = true; - this.regexCheckBox.Location = new System.Drawing.Point(6, 43); - this.regexCheckBox.Name = "regexCheckBox"; - this.regexCheckBox.Size = new System.Drawing.Size(116, 17); - this.regexCheckBox.TabIndex = 5; - this.regexCheckBox.Text = "&Regular expression"; - this.regexCheckBox.UseVisualStyleBackColor = true; - // - // regexHelperButton - // - this.regexHelperButton.Location = new System.Drawing.Point(124, 34); - this.regexHelperButton.Name = "regexHelperButton"; - this.regexHelperButton.Size = new System.Drawing.Size(84, 26); - this.regexHelperButton.TabIndex = 3; - this.regexHelperButton.Text = "Regex-&Helper"; - this.regexHelperButton.UseVisualStyleBackColor = true; - this.regexHelperButton.Click += new System.EventHandler(this.regexHelperButton_Click); - // - // fromTopRadioButton - // - this.fromTopRadioButton.AutoSize = true; - this.fromTopRadioButton.Location = new System.Drawing.Point(6, 19); - this.fromTopRadioButton.Name = "fromTopRadioButton"; - this.fromTopRadioButton.Size = new System.Drawing.Size(66, 17); - this.fromTopRadioButton.TabIndex = 7; - this.fromTopRadioButton.TabStop = true; - this.fromTopRadioButton.Text = "From top"; - this.fromTopRadioButton.UseVisualStyleBackColor = true; - // - // fromSelectedRadioButton - // - this.fromSelectedRadioButton.AutoSize = true; - this.fromSelectedRadioButton.Location = new System.Drawing.Point(6, 42); - this.fromSelectedRadioButton.Name = "fromSelectedRadioButton"; - this.fromSelectedRadioButton.Size = new System.Drawing.Size(110, 17); - this.fromSelectedRadioButton.TabIndex = 8; - this.fromSelectedRadioButton.TabStop = true; - this.fromSelectedRadioButton.Text = "From selected line"; - this.fromSelectedRadioButton.UseVisualStyleBackColor = true; - // - // groupBox1 - // - this.groupBox1.Controls.Add(this.fromTopRadioButton); - this.groupBox1.Controls.Add(this.fromSelectedRadioButton); - this.groupBox1.Location = new System.Drawing.Point(13, 62); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(122, 79); - this.groupBox1.TabIndex = 1; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "Search start"; - // - // groupBox2 - // - this.groupBox2.Controls.Add(this.caseSensitiveCheckBox); - this.groupBox2.Controls.Add(this.regexCheckBox); - this.groupBox2.Controls.Add(this.regexHelperButton); - this.groupBox2.Location = new System.Drawing.Point(158, 62); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(219, 79); - this.groupBox2.TabIndex = 2; - this.groupBox2.TabStop = false; - this.groupBox2.Text = "Options"; - // - // groupBox3 - // - this.groupBox3.Controls.Add(this.backwardRadioButton); - this.groupBox3.Controls.Add(this.forwardRadioButton); - this.groupBox3.Location = new System.Drawing.Point(13, 148); - this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(122, 79); - this.groupBox3.TabIndex = 4; - this.groupBox3.TabStop = false; - this.groupBox3.Text = "Direction"; - // - // backwardRadioButton - // - this.backwardRadioButton.AutoSize = true; - this.backwardRadioButton.Location = new System.Drawing.Point(7, 44); - this.backwardRadioButton.Name = "backwardRadioButton"; - this.backwardRadioButton.Size = new System.Drawing.Size(73, 17); - this.backwardRadioButton.TabIndex = 1; - this.backwardRadioButton.TabStop = true; - this.backwardRadioButton.Text = "Backward"; - this.backwardRadioButton.UseVisualStyleBackColor = true; - // - // forwardRadioButton - // - this.forwardRadioButton.AutoSize = true; - this.forwardRadioButton.Location = new System.Drawing.Point(7, 20); - this.forwardRadioButton.Name = "forwardRadioButton"; - this.forwardRadioButton.Size = new System.Drawing.Size(63, 17); - this.forwardRadioButton.TabIndex = 0; - this.forwardRadioButton.TabStop = true; - this.forwardRadioButton.Text = "Forward"; - this.forwardRadioButton.UseVisualStyleBackColor = true; - // - // searchComboBox - // - this.searchComboBox.FormattingEnabled = true; - this.searchComboBox.Location = new System.Drawing.Point(13, 25); - this.searchComboBox.Name = "searchComboBox"; - this.searchComboBox.Size = new System.Drawing.Size(364, 21); - this.searchComboBox.TabIndex = 0; - // - // helpProvider1 - // - this.helpProvider1.HelpNamespace = "LogExpert.chm"; - // - // SearchDialog - // - this.AcceptButton = this.okButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.cancelButton; - this.ClientSize = new System.Drawing.Size(385, 239); - this.Controls.Add(this.searchComboBox); - this.Controls.Add(this.groupBox3); - this.Controls.Add(this.groupBox2); - this.Controls.Add(this.groupBox1); - this.Controls.Add(this.label1); - this.Controls.Add(this.cancelButton); - this.Controls.Add(this.okButton); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.helpProvider1.SetHelpKeyword(this, "Search and Navigation.htm"); - this.helpProvider1.SetHelpNavigator(this, System.Windows.Forms.HelpNavigator.Topic); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "SearchDialog"; - this.helpProvider1.SetShowHelp(this, true); - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Search"; - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); - this.groupBox2.ResumeLayout(false); - this.groupBox2.PerformLayout(); - this.groupBox3.ResumeLayout(false); - this.groupBox3.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); + this.buttonOk = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.labelSearchFor = new System.Windows.Forms.Label(); + this.checkBoxCaseSensitive = new System.Windows.Forms.CheckBox(); + this.checkBoxRegex = new System.Windows.Forms.CheckBox(); + this.buttonRegexHelper = new System.Windows.Forms.Button(); + this.radioButtonFromTop = new System.Windows.Forms.RadioButton(); + this.radioButtonFromSelected = new System.Windows.Forms.RadioButton(); + this.groupBoxSearchStart = new System.Windows.Forms.GroupBox(); + this.groupBoxOptions = new System.Windows.Forms.GroupBox(); + this.groupBoxDirection = new System.Windows.Forms.GroupBox(); + this.radioButtonBackward = new System.Windows.Forms.RadioButton(); + this.radioButtonForward = new System.Windows.Forms.RadioButton(); + this.comboBoxSearchFor = new System.Windows.Forms.ComboBox(); + this.helpProvider1 = new System.Windows.Forms.HelpProvider(); + this.groupBoxSearchStart.SuspendLayout(); + this.groupBoxOptions.SuspendLayout(); + this.groupBoxDirection.SuspendLayout(); + this.SuspendLayout(); + // + // buttonOk + // + this.buttonOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this.buttonOk.Location = new System.Drawing.Point(317, 215); + this.buttonOk.Name = "buttonOk"; + this.buttonOk.Size = new System.Drawing.Size(75, 23); + this.buttonOk.TabIndex = 5; + this.buttonOk.Text = "OK"; + this.buttonOk.UseVisualStyleBackColor = true; + this.buttonOk.Click += new System.EventHandler(this.OnButtonOkClick); + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(398, 215); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(75, 23); + this.buttonCancel.TabIndex = 6; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.OnButtonCancelClick); + // + // labelSearchFor + // + this.labelSearchFor.AutoSize = true; + this.labelSearchFor.Location = new System.Drawing.Point(10, 9); + this.labelSearchFor.Name = "labelSearchFor"; + this.labelSearchFor.Size = new System.Drawing.Size(87, 20); + this.labelSearchFor.TabIndex = 0; + this.labelSearchFor.Text = "&Search for:"; + // + // checkBoxCaseSensitive + // + this.checkBoxCaseSensitive.AutoSize = true; + this.checkBoxCaseSensitive.Location = new System.Drawing.Point(6, 19); + this.checkBoxCaseSensitive.Name = "checkBoxCaseSensitive"; + this.checkBoxCaseSensitive.Size = new System.Drawing.Size(137, 24); + this.checkBoxCaseSensitive.TabIndex = 4; + this.checkBoxCaseSensitive.Text = "&Case sensitive"; + this.checkBoxCaseSensitive.UseVisualStyleBackColor = true; + // + // checkBoxRegex + // + this.checkBoxRegex.AutoSize = true; + this.checkBoxRegex.Location = new System.Drawing.Point(6, 43); + this.checkBoxRegex.Name = "checkBoxRegex"; + this.checkBoxRegex.Size = new System.Drawing.Size(171, 24); + this.checkBoxRegex.TabIndex = 5; + this.checkBoxRegex.Text = "&Regular expression"; + this.checkBoxRegex.UseVisualStyleBackColor = true; + // + // buttonRegexHelper + // + this.buttonRegexHelper.Location = new System.Drawing.Point(6, 72); + this.buttonRegexHelper.Name = "buttonRegexHelper"; + this.buttonRegexHelper.Size = new System.Drawing.Size(84, 26); + this.buttonRegexHelper.TabIndex = 3; + this.buttonRegexHelper.Text = "Regex-&Helper"; + this.buttonRegexHelper.UseVisualStyleBackColor = true; + this.buttonRegexHelper.Click += new System.EventHandler(this.OnButtonRegexClick); + // + // radioButtonFromTop + // + this.radioButtonFromTop.AutoSize = true; + this.radioButtonFromTop.Location = new System.Drawing.Point(6, 19); + this.radioButtonFromTop.Name = "radioButtonFromTop"; + this.radioButtonFromTop.Size = new System.Drawing.Size(98, 24); + this.radioButtonFromTop.TabIndex = 7; + this.radioButtonFromTop.TabStop = true; + this.radioButtonFromTop.Text = "From top"; + this.radioButtonFromTop.UseVisualStyleBackColor = true; + // + // radioButtonFromSelected + // + this.radioButtonFromSelected.AutoSize = true; + this.radioButtonFromSelected.Location = new System.Drawing.Point(6, 42); + this.radioButtonFromSelected.Name = "radioButtonFromSelected"; + this.radioButtonFromSelected.Size = new System.Drawing.Size(163, 24); + this.radioButtonFromSelected.TabIndex = 8; + this.radioButtonFromSelected.TabStop = true; + this.radioButtonFromSelected.Text = "From selected line"; + this.radioButtonFromSelected.UseVisualStyleBackColor = true; + // + // groupBoxSearchStart + // + this.groupBoxSearchStart.Controls.Add(this.radioButtonFromTop); + this.groupBoxSearchStart.Controls.Add(this.radioButtonFromSelected); + this.groupBoxSearchStart.Location = new System.Drawing.Point(12, 74); + this.groupBoxSearchStart.Name = "groupBoxSearchStart"; + this.groupBoxSearchStart.Size = new System.Drawing.Size(179, 79); + this.groupBoxSearchStart.TabIndex = 1; + this.groupBoxSearchStart.TabStop = false; + this.groupBoxSearchStart.Text = "Search start"; + // + // groupBoxOptions + // + this.groupBoxOptions.Controls.Add(this.checkBoxCaseSensitive); + this.groupBoxOptions.Controls.Add(this.checkBoxRegex); + this.groupBoxOptions.Controls.Add(this.buttonRegexHelper); + this.groupBoxOptions.Location = new System.Drawing.Point(198, 74); + this.groupBoxOptions.Name = "groupBoxOptions"; + this.groupBoxOptions.Size = new System.Drawing.Size(275, 104); + this.groupBoxOptions.TabIndex = 2; + this.groupBoxOptions.TabStop = false; + this.groupBoxOptions.Text = "Options"; + // + // groupBoxDirection + // + this.groupBoxDirection.Controls.Add(this.radioButtonBackward); + this.groupBoxDirection.Controls.Add(this.radioButtonForward); + this.groupBoxDirection.Location = new System.Drawing.Point(13, 159); + this.groupBoxDirection.Name = "groupBoxDirection"; + this.groupBoxDirection.Size = new System.Drawing.Size(122, 79); + this.groupBoxDirection.TabIndex = 4; + this.groupBoxDirection.TabStop = false; + this.groupBoxDirection.Text = "Direction"; + // + // radioButtonBackward + // + this.radioButtonBackward.AutoSize = true; + this.radioButtonBackward.Location = new System.Drawing.Point(7, 44); + this.radioButtonBackward.Name = "radioButtonBackward"; + this.radioButtonBackward.Size = new System.Drawing.Size(104, 24); + this.radioButtonBackward.TabIndex = 1; + this.radioButtonBackward.TabStop = true; + this.radioButtonBackward.Text = "Backward"; + this.radioButtonBackward.UseVisualStyleBackColor = true; + // + // radioButtonForward + // + this.radioButtonForward.AutoSize = true; + this.radioButtonForward.Location = new System.Drawing.Point(7, 20); + this.radioButtonForward.Name = "radioButtonForward"; + this.radioButtonForward.Size = new System.Drawing.Size(92, 24); + this.radioButtonForward.TabIndex = 0; + this.radioButtonForward.TabStop = true; + this.radioButtonForward.Text = "Forward"; + this.radioButtonForward.UseVisualStyleBackColor = true; + // + // comboBoxSearchFor + // + this.comboBoxSearchFor.FormattingEnabled = true; + this.comboBoxSearchFor.Location = new System.Drawing.Point(13, 34); + this.comboBoxSearchFor.Name = "comboBoxSearchFor"; + this.comboBoxSearchFor.Size = new System.Drawing.Size(460, 28); + this.comboBoxSearchFor.TabIndex = 0; + // + // helpProvider1 + // + this.helpProvider1.HelpNamespace = "LogExpert.chm"; + // + // SearchDialog + // + this.AcceptButton = this.buttonOk; + this.CancelButton = this.buttonCancel; + this.ClientSize = new System.Drawing.Size(488, 250); + this.Controls.Add(this.comboBoxSearchFor); + this.Controls.Add(this.groupBoxDirection); + this.Controls.Add(this.groupBoxOptions); + this.Controls.Add(this.groupBoxSearchStart); + this.Controls.Add(this.labelSearchFor); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOk); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.helpProvider1.SetHelpKeyword(this, "Search and Navigation.htm"); + this.helpProvider1.SetHelpNavigator(this, System.Windows.Forms.HelpNavigator.Topic); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "SearchDialog"; + this.helpProvider1.SetShowHelp(this, true); + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Search"; + this.groupBoxSearchStart.ResumeLayout(false); + this.groupBoxSearchStart.PerformLayout(); + this.groupBoxOptions.ResumeLayout(false); + this.groupBoxOptions.PerformLayout(); + this.groupBoxDirection.ResumeLayout(false); + this.groupBoxDirection.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); } #endregion - private System.Windows.Forms.Button okButton; - private System.Windows.Forms.Button cancelButton; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.CheckBox caseSensitiveCheckBox; - private System.Windows.Forms.CheckBox regexCheckBox; - private System.Windows.Forms.Button regexHelperButton; - private System.Windows.Forms.RadioButton fromTopRadioButton; - private System.Windows.Forms.RadioButton fromSelectedRadioButton; - private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.GroupBox groupBox2; - private System.Windows.Forms.GroupBox groupBox3; - private System.Windows.Forms.RadioButton backwardRadioButton; - private System.Windows.Forms.RadioButton forwardRadioButton; - private System.Windows.Forms.ComboBox searchComboBox; + private System.Windows.Forms.Button buttonOk; + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.Label labelSearchFor; + private System.Windows.Forms.CheckBox checkBoxCaseSensitive; + private System.Windows.Forms.CheckBox checkBoxRegex; + private System.Windows.Forms.Button buttonRegexHelper; + private System.Windows.Forms.RadioButton radioButtonFromTop; + private System.Windows.Forms.RadioButton radioButtonFromSelected; + private System.Windows.Forms.GroupBox groupBoxSearchStart; + private System.Windows.Forms.GroupBox groupBoxOptions; + private System.Windows.Forms.GroupBox groupBoxDirection; + private System.Windows.Forms.RadioButton radioButtonBackward; + private System.Windows.Forms.RadioButton radioButtonForward; + private System.Windows.Forms.ComboBox comboBoxSearchFor; private System.Windows.Forms.HelpProvider helpProvider1; } } \ No newline at end of file diff --git a/src/LogExpert/Dialogs/SearchDialog.cs b/src/LogExpert/Dialogs/SearchDialog.cs index 7f6b9244..9e2f90d3 100644 --- a/src/LogExpert/Dialogs/SearchDialog.cs +++ b/src/LogExpert/Dialogs/SearchDialog.cs @@ -1,9 +1,5 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; using System.Drawing; -using System.Text; using System.Text.RegularExpressions; using System.Windows.Forms; using LogExpert.Entities; @@ -25,97 +21,102 @@ public partial class SearchDialog : Form public SearchDialog() { InitializeComponent(); - Load += new EventHandler(SearchDialog_Load); + + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; + + Load += OnSearchDialogLoad; } #endregion #region Properties - public SearchParams SearchParams { get; set; } = null; + public SearchParams SearchParams { get; set; } #endregion #region Events handler - private void SearchDialog_Load(object sender, EventArgs e) + private void OnSearchDialogLoad(object sender, EventArgs e) { if (SearchParams != null) { if (SearchParams.isFromTop) { - fromTopRadioButton.Checked = true; + radioButtonFromTop.Checked = true; } else { - fromSelectedRadioButton.Checked = true; + radioButtonFromSelected.Checked = true; } if (SearchParams.isForward) { - forwardRadioButton.Checked = true; + radioButtonForward.Checked = true; } else { - backwardRadioButton.Checked = true; + radioButtonBackward.Checked = true; } - regexCheckBox.Checked = SearchParams.isRegex; - caseSensitiveCheckBox.Checked = SearchParams.isCaseSensitive; + checkBoxRegex.Checked = SearchParams.isRegex; + checkBoxCaseSensitive.Checked = SearchParams.isCaseSensitive; foreach (string item in SearchParams.historyList) { - searchComboBox.Items.Add(item); + comboBoxSearchFor.Items.Add(item); } - if (searchComboBox.Items.Count > 0) + if (comboBoxSearchFor.Items.Count > 0) { - searchComboBox.SelectedIndex = 0; + comboBoxSearchFor.SelectedIndex = 0; } } else { - fromSelectedRadioButton.Checked = true; - forwardRadioButton.Checked = true; + radioButtonFromSelected.Checked = true; + radioButtonForward.Checked = true; SearchParams = new SearchParams(); } } - private void regexHelperButton_Click(object sender, EventArgs e) + private void OnButtonRegexClick(object sender, EventArgs e) { - RegexHelperDialog dlg = new RegexHelperDialog(); + RegexHelperDialog dlg = new(); dlg.Owner = this; - dlg.CaseSensitive = caseSensitiveCheckBox.Checked; - dlg.Pattern = searchComboBox.Text; + dlg.CaseSensitive = checkBoxCaseSensitive.Checked; + dlg.Pattern = comboBoxSearchFor.Text; + DialogResult res = dlg.ShowDialog(); if (res == DialogResult.OK) { - caseSensitiveCheckBox.Checked = dlg.CaseSensitive; - searchComboBox.Text = dlg.Pattern; + checkBoxCaseSensitive.Checked = dlg.CaseSensitive; + comboBoxSearchFor.Text = dlg.Pattern; } } - private void okButton_Click(object sender, EventArgs e) + private void OnButtonOkClick(object sender, EventArgs e) { try { - if (regexCheckBox.Checked) + if (checkBoxRegex.Checked) { - if (string.IsNullOrWhiteSpace(searchComboBox.Text)) + if (string.IsNullOrWhiteSpace(comboBoxSearchFor.Text)) { throw new ArgumentException("Search text is empty"); } // ReSharper disable once ReturnValueOfPureMethodIsNotUsed - Regex.IsMatch("", searchComboBox.Text); + Regex.IsMatch("", comboBoxSearchFor.Text); } - SearchParams.searchText = searchComboBox.Text; - SearchParams.isCaseSensitive = caseSensitiveCheckBox.Checked; - SearchParams.isForward = forwardRadioButton.Checked; - SearchParams.isFromTop = fromTopRadioButton.Checked; - SearchParams.isRegex = regexCheckBox.Checked; - SearchParams.historyList.Remove(searchComboBox.Text); - SearchParams.historyList.Insert(0, searchComboBox.Text); + SearchParams.searchText = comboBoxSearchFor.Text; + SearchParams.isCaseSensitive = checkBoxCaseSensitive.Checked; + SearchParams.isForward = radioButtonForward.Checked; + SearchParams.isFromTop = radioButtonFromTop.Checked; + SearchParams.isRegex = checkBoxRegex.Checked; + SearchParams.historyList.Remove(comboBoxSearchFor.Text); + SearchParams.historyList.Insert(0, comboBoxSearchFor.Text); if (SearchParams.historyList.Count > MAX_HISTORY) { SearchParams.historyList.RemoveAt(SearchParams.historyList.Count - 1); @@ -129,5 +130,10 @@ private void okButton_Click(object sender, EventArgs e) } #endregion + + private void OnButtonCancelClick(object sender, EventArgs e) + { + Close(); + } } } \ No newline at end of file diff --git a/src/LogExpert/Dialogs/SearchDialog.resx b/src/LogExpert/Dialogs/SearchDialog.resx index 7e44abcd..59775d45 100644 --- a/src/LogExpert/Dialogs/SearchDialog.resx +++ b/src/LogExpert/Dialogs/SearchDialog.resx @@ -112,12 +112,12 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + 17, 17 \ No newline at end of file diff --git a/src/LogExpert/Dialogs/SearchProgressDialog.Designer.cs b/src/LogExpert/Dialogs/SearchProgressDialog.Designer.cs index d2379060..c0532607 100644 --- a/src/LogExpert/Dialogs/SearchProgressDialog.Designer.cs +++ b/src/LogExpert/Dialogs/SearchProgressDialog.Designer.cs @@ -28,50 +28,48 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.cancelButton = new System.Windows.Forms.Button(); - this.label1 = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // cancelButton - // - this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.cancelButton.Location = new System.Drawing.Point(159, 40); - this.cancelButton.Name = "cancelButton"; - this.cancelButton.Size = new System.Drawing.Size(90, 23); - this.cancelButton.TabIndex = 0; - this.cancelButton.Text = "Cancel search"; - this.cancelButton.UseVisualStyleBackColor = true; - this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(13, 13); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(118, 13); - this.label1.TabIndex = 1; - this.label1.Text = "Searching in progress..."; - // - // SearchProgressDialog - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(261, 80); - this.ControlBox = false; - this.Controls.Add(this.label1); - this.Controls.Add(this.cancelButton); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.Name = "SearchProgressDialog"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Searching..."; - this.ResumeLayout(false); - this.PerformLayout(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.labelSearchProgress = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // buttonCancel + // + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(159, 40); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(90, 23); + this.buttonCancel.TabIndex = 0; + this.buttonCancel.Text = "Cancel search"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.OnButtonCancelClick); + // + // labelSearchProgress + // + this.labelSearchProgress.AutoSize = true; + this.labelSearchProgress.Location = new System.Drawing.Point(13, 13); + this.labelSearchProgress.Name = "labelSearchProgress"; + this.labelSearchProgress.Size = new System.Drawing.Size(175, 20); + this.labelSearchProgress.TabIndex = 1; + this.labelSearchProgress.Text = "Searching in progress..."; + // + // SearchProgressDialog + // + this.ClientSize = new System.Drawing.Size(261, 80); + this.ControlBox = false; + this.Controls.Add(this.labelSearchProgress); + this.Controls.Add(this.buttonCancel); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Name = "SearchProgressDialog"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Searching..."; + this.ResumeLayout(false); + this.PerformLayout(); } #endregion - private System.Windows.Forms.Button cancelButton; - private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.Label labelSearchProgress; } } \ No newline at end of file diff --git a/src/LogExpert/Dialogs/SearchProgressDialog.cs b/src/LogExpert/Dialogs/SearchProgressDialog.cs index c7bec5d3..8e4ea303 100644 --- a/src/LogExpert/Dialogs/SearchProgressDialog.cs +++ b/src/LogExpert/Dialogs/SearchProgressDialog.cs @@ -1,9 +1,5 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; using System.Drawing; -using System.Text; using System.Windows.Forms; namespace LogExpert.Dialogs @@ -19,7 +15,11 @@ public partial class SearchProgressDialog : Form public SearchProgressDialog() { InitializeComponent(); - this.ShouldStop = false; + + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; + + ShouldStop = false; } #endregion @@ -32,9 +32,9 @@ public SearchProgressDialog() #region Events handler - private void cancelButton_Click(object sender, EventArgs e) + private void OnButtonCancelClick(object sender, EventArgs e) { - this.ShouldStop = true; + ShouldStop = true; } #endregion diff --git a/src/LogExpert/Dialogs/SearchProgressDialog.resx b/src/LogExpert/Dialogs/SearchProgressDialog.resx index ff31a6db..c7e0d4bd 100644 --- a/src/LogExpert/Dialogs/SearchProgressDialog.resx +++ b/src/LogExpert/Dialogs/SearchProgressDialog.resx @@ -112,9 +112,9 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 \ No newline at end of file diff --git a/src/LogExpert/Dialogs/SelectLineEventArgs.cs b/src/LogExpert/Dialogs/SelectLineEventArgs.cs index 5b173536..4f2fa88b 100644 --- a/src/LogExpert/Dialogs/SelectLineEventArgs.cs +++ b/src/LogExpert/Dialogs/SelectLineEventArgs.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; namespace LogExpert.Dialogs { @@ -14,7 +12,7 @@ public class SelectLineEventArgs : EventArgs public SelectLineEventArgs(int line) { - this.Line = line; + Line = line; } #endregion diff --git a/src/LogExpert/Dialogs/SettingsDialog.Designer.cs b/src/LogExpert/Dialogs/SettingsDialog.Designer.cs index 9eba116b..dfb8ed33 100644 --- a/src/LogExpert/Dialogs/SettingsDialog.Designer.cs +++ b/src/LogExpert/Dialogs/SettingsDialog.Designer.cs @@ -362,7 +362,7 @@ private void InitializeComponent() this.checkBoxColumnSize.TabIndex = 5; this.checkBoxColumnSize.Text = "Set last column width"; this.checkBoxColumnSize.UseVisualStyleBackColor = true; - this.checkBoxColumnSize.CheckedChanged += new System.EventHandler(this.OnColumnSizeCheckBoxCheckedChanged); + this.checkBoxColumnSize.CheckedChanged += new System.EventHandler(this.OnChkBoxColumnSizeCheckedChanged); // // buttonTailColor // @@ -373,7 +373,7 @@ private void InitializeComponent() this.buttonTailColor.TabIndex = 4; this.buttonTailColor.Text = "Color..."; this.buttonTailColor.UseVisualStyleBackColor = true; - this.buttonTailColor.Click += new System.EventHandler(this.OnTailColorButtonClick); + this.buttonTailColor.Click += new System.EventHandler(this.OnBtnTailColorClick); // // checkBoxTailState // @@ -512,7 +512,7 @@ private void InitializeComponent() this.buttonChangeFont.TabIndex = 1; this.buttonChangeFont.Text = "Change..."; this.buttonChangeFont.UseVisualStyleBackColor = true; - this.buttonChangeFont.Click += new System.EventHandler(this.OnChangeFontButtonClick); + this.buttonChangeFont.Click += new System.EventHandler(this.OnBtnChangeFontClick); // // labelFont // @@ -609,7 +609,7 @@ private void InitializeComponent() this.buttonTimespreadColor.TabIndex = 7; this.buttonTimespreadColor.Text = "Color..."; this.buttonTimespreadColor.UseVisualStyleBackColor = true; - this.buttonTimespreadColor.Click += new System.EventHandler(this.OnTimespreadColorButtonClick); + this.buttonTimespreadColor.Click += new System.EventHandler(this.OnBtnTimespreadColorClick); // // checkBoxTimeSpread // @@ -744,7 +744,7 @@ private void InitializeComponent() this.buttonToolAdd.TabIndex = 1; this.buttonToolAdd.Text = "Add new"; this.buttonToolAdd.UseVisualStyleBackColor = true; - this.buttonToolAdd.Click += new System.EventHandler(this.OnToolAddButtonClick); + this.buttonToolAdd.Click += new System.EventHandler(this.OnBtnToolAddClick); // // buttonToolDown // @@ -755,7 +755,7 @@ private void InitializeComponent() this.buttonToolDown.TabIndex = 4; this.buttonToolDown.Text = "Down"; this.buttonToolDown.UseVisualStyleBackColor = true; - this.buttonToolDown.Click += new System.EventHandler(this.OnToolDownButtonClick); + this.buttonToolDown.Click += new System.EventHandler(this.OnBtnToolDownClick); // // buttonToolUp // @@ -766,7 +766,7 @@ private void InitializeComponent() this.buttonToolUp.TabIndex = 3; this.buttonToolUp.Text = "Up"; this.buttonToolUp.UseVisualStyleBackColor = true; - this.buttonToolUp.Click += new System.EventHandler(this.OnToolUpButtonClick); + this.buttonToolUp.Click += new System.EventHandler(this.OnBtnToolUpClick); // // listBoxTools // @@ -776,7 +776,7 @@ private void InitializeComponent() this.listBoxTools.Name = "listBoxTools"; this.listBoxTools.Size = new System.Drawing.Size(406, 165); this.listBoxTools.TabIndex = 0; - this.listBoxTools.SelectedIndexChanged += new System.EventHandler(this.OnToolListBoxSelectedIndexChanged); + this.listBoxTools.SelectedIndexChanged += new System.EventHandler(this.OnListBoxToolSelectedIndexChanged); // // groupBoxToolSettings // @@ -823,7 +823,7 @@ private void InitializeComponent() this.buttonWorkingDir.TabIndex = 10; this.buttonWorkingDir.Text = "..."; this.buttonWorkingDir.UseVisualStyleBackColor = true; - this.buttonWorkingDir.Click += new System.EventHandler(this.OnWorkingDirButtonClick); + this.buttonWorkingDir.Click += new System.EventHandler(this.OnBtnWorkingDirClick); // // textBoxWorkingDir // @@ -844,7 +844,7 @@ private void InitializeComponent() this.buttonIcon.Text = " Icon..."; this.buttonIcon.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; this.buttonIcon.UseVisualStyleBackColor = true; - this.buttonIcon.Click += new System.EventHandler(this.OnIconButtonClick); + this.buttonIcon.Click += new System.EventHandler(this.OnBtnIconClick); // // labelToolName // @@ -893,7 +893,7 @@ private void InitializeComponent() this.checkBoxSysout.TabIndex = 6; this.checkBoxSysout.Text = "Pipe sysout to tab"; this.checkBoxSysout.UseVisualStyleBackColor = true; - this.checkBoxSysout.CheckedChanged += new System.EventHandler(this.OnSysoutCheckBoxACheckedChanged); + this.checkBoxSysout.CheckedChanged += new System.EventHandler(this.OnChkBoxSysoutCheckedChanged); // // buttonArguments // @@ -904,7 +904,7 @@ private void InitializeComponent() this.buttonArguments.TabIndex = 5; this.buttonArguments.Text = "..."; this.buttonArguments.UseVisualStyleBackColor = true; - this.buttonArguments.Click += new System.EventHandler(this.OnArgButtonAClick); + this.buttonArguments.Click += new System.EventHandler(this.OnBtnArgClick); // // labelTool // @@ -925,7 +925,7 @@ private void InitializeComponent() this.buttonTool.TabIndex = 3; this.buttonTool.Text = "..."; this.buttonTool.UseVisualStyleBackColor = true; - this.buttonTool.Click += new System.EventHandler(this.OnToolButtonAClick); + this.buttonTool.Click += new System.EventHandler(this.OnBtnToolClick); // // textBoxTool // @@ -1001,7 +1001,7 @@ private void InitializeComponent() this.buttonDelete.TabIndex = 3; this.buttonDelete.Text = "Delete"; this.buttonDelete.UseVisualStyleBackColor = true; - this.buttonDelete.Click += new System.EventHandler(this.OnDeleteButtonClick); + this.buttonDelete.Click += new System.EventHandler(this.OnBtnDeleteClick); // // dataGridViewColumnizer // @@ -1020,7 +1020,7 @@ private void InitializeComponent() this.dataGridViewColumnizer.RowHeadersWidth = 62; this.dataGridViewColumnizer.Size = new System.Drawing.Size(934, 365); this.dataGridViewColumnizer.TabIndex = 2; - this.dataGridViewColumnizer.RowsAdded += new System.Windows.Forms.DataGridViewRowsAddedEventHandler(this.OnColumnizerDataGridViewRowsAdded); + this.dataGridViewColumnizer.RowsAdded += new System.Windows.Forms.DataGridViewRowsAddedEventHandler(this.OnDataGridViewColumnizerRowsAdded); // // columnFileMask // @@ -1262,7 +1262,7 @@ private void InitializeComponent() this.listBoxPlugin.Size = new System.Drawing.Size(322, 344); this.listBoxPlugin.TabIndex = 0; this.listBoxPlugin.ValueMember = "Text"; - this.listBoxPlugin.SelectedIndexChanged += new System.EventHandler(this.OnPluginListBoxSelectedIndexChanged); + this.listBoxPlugin.SelectedIndexChanged += new System.EventHandler(this.OnListBoxPluginSelectedIndexChanged); // // groupBoxSettings // @@ -1301,7 +1301,7 @@ private void InitializeComponent() this.buttonConfigPlugin.TabIndex = 0; this.buttonConfigPlugin.Text = "Configure..."; this.buttonConfigPlugin.UseVisualStyleBackColor = true; - this.buttonConfigPlugin.Click += new System.EventHandler(this.OnConfigPluginButtonClick); + this.buttonConfigPlugin.Click += new System.EventHandler(this.OnBtnConfigPluginClick); // // tabPageSessions // @@ -1378,7 +1378,7 @@ private void InitializeComponent() this.buttonSessionSaveDir.TabIndex = 3; this.buttonSessionSaveDir.Text = "..."; this.buttonSessionSaveDir.UseVisualStyleBackColor = true; - this.buttonSessionSaveDir.Click += new System.EventHandler(this.OnSessionSaveDirButtonClick); + this.buttonSessionSaveDir.Click += new System.EventHandler(this.OnBtnSessionSaveDirClick); // // radioButtonSessionSaveOwn // @@ -1627,7 +1627,7 @@ private void InitializeComponent() this.buttonCancel.TabIndex = 1; this.buttonCancel.Text = "Cancel"; this.buttonCancel.UseVisualStyleBackColor = true; - this.buttonCancel.Click += new System.EventHandler(this.OnCancelButtonClick); + this.buttonCancel.Click += new System.EventHandler(this.OnBtnCancelClick); // // buttonOk // @@ -1639,7 +1639,7 @@ private void InitializeComponent() this.buttonOk.TabIndex = 0; this.buttonOk.Text = "OK"; this.buttonOk.UseVisualStyleBackColor = true; - this.buttonOk.Click += new System.EventHandler(this.OnOkButtonClick); + this.buttonOk.Click += new System.EventHandler(this.OnBtnOkClick); // // helpProvider // @@ -1654,7 +1654,7 @@ private void InitializeComponent() this.buttonExport.TabIndex = 2; this.buttonExport.Text = "Export..."; this.buttonExport.UseVisualStyleBackColor = true; - this.buttonExport.Click += new System.EventHandler(this.OnExportButtonClick); + this.buttonExport.Click += new System.EventHandler(this.OnBtnExportClick); // // buttonImport // @@ -1665,7 +1665,7 @@ private void InitializeComponent() this.buttonImport.TabIndex = 3; this.buttonImport.Text = "Import..."; this.buttonImport.UseVisualStyleBackColor = true; - this.buttonImport.Click += new System.EventHandler(this.OnImportButtonClick); + this.buttonImport.Click += new System.EventHandler(this.OnBtnImportClick); // // dataGridViewTextBoxColumn1 // @@ -1695,8 +1695,6 @@ private void InitializeComponent() // SettingsDialog // this.AcceptButton = this.buttonOk; - this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.buttonCancel; this.ClientSize = new System.Drawing.Size(956, 563); this.Controls.Add(this.buttonImport); diff --git a/src/LogExpert/Dialogs/SettingsDialog.cs b/src/LogExpert/Dialogs/SettingsDialog.cs index 8a96e647..a5b90606 100644 --- a/src/LogExpert/Dialogs/SettingsDialog.cs +++ b/src/LogExpert/Dialogs/SettingsDialog.cs @@ -32,6 +32,10 @@ public SettingsDialog(Preferences prefs, LogTabWindow logTabWin) Preferences = prefs; _logTabWin = logTabWin; InitializeComponent(); + + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; + Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); } public SettingsDialog(Preferences prefs, LogTabWindow logTabWin, int tabToOpen) : this(prefs, logTabWin) @@ -75,7 +79,6 @@ private void FillDialog() checkBoxSyncFilter.Checked = Preferences.filterSync; checkBoxFilterTail.Checked = Preferences.filterTail; checkBoxFollowTail.Checked = Preferences.followTail; - checkBoxDarkMode.Checked = Preferences.darkMode; radioButtonHorizMouseDrag.Checked = Preferences.timestampControlDragOrientation == DateTimeDragControl.DragOrientations.Horizontal; radioButtonVerticalMouseDrag.Checked = Preferences.timestampControlDragOrientation == DateTimeDragControl.DragOrientations.Vertical; @@ -150,7 +153,7 @@ private void FillDialog() upDownPollingInterval.Value = Preferences.pollingInterval; checkBoxMultiThread.Checked = Preferences.multiThreadFilter; - dataGridViewColumnizer.DataError += OnColumnizerDataGridViewDataError; + dataGridViewColumnizer.DataError += OnDataGridViewColumnizerDataError; FillColumnizerList(); FillPluginList(); @@ -160,6 +163,8 @@ private void FillDialog() FillMultifileSettings(); FillEncodingList(); + var temp = Encoding.GetEncoding(Preferences.defaultEncoding); + comboBoxEncoding.SelectedItem = Encoding.GetEncoding(Preferences.defaultEncoding); checkBoxMaskPrio.Checked = Preferences.maskPrio; checkBoxAutoPick.Checked = Preferences.autoPick; @@ -201,14 +206,15 @@ private void SaveMultifileData() Preferences.multiFileOptions.MaxDayTry = (int)upDownMultifileDays.Value; } - private void OnToolButtonClick(TextBox textBox) + private void OnBtnToolClickInternal(TextBox textBox) { - OpenFileDialog dlg = new OpenFileDialog(); + OpenFileDialog dlg = new(); dlg.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); - if (!string.IsNullOrEmpty(textBox.Text)) + + if (string.IsNullOrEmpty(textBox.Text) == false) { - FileInfo info = new FileInfo(textBox.Text); - if (info.Directory.Exists) + FileInfo info = new(textBox.Text); + if (info.Directory != null && info.Directory.Exists) { dlg.InitialDirectory = info.DirectoryName; } @@ -220,9 +226,9 @@ private void OnToolButtonClick(TextBox textBox) } } - private void OnArgsButtonClick(TextBox textBox) + private void OnBtnArgsClickInternal(TextBox textBox) { - ToolArgsDialog dlg = new ToolArgsDialog(_logTabWin, this); + ToolArgsDialog dlg = new(_logTabWin, this); dlg.Arg = textBox.Text; if (dlg.ShowDialog() == DialogResult.OK) { @@ -230,14 +236,14 @@ private void OnArgsButtonClick(TextBox textBox) } } - private void OnWorkingDirButtonClick(TextBox textBox) + private void OnBtnWorkingDirClick(TextBox textBox) { - FolderBrowserDialog dlg = new FolderBrowserDialog(); + FolderBrowserDialog dlg = new(); dlg.RootFolder = Environment.SpecialFolder.MyComputer; dlg.Description = @"Select a working directory"; if (!string.IsNullOrEmpty(textBox.Text)) { - DirectoryInfo info = new DirectoryInfo(textBox.Text); + DirectoryInfo info = new(textBox.Text); if (info.Exists) { dlg.SelectedPath = info.FullName; @@ -297,9 +303,9 @@ private void FillColumnizerList() foreach (ColumnizerMaskEntry maskEntry in Preferences.columnizerMaskList) { - DataGridViewRow row = new DataGridViewRow(); + DataGridViewRow row = new(); row.Cells.Add(new DataGridViewTextBoxCell()); - DataGridViewComboBoxCell cell = new DataGridViewComboBoxCell(); + DataGridViewComboBoxCell cell = new(); foreach (ILogLineColumnizer logColumnizer in columnizers) { @@ -340,9 +346,9 @@ private void FillHighlightMaskList() foreach (HighlightMaskEntry maskEntry in Preferences.highlightMaskList) { - DataGridViewRow row = new DataGridViewRow(); + DataGridViewRow row = new(); row.Cells.Add(new DataGridViewTextBoxCell()); - DataGridViewComboBoxCell cell = new DataGridViewComboBoxCell(); + DataGridViewComboBoxCell cell = new(); foreach (HilightGroup group in groups) { @@ -383,7 +389,7 @@ private void SaveColumnizerList() { if (!row.IsNewRow) { - ColumnizerMaskEntry entry = new ColumnizerMaskEntry(); + ColumnizerMaskEntry entry = new(); entry.mask = (string)row.Cells[0].Value; entry.columnizerName = (string)row.Cells[1].Value; Preferences.columnizerMaskList.Add(entry); @@ -399,7 +405,7 @@ private void SaveHighlightMaskList() { if (!row.IsNewRow) { - HighlightMaskEntry entry = new HighlightMaskEntry(); + HighlightMaskEntry entry = new(); entry.mask = (string)row.Cells[0].Value; entry.highlightGroupName = (string)row.Cells[1].Value; Preferences.highlightMaskList.Add(entry); @@ -566,6 +572,7 @@ private void FillEncodingList() comboBoxEncoding.Items.Add(Encoding.GetEncoding("iso-8859-1")); comboBoxEncoding.Items.Add(Encoding.UTF8); comboBoxEncoding.Items.Add(Encoding.Unicode); + comboBoxEncoding.Items.Add(CodePagesEncodingProvider.Instance.GetEncoding(1252)); comboBoxEncoding.ValueMember = "HeaderName"; } @@ -579,9 +586,9 @@ private void OnSettingsDialogLoad(object sender, EventArgs e) FillDialog(); } - private void OnChangeFontButtonClick(object sender, EventArgs e) + private void OnBtnChangeFontClick(object sender, EventArgs e) { - FontDialog dlg = new FontDialog(); + FontDialog dlg = new(); dlg.ShowEffects = false; dlg.AllowVerticalFonts = false; dlg.AllowScriptChange = false; @@ -596,14 +603,12 @@ private void OnChangeFontButtonClick(object sender, EventArgs e) DisplayFontName(); } - - private void OnOkButtonClick(object sender, EventArgs e) + private void OnBtnOkClick(object sender, EventArgs e) { Preferences.timestampControl = checkBoxTimestamp.Checked; Preferences.filterSync = checkBoxSyncFilter.Checked; Preferences.filterTail = checkBoxFilterTail.Checked; Preferences.followTail = checkBoxFollowTail.Checked; - Preferences.darkMode = checkBoxDarkMode.Checked; if (radioButtonVerticalMouseDrag.Checked) { @@ -672,18 +677,18 @@ private void OnOkButtonClick(object sender, EventArgs e) SaveMultifileData(); } - private void OnToolButtonAClick(object sender, EventArgs e) + private void OnBtnToolClick(object sender, EventArgs e) { - OnToolButtonClick(textBoxTool); + OnBtnToolClickInternal(textBoxTool); } - private void OnArgButtonAClick(object sender, EventArgs e) + private void OnBtnArgClick(object sender, EventArgs e) { - OnArgsButtonClick(textBoxArguments); + OnBtnArgsClickInternal(textBoxArguments); } //TODO Remove or refactor this function - private void OnColumnizerDataGridViewRowsAdded(object sender, DataGridViewRowsAddedEventArgs e) + private void OnDataGridViewColumnizerRowsAdded(object sender, DataGridViewRowsAddedEventArgs e) { DataGridViewComboBoxCell comboCell = (DataGridViewComboBoxCell) dataGridViewColumnizer.Rows[e.RowIndex].Cells[1]; if (comboCell.Items.Count > 0) @@ -692,7 +697,7 @@ private void OnColumnizerDataGridViewRowsAdded(object sender, DataGridViewRowsAd } } - private void OnDeleteButtonClick(object sender, EventArgs e) + private void OnBtnDeleteClick(object sender, EventArgs e) { if (dataGridViewColumnizer.CurrentRow != null && !dataGridViewColumnizer.CurrentRow.IsNewRow) { @@ -702,19 +707,19 @@ private void OnDeleteButtonClick(object sender, EventArgs e) } } - private void OnColumnizerDataGridViewDataError(object sender, DataGridViewDataErrorEventArgs e) + private void OnDataGridViewColumnizerDataError(object sender, DataGridViewDataErrorEventArgs e) { e.Cancel = true; } - private void OnSysoutCheckBoxACheckedChanged(object sender, EventArgs e) + private void OnChkBoxSysoutCheckedChanged(object sender, EventArgs e) { comboBoxColumnizer.Enabled = checkBoxSysout.Checked; } - private void OnTailColorButtonClick(object sender, EventArgs e) + private void OnBtnTailColorClick(object sender, EventArgs e) { - ColorDialog dlg = new ColorDialog(); + ColorDialog dlg = new(); dlg.Color = Preferences.showTailColor; if (dlg.ShowDialog() == DialogResult.OK) @@ -723,14 +728,14 @@ private void OnTailColorButtonClick(object sender, EventArgs e) } } - private void OnColumnSizeCheckBoxCheckedChanged(object sender, EventArgs e) + private void OnChkBoxColumnSizeCheckedChanged(object sender, EventArgs e) { cpDownColumnWidth.Enabled = checkBoxColumnSize.Checked; } - private void OnTimespreadColorButtonClick(object sender, EventArgs e) + private void OnBtnTimespreadColorClick(object sender, EventArgs e) { - ColorDialog dlg = new ColorDialog(); + ColorDialog dlg = new(); dlg.Color = Preferences.timeSpreadColor; if (dlg.ShowDialog() == DialogResult.OK) @@ -739,7 +744,7 @@ private void OnTimespreadColorButtonClick(object sender, EventArgs e) } } - private void OnPluginListBoxSelectedIndexChanged(object sender, EventArgs e) + private void OnListBoxPluginSelectedIndexChanged(object sender, EventArgs e) { _selectedPlugin?.HideConfigForm(); @@ -771,9 +776,9 @@ private void OnPluginListBoxSelectedIndexChanged(object sender, EventArgs e) } } - private void OnSessionSaveDirButtonClick(object sender, EventArgs e) + private void OnBtnSessionSaveDirClick(object sender, EventArgs e) { - FolderBrowserDialog dlg = new FolderBrowserDialog(); + FolderBrowserDialog dlg = new(); if (Preferences.sessionSaveDirectory != null) { @@ -802,9 +807,11 @@ private void OnPortableModeCheckedChanged(object sender, EventArgs e) Directory.CreateDirectory(ConfigManager.PortableModeDir); } - using (File.Create(ConfigManager.PortableModeDir + Path.DirectorySeparatorChar + ConfigManager.PortableModeSettingsFileName)) - break; - } + using (File.Create(ConfigManager.PortableModeDir + Path.DirectorySeparatorChar + ConfigManager.PortableModeSettingsFileName)) + { + break; + } + } case CheckState.Unchecked when File.Exists(ConfigManager.PortableModeDir + Path.DirectorySeparatorChar + ConfigManager.PortableModeSettingsFileName): { File.Delete(ConfigManager.PortableModeDir + Path.DirectorySeparatorChar + ConfigManager.PortableModeSettingsFileName); @@ -836,7 +843,7 @@ private void OnPortableModeCheckedChanged(object sender, EventArgs e) } - private void OnConfigPluginButtonClick(object sender, EventArgs e) + private void OnBtnConfigPluginClick(object sender, EventArgs e) { if (!_selectedPlugin.HasEmbeddedForm()) { @@ -849,7 +856,7 @@ private void OnNumericUpDown1ValueChanged(object sender, EventArgs e) //TODO implement } - private void OnToolListBoxSelectedIndexChanged(object sender, EventArgs e) + private void OnListBoxToolSelectedIndexChanged(object sender, EventArgs e) { GetCurrentToolValues(); _selectedTool = listBoxTools.SelectedItem as ToolEntry; @@ -859,7 +866,7 @@ private void OnToolListBoxSelectedIndexChanged(object sender, EventArgs e) DisplayCurrentIcon(); } - private void OnToolUpButtonClick(object sender, EventArgs e) + private void OnBtnToolUpClick(object sender, EventArgs e) { int i = listBoxTools.SelectedIndex; @@ -875,7 +882,7 @@ private void OnToolUpButtonClick(object sender, EventArgs e) } } - private void OnToolDownButtonClick(object sender, EventArgs e) + private void OnBtnToolDownClick(object sender, EventArgs e) { int i = listBoxTools.SelectedIndex; @@ -891,7 +898,7 @@ private void OnToolDownButtonClick(object sender, EventArgs e) } } - private void OnToolAddButtonClick(object sender, EventArgs e) + private void OnBtnToolAddClick(object sender, EventArgs e) { listBoxTools.Items.Add(new ToolEntry()); listBoxTools.SelectedIndex = listBoxTools.Items.Count - 1; @@ -918,7 +925,7 @@ private void OnToolDeleteButtonClick(object sender, EventArgs e) } } - private void OnIconButtonClick(object sender, EventArgs e) + private void OnBtnIconClick(object sender, EventArgs e) { if (_selectedTool != null) { @@ -929,7 +936,7 @@ private void OnIconButtonClick(object sender, EventArgs e) iconFile = textBoxTool.Text; } - ChooseIconDlg dlg = new ChooseIconDlg(iconFile); + ChooseIconDlg dlg = new(iconFile); if (dlg.ShowDialog() == DialogResult.OK) { @@ -940,14 +947,14 @@ private void OnIconButtonClick(object sender, EventArgs e) } } - private void OnCancelButtonClick(object sender, EventArgs e) + private void OnBtnCancelClick(object sender, EventArgs e) { _selectedPlugin?.HideConfigForm(); } - private void OnWorkingDirButtonClick(object sender, EventArgs e) + private void OnBtnWorkingDirClick(object sender, EventArgs e) { - OnWorkingDirButtonClick(textBoxWorkingDir); + OnBtnWorkingDirClick(textBoxWorkingDir); } private void OnMultiFilePatternTextChanged(object sender, EventArgs e) @@ -956,9 +963,9 @@ private void OnMultiFilePatternTextChanged(object sender, EventArgs e) upDownMultifileDays.Enabled = pattern.Contains("$D"); } - private void OnExportButtonClick(object sender, EventArgs e) + private void OnBtnExportClick(object sender, EventArgs e) { - SaveFileDialog dlg = new SaveFileDialog(); + SaveFileDialog dlg = new(); dlg.Title = @"Export Settings to file"; dlg.DefaultExt = "json"; dlg.AddExtension = true; @@ -968,7 +975,7 @@ private void OnExportButtonClick(object sender, EventArgs e) if (result == DialogResult.OK) { - FileInfo fileInfo = new FileInfo(dlg.FileName); + FileInfo fileInfo = new(dlg.FileName); ConfigManager.Export(fileInfo); } } @@ -978,9 +985,9 @@ private void OnExportButtonClick(object sender, EventArgs e) /// /// /// - private void OnImportButtonClick(object sender, EventArgs e) + private void OnBtnImportClick(object sender, EventArgs e) { - ImportSettingsDialog dlg = new ImportSettingsDialog(); + ImportSettingsDialog dlg = new(); if (dlg.ShowDialog() == DialogResult.OK) { @@ -1007,7 +1014,6 @@ private void OnImportButtonClick(object sender, EventArgs e) } } - #endregion } -} \ No newline at end of file +} diff --git a/src/LogExpert/Dialogs/TabRenameDlg.Designer.cs b/src/LogExpert/Dialogs/TabRenameDlg.Designer.cs index d7c41ef8..75fd448f 100644 --- a/src/LogExpert/Dialogs/TabRenameDlg.Designer.cs +++ b/src/LogExpert/Dialogs/TabRenameDlg.Designer.cs @@ -28,64 +28,75 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.tabNameTextBox = new System.Windows.Forms.TextBox(); - this.label1 = new System.Windows.Forms.Label(); - this.okButton = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // tabNameTextBox - // - this.tabNameTextBox.Location = new System.Drawing.Point(12, 34); - this.tabNameTextBox.Name = "tabNameTextBox"; - this.tabNameTextBox.Size = new System.Drawing.Size(193, 20); - this.tabNameTextBox.TabIndex = 0; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(13, 15); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(38, 13); - this.label1.TabIndex = 1; - this.label1.Text = "Name:"; - // - // okButton - // - this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.okButton.Location = new System.Drawing.Point(130, 73); - this.okButton.Name = "okButton"; - this.okButton.Size = new System.Drawing.Size(75, 23); - this.okButton.TabIndex = 2; - this.okButton.Text = "OK"; - this.okButton.UseVisualStyleBackColor = true; - // - // TabRenameDlg - // - this.AcceptButton = this.okButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(219, 108); - this.Controls.Add(this.okButton); - this.Controls.Add(this.label1); - this.Controls.Add(this.tabNameTextBox); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; - this.KeyPreview = true; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "TabRenameDlg"; - this.ShowIcon = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Rename Tab"; - this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TabRenameDlg_KeyDown); - this.ResumeLayout(false); - this.PerformLayout(); + this.textBoxTabName = new System.Windows.Forms.TextBox(); + this.labelName = new System.Windows.Forms.Label(); + this.buttonOk = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // textBoxTabName + // + this.textBoxTabName.Location = new System.Drawing.Point(12, 34); + this.textBoxTabName.Name = "textBoxTabName"; + this.textBoxTabName.Size = new System.Drawing.Size(193, 26); + this.textBoxTabName.TabIndex = 0; + // + // labelName + // + this.labelName.AutoSize = true; + this.labelName.Location = new System.Drawing.Point(13, 11); + this.labelName.Name = "labelName"; + this.labelName.Size = new System.Drawing.Size(55, 20); + this.labelName.TabIndex = 1; + this.labelName.Text = "Name:"; + // + // buttonOk + // + this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this.buttonOk.Location = new System.Drawing.Point(49, 73); + this.buttonOk.Name = "buttonOk"; + this.buttonOk.Size = new System.Drawing.Size(75, 23); + this.buttonOk.TabIndex = 2; + this.buttonOk.Text = "OK"; + this.buttonOk.UseVisualStyleBackColor = true; + // + // buttonCancel + // + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(130, 73); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(75, 23); + this.buttonCancel.TabIndex = 3; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + // + // TabRenameDlg + // + this.AcceptButton = this.buttonOk; + this.ClientSize = new System.Drawing.Size(219, 108); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOk); + this.Controls.Add(this.labelName); + this.Controls.Add(this.textBoxTabName); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.KeyPreview = true; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "TabRenameDlg"; + this.ShowIcon = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Rename Tab"; + this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnTabRenameDlgKeyDown); + this.ResumeLayout(false); + this.PerformLayout(); } #endregion - private System.Windows.Forms.TextBox tabNameTextBox; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Button okButton; - } + private System.Windows.Forms.TextBox textBoxTabName; + private System.Windows.Forms.Label labelName; + private System.Windows.Forms.Button buttonOk; + private System.Windows.Forms.Button buttonCancel; + } } \ No newline at end of file diff --git a/src/LogExpert/Dialogs/TabRenameDlg.cs b/src/LogExpert/Dialogs/TabRenameDlg.cs index 3e14b7eb..0896cf39 100644 --- a/src/LogExpert/Dialogs/TabRenameDlg.cs +++ b/src/LogExpert/Dialogs/TabRenameDlg.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; +using System.Drawing; using System.Windows.Forms; namespace LogExpert.Dialogs @@ -15,6 +10,9 @@ public partial class TabRenameDlg : Form public TabRenameDlg() { InitializeComponent(); + + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; } #endregion @@ -23,15 +21,15 @@ public TabRenameDlg() public string TabName { - get { return this.tabNameTextBox.Text; } - set { this.tabNameTextBox.Text = value; } + get => textBoxTabName.Text; + set => textBoxTabName.Text = value; } #endregion #region Events handler - private void TabRenameDlg_KeyDown(object sender, KeyEventArgs e) + private void OnTabRenameDlgKeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape) { diff --git a/src/LogExpert/Dialogs/TabRenameDlg.resx b/src/LogExpert/Dialogs/TabRenameDlg.resx index ff31a6db..c7e0d4bd 100644 --- a/src/LogExpert/Dialogs/TabRenameDlg.resx +++ b/src/LogExpert/Dialogs/TabRenameDlg.resx @@ -112,9 +112,9 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 \ No newline at end of file diff --git a/src/LogExpert/Dialogs/TimeSpreadigControl.Designer.cs b/src/LogExpert/Dialogs/TimeSpreadigControl.Designer.cs index 09d8b063..5f8d1dc8 100644 --- a/src/LogExpert/Dialogs/TimeSpreadigControl.Designer.cs +++ b/src/LogExpert/Dialogs/TimeSpreadigControl.Designer.cs @@ -32,9 +32,6 @@ private void InitializeComponent() // // TimeSpreadingControl // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "TimeSpreadingControl"; this.Size = new System.Drawing.Size(26, 324); this.MouseLeave += new System.EventHandler(this.TimeSpreadingControl_MouseLeave); diff --git a/src/LogExpert/Dialogs/TimeSpreadigControl.cs b/src/LogExpert/Dialogs/TimeSpreadigControl.cs index 6e9d6161..56a888b4 100644 --- a/src/LogExpert/Dialogs/TimeSpreadigControl.cs +++ b/src/LogExpert/Dialogs/TimeSpreadigControl.cs @@ -1,12 +1,11 @@ -using System; +using LogExpert.Classes; + +using NLog; + +using System; using System.Collections.Generic; -using System.ComponentModel; using System.Drawing; -using System.Data; -using System.Text; using System.Windows.Forms; -using LogExpert.Classes; -using NLog; namespace LogExpert.Dialogs { @@ -15,15 +14,15 @@ public partial class TimeSpreadingControl : UserControl private static readonly ILogger _logger = LogManager.GetCurrentClassLogger(); #region Fields - private Bitmap bmp = new Bitmap(1, 1); - private int displayHeight = 1; - private readonly int EDGE_OFFSET = (int) Win32.GetSystemMetrics(Win32.SM_CYVSCROLL); - private int lastMouseY = 0; - private readonly object monitor = new object(); - private int rectHeight = 1; + private Bitmap _bitmap = new(1, 1); + private int _displayHeight = 1; + private readonly int _edgeOffset = (int)Win32.GetSystemMetricsForDpi(Win32.SM_CYVSCROLL); + private int _lastMouseY = 0; + private readonly object _monitor = new(); + private int _rectHeight = 1; - private TimeSpreadCalculator timeSpreadCalc; - private readonly ToolTip toolTip; + private TimeSpreadCalculator _timeSpreadCalc; + private readonly ToolTip _toolTip; #endregion @@ -32,11 +31,12 @@ public partial class TimeSpreadingControl : UserControl public TimeSpreadingControl() { InitializeComponent(); - this.toolTip = new ToolTip(); - this.toolTip.InitialDelay = 0; - this.toolTip.ReshowDelay = 0; - this.toolTip.ShowAlways = true; - this.DoubleBuffered = false; + _toolTip = new ToolTip(); + Font = new Font("Courier New", 8.25F, FontStyle.Regular, GraphicsUnit.Point, 0); + _toolTip.InitialDelay = 0; + _toolTip.ReshowDelay = 0; + _toolTip.ShowAlways = true; + DoubleBuffered = false; } #endregion @@ -59,13 +59,13 @@ public TimeSpreadingControl() internal TimeSpreadCalculator TimeSpreadCalc { - get { return timeSpreadCalc; } + get => _timeSpreadCalc; set { //timeSpreadCalc.CalcDone -= timeSpreadCalc_CalcDone; - timeSpreadCalc = value; - timeSpreadCalc.CalcDone += timeSpreadCalc_CalcDone; - timeSpreadCalc.StartCalc += timeSpreadCalc_StartCalc; + _timeSpreadCalc = value; + _timeSpreadCalc.CalcDone += TimeSpreadCalc_CalcDone; + _timeSpreadCalc.StartCalc += TimeSpreadCalc_StartCalc; } } @@ -76,19 +76,19 @@ internal TimeSpreadCalculator TimeSpreadCalc protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); - lock (this.monitor) + lock (_monitor) { if (DesignMode) { Brush bgBrush = new SolidBrush(Color.FromKnownColor(KnownColor.LightSkyBlue)); Rectangle rect = ClientRectangle; - rect.Inflate(0, -EDGE_OFFSET); + rect.Inflate(0, -_edgeOffset); e.Graphics.FillRectangle(bgBrush, rect); bgBrush.Dispose(); } else { - e.Graphics.DrawImage(this.bmp, 0, EDGE_OFFSET); + e.Graphics.DrawImage(_bitmap, 0, _edgeOffset); } } } @@ -100,21 +100,21 @@ protected override void OnPaint(PaintEventArgs e) private TimeSpreadCalculator.SpreadEntry GetEntryForMouse(MouseEventArgs e) { List list = TimeSpreadCalc.DiffList; - int y = e.Y - EDGE_OFFSET; + int y = e.Y - _edgeOffset; if (y < 0) { y = 0; } - else if (y >= ClientRectangle.Height - EDGE_OFFSET * 3) + else if (y >= ClientRectangle.Height - _edgeOffset * 3) { y = list.Count - 1; } else { - y = y / this.rectHeight; + y /= _rectHeight; } - lock (this.monitor) + lock (_monitor) { if (y >= list.Count || y < 0) { @@ -126,65 +126,62 @@ private TimeSpreadCalculator.SpreadEntry GetEntryForMouse(MouseEventArgs e) private void DragContrast(MouseEventArgs e) { - if (this.lastMouseY == 0) + if (_lastMouseY == 0) { - this.lastMouseY = this.lastMouseY = e.Y; + _lastMouseY = _lastMouseY = e.Y; return; } - this.timeSpreadCalc.Contrast = this.timeSpreadCalc.Contrast + (this.lastMouseY - e.Y) * 5; - this.lastMouseY = e.Y; + _timeSpreadCalc.Contrast += (_lastMouseY - e.Y) * 5; + _lastMouseY = e.Y; } private void OnLineSelected(SelectLineEventArgs e) { - if (LineSelected != null) - { - LineSelected(this, e); - } + LineSelected?.Invoke(this, e); } #endregion #region Events handler - private void timeSpreadCalc_CalcDone(object sender, EventArgs e) + private void TimeSpreadCalc_CalcDone(object sender, EventArgs e) { _logger.Debug("timeSpreadCalc_CalcDone()"); - lock (this.monitor) + lock (_monitor) { - this.Invalidate(); - Rectangle rect = this.ClientRectangle; - rect.Size = new Size(rect.Width, rect.Height - EDGE_OFFSET * 3); + Invalidate(); + Rectangle rect = ClientRectangle; + rect.Size = new Size(rect.Width, rect.Height - _edgeOffset * 3); if (rect.Height < 1) { return; } - this.bmp = new Bitmap(rect.Width, rect.Height); - Graphics gfx = Graphics.FromImage(bmp); - Brush bgBrush = new SolidBrush(this.BackColor); + _bitmap = new Bitmap(rect.Width, rect.Height); + Graphics gfx = Graphics.FromImage(_bitmap); + Brush bgBrush = new SolidBrush(BackColor); gfx.FillRectangle(bgBrush, rect); bgBrush.Dispose(); List list = TimeSpreadCalc.DiffList; int step; - if (list.Count >= this.displayHeight) + if (list.Count >= _displayHeight) { - step = (int) Math.Round((double) list.Count / (double) this.displayHeight); - this.rectHeight = 1; + step = (int)Math.Round(list.Count / (double)_displayHeight); + _rectHeight = 1; } else { step = 1; - this.rectHeight = (int) Math.Round((double) this.displayHeight / (double) list.Count); + _rectHeight = (int)Math.Round(_displayHeight / (double)list.Count); } - Rectangle fillRect = new Rectangle(0, 0, rect.Width, this.rectHeight); + Rectangle fillRect = new(0, 0, rect.Width, _rectHeight); lock (list) { for (int i = 0; i < list.Count; i += step) { TimeSpreadCalculator.SpreadEntry entry = list[i]; - int color = ReverseAlpha ? entry.value : 255 - entry.value; + int color = ReverseAlpha ? entry.Value : 255 - entry.Value; if (color > 255) { color = 255; @@ -193,55 +190,56 @@ private void timeSpreadCalc_CalcDone(object sender, EventArgs e) { color = 0; } - Brush brush = new SolidBrush(Color.FromArgb(color, this.ForeColor)); + Brush brush = new SolidBrush(Color.FromArgb(color, ForeColor)); //Brush brush = new SolidBrush(Color.FromArgb(color, color, color, color)); gfx.FillRectangle(brush, fillRect); brush.Dispose(); - fillRect.Offset(0, this.rectHeight); + fillRect.Offset(0, _rectHeight); } } } - this.BeginInvoke(new MethodInvoker(Refresh)); + BeginInvoke(new MethodInvoker(Refresh)); } - - private void timeSpreadCalc_StartCalc(object sender, EventArgs e) + private void TimeSpreadCalc_StartCalc(object sender, EventArgs e) { - lock (this.monitor) + lock (_monitor) { - this.Invalidate(); - Rectangle rect = this.ClientRectangle; - rect.Size = new Size(rect.Width, rect.Height - EDGE_OFFSET * 3); + Invalidate(); + Rectangle rect = ClientRectangle; + rect.Size = new Size(rect.Width, rect.Height - _edgeOffset * 3); if (rect.Height < 1) { return; } //this.bmp = new Bitmap(rect.Width, rect.Height); - Graphics gfx = Graphics.FromImage(this.bmp); - Brush bgBrush = new SolidBrush(this.BackColor); - Brush fgBrush = new SolidBrush(this.ForeColor); + Graphics gfx = Graphics.FromImage(_bitmap); + + Brush bgBrush = new SolidBrush(BackColor); + Brush fgBrush = new SolidBrush(ForeColor); //gfx.FillRectangle(bgBrush, rect); - StringFormat format = new StringFormat( - StringFormatFlags.DirectionVertical | - StringFormatFlags.NoWrap - ); + + StringFormat format = new(StringFormatFlags.DirectionVertical | StringFormatFlags.NoWrap); format.LineAlignment = StringAlignment.Center; format.Alignment = StringAlignment.Center; - RectangleF rectf = new RectangleF(rect.Left, rect.Top, rect.Width, rect.Height); - gfx.DrawString("Calculating time spread view...", this.Font, fgBrush, rectf, format); + + RectangleF rectf = new(rect.Left, rect.Top, rect.Width, rect.Height); + + gfx.DrawString("Calculating time spread view...", Font, fgBrush, rectf, format); + bgBrush.Dispose(); fgBrush.Dispose(); } - this.BeginInvoke(new MethodInvoker(Refresh)); - } + BeginInvoke(new MethodInvoker(Refresh)); + } private void TimeSpreadingControl_SizeChanged(object sender, EventArgs e) { - if (this.TimeSpreadCalc != null) + if (TimeSpreadCalc != null) { - this.displayHeight = this.ClientRectangle.Height - EDGE_OFFSET * 3; - this.TimeSpreadCalc.SetDisplayHeight(this.displayHeight); + _displayHeight = ClientRectangle.Height - _edgeOffset * 3; + TimeSpreadCalc.SetDisplayHeight(_displayHeight); } } @@ -258,23 +256,23 @@ private void TimeSpreadingControl_MouseUp(object sender, MouseEventArgs e) { return; } - OnLineSelected(new SelectLineEventArgs(entry.lineNum)); + OnLineSelected(new SelectLineEventArgs(entry.LineNum)); } } private void TimeSpreadingControl_MouseEnter(object sender, EventArgs e) { - this.toolTip.Active = true; + _toolTip.Active = true; } private void TimeSpreadingControl_MouseLeave(object sender, EventArgs e) { - this.toolTip.Active = false; + _toolTip.Active = false; } private void TimeSpreadingControl_MouseMove(object sender, MouseEventArgs e) { - if (e.Y == this.lastMouseY) + if (e.Y == _lastMouseY) { return; } @@ -290,9 +288,9 @@ private void TimeSpreadingControl_MouseMove(object sender, MouseEventArgs e) { return; } - this.lastMouseY = e.Y; - string dts = entry.timestamp.ToString("dd.MM.yyyy HH:mm:ss"); - this.toolTip.SetToolTip(this, "Line " + (entry.lineNum + 1) + "\n" + dts); + _lastMouseY = e.Y; + string dts = entry.Timestamp.ToString("dd.MM.yyyy HH:mm:ss"); + _toolTip.SetToolTip(this, "Line " + (entry.LineNum + 1) + "\n" + dts); } #endregion diff --git a/src/LogExpert/Dialogs/ToolArgsDialog.Designer.cs b/src/LogExpert/Dialogs/ToolArgsDialog.Designer.cs index bc66b2f3..fc9d4dcd 100644 --- a/src/LogExpert/Dialogs/ToolArgsDialog.Designer.cs +++ b/src/LogExpert/Dialogs/ToolArgsDialog.Designer.cs @@ -28,126 +28,124 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.okButton = new System.Windows.Forms.Button(); - this.regexHelpButton = new System.Windows.Forms.Button(); - this.argsTextBox = new System.Windows.Forms.TextBox(); - this.testButton = new System.Windows.Forms.Button(); - this.label1 = new System.Windows.Forms.Label(); - this.helpLabel = new System.Windows.Forms.Label(); - this.button2 = new System.Windows.Forms.Button(); - this.testResultLabel = new System.Windows.Forms.TextBox(); - this.SuspendLayout(); - // - // okButton - // - this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.okButton.Location = new System.Drawing.Point(429, 292); - this.okButton.Name = "okButton"; - this.okButton.Size = new System.Drawing.Size(75, 23); - this.okButton.TabIndex = 1; - this.okButton.Text = "OK"; - this.okButton.UseVisualStyleBackColor = true; - this.okButton.Click += new System.EventHandler(this.button1_Click); - // - // regexHelpButton - // - this.regexHelpButton.Location = new System.Drawing.Point(429, 59); - this.regexHelpButton.Name = "regexHelpButton"; - this.regexHelpButton.Size = new System.Drawing.Size(75, 21); - this.regexHelpButton.TabIndex = 2; - this.regexHelpButton.Text = "RegEx Help"; - this.regexHelpButton.UseVisualStyleBackColor = true; - this.regexHelpButton.Click += new System.EventHandler(this.regexHelpButton_Click); - // - // argsTextBox - // - this.argsTextBox.Location = new System.Drawing.Point(12, 30); - this.argsTextBox.Name = "argsTextBox"; - this.argsTextBox.Size = new System.Drawing.Size(395, 20); - this.argsTextBox.TabIndex = 8; - // - // testButton - // - this.testButton.Location = new System.Drawing.Point(429, 30); - this.testButton.Name = "testButton"; - this.testButton.Size = new System.Drawing.Size(75, 23); - this.testButton.TabIndex = 9; - this.testButton.Text = "Test"; - this.testButton.UseVisualStyleBackColor = true; - this.testButton.Click += new System.EventHandler(this.testButton_Click); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 13); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(103, 13); - this.label1.TabIndex = 11; - this.label1.Text = "Enter command line:"; - // - // helpLabel - // - this.helpLabel.Location = new System.Drawing.Point(15, 113); - this.helpLabel.Name = "helpLabel"; - this.helpLabel.Size = new System.Drawing.Size(392, 157); - this.helpLabel.TabIndex = 12; - this.helpLabel.Text = "label2"; - // - // button2 - // - this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.button2.Location = new System.Drawing.Point(429, 261); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(75, 23); - this.button2.TabIndex = 13; - this.button2.Text = "Cancel"; - this.button2.UseVisualStyleBackColor = true; - // - // testResultLabel - // - this.testResultLabel.Location = new System.Drawing.Point(12, 56); - this.testResultLabel.Multiline = true; - this.testResultLabel.Name = "testResultLabel"; - this.testResultLabel.ReadOnly = true; - this.testResultLabel.Size = new System.Drawing.Size(395, 48); - this.testResultLabel.TabIndex = 14; - // - // ToolArgsDialog - // - this.AcceptButton = this.okButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.button2; - this.ClientSize = new System.Drawing.Size(516, 327); - this.Controls.Add(this.testResultLabel); - this.Controls.Add(this.button2); - this.Controls.Add(this.helpLabel); - this.Controls.Add(this.label1); - this.Controls.Add(this.testButton); - this.Controls.Add(this.argsTextBox); - this.Controls.Add(this.regexHelpButton); - this.Controls.Add(this.okButton); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "ToolArgsDialog"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Tool Arguments Help"; - this.Load += new System.EventHandler(this.ToolArgsDialog_Load); - this.ResumeLayout(false); - this.PerformLayout(); + this.buttonOk = new System.Windows.Forms.Button(); + this.buttonRegexHelp = new System.Windows.Forms.Button(); + this.textBoxArguments = new System.Windows.Forms.TextBox(); + this.buttonTest = new System.Windows.Forms.Button(); + this.labelEnterArguments = new System.Windows.Forms.Label(); + this.labelHelp = new System.Windows.Forms.Label(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.labelTestResult = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // buttonOk + // + this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this.buttonOk.Location = new System.Drawing.Point(348, 292); + this.buttonOk.Name = "buttonOk"; + this.buttonOk.Size = new System.Drawing.Size(75, 23); + this.buttonOk.TabIndex = 1; + this.buttonOk.Text = "OK"; + this.buttonOk.UseVisualStyleBackColor = true; + this.buttonOk.Click += new System.EventHandler(this.OnButtonOkClick); + // + // buttonRegexHelp + // + this.buttonRegexHelp.Location = new System.Drawing.Point(429, 59); + this.buttonRegexHelp.Name = "buttonRegexHelp"; + this.buttonRegexHelp.Size = new System.Drawing.Size(75, 21); + this.buttonRegexHelp.TabIndex = 2; + this.buttonRegexHelp.Text = "RegEx Help"; + this.buttonRegexHelp.UseVisualStyleBackColor = true; + this.buttonRegexHelp.Click += new System.EventHandler(this.OnButtonRegexHelpClick); + // + // textBoxArguments + // + this.textBoxArguments.Location = new System.Drawing.Point(12, 36); + this.textBoxArguments.Name = "textBoxArguments"; + this.textBoxArguments.Size = new System.Drawing.Size(395, 26); + this.textBoxArguments.TabIndex = 8; + // + // buttonTest + // + this.buttonTest.Location = new System.Drawing.Point(429, 30); + this.buttonTest.Name = "buttonTest"; + this.buttonTest.Size = new System.Drawing.Size(75, 23); + this.buttonTest.TabIndex = 9; + this.buttonTest.Text = "Test"; + this.buttonTest.UseVisualStyleBackColor = true; + this.buttonTest.Click += new System.EventHandler(this.OnButtonTestClick); + // + // labelEnterArguments + // + this.labelEnterArguments.AutoSize = true; + this.labelEnterArguments.Location = new System.Drawing.Point(12, 13); + this.labelEnterArguments.Name = "labelEnterArguments"; + this.labelEnterArguments.Size = new System.Drawing.Size(154, 20); + this.labelEnterArguments.TabIndex = 11; + this.labelEnterArguments.Text = "Enter command line:"; + // + // labelHelp + // + this.labelHelp.Location = new System.Drawing.Point(15, 124); + this.labelHelp.Name = "labelHelp"; + this.labelHelp.Size = new System.Drawing.Size(392, 157); + this.labelHelp.TabIndex = 12; + this.labelHelp.Text = "Help"; + // + // buttonCancel + // + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(429, 292); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(75, 23); + this.buttonCancel.TabIndex = 13; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + // + // labelTestResult + // + this.labelTestResult.Location = new System.Drawing.Point(12, 68); + this.labelTestResult.Multiline = true; + this.labelTestResult.Name = "labelTestResult"; + this.labelTestResult.ReadOnly = true; + this.labelTestResult.Size = new System.Drawing.Size(395, 48); + this.labelTestResult.TabIndex = 14; + // + // ToolArgsDialog + // + this.AcceptButton = this.buttonOk; + this.CancelButton = this.buttonCancel; + this.ClientSize = new System.Drawing.Size(516, 327); + this.Controls.Add(this.labelTestResult); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.labelHelp); + this.Controls.Add(this.labelEnterArguments); + this.Controls.Add(this.buttonTest); + this.Controls.Add(this.textBoxArguments); + this.Controls.Add(this.buttonRegexHelp); + this.Controls.Add(this.buttonOk); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ToolArgsDialog"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Tool Arguments Help"; + this.Load += new System.EventHandler(this.OnToolArgsDialogLoad); + this.ResumeLayout(false); + this.PerformLayout(); } #endregion - private System.Windows.Forms.Button okButton; - private System.Windows.Forms.Button regexHelpButton; - private System.Windows.Forms.TextBox argsTextBox; - private System.Windows.Forms.Button testButton; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label helpLabel; - private System.Windows.Forms.Button button2; - private System.Windows.Forms.TextBox testResultLabel; + private System.Windows.Forms.Button buttonOk; + private System.Windows.Forms.Button buttonRegexHelp; + private System.Windows.Forms.TextBox textBoxArguments; + private System.Windows.Forms.Button buttonTest; + private System.Windows.Forms.Label labelEnterArguments; + private System.Windows.Forms.Label labelHelp; + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.TextBox labelTestResult; } } \ No newline at end of file diff --git a/src/LogExpert/Dialogs/ToolArgsDialog.cs b/src/LogExpert/Dialogs/ToolArgsDialog.cs index a6621380..0ecd6a62 100644 --- a/src/LogExpert/Dialogs/ToolArgsDialog.cs +++ b/src/LogExpert/Dialogs/ToolArgsDialog.cs @@ -25,23 +25,26 @@ public ToolArgsDialog(LogTabWindow logTabWin, Form parent) { this.logTabWin = logTabWin; parent.AddOwnedForm(this); - this.TopMost = parent.TopMost; + TopMost = parent.TopMost; InitializeComponent(); + + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; } #endregion #region Properties - public string Arg { get; set; } = null; + public string Arg { get; set; } #endregion #region Events handler - private void ToolArgsDialog_Load(object sender, EventArgs e) + private void OnToolArgsDialogLoad(object sender, EventArgs e) { - this.helpLabel.Text = "" + + labelHelp.Text = "" + "%L = Current line number\n" + "%N = Current log file name without path\n" + "%P = Path (directory) of current log file\n" + @@ -58,38 +61,38 @@ private void ToolArgsDialog_Load(object sender, EventArgs e) "{}{}:\n" + "Regex search/replace on current selected line."; - this.argsTextBox.Text = this.Arg; + textBoxArguments.Text = Arg; } - private void regexHelpButton_Click(object sender, EventArgs e) + private void OnButtonRegexHelpClick(object sender, EventArgs e) { - RegexHelperDialog regexDlg = new RegexHelperDialog(); + RegexHelperDialog regexDlg = new(); if (regexDlg.ShowDialog() == DialogResult.OK) { - this.argsTextBox.SelectedText = regexDlg.Pattern; + textBoxArguments.SelectedText = regexDlg.Pattern; } } - private void testButton_Click(object sender, EventArgs e) + private void OnButtonTestClick(object sender, EventArgs e) { - if (this.logTabWin.CurrentLogWindow != null) + if (logTabWin.CurrentLogWindow != null) { - ILogLine line = this.logTabWin.CurrentLogWindow.GetCurrentLine(); - ILogFileInfo info = this.logTabWin.CurrentLogWindow.GetCurrentFileInfo(); + ILogLine line = logTabWin.CurrentLogWindow.GetCurrentLine(); + ILogFileInfo info = logTabWin.CurrentLogWindow.GetCurrentFileInfo(); if (line != null && info != null) { - ArgParser parser = new ArgParser(this.argsTextBox.Text); - string args = parser.BuildArgs(line, this.logTabWin.CurrentLogWindow.GetRealLineNum() + 1, info, + ArgParser parser = new(textBoxArguments.Text); + string args = parser.BuildArgs(line, logTabWin.CurrentLogWindow.GetRealLineNum() + 1, info, this); - this.testResultLabel.Text = args; + labelTestResult.Text = args; } } } - private void button1_Click(object sender, EventArgs e) + private void OnButtonOkClick(object sender, EventArgs e) { - this.Arg = this.argsTextBox.Text; + Arg = textBoxArguments.Text; } #endregion diff --git a/src/LogExpert/Dialogs/ToolArgsDialog.resx b/src/LogExpert/Dialogs/ToolArgsDialog.resx index ff31a6db..c7e0d4bd 100644 --- a/src/LogExpert/Dialogs/ToolArgsDialog.resx +++ b/src/LogExpert/Dialogs/ToolArgsDialog.resx @@ -112,9 +112,9 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 \ No newline at end of file diff --git a/src/LogExpert/Entities/DefaultLogfileColumnizer.cs b/src/LogExpert/Entities/DefaultLogfileColumnizer.cs index f43761af..6bffc9d2 100644 --- a/src/LogExpert/Entities/DefaultLogfileColumnizer.cs +++ b/src/LogExpert/Entities/DefaultLogfileColumnizer.cs @@ -29,7 +29,7 @@ public string[] GetColumnNames() public IColumnizedLogLine SplitLine(ILogLineColumnizerCallback callback, ILogLine line) { - ColumnizedLogLine cLogLine = new ColumnizedLogLine(); + ColumnizedLogLine cLogLine = new(); cLogLine.LogLine = line; cLogLine.ColumnValues = new IColumn[] { diff --git a/src/LogExpert/Entities/EventArgs/StatusEventArgs.cs b/src/LogExpert/Entities/EventArgs/StatusEventArgs.cs index 1169e9f1..08cb79dd 100644 --- a/src/LogExpert/Entities/EventArgs/StatusEventArgs.cs +++ b/src/LogExpert/Entities/EventArgs/StatusEventArgs.cs @@ -22,7 +22,7 @@ public class StatusLineEventArgs : System.EventArgs public StatusLineEventArgs Clone() { - StatusLineEventArgs e = new StatusLineEventArgs(); + StatusLineEventArgs e = new(); e.StatusText = StatusText; e.CurrentLineNum = CurrentLineNum; e.LineCount = LineCount; diff --git a/src/LogExpert/Entities/HilightGroup.cs b/src/LogExpert/Entities/HilightGroup.cs index 7fafee9e..8e80e902 100644 --- a/src/LogExpert/Entities/HilightGroup.cs +++ b/src/LogExpert/Entities/HilightGroup.cs @@ -10,7 +10,7 @@ public class HilightGroup #region Fields private string groupName = ""; - private List hilightEntryList = new List(); + private List hilightEntryList = []; #endregion diff --git a/src/LogExpert/Entities/SearchParams.cs b/src/LogExpert/Entities/SearchParams.cs index fd88a5c4..ca79341f 100644 --- a/src/LogExpert/Entities/SearchParams.cs +++ b/src/LogExpert/Entities/SearchParams.cs @@ -9,7 +9,7 @@ public class SearchParams #region Fields public int currentLine; - public List historyList = new List(); + public List historyList = []; public bool isCaseSensitive = false; public bool isFindNext; diff --git a/src/LogExpert/Extensions/ComboBoxExtensions.cs b/src/LogExpert/Extensions/ComboBoxExtensions.cs index 76781de1..b7488e55 100644 --- a/src/LogExpert/Extensions/ComboBoxExtensions.cs +++ b/src/LogExpert/Extensions/ComboBoxExtensions.cs @@ -4,7 +4,7 @@ namespace LogExpert.Extensions { public static class ComboBoxExtensions { - /// + /// public static int GetMaxTextWidth(this ComboBox comboBox) { var maxTextWidth = comboBox.Width; diff --git a/src/LogExpert/Extensions/Forms/LineToolStripSeparatorExtension.cs b/src/LogExpert/Extensions/Forms/LineToolStripSeparatorExtension.cs index ca9e0d6d..a5239c73 100644 --- a/src/LogExpert/Extensions/Forms/LineToolStripSeparatorExtension.cs +++ b/src/LogExpert/Extensions/Forms/LineToolStripSeparatorExtension.cs @@ -24,10 +24,12 @@ private void OnExtendedToolStripSeparatorPaint(object sender, PaintEventArgs e) Color backColor = Config.ColorMode.BackgroundColor; // Fill the background. - e.Graphics.FillRectangle(new SolidBrush(backColor), 0, 0, width, height); + using SolidBrush backbrush = new(backColor); + e.Graphics.FillRectangle(backbrush, 0, 0, width, height); // Draw the line. - e.Graphics.DrawLine(new Pen(foreColor), 4, height / 2, width - 4, height / 2); + using Pen pen = new(foreColor); + e.Graphics.DrawLine(pen, width / 2, 4, width / 2, height - 4); } - } + } } diff --git a/src/LogExpert/Interface/ILogExpertProxy.cs b/src/LogExpert/Interface/ILogExpertProxy.cs index 313e50be..db6ca8bb 100644 --- a/src/LogExpert/Interface/ILogExpertProxy.cs +++ b/src/LogExpert/Interface/ILogExpertProxy.cs @@ -1,4 +1,5 @@ using LogExpert.Controls.LogTabWindow; +using LogExpert.Grpc; namespace LogExpert.Interface { diff --git a/src/LogExpert/LogExpert.csproj b/src/LogExpert/LogExpert.csproj index e49097e8..51fa80f5 100644 --- a/src/LogExpert/LogExpert.csproj +++ b/src/LogExpert/LogExpert.csproj @@ -1,615 +1,101 @@ - + - Debug - AnyCPU - 2.0 - {F0C0D370-F416-44ED-939A-B4827D15AC14} + net8.0-windows + true WinExe - Properties - LogExpert - LogExpert - v4.8.1 Resources\logexpert.ico - - - - true - full - false - ..\..\bin\Debug\ - DEBUG;TRACE - prompt - 4 - - + false + true + true + $(SolutionDir)..\bin\Docs\LogExpert.xml true Auto - AnyCPU - false - - - pdbonly - true - ..\..\bin\Release\ - TRACE - prompt - 4 - true - false - - true - - ..\Solution Items\Key.snk + false + $(SolutionDir)..\bin\$(Configuration) + true + PerMonitorV2 + true + CS1591;CA1416; + + + False + + + True - - - - - - - - Properties\AssemblyVersion.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Form - - - Form - - - Form - - - Form - - - Form - - - Form - - - Form - - - AllowOnlyOneInstanceErrorDialog.cs - - + Component - - - - - - - Component - - - Component - - - - - - - - - - - - - - - - - - - - - Form - - - BookmarkCommentDlg.cs - - - Form - - - ChooseIconDlg.cs - - - Form - - - ExceptionWindow.cs - - - Form - - - ImportSettingsDialog.cs - - - Form - - - KeywordActionDlg.cs - - - Form - - - MultiFileMaskDialog.cs - - - Form - - - OpenUriDialog.cs - - - - Form - - - ProjectLoadDlg.cs - - - Form - - - TabRenameDlg.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Form - - - BookmarkWindow.cs - - + UserControl - - DateTimeDragControl.cs - - - Form - - - FilterColumnChooser.cs - - - + UserControl - - TimeSpreadigControl.cs - - - Form - - - MultiLoadRequestDialog.cs - - - Form - - - ParamRequesterDialog.cs - - - Form - - - SettingsDialog.cs - - - Form - - - ToolArgsDialog.cs - - - - + UserControl - - KnobControl.cs - - - + Component - + Component - - Form - - - LogTabWindow.cs - - - - Form - - - AboutBox.cs - - + Component - - BufferedDataGridView.cs - - + Component - - Form - - - FilterSelectorForm.cs - - - Form - - - GotoLineDialog.cs - - - Form - - - HighlightDialog.cs - - - Form - - - RegexHelperDialog.cs - - - Form - - - SearchDialog.cs - - - Form - - - SearchProgressDialog.cs - - - - - - - - - - Form - - - LogWindow.cs - - - - - Form - - - PatternWindow.cs - - - - - - - - - AllowOnlyOneInstanceErrorDialog.cs - - - DateTimeDragControl.cs - Designer - - - MultiLoadRequestDialog.cs - Designer - - - ParamRequesterDialog.cs - Designer - - - SettingsDialog.cs - Designer - - - ToolArgsDialog.cs - Designer - - - Designer - KnobControl.cs - - - LogTabWindow.cs - Designer - - - AboutBox.cs - Designer - - - FilterSelectorForm.cs - Designer - - - GotoLineDialog.cs - Designer - - - HighlightDialog.cs - Designer - - - RegexHelperDialog.cs - Designer - - - SearchDialog.cs - Designer - - - SearchProgressDialog.cs - Designer - - - LogWindow.cs - Designer - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - + + PublicResXFileCodeGenerator + True True Resources.resx - True Key.snk - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - - - - - - - - - - Code - - - - - - - - - + Always - - - - - - - - - - - - - - - - - - - - - - - - - - + Always Always - - - - - - BookmarkCommentDlg.cs - Designer - - - BookmarkWindow.cs - Designer - - - ChooseIconDlg.cs - Designer - - - ExceptionWindow.cs - Designer - - - FilterColumnChooser.cs - Designer - - - ImportSettingsDialog.cs - Designer - - - KeywordActionDlg.cs - Designer - - - MultiFileMaskDialog.cs - Designer - - - OpenUriDialog.cs - Designer - - - ProjectLoadDlg.cs - - - TabRenameDlg.cs - - - TimeSpreadigControl.cs - Designer - - - PatternWindow.cs - Designer - - - - - - - - - - - - - {e72c2bb1-34de-4d66-a830-9647c3837833} - ColumnizerLib - False - - - {c75532c4-765b-418e-b09b-46d36b2abdb1} - WinFormsUI - + + + + + + + - - - 13.0.3 - - - 5.2.8 - + + + - - - - - - - \ No newline at end of file + + + + + + + PublicResXFileCodeGenerator + Resources.Designer.cs + + + diff --git a/src/LogExpert/Program.cs b/src/LogExpert/Program.cs index 124f3001..5713627e 100644 --- a/src/LogExpert/Program.cs +++ b/src/LogExpert/Program.cs @@ -1,28 +1,31 @@ -using System; -using System.Collections.Generic; -using System.Windows.Forms; -using System.Threading; -using System.Runtime.Remoting.Channels.Ipc; -using System.Runtime.Remoting.Channels; -using System.Runtime.Remoting; -using System.IO; -using System.Diagnostics; -using System.Security; -using System.Reflection; +using Grpc.Core; +using Grpc.Net.Client; + using LogExpert.Classes; using LogExpert.Config; using LogExpert.Controls.LogTabWindow; using LogExpert.Dialogs; + +using LogexpertGRPCService.Services; + using NLog; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Reflection; +using System.Security; +using System.Security.Principal; +using System.Threading; +using System.Windows.Forms; + namespace LogExpert { internal static class Program { #region Fields - private static readonly ILogger _logger = LogManager.GetLogger("Program"); - #endregion #region Private Methods @@ -35,31 +38,37 @@ private static void Main(string[] orgArgs) { try { - Sub_Main(orgArgs); + var server = new Server() + { + Services = { Grpc.LogExpertService.BindService(new LogExpertServiceImpl()) }, + Ports = { new ServerPort("localhost", 5001, ServerCredentials.Insecure) } + }; + + Sub_Main(server, orgArgs); } catch (SecurityException se) { - MessageBox.Show( - "Insufficient system rights for LogExpert. Maybe you have started it from a network drive. Please start LogExpert from a local drive.\n(" + - se.Message + ")", "LogExpert Error"); + MessageBox.Show("Insufficient system rights for LogExpert. Maybe you have started it from a network drive. Please start LogExpert from a local drive.\n(" + se.Message + ")", "LogExpert Error"); } } - private static void Sub_Main(string[] orgArgs) + private static void Sub_Main(Server server, string[] orgArgs) { AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; Application.ThreadException += Application_ThreadException; + ApplicationConfiguration.Initialize(); + Application.EnableVisualStyles(); Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); _logger.Info("\r\n============================================================================\r\nLogExpert {0} started.\r\n============================================================================", Assembly.GetExecutingAssembly().GetName().Version.ToString(3)); - CmdLine cmdLine = new CmdLine(); - CmdLineString configFile = new CmdLineString("config", false, "A configuration (settings) file"); + CmdLine cmdLine = new(); + CmdLineString configFile = new("config", false, "A configuration (settings) file"); cmdLine.RegisterParameter(configFile); string[] remainingArgs = cmdLine.Parse(orgArgs); - List argsList = new List(); + List argsList = []; // This loop tries to convert relative file names into absolute file names (assuming that platform file names are given). // It tolerates errors, to give file system plugins (e.g. sftp) a change later. @@ -68,7 +77,7 @@ private static void Sub_Main(string[] orgArgs) { try { - FileInfo info = new FileInfo(fileArg); + FileInfo info = new(fileArg); argsList.Add(info.Exists ? info.FullName : fileArg); } catch (Exception) @@ -76,10 +85,10 @@ private static void Sub_Main(string[] orgArgs) argsList.Add(fileArg); } } - string[] args = argsList.ToArray(); + string[] args = [.. argsList]; if (configFile.Exists) { - FileInfo cfgFileInfo = new FileInfo(configFile.Value); + FileInfo cfgFileInfo = new(configFile.Value); if (cfgFileInfo.Exists) { @@ -96,54 +105,63 @@ private static void Sub_Main(string[] orgArgs) try { Settings settings = ConfigManager.Settings; - Mutex mutex = new Mutex(false, "Local\\LogExpertInstanceMutex" + pId, out var isCreated); + + Mutex mutex = new(false, "Local\\LogExpertInstanceMutex" + pId, out var isCreated); if (isCreated) { // first application instance Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - LogTabWindow logWin = new LogTabWindow(args.Length > 0 ? args : null, 1, false); + LogTabWindow logWin = new(args.Length > 0 ? args : null, 1, false); // first instance - //WindowsIdentity wi = WindowsIdentity.GetCurrent(); + WindowsIdentity wi = WindowsIdentity.GetCurrent(); - IpcServerChannel ipcChannel = new IpcServerChannel("LogExpert" + pId); - ChannelServices.RegisterChannel(ipcChannel, false); - RemotingConfiguration.RegisterWellKnownServiceType(typeof(LogExpertProxy), "LogExpertProxy", WellKnownObjectMode.Singleton); - LogExpertProxy proxy = new LogExpertProxy(logWin); - RemotingServices.Marshal(proxy, "LogExpertProxy"); + server.Start(); - LogExpertApplicationContext context = new LogExpertApplicationContext(proxy, logWin); + //IpcServerChannel ipcChannel = new IpcServerChannel("LogExpert" + pId); + //ChannelServices.RegisterChannel(ipcChannel, false); + //RemotingConfiguration.RegisterWellKnownServiceType(typeof(LogExpertProxy), "LogExpertProxy", WellKnownObjectMode.Singleton); + LogExpertProxy proxy = new(logWin); + //RemotingServices.Marshal(proxy, "LogExpertProxy"); + + LogExpertApplicationContext context = new(proxy, logWin); Application.Run(context); - ChannelServices.UnregisterChannel(ipcChannel); + //ChannelServices.UnregisterChannel(ipcChannel); + server.ShutdownAsync().Wait(); } else { int counter = 3; Exception errMsg = null; - IpcClientChannel ipcChannel = new IpcClientChannel("LogExpertClient#" + pId, null); - ChannelServices.RegisterChannel(ipcChannel, false); + //IpcClientChannel ipcChannel = new IpcClientChannel("LogExpertClient#" + pId, null); + //ChannelServices.RegisterChannel(ipcChannel, false); while (counter > 0) { try { + using var channel = GrpcChannel.ForAddress("https://localhost:5001"); + var client = new Grpc.LogExpertService.LogExpertServiceClient(channel); + + //Console.WriteLine("Greeting: " + reply.Result); // another instance already exists - //WindowsIdentity wi = WindowsIdentity.GetCurrent(); - LogExpertProxy proxy = (LogExpertProxy) Activator.GetObject(typeof(LogExpertProxy), "ipc://LogExpert" + pId + "/LogExpertProxy"); + WindowsIdentity wi = WindowsIdentity.GetCurrent(); + //LogExpertProxy proxy = (LogExpertProxy)Activator.GetObject(typeof(LogExpertProxy), "ipc://LogExpert" + pId + "/LogExpertProxy"); if (settings.preferences.allowOnlyOneInstance) { - proxy.LoadFiles(args); + client.LoadFiles(new Grpc.FileNames { FileNames_ = { args } }); } else { - proxy.NewWindowOrLockedWindow(args); + client.NewWindowOrLockedWindow(new Grpc.FileNames { FileNames_ = { args } }); } + break; } - catch (RemotingException e) + catch (Exception e) { _logger.Warn(e, "IpcClientChannel error: "); errMsg = e; @@ -160,7 +178,7 @@ private static void Sub_Main(string[] orgArgs) if (settings.preferences.allowOnlyOneInstance && settings.preferences.ShowErrorMessageAllowOnlyOneInstances) { - AllowOnlyOneInstanceErrorDialog a = new AllowOnlyOneInstanceErrorDialog(); + AllowOnlyOneInstanceErrorDialog a = new(); if (a.ShowDialog() == DialogResult.OK) { settings.preferences.ShowErrorMessageAllowOnlyOneInstances = !a.DoNotShowThisMessageAgain; @@ -200,8 +218,8 @@ private static void ShowUnhandledException(object exceptionObject) errorText = lines[0]; } } - ExceptionWindow win = new ExceptionWindow(errorText, stackTrace); - win.ShowDialog(); + ExceptionWindow win = new(errorText, stackTrace); + _ = win.ShowDialog(); } #endregion @@ -213,7 +231,7 @@ private static void Application_ThreadException(object sender, ThreadExceptionEv _logger.Fatal(e); //ShowUnhandledException(e.Exception); - Thread thread = new Thread(ShowUnhandledException); + Thread thread = new(ShowUnhandledException); thread.IsBackground = true; thread.SetApartmentState(ApartmentState.STA); thread.Start(e.Exception); @@ -226,7 +244,7 @@ private static void CurrentDomain_UnhandledException(object sender, UnhandledExc object exceptionObject = e.ExceptionObject; //ShowUnhandledException(exceptionObject); - Thread thread = new Thread(ShowUnhandledException); + Thread thread = new(ShowUnhandledException); thread.IsBackground = true; thread.SetApartmentState(ApartmentState.STA); thread.Start(exceptionObject); @@ -235,4 +253,4 @@ private static void CurrentDomain_UnhandledException(object sender, UnhandledExc #endregion } -} \ No newline at end of file +} diff --git a/src/LogExpert/Properties/AssemblyInfo.cs b/src/LogExpert/Properties/AssemblyInfo.cs index 7626be05..69e5aee9 100644 --- a/src/LogExpert/Properties/AssemblyInfo.cs +++ b/src/LogExpert/Properties/AssemblyInfo.cs @@ -1,14 +1 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("LogExpert")] -[assembly: AssemblyDescription("Log file viewing for the Pros")] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("02f6ebc2-5450-4750-85ec-61d4bd8d6baa")] - -[assembly: InternalsVisibleTo("LogExpert.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100619e9beea345a3bb5e15f55b29ddf40d96e9bb473ae58304fc63dfb3e9c94d8944bb7e45324ee0bef3e345dccba79b0bf64b85a128a7f261861899add639218ddaeb2acc6fcc746d6acb5bb212d375a0967756af192cfdb6cf0bff666a0fe535600abda860d3eafaff4ef1c9b5710181f72d996ca9c29ed64bae4a5fd916dea5")] \ No newline at end of file +[assembly: System.Runtime.Versioning.SupportedOSPlatform("windows")] \ No newline at end of file diff --git a/src/LogExpert/Properties/Resources.Designer.cs b/src/LogExpert/Properties/Resources.Designer.cs index 67fa91b0..b81d26da 100644 --- a/src/LogExpert/Properties/Resources.Designer.cs +++ b/src/LogExpert/Properties/Resources.Designer.cs @@ -63,9 +63,9 @@ internal Resources() { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap AdvancedIcon { + internal static System.Drawing.Bitmap Add { get { - object obj = ResourceManager.GetObject("AdvancedIcon", resourceCulture); + object obj = ResourceManager.GetObject("Add", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -73,9 +73,19 @@ internal static System.Drawing.Bitmap AdvancedIcon { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap AdvancedIcon2 { + internal static System.Drawing.Bitmap Arrow_menu_close { get { - object obj = ResourceManager.GetObject("AdvancedIcon2", resourceCulture); + object obj = ResourceManager.GetObject("Arrow_menu_close", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Arrow_menu_open { + get { + object obj = ResourceManager.GetObject("Arrow_menu_open", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -90,6 +100,26 @@ internal static System.Drawing.Bitmap ArrowDown { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap ArrowLeft { + get { + object obj = ResourceManager.GetObject("ArrowLeft", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap ArrowRight { + get { + object obj = ResourceManager.GetObject("ArrowRight", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -101,21 +131,121 @@ internal static System.Drawing.Bitmap ArrowUp { } /// - /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Icon bubble { + internal static System.Drawing.Bitmap Bookmark_add { get { - object obj = ResourceManager.GetObject("bubble", resourceCulture); - return ((System.Drawing.Icon)(obj)); + object obj = ResourceManager.GetObject("Bookmark_add", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Bookmark_added { + get { + object obj = ResourceManager.GetObject("Bookmark_added", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap bookmark_bubbles { + get { + object obj = ResourceManager.GetObject("bookmark_bubbles", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Bookmark_manager { + get { + object obj = ResourceManager.GetObject("Bookmark_manager", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Bookmark_remove { + get { + object obj = ResourceManager.GetObject("Bookmark_remove", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Bookmarks { + get { + object obj = ResourceManager.GetObject("Bookmarks", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Check_circle { + get { + object obj = ResourceManager.GetObject("Check_circle", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Close { + get { + object obj = ResourceManager.GetObject("Close", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Deceased { + get { + object obj = ResourceManager.GetObject("Deceased", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Delete { + get { + object obj = ResourceManager.GetObject("Delete", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Exit { + get { + object obj = ResourceManager.GetObject("Exit", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap check_blue { + internal static System.Drawing.Bitmap Favorite { get { - object obj = ResourceManager.GetObject("check-blue", resourceCulture); + object obj = ResourceManager.GetObject("Favorite", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -123,9 +253,9 @@ internal static System.Drawing.Bitmap check_blue { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap delete_page_red { + internal static System.Drawing.Bitmap File_open { get { - object obj = ResourceManager.GetObject("delete_page_red", resourceCulture); + object obj = ResourceManager.GetObject("File_open", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -133,9 +263,9 @@ internal static System.Drawing.Bitmap delete_page_red { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap down_blue { + internal static System.Drawing.Bitmap Filter { get { - object obj = ResourceManager.GetObject("down_blue", resourceCulture); + object obj = ResourceManager.GetObject("Filter", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -143,9 +273,9 @@ internal static System.Drawing.Bitmap down_blue { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap folder_blue { + internal static System.Drawing.Bitmap Folder_open { get { - object obj = ResourceManager.GetObject("folder_blue", resourceCulture); + object obj = ResourceManager.GetObject("Folder_open", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -230,26 +360,6 @@ internal static System.Drawing.Bitmap LogLover { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap PanelClose { - get { - object obj = ResourceManager.GetObject("PanelClose", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap PanelOpen { - get { - object obj = ResourceManager.GetObject("PanelOpen", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -263,9 +373,9 @@ internal static System.Drawing.Bitmap Pro_Filter { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap search_blue { + internal static System.Drawing.Bitmap Restart_alt { get { - object obj = ResourceManager.GetObject("search_blue", resourceCulture); + object obj = ResourceManager.GetObject("Restart_alt", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -273,9 +383,9 @@ internal static System.Drawing.Bitmap search_blue { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap search_folder_blue { + internal static System.Drawing.Bitmap Search { get { - object obj = ResourceManager.GetObject("search_folder_blue", resourceCulture); + object obj = ResourceManager.GetObject("Search", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -283,9 +393,9 @@ internal static System.Drawing.Bitmap search_folder_blue { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap search_icon_blue { + internal static System.Drawing.Bitmap Settings { get { - object obj = ResourceManager.GetObject("search_icon_blue", resourceCulture); + object obj = ResourceManager.GetObject("Settings", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -293,9 +403,9 @@ internal static System.Drawing.Bitmap search_icon_blue { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap up_blue { + internal static System.Drawing.Bitmap Star { get { - object obj = ResourceManager.GetObject("up_blue", resourceCulture); + object obj = ResourceManager.GetObject("Star", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } diff --git a/src/LogExpert/Properties/Resources.resx b/src/LogExpert/Properties/Resources.resx index a811dde7..58db6575 100644 --- a/src/LogExpert/Properties/Resources.resx +++ b/src/LogExpert/Properties/Resources.resx @@ -1,17 +1,17 @@  - @@ -118,60 +118,18 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ..\Resources\search-icon-blue.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\LogExpert-Logo.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\search-blue.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\PanelOpen.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\ArrowUp.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\check-blue.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\Pro_Filter.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\LogExpert.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\AdvancedIcon.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\folder-blue.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\search-folder-blue.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\LogLover.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\up-blue.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\down-blue.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\AdvancedIcon2.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\ArrowDown.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\resources\bubble.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\resources\delete-page-red.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\resources\icon1.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -187,7 +145,108 @@ ..\resources\log_icon_small.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\resources\panelclose.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\resources\PNG\48\bookmark_bubbles.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Bookmark_Bubbles + + + ..\resources\PNG\48\Add.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Add + + + ..\resources\PNG\48\ArrowDown.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ArrowDown + + + ..\resources\PNG\48\ArrowLeft.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ArrowLeft + + + ..\resources\PNG\48\ArrowRight.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ArrowRight + + + ..\resources\PNG\48\ArrowUp.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ArrowUp + + + ..\resources\PNG\48\Bookmark_add.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Bookmark_add + + + ..\resources\PNG\48\Bookmark_added.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Bookmark_added + + + ..\resources\PNG\48\Bookmark_manager.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Bookmark_manager + + + ..\resources\PNG\48\Bookmark_remove.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Bookmark_remove + + + ..\resources\PNG\48\Bookmarks.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Bookmarks + + + ..\resources\PNG\48\Delete.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Delete + + + ..\resources\PNG\48\Exit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Exit + + + ..\resources\PNG\48\Favorite.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Favorite + + + ..\resources\PNG\48\File_open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + File_open + + + ..\resources\PNG\48\Filter.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Filter + + + ..\resources\PNG\48\Folder_open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Folder_open + + + ..\resources\PNG\48\Restart_alt.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Restart_alt + + + ..\resources\PNG\48\Search.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Search + + + ..\resources\PNG\48\Settings.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Settings + + + ..\resources\PNG\48\Star.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Star + + + ..\resources\PNG\48\Arrow_menu_close.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Arrow_menu_close + + + ..\resources\PNG\48\Arrow_menu_open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Arrow_menu_open + + + ..\resources\PNG\48\Close.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Close + + + ..\resources\PNG\48\Deceased.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Deceased + + + ..\resources\PNG\48\Check_circle.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Check_circle \ No newline at end of file diff --git a/src/LogExpert/Resources/ArrowDown.gif b/src/LogExpert/Resources/ArrowDown.gif deleted file mode 100644 index 0588d140..00000000 Binary files a/src/LogExpert/Resources/ArrowDown.gif and /dev/null differ diff --git a/src/LogExpert/Resources/ArrowUp.gif b/src/LogExpert/Resources/ArrowUp.gif deleted file mode 100644 index 53b8d9a8..00000000 Binary files a/src/LogExpert/Resources/ArrowUp.gif and /dev/null differ diff --git a/src/LogExpert/Resources/Log-Icon_big.png b/src/LogExpert/Resources/Log-Icon_big.png deleted file mode 100644 index a16bb6c4..00000000 Binary files a/src/LogExpert/Resources/Log-Icon_big.png and /dev/null differ diff --git a/src/LogExpert/Resources/PNG/48/Add.png b/src/LogExpert/Resources/PNG/48/Add.png new file mode 100644 index 00000000..5f96dc4d Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/Add.png differ diff --git a/src/LogExpert/Resources/PNG/48/ArrowDown.png b/src/LogExpert/Resources/PNG/48/ArrowDown.png new file mode 100644 index 00000000..0553d2e2 Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/ArrowDown.png differ diff --git a/src/LogExpert/Resources/PNG/48/ArrowLeft.png b/src/LogExpert/Resources/PNG/48/ArrowLeft.png new file mode 100644 index 00000000..ababe7c6 Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/ArrowLeft.png differ diff --git a/src/LogExpert/Resources/PNG/48/ArrowRight.png b/src/LogExpert/Resources/PNG/48/ArrowRight.png new file mode 100644 index 00000000..5a42460e Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/ArrowRight.png differ diff --git a/src/LogExpert/Resources/PNG/48/ArrowUp.png b/src/LogExpert/Resources/PNG/48/ArrowUp.png new file mode 100644 index 00000000..491bf1a8 Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/ArrowUp.png differ diff --git a/src/LogExpert/Resources/PNG/48/Arrow_menu_close.png b/src/LogExpert/Resources/PNG/48/Arrow_menu_close.png new file mode 100644 index 00000000..3dfbfc73 Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/Arrow_menu_close.png differ diff --git a/src/LogExpert/Resources/PNG/48/Arrow_menu_open.png b/src/LogExpert/Resources/PNG/48/Arrow_menu_open.png new file mode 100644 index 00000000..ba0f5c9e Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/Arrow_menu_open.png differ diff --git a/src/LogExpert/Resources/PNG/48/Bookmark_add.png b/src/LogExpert/Resources/PNG/48/Bookmark_add.png new file mode 100644 index 00000000..00383d80 Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/Bookmark_add.png differ diff --git a/src/LogExpert/Resources/PNG/48/Bookmark_added.png b/src/LogExpert/Resources/PNG/48/Bookmark_added.png new file mode 100644 index 00000000..90fbffee Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/Bookmark_added.png differ diff --git a/src/LogExpert/Resources/PNG/48/Bookmark_manager.png b/src/LogExpert/Resources/PNG/48/Bookmark_manager.png new file mode 100644 index 00000000..1b44cd34 Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/Bookmark_manager.png differ diff --git a/src/LogExpert/Resources/PNG/48/Bookmark_remove.png b/src/LogExpert/Resources/PNG/48/Bookmark_remove.png new file mode 100644 index 00000000..86609449 Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/Bookmark_remove.png differ diff --git a/src/LogExpert/Resources/PNG/48/Bookmarks.png b/src/LogExpert/Resources/PNG/48/Bookmarks.png new file mode 100644 index 00000000..f5f65d36 Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/Bookmarks.png differ diff --git a/src/LogExpert/Resources/PNG/48/Check_circle.png b/src/LogExpert/Resources/PNG/48/Check_circle.png new file mode 100644 index 00000000..b831a4be Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/Check_circle.png differ diff --git a/src/LogExpert/Resources/PNG/48/Close.png b/src/LogExpert/Resources/PNG/48/Close.png new file mode 100644 index 00000000..91246b94 Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/Close.png differ diff --git a/src/LogExpert/Resources/PNG/48/Deceased.png b/src/LogExpert/Resources/PNG/48/Deceased.png new file mode 100644 index 00000000..ef17ab64 Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/Deceased.png differ diff --git a/src/LogExpert/Resources/PNG/48/Delete.png b/src/LogExpert/Resources/PNG/48/Delete.png new file mode 100644 index 00000000..78794d0f Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/Delete.png differ diff --git a/src/LogExpert/Resources/PNG/48/Exit.png b/src/LogExpert/Resources/PNG/48/Exit.png new file mode 100644 index 00000000..b1440bf7 Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/Exit.png differ diff --git a/src/LogExpert/Resources/PNG/48/Favorite.png b/src/LogExpert/Resources/PNG/48/Favorite.png new file mode 100644 index 00000000..6aa9f3b4 Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/Favorite.png differ diff --git a/src/LogExpert/Resources/PNG/48/File_open.png b/src/LogExpert/Resources/PNG/48/File_open.png new file mode 100644 index 00000000..66e0d336 Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/File_open.png differ diff --git a/src/LogExpert/Resources/PNG/48/Filter.png b/src/LogExpert/Resources/PNG/48/Filter.png new file mode 100644 index 00000000..caa7db83 Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/Filter.png differ diff --git a/src/LogExpert/Resources/PNG/48/Folder_open.png b/src/LogExpert/Resources/PNG/48/Folder_open.png new file mode 100644 index 00000000..5a0e780b Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/Folder_open.png differ diff --git a/src/LogExpert/Resources/PNG/48/Restart_alt.png b/src/LogExpert/Resources/PNG/48/Restart_alt.png new file mode 100644 index 00000000..b62534e8 Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/Restart_alt.png differ diff --git a/src/LogExpert/Resources/PNG/48/Search.png b/src/LogExpert/Resources/PNG/48/Search.png new file mode 100644 index 00000000..9b5f26be Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/Search.png differ diff --git a/src/LogExpert/Resources/PNG/48/Settings.png b/src/LogExpert/Resources/PNG/48/Settings.png new file mode 100644 index 00000000..72d2f09e Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/Settings.png differ diff --git a/src/LogExpert/Resources/PNG/48/Star.png b/src/LogExpert/Resources/PNG/48/Star.png new file mode 100644 index 00000000..07d1ccc7 Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/Star.png differ diff --git a/src/LogExpert/Resources/PNG/48/bookmark_bubbles.png b/src/LogExpert/Resources/PNG/48/bookmark_bubbles.png new file mode 100644 index 00000000..fbe5335a Binary files /dev/null and b/src/LogExpert/Resources/PNG/48/bookmark_bubbles.png differ diff --git a/src/LogExpert/Resources/PanelOpen1.gif b/src/LogExpert/Resources/PanelOpen1.gif deleted file mode 100644 index a826a94c..00000000 Binary files a/src/LogExpert/Resources/PanelOpen1.gif and /dev/null differ diff --git a/src/LogExpert/Resources/SearchIcon.gif b/src/LogExpert/Resources/SearchIcon.gif deleted file mode 100644 index d07c6565..00000000 Binary files a/src/LogExpert/Resources/SearchIcon.gif and /dev/null differ diff --git a/src/LogExpert/Resources/check-blue.ico b/src/LogExpert/Resources/check-blue.ico deleted file mode 100644 index 7a8716de..00000000 Binary files a/src/LogExpert/Resources/check-blue.ico and /dev/null differ diff --git a/src/LogExpert/Resources/logexpert_16x16-Icon_dunkler.bmp b/src/LogExpert/Resources/logexpert_16x16-Icon_dunkler.bmp deleted file mode 100644 index a3f5341a..00000000 Binary files a/src/LogExpert/Resources/logexpert_16x16-Icon_dunkler.bmp and /dev/null differ diff --git a/src/LogExpert/Resources/search-icon-blue.gif b/src/LogExpert/Resources/search-icon-blue.gif deleted file mode 100644 index 3776aa74..00000000 Binary files a/src/LogExpert/Resources/search-icon-blue.gif and /dev/null differ diff --git a/src/LogExpert/Resources/search.ico b/src/LogExpert/Resources/search.ico deleted file mode 100644 index ec5e80cb..00000000 Binary files a/src/LogExpert/Resources/search.ico and /dev/null differ diff --git a/src/LogExpert/app.config b/src/LogExpert/app.config index 8b3fc7ce..8713f896 100644 --- a/src/LogExpert/app.config +++ b/src/LogExpert/app.config @@ -1,10 +1,13 @@ + + +
+ - -
- - + + + diff --git a/src/LogExpert/gRPC/LogExpert.proto b/src/LogExpert/gRPC/LogExpert.proto new file mode 100644 index 00000000..3a082a08 --- /dev/null +++ b/src/LogExpert/gRPC/LogExpert.proto @@ -0,0 +1,45 @@ +syntax = "proto3"; + +option csharp_namespace = "LogExpert.Grpc"; + +package logexpert; + +// The log service definition. +service LogExpertService { + // Sends a log message + rpc SendLog (LogRequest) returns (LogReply) {} + rpc LoadFiles (FileNames); + rpc NewWindow (FileNames); + rpc NewWindowOrLockedWindow (FileNames); + rpc WindowClosed(); + rpc GetLogWindowCount() returns (Count); +} + +message FileNames +{ + repeated string FileNames = 4; +} + +message Count +{ + int32 count = 0; +} + +message FilesReply +{ + bool success = false; +} + +// The request message containing the log message. +message LogRequest +{ + string message = 1; +} + +message LoadFiles(repeated ) + +// The response message containing the response. +message LogReply +{ + string result = 1; +} \ No newline at end of file diff --git a/src/LogexpertgRPCService/LogexpertgRPCService.csproj b/src/LogexpertgRPCService/LogexpertgRPCService.csproj new file mode 100644 index 00000000..80389635 --- /dev/null +++ b/src/LogexpertgRPCService/LogexpertgRPCService.csproj @@ -0,0 +1,17 @@ + + + net8.0 + enable + enable + + + true + ..\Solution Items\Key.snk + + + + + + + + \ No newline at end of file diff --git a/src/LogexpertgRPCService/Program.cs b/src/LogexpertgRPCService/Program.cs new file mode 100644 index 00000000..7ecdb775 --- /dev/null +++ b/src/LogexpertgRPCService/Program.cs @@ -0,0 +1,14 @@ +using LogexpertGRPCService.Services; + +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. +builder.Services.AddGrpc(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +app.MapGrpcService(); +app.MapGet("/", () => "Communication with gRPC endpoints must be made through a gRPC client. To learn how to create a client, visit: https://go.microsoft.com/fwlink/?linkid=2086909"); + +app.Run(); diff --git a/src/LogexpertgRPCService/Properties/launchSettings.json b/src/LogexpertgRPCService/Properties/launchSettings.json new file mode 100644 index 00000000..25ca2150 --- /dev/null +++ b/src/LogexpertgRPCService/Properties/launchSettings.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": false, + "applicationUrl": "http://localhost:5282", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": false, + "applicationUrl": "https://localhost:7125;http://localhost:5282", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/src/LogexpertgRPCService/Protos/Logexpert.proto b/src/LogexpertgRPCService/Protos/Logexpert.proto new file mode 100644 index 00000000..838357a7 --- /dev/null +++ b/src/LogexpertgRPCService/Protos/Logexpert.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; + +option csharp_namespace = "LogExpert.Grpc"; + +import "google/protobuf/empty.proto"; + +package logexpert; + +// The log service definition. +service LogExpertService +{ + // Sends a log message + rpc SendLog (LogRequest) returns (LogReply) ; + rpc LoadFiles (FileNames) returns (FilesReply); + rpc NewWindow (FileNames) returns (FilesReply); + rpc NewWindowOrLockedWindow (FileNames) returns (FilesReply); + //is this really needed? + rpc WindowClosed(google.protobuf.Empty) returns (google.protobuf.Empty); + rpc GetLogWindowCount(google.protobuf.Empty) returns (Count); +} + +message FileNames +{ + repeated string fileNames = 1; +} + +message Count +{ + int32 count = 1; +} + +message FilesReply +{ + bool success = 1; +} + +// The request message containing the log message. +message LogRequest +{ + string message = 1; +} + +// The response message containing the response. +message LogReply +{ + string result = 1; +} \ No newline at end of file diff --git a/src/LogexpertgRPCService/Services/LogExpertServiceImpl.cs b/src/LogexpertgRPCService/Services/LogExpertServiceImpl.cs new file mode 100644 index 00000000..86a237d4 --- /dev/null +++ b/src/LogexpertgRPCService/Services/LogExpertServiceImpl.cs @@ -0,0 +1,34 @@ +using Grpc.Core; + +using LogExpert.Grpc; + +namespace LogexpertGRPCService.Services +{ + public class LogExpertServiceImpl : LogExpertService.LogExpertServiceBase + { + public override Task SendLog(LogRequest request, ServerCallContext context) + { + return Task.FromResult(new LogReply { Result = "Hello " + request.Message }); + } + + public override Task LoadFiles(FileNames fileNames, ServerCallContext context) + { + return Task.FromResult(new FilesReply { Success = true }); + } + + public override Task NewWindow(FileNames fileNames, ServerCallContext context) + { + return Task.FromResult(new FilesReply { Success = true }); + } + + public override Task NewWindowOrLockedWindow(FileNames fileNames, ServerCallContext context) + { + return Task.FromResult(new FilesReply { Success = true }); + } + + //public override void WindowClosed() + //{ + + //} + } +} diff --git a/src/LogexpertgRPCService/appsettings.Development.json b/src/LogexpertgRPCService/appsettings.Development.json new file mode 100644 index 00000000..0c208ae9 --- /dev/null +++ b/src/LogexpertgRPCService/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/src/LogexpertgRPCService/appsettings.json b/src/LogexpertgRPCService/appsettings.json new file mode 100644 index 00000000..1aef5074 --- /dev/null +++ b/src/LogexpertgRPCService/appsettings.json @@ -0,0 +1,14 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*", + "Kestrel": { + "EndpointDefaults": { + "Protocols": "Http2" + } + } +} diff --git a/src/RegexColumnizer.UnitTests/Properties/AssemblyInfo.cs b/src/RegexColumnizer.UnitTests/Properties/AssemblyInfo.cs index c42f87d7..323361a8 100644 --- a/src/RegexColumnizer.UnitTests/Properties/AssemblyInfo.cs +++ b/src/RegexColumnizer.UnitTests/Properties/AssemblyInfo.cs @@ -1,15 +1,5 @@ using System.Reflection; using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("RegexColumnizer.UnitTests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("RegexColumnizer.UnitTests")] -[assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -20,16 +10,3 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("FBFB598D-B94A-4AD3-A355-0D5A618CEEE3")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/src/RegexColumnizer.UnitTests/RegexColumnizer.UnitTests.csproj b/src/RegexColumnizer.UnitTests/RegexColumnizer.UnitTests.csproj index 15be083b..75cf507e 100644 --- a/src/RegexColumnizer.UnitTests/RegexColumnizer.UnitTests.csproj +++ b/src/RegexColumnizer.UnitTests/RegexColumnizer.UnitTests.csproj @@ -1,75 +1,31 @@ - - - - - - Debug - AnyCPU - {FBFB598D-B94A-4AD3-A355-0D5A618CEEE3} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Library - Properties - RegexColumnizer.UnitTests - RegexColumnizer.UnitTests - v4.8.1 - 512 - - - - true - - - ..\Solution Items\Key.snk - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - {e72c2bb1-34de-4d66-a830-9647c3837833} - ColumnizerLib - - - {b5a7dfa4-48a8-4616-8008-7441699ec946} - RegexColumnizer - - - - - 4.20.70 - - - 4.1.0 - - - 4.5.0 - - - - \ No newline at end of file + + + net8.0-windows + Library + true + false + false + bin\$(Configuration) + + + true + + + ..\Solution Items\Key.snk + RegexColumnizer.UnitTests + RegexColumnizer.UnitTests + Copyright © 2023 + 1.0.0.0 + 1.0.0.0 + + + + + + + + + + + + diff --git a/src/RegexColumnizer.UnitTests/RegexColumnizerTests.cs b/src/RegexColumnizer.UnitTests/RegexColumnizerTests.cs index 6ab29448..0ac4c534 100644 --- a/src/RegexColumnizer.UnitTests/RegexColumnizerTests.cs +++ b/src/RegexColumnizer.UnitTests/RegexColumnizerTests.cs @@ -17,8 +17,8 @@ public void SplitLine_ColumnCountMatches(string lineToParse, string regex, int e TestLogLine testLogLine = new TestLogLine(4, lineToParse); IColumnizedLogLine parsedLogLine = columnizer.SplitLine(Mock.Of(), testLogLine); - - Assert.That(parsedLogLine.ColumnValues.Length, Is.EqualTo(expectedNumberOfColumns)); + + Assert.That(expectedNumberOfColumns, Is.EqualTo(parsedLogLine.ColumnValues.Length)); } //Using "" for empty string since string.Empty can't be passed to the TestCase attribute. @@ -33,8 +33,8 @@ public void SplitLine_ColumnValues(string lineToParse, string regex, int columnI TestLogLine testLogLine = new TestLogLine(3, lineToParse); IColumnizedLogLine parsedLogLine = columnizer.SplitLine(Mock.Of(), testLogLine); - - Assert.That(parsedLogLine.ColumnValues[columnIndexToTest].Text, Is.EqualTo(expectedColumnValue)); + + Assert.That(expectedColumnValue, Is.EqualTo(parsedLogLine.ColumnValues[columnIndexToTest].Text)); } private Regex1Columnizer CreateInitializedColumnizer(string regex) @@ -44,7 +44,9 @@ private Regex1Columnizer CreateInitializedColumnizer(string regex) Expression = regex, Name = "Test regex" }; + Regex1Columnizer columnizer = new Regex1Columnizer(); + //TODO this should be an internal function columnizer.Init(columnizerConfig); return columnizer; } @@ -64,4 +66,4 @@ public TestLogLine(int lineNumber, string fullLine) } -} \ No newline at end of file +} diff --git a/src/RegexColumnizer/Properties/AssemblyInfo.cs b/src/RegexColumnizer/Properties/AssemblyInfo.cs deleted file mode 100644 index 87922f5e..00000000 --- a/src/RegexColumnizer/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("RegexColumnizer")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -//Allow the unit tests to use internal methods to make tests easier to read/write and understand -[assembly:InternalsVisibleTo("RegexColumnizer.UnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100619e9beea345a3bb5e15f55b29ddf40d96e9bb473ae58304fc63dfb3e9c94d8944bb7e45324ee0bef3e345dccba79b0bf64b85a128a7f261861899add639218ddaeb2acc6fcc746d6acb5bb212d375a0967756af192cfdb6cf0bff666a0fe535600abda860d3eafaff4ef1c9b5710181f72d996ca9c29ed64bae4a5fd916dea5")] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("b5a7dfa4-48a8-4616-8008-7441699ec946")] \ No newline at end of file diff --git a/src/RegexColumnizer/RegexColumnizer.cs b/src/RegexColumnizer/RegexColumnizer.cs index 723b21dc..6cdaf3f0 100644 --- a/src/RegexColumnizer/RegexColumnizer.cs +++ b/src/RegexColumnizer/RegexColumnizer.cs @@ -1,6 +1,5 @@ using LogExpert; using System; -using System.Collections.Generic; using System.IO; using System.Linq; using System.Text.RegularExpressions; @@ -181,7 +180,7 @@ public override string ToString() protected abstract string GetNameInternal(); - internal void Init(RegexColumnizerConfig config) + public void Init(RegexColumnizerConfig config) { Config = config; diff --git a/src/RegexColumnizer/RegexColumnizer.csproj b/src/RegexColumnizer/RegexColumnizer.csproj index 9709b071..318d2269 100644 --- a/src/RegexColumnizer/RegexColumnizer.csproj +++ b/src/RegexColumnizer/RegexColumnizer.csproj @@ -1,36 +1,20 @@ - - - + - Debug - AnyCPU - {B5A7DFA4-48A8-4616-8008-7441699EC946} + net8.0-windows + true Library - Properties - RegexColumnizer - RegexColumnizer - v4.8.1 - 512 - + false + true + true + false + $(SolutionDir)..\bin\$(Configuration)\plugins + CA1416; - - true - full - false - ..\..\bin\Debug\plugins\ - DEBUG;TRACE - prompt - 4 - false + + False - - pdbonly - true - ..\..\bin\Release\plugins\ - TRACE - prompt - 4 - false + + True true @@ -38,47 +22,21 @@ ..\Solution Items\Key.snk - - - - - - - - - - - - Properties\AssemblyVersion.cs - - - - - Form - - - RegexColumnizerConfigDialog.cs - - - {E72C2BB1-34DE-4D66-A830-9647C3837833} - ColumnizerLib - - - - - RegexColumnizerConfigDialog.cs - + Key.snk - - \ No newline at end of file + + + + + diff --git a/src/RegexColumnizer/RegexColumnizerConfigDialog.Designer.cs b/src/RegexColumnizer/RegexColumnizerConfigDialog.Designer.cs index 8ec3613c..9e02a094 100644 --- a/src/RegexColumnizer/RegexColumnizerConfigDialog.Designer.cs +++ b/src/RegexColumnizer/RegexColumnizerConfigDialog.Designer.cs @@ -1,33 +1,33 @@ -namespace RegexColumnizer -{ - partial class RegexColumnizerConfigDialog - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { +namespace RegexColumnizer +{ + partial class RegexColumnizerConfigDialog + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { this.btnCancel = new System.Windows.Forms.Button(); this.btnOk = new System.Windows.Forms.Button(); this.lblRegEx = new System.Windows.Forms.Label(); @@ -163,8 +163,6 @@ private void InitializeComponent() // // RegexColumnizerConfigDialog // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(938, 293); this.Controls.Add(this.tbName); this.Controls.Add(this.label2); @@ -182,20 +180,20 @@ private void InitializeComponent() this.ResumeLayout(false); this.PerformLayout(); - } - - #endregion - - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.Button btnOk; - private System.Windows.Forms.Label lblRegEx; - private System.Windows.Forms.TextBox tbExpression; - private System.Windows.Forms.Button tbCheck; - private System.Windows.Forms.TextBox tbTestLine; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.GroupBox gbTestZone; + } + + #endregion + + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Button btnOk; + private System.Windows.Forms.Label lblRegEx; + private System.Windows.Forms.TextBox tbExpression; + private System.Windows.Forms.Button tbCheck; + private System.Windows.Forms.TextBox tbTestLine; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.GroupBox gbTestZone; private System.Windows.Forms.DataGridView dataGridView1; private System.Windows.Forms.TextBox tbName; private System.Windows.Forms.Label label2; - } + } } \ No newline at end of file diff --git a/src/SftpFileSystemx64/ConfigDialog.Designer.cs b/src/SftpFileSystemx64/ConfigDialog.Designer.cs index 344c0391..ccdba1a2 100644 --- a/src/SftpFileSystemx64/ConfigDialog.Designer.cs +++ b/src/SftpFileSystemx64/ConfigDialog.Designer.cs @@ -113,8 +113,6 @@ private void InitializeComponent() // // ConfigDialog // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(362, 171); this.ControlBox = false; this.Controls.Add(this.label1); diff --git a/src/SftpFileSystemx64/FailedKeyDialog.Designer.cs b/src/SftpFileSystemx64/FailedKeyDialog.Designer.cs index 858ebe0d..142e3a8a 100644 --- a/src/SftpFileSystemx64/FailedKeyDialog.Designer.cs +++ b/src/SftpFileSystemx64/FailedKeyDialog.Designer.cs @@ -77,8 +77,6 @@ private void InitializeComponent() // FailedKeyDialog // this.AcceptButton = this.btnRetry; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(338, 115); this.ControlBox = false; this.Controls.Add(this.btnRetry); diff --git a/src/SftpFileSystemx64/LoginDialog.Designer.cs b/src/SftpFileSystemx64/LoginDialog.Designer.cs index 517221ef..7e1cb395 100644 --- a/src/SftpFileSystemx64/LoginDialog.Designer.cs +++ b/src/SftpFileSystemx64/LoginDialog.Designer.cs @@ -116,8 +116,6 @@ private void InitializeComponent() // LoginDialog // this.AcceptButton = this.btnOk; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.btnCancel; this.ClientSize = new System.Drawing.Size(260, 128); this.Controls.Add(this.btnCancel); diff --git a/src/SftpFileSystemx64/PrivateKeyPasswordDialog.Designer.cs b/src/SftpFileSystemx64/PrivateKeyPasswordDialog.Designer.cs index a39e6b5f..25af75cb 100644 --- a/src/SftpFileSystemx64/PrivateKeyPasswordDialog.Designer.cs +++ b/src/SftpFileSystemx64/PrivateKeyPasswordDialog.Designer.cs @@ -85,8 +85,6 @@ private void InitializeComponent() // PrivateKeyPasswordDialog // this.AcceptButton = this.btnOk; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.btnCancel; this.ClientSize = new System.Drawing.Size(333, 135); this.Controls.Add(this.label1); diff --git a/src/SftpFileSystemx64/Properties/AssemblyInfo.cs b/src/SftpFileSystemx64/Properties/AssemblyInfo.cs index ed704bd6..458b8d80 100644 --- a/src/SftpFileSystemx64/Properties/AssemblyInfo.cs +++ b/src/SftpFileSystemx64/Properties/AssemblyInfo.cs @@ -1,8 +1,5 @@ using System.Reflection; using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("SftpFileSystem")] -[assembly: AssemblyDescription("")] [assembly: AssemblyCulture("")] // The following GUID is for the ID of the typelib if this project is exposed to COM diff --git a/src/SftpFileSystemx64/SftpFileSystem.cs b/src/SftpFileSystemx64/SftpFileSystem.cs index f568a1d2..459b3e02 100644 --- a/src/SftpFileSystemx64/SftpFileSystem.cs +++ b/src/SftpFileSystemx64/SftpFileSystem.cs @@ -39,7 +39,7 @@ public bool CanHandleUri(string uriString) { try { - Uri uri = new Uri(uriString); + Uri uri = new(uriString); return uri.Scheme.Equals("sftp", StringComparison.InvariantCultureIgnoreCase); } catch (Exception e) @@ -53,7 +53,7 @@ public ILogFileInfo GetLogfileInfo(string uriString) { try { - Uri uri = new Uri(uriString.Replace('\\', '/')); + Uri uri = new(uriString.Replace('\\', '/')); return new SftpLogFileInfo(this, uri, _logger); } catch (Exception e) @@ -81,9 +81,9 @@ public void HideConfigForm() public void LoadConfig(string configDir) { - XmlSerializer xml = new XmlSerializer(ConfigData.GetType()); + XmlSerializer xml = new(ConfigData.GetType()); - FileInfo configFile = new FileInfo(configDir + "\\" + "sftpfilesystem.cfg"); + FileInfo configFile = new(configDir + "\\" + "sftpfilesystem.cfg"); if (!configFile.Exists) { @@ -113,7 +113,7 @@ public void LoadConfig(string configDir) public void SaveConfig(string configDir) { _logger.Info("Saving SFTP config"); - XmlSerializer xml = new XmlSerializer(ConfigData.GetType()); + XmlSerializer xml = new(ConfigData.GetType()); FileStream fs = null; @@ -209,7 +209,7 @@ internal Credentials GetCredentials(Uri uri, bool cacheAllowed, bool hidePasswor if (userName == null || password == null) { - LoginDialog dlg = new LoginDialog(uri.Host, usersForHost, hidePasswordField); + LoginDialog dlg = new(uri.Host, usersForHost, hidePasswordField); dlg.Username = userName; if (DialogResult.OK == dlg.ShowDialog()) { @@ -220,7 +220,7 @@ internal Credentials GetCredentials(Uri uri, bool cacheAllowed, bool hidePasswor dlg.Dispose(); } - Credentials credentials = new Credentials(uri.Host, userName, password); + Credentials credentials = new(uri.Host, userName, password); CredentialsCache.Add(credentials); return credentials; } diff --git a/src/SftpFileSystemx64/SftpFileSystemx64.csproj b/src/SftpFileSystemx64/SftpFileSystemx64.csproj index cc3f556b..3cd2c2f6 100644 --- a/src/SftpFileSystemx64/SftpFileSystemx64.csproj +++ b/src/SftpFileSystemx64/SftpFileSystemx64.csproj @@ -1,129 +1,53 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B9BF5AB6-4791-4CC1-B9B7-66151A212814} - Library - Properties - SftpFileSystem - SftpFileSystem - v4.8.1 - 512 - - - - true - full - false - ..\..\bin\Debug\plugins\ - DEBUG;TRACE - prompt - 4 - false - - - pdbonly - true - ..\..\bin\Release\plugins\ - TRACE - prompt - 4 - false - - - true - - - ..\Solution Items\Key.snk - - - - - - - - - - - Properties\AssemblyVersion.cs - - - - Form - - - ConfigDialog.cs - - - - - Form - - - FailedKeyDialog.cs - - - - Form - - - PrivateKeyPasswordDialog.cs - - - Form - - - LoginDialog.cs - - - - - - - - ConfigDialog.cs - - - FailedKeyDialog.cs - - - PrivateKeyPasswordDialog.cs - Designer - - - LoginDialog.cs - Designer - - - - - Key.snk - - - - - 2024.0.0 - - - - - {e72c2bb1-34de-4d66-a830-9647c3837833} - ColumnizerLib - - - - - - - - - \ No newline at end of file + + + net8.0-windows + true + Library + SftpFileSystem + SftpFileSystem + false + true + true + false + $(SolutionDir)..\bin\$(Configuration)\plugins + CA1416; + + + False + + + True + + + true + + + ..\Solution Items\Key.snk + + + + Properties\AssemblyVersion.cs + + + + + Key.snk + + + + + + + + + + + + + + + + + SftpFileSystem + + diff --git a/src/SftpFileSystemx64/SftpLogFileInfo.cs b/src/SftpFileSystemx64/SftpLogFileInfo.cs index c780c539..6323c202 100644 --- a/src/SftpFileSystemx64/SftpLogFileInfo.cs +++ b/src/SftpFileSystemx64/SftpLogFileInfo.cs @@ -23,7 +23,7 @@ internal class SftpLogFileInfo : ILogFileInfo private readonly string _remoteFileName; private readonly SftpClient _sftp; - private readonly object _sshKeyMonitor = new object(); + private readonly object _sshKeyMonitor = new(); private DateTime _lastChange = DateTime.Now; private long _lastLength; @@ -48,7 +48,7 @@ internal SftpLogFileInfo(SftpFileSystem sftpFileSystem, Uri fileUri, ILogExpertL { while (sftFileSystem.PrivateKeyFile == null) { - PrivateKeyPasswordDialog dlg = new PrivateKeyPasswordDialog(); + PrivateKeyPasswordDialog dlg = new(); DialogResult dialogResult = dlg.ShowDialog(); if (dialogResult == DialogResult.Cancel) { @@ -56,7 +56,7 @@ internal SftpLogFileInfo(SftpFileSystem sftpFileSystem, Uri fileUri, ILogExpertL break; } - PrivateKeyFile privateKeyFile = new PrivateKeyFile(sftFileSystem.ConfigData.KeyFile, dlg.Password); + PrivateKeyFile privateKeyFile = new(sftFileSystem.ConfigData.KeyFile, dlg.Password); if (privateKeyFile != null) { @@ -86,7 +86,7 @@ internal SftpLogFileInfo(SftpFileSystem sftpFileSystem, Uri fileUri, ILogExpertL if (success == false) { - FailedKeyDialog dlg = new FailedKeyDialog(); + FailedKeyDialog dlg = new(); DialogResult res = dlg.ShowDialog(); dlg.Dispose(); if (res == DialogResult.Cancel) @@ -168,7 +168,7 @@ public bool FileExists { try { - ISftpFile file = _sftp.Get(_remoteFileName); + SftpFile file = (SftpFile) _sftp.Get(_remoteFileName); long len = file.Attributes.Size; return len != -1; } @@ -196,7 +196,7 @@ public long Length { get { - ISftpFile file = _sftp.Get(_remoteFileName); + SftpFile file = (SftpFile)_sftp.Get(_remoteFileName); return file.Attributes.Size; } } diff --git a/src/SftpFileSystemx86/Properties/AssemblyInfo.cs b/src/SftpFileSystemx86/Properties/AssemblyInfo.cs index f1e59d4b..2d342d43 100644 --- a/src/SftpFileSystemx86/Properties/AssemblyInfo.cs +++ b/src/SftpFileSystemx86/Properties/AssemblyInfo.cs @@ -2,11 +2,5 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SftpFileSystemx86")] -[assembly: AssemblyDescription("")] - // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("3d01e923-5219-488b-b0a7-98521841e680")] \ No newline at end of file diff --git a/src/SftpFileSystemx86/SftpFileSystemx86.csproj b/src/SftpFileSystemx86/SftpFileSystemx86.csproj index 814229f1..f70e3d23 100644 --- a/src/SftpFileSystemx86/SftpFileSystemx86.csproj +++ b/src/SftpFileSystemx86/SftpFileSystemx86.csproj @@ -1,94 +1,45 @@ - - - + - Debug - AnyCPU - {3D01E923-5219-488B-B0A7-98521841E680} + net8.0-windows + true Library - Properties SftpFileSystem SftpFileSystem - v4.8.1 - 512 - true - + false + true + true + SftpFileSystemx86 + false + $(SolutionDir)..\bin\$(Configuration)\pluginsx86 + CA1416; - - true - full - false - ..\..\bin\Debug\pluginsx86\ - DEBUG;TRACE - prompt - 4 - false + + False - - pdbonly - true - ..\..\bin\Release\pluginsx86\ - TRACE - prompt - 4 - false + + True - - - - - - - - - - - ConfigData.cs - - ConfigDialog.cs - Form - - - ConfigDialog.cs - ConfigDialog.Designer.cs - + + CredentialCache.cs Credentials.cs - - FailedKeyDialog.cs - Form - - - FailedKeyDialog.cs - FailedKeyDialog.Designer.cs - + + KeyType.cs - - LoginDialog.cs - Form - - - LoginDialog.cs - LoginDialog.Designer.cs - - - PrivateKeyPasswordDialog.cs - Form - - - PrivateKeyPasswordDialog.cs - PrivateKeyPasswordDialog.Designer.cs - + + + + SftpFileSystem.cs @@ -98,35 +49,16 @@ Properties\AssemblyVersion.cs - - - {e72c2bb1-34de-4d66-a830-9647c3837833} - ColumnizerLib - - - {2563526e-4566-40cb-aa27-587b904fd25b} - CsvColumnizer - + + + + - - ConfigDialog.cs - ConfigDialog.resx - - - FailedKeyDialog.cs - FailedKeyDialog.resx - - - LoginDialog.cs - LoginDialog.resx - - - PrivateKeyPasswordDialog.cs - PrivateKeyPasswordDialog.resx - + + @@ -134,9 +66,8 @@ - - 2024.0.0 - + + + - - \ No newline at end of file + diff --git a/src/Solution Items/AssemblyVersion.cs b/src/Solution Items/AssemblyVersion.cs index f27d67a5..3a5b278f 100644 --- a/src/Solution Items/AssemblyVersion.cs +++ b/src/Solution Items/AssemblyVersion.cs @@ -3,10 +3,10 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyProduct("LogExpert")] -[assembly: AssemblyCopyright("Original work Copyright (c) 2008-2011 Hagen Raab\r\nModified work Copyright (c) 2022 Zarunbal|Hirogen")] +[assembly: AssemblyCopyright("Original work Copyright (c) 2008-2011 Hagen Raab\r\nModified work Copyright (c) 2025 Zarunbal|Hirogen and many others")] -[assembly: AssemblyVersion("1.9.1.9001")] -[assembly: AssemblyFileVersion("1.9.1.9001")] -[assembly: AssemblyInformationalVersion("1.9.1 Testrelease")] +[assembly: AssemblyVersion("1.10.0")] +[assembly: AssemblyFileVersion("1.10.0")] +[assembly: AssemblyInformationalVersion("1.10.0")] -[assembly: ComVisible(false)] \ No newline at end of file +[assembly: ComVisible(false)] diff --git a/src/WinFormsUI/Docking/DockContent.cs b/src/WinFormsUI/Docking/DockContent.cs index 0ad885f5..76bad264 100644 --- a/src/WinFormsUI/Docking/DockContent.cs +++ b/src/WinFormsUI/Docking/DockContent.cs @@ -2,7 +2,6 @@ using System.ComponentModel; using System.Drawing; using System.Windows.Forms; -using System.Runtime.InteropServices; using System.Diagnostics.CodeAnalysis; namespace WeifenLuo.WinFormsUI.Docking @@ -22,10 +21,10 @@ public class DockContent : Form, IDockContent public DockContent() { - DockHandler = new DockContentHandler(this, new GetPersistStringCallback(GetPersistString)); - DockHandler.DockStateChanged += new EventHandler(DockHandler_DockStateChanged); + DockHandler = new DockContentHandler(this, GetPersistString); + DockHandler.DockStateChanged += DockHandler_DockStateChanged; //Suggested as a fix by bensty regarding form resize - this.ParentChanged += new EventHandler(DockContent_ParentChanged); + ParentChanged += DockContent_ParentChanged; } #endregion @@ -36,8 +35,9 @@ public DockContent() [LocalizedDescription("Pane_DockStateChanged_Description")] public event EventHandler DockStateChanged { - add { Events.AddHandler(DockStateChangedEvent, value); } - remove { Events.RemoveHandler(DockStateChangedEvent, value); } + + add => Events.AddHandler(DockStateChangedEvent, value); + remove => Events.RemoveHandler(DockStateChangedEvent, value); } #endregion @@ -52,8 +52,8 @@ public event EventHandler DockStateChanged [DefaultValue(true)] public bool AllowEndUserDocking { - get { return DockHandler.AllowEndUserDocking; } - set { DockHandler.AllowEndUserDocking = value; } + get => DockHandler.AllowEndUserDocking; + set => DockHandler.AllowEndUserDocking = value; } [LocalizedCategory("Category_Docking")] @@ -62,8 +62,8 @@ public bool AllowEndUserDocking DockAreas.Document | DockAreas.Float)] public DockAreas DockAreas { - get { return DockHandler.DockAreas; } - set { DockHandler.DockAreas = value; } + get => DockHandler.DockAreas; + set => DockHandler.DockAreas = value; } [LocalizedCategory("Category_Docking")] @@ -71,14 +71,14 @@ public DockAreas DockAreas [DefaultValue(0.25)] public double AutoHidePortion { - get { return DockHandler.AutoHidePortion; } - set { DockHandler.AutoHidePortion = value; } + get => DockHandler.AutoHidePortion; + set => DockHandler.AutoHidePortion = value; } public string TabText { - get { return m_tabText; } - set { DockHandler.TabText = m_tabText = value; } + get => m_tabText; + set => DockHandler.TabText = m_tabText = value; } [LocalizedCategory("Category_Docking")] @@ -86,8 +86,8 @@ public string TabText [DefaultValue(true)] public bool CloseButton { - get { return DockHandler.CloseButton; } - set { DockHandler.CloseButton = value; } + get => DockHandler.CloseButton; + set => DockHandler.CloseButton = value; } [LocalizedCategory("Category_Docking")] @@ -95,64 +95,64 @@ public bool CloseButton [DefaultValue(true)] public bool CloseButtonVisible { - get { return DockHandler.CloseButtonVisible; } - set { DockHandler.CloseButtonVisible = value; } + get => DockHandler.CloseButtonVisible; + set => DockHandler.CloseButtonVisible = value; } [Browsable(false)] public DockPanel DockPanel { - get { return DockHandler.DockPanel; } - set { DockHandler.DockPanel = value; } + get => DockHandler.DockPanel; + set => DockHandler.DockPanel = value; } [Browsable(false)] public DockState DockState { - get { return DockHandler.DockState; } - set { DockHandler.DockState = value; } + get => DockHandler.DockState; + set => DockHandler.DockState = value; } [Browsable(false)] public DockPane Pane { - get { return DockHandler.Pane; } - set { DockHandler.Pane = value; } + get => DockHandler.Pane; + set => DockHandler.Pane = value; } [Browsable(false)] public bool IsHidden { - get { return DockHandler.IsHidden; } - set { DockHandler.IsHidden = value; } + get => DockHandler.IsHidden; + set => DockHandler.IsHidden = value; } [Browsable(false)] public DockState VisibleState { - get { return DockHandler.VisibleState; } - set { DockHandler.VisibleState = value; } + get => DockHandler.VisibleState; + set => DockHandler.VisibleState = value; } [Browsable(false)] public bool IsFloat { - get { return DockHandler.IsFloat; } - set { DockHandler.IsFloat = value; } + get => DockHandler.IsFloat; + set => DockHandler.IsFloat = value; } [Browsable(false)] public DockPane PanelPane { - get { return DockHandler.PanelPane; } - set { DockHandler.PanelPane = value; } + get => DockHandler.PanelPane; + set => DockHandler.PanelPane = value; } [Browsable(false)] public DockPane FloatPane { - get { return DockHandler.FloatPane; } - set { DockHandler.FloatPane = value; } + get => DockHandler.FloatPane; + set => DockHandler.FloatPane = value; } [LocalizedCategory("Category_Docking")] @@ -160,8 +160,8 @@ public DockPane FloatPane [DefaultValue(false)] public bool HideOnClose { - get { return DockHandler.HideOnClose; } - set { DockHandler.HideOnClose = value; } + get => DockHandler.HideOnClose; + set => DockHandler.HideOnClose = value; } [LocalizedCategory("Category_Docking")] @@ -169,23 +169,20 @@ public bool HideOnClose [DefaultValue(DockState.Unknown)] public DockState ShowHint { - get { return DockHandler.ShowHint; } - set { DockHandler.ShowHint = value; } + get => DockHandler.ShowHint; + set => DockHandler.ShowHint = value; } [Browsable(false)] - public bool IsActivated - { - get { return DockHandler.IsActivated; } - } + public bool IsActivated => DockHandler.IsActivated; [LocalizedCategory("Category_Docking")] [LocalizedDescription("DockContent_TabPageContextMenu_Description")] [DefaultValue(null)] - public ContextMenu TabPageContextMenu + public ContextMenuStrip TabPageContextMenu { - get { return DockHandler.TabPageContextMenu; } - set { DockHandler.TabPageContextMenu = value; } + get => DockHandler.TabPageContextMenu; + set => DockHandler.TabPageContextMenu = value; } [LocalizedCategory("Category_Docking")] @@ -193,8 +190,8 @@ public ContextMenu TabPageContextMenu [DefaultValue(null)] public ContextMenuStrip TabPageContextMenuStrip { - get { return DockHandler.TabPageContextMenuStrip; } - set { DockHandler.TabPageContextMenuStrip = value; } + get => DockHandler.TabPageContextMenuStrip; + set => DockHandler.TabPageContextMenuStrip = value; } [Localizable(true)] @@ -203,8 +200,8 @@ public ContextMenuStrip TabPageContextMenuStrip [DefaultValue(null)] public string ToolTipText { - get { return DockHandler.ToolTipText; } - set { DockHandler.ToolTipText = value; } + get => DockHandler.ToolTipText; + set => DockHandler.ToolTipText = value; } #endregion @@ -289,9 +286,9 @@ private bool ShouldSerializeTabText() //Suggested as a fix by bensty regarding form resize private void DockContent_ParentChanged(object Sender, EventArgs e) { - if (this.Parent != null) + if (Parent != null) { - this.Font = this.Parent.Font; + Font = Parent.Font; } } @@ -311,22 +308,19 @@ protected virtual string GetPersistString() protected virtual void OnDockStateChanged(EventArgs e) { EventHandler handler = (EventHandler) Events[DockStateChangedEvent]; - if (handler != null) - { - handler(this, e); - } + handler?.Invoke(this, e); } #region IDockContent Members void IDockContent.OnActivated(EventArgs e) { - this.OnActivated(e); + OnActivated(e); } void IDockContent.OnDeactivate(EventArgs e) { - this.OnDeactivate(e); + OnDeactivate(e); } #endregion diff --git a/src/WinFormsUI/Docking/DockContentHandler.cs b/src/WinFormsUI/Docking/DockContentHandler.cs index 70c5b852..8d20156b 100644 --- a/src/WinFormsUI/Docking/DockContentHandler.cs +++ b/src/WinFormsUI/Docking/DockContentHandler.cs @@ -541,7 +541,7 @@ internal set } } - public ContextMenu TabPageContextMenu { get; set; } = null; + public ContextMenuStrip TabPageContextMenu { get; set; } = null; public string ToolTipText { get; set; } = null; diff --git a/src/WinFormsUI/Docking/DockPane.cs b/src/WinFormsUI/Docking/DockPane.cs index 27bbf407..ec395b13 100644 --- a/src/WinFormsUI/Docking/DockPane.cs +++ b/src/WinFormsUI/Docking/DockPane.cs @@ -1,11 +1,8 @@ using System; using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; using System.Drawing; -using System.Drawing.Drawing2D; using System.Windows.Forms; -using System.Runtime.InteropServices; -using System.Security.Permissions; -using System.Diagnostics.CodeAnalysis; namespace WeifenLuo.WinFormsUI.Docking { @@ -698,15 +695,13 @@ internal void ShowTabPageContextMenu(Control control, Point position) return; } - ContextMenuStrip contextMenuStrip = menu as ContextMenuStrip; - if (contextMenuStrip != null) + if (menu is ContextMenuStrip contextMenuStrip) { contextMenuStrip.Show(control, position); return; } - ContextMenu contextMenu = menu as ContextMenu; - if (contextMenu != null) + if (menu is ContextMenuStrip contextMenu) { contextMenu.Show(this, position); } @@ -957,7 +952,6 @@ protected override void OnLayout(LayoutEventArgs levent) base.OnLayout(levent); } - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] protected override void WndProc(ref Message m) { if (m.Msg == (int) Win32.Msgs.WM_MOUSEACTIVATE) diff --git a/src/WinFormsUI/Docking/DockPaneCaptionBase.cs b/src/WinFormsUI/Docking/DockPaneCaptionBase.cs index 4d79a777..2c2d5f92 100644 --- a/src/WinFormsUI/Docking/DockPaneCaptionBase.cs +++ b/src/WinFormsUI/Docking/DockPaneCaptionBase.cs @@ -1,8 +1,5 @@ -using System; -using System.Windows.Forms; using System.Drawing; -using System.Runtime.InteropServices; -using System.Security.Permissions; +using System.Windows.Forms; namespace WeifenLuo.WinFormsUI.Docking { @@ -83,7 +80,6 @@ protected override void OnMouseDown(MouseEventArgs e) } } - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] protected override void WndProc(ref Message m) { if (m.Msg == (int) Win32.Msgs.WM_LBUTTONDBLCLK) diff --git a/src/WinFormsUI/Docking/DockPaneStripBase.cs b/src/WinFormsUI/Docking/DockPaneStripBase.cs index f460ea95..62fce1bf 100644 --- a/src/WinFormsUI/Docking/DockPaneStripBase.cs +++ b/src/WinFormsUI/Docking/DockPaneStripBase.cs @@ -1,11 +1,10 @@ using System; -using System.Windows.Forms; -using System.Drawing; -using System.Drawing.Drawing2D; using System.Collections; using System.Collections.Generic; -using System.Security.Permissions; using System.Diagnostics.CodeAnalysis; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Windows.Forms; namespace WeifenLuo.WinFormsUI.Docking { @@ -121,7 +120,6 @@ protected override void OnMouseUp(MouseEventArgs e) } } - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] protected override void WndProc(ref Message m) { if (m.Msg == (int) Win32.Msgs.WM_LBUTTONDBLCLK) diff --git a/src/WinFormsUI/Docking/DockPanel.Persistor.cs b/src/WinFormsUI/Docking/DockPanel.Persistor.cs index 22f44e58..49d54ff2 100644 --- a/src/WinFormsUI/Docking/DockPanel.Persistor.cs +++ b/src/WinFormsUI/Docking/DockPanel.Persistor.cs @@ -270,6 +270,7 @@ public static void LoadFromXml(DockPanel dockPanel, Stream stream, { if (dockPanel.Contents.Count != 0) { + //TODO this happens if a session is loaded and the dialog is just closed, this needs to be adressed throw new InvalidOperationException(Strings.DockPanel_LoadFromXml_AlreadyInitialized); } diff --git a/src/WinFormsUI/Docking/DockPanel.cs b/src/WinFormsUI/Docking/DockPanel.cs index e376e327..6012c27b 100644 --- a/src/WinFormsUI/Docking/DockPanel.cs +++ b/src/WinFormsUI/Docking/DockPanel.cs @@ -1,20 +1,18 @@ using System; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; +using System.Collections.Generic; using System.ComponentModel; -using System.Runtime.InteropServices; -using System.IO; -using System.Text; using System.Diagnostics.CodeAnalysis; -using System.Collections.Generic; +using System.Drawing; +using System.Windows.Forms; // To simplify the process of finding the toolbox bitmap resource: // #1 Create an internal class called "resfinder" outside of the root namespace. // #2 Use "resfinder" in the toolbox bitmap attribute instead of the control name. // #3 use the "." string to locate the resource. // See: http://www.bobpowell.net/toolboxbitmap.htm +#pragma warning disable CS8981 // The type name only contains lower-cased ascii characters. Such names may become reserved for the language. internal class resfinder +#pragma warning restore CS8981 // The type name only contains lower-cased ascii characters. Such names may become reserved for the language. { } @@ -124,7 +122,7 @@ public event EventHandler ContentRemoved /// Determines the color with which the client rectangle will be drawn. /// If this property is used instead of the BackColor it will not have any influence on the borders to the surrounding controls (DockPane). /// The BackColor property changes the borders of surrounding controls (DockPane). - /// Alternatively both properties may be used (BackColor to draw and define the color of the borders and DockBackColor to define the color of the client rectangle). + /// Alternatively both properties may be used (BackColor to draw and define the color of the borders and DockBackColor to define the color of the client rectangle). /// For Backgroundimages: Set your prefered Image, then set the DockBackColor and the BackColor to the same Color (Control) /// [Description("Determines the color with which the client rectangle will be drawn.\r\n" + @@ -140,7 +138,7 @@ public Color DockBackColor if (m_BackColor != value) { m_BackColor = value; - this.Refresh(); + Refresh(); } } } @@ -436,21 +434,21 @@ private Rectangle DocumentRectangle Rectangle rect = DockArea; if (DockWindows[DockState.DockLeft].VisibleNestedPanes.Count != 0) { - rect.X += (int) (DockArea.Width * DockLeftPortion); - rect.Width -= (int) (DockArea.Width * DockLeftPortion); + rect.X += (int)(DockArea.Width * DockLeftPortion); + rect.Width -= (int)(DockArea.Width * DockLeftPortion); } if (DockWindows[DockState.DockRight].VisibleNestedPanes.Count != 0) { - rect.Width -= (int) (DockArea.Width * DockRightPortion); + rect.Width -= (int)(DockArea.Width * DockRightPortion); } if (DockWindows[DockState.DockTop].VisibleNestedPanes.Count != 0) { - rect.Y += (int) (DockArea.Height * DockTopPortion); - rect.Height -= (int) (DockArea.Height * DockTopPortion); + rect.Y += (int)(DockArea.Height * DockTopPortion); + rect.Height -= (int)(DockArea.Height * DockTopPortion); } if (DockWindows[DockState.DockBottom].VisibleNestedPanes.Count != 0) { - rect.Height -= (int) (DockArea.Height * DockBottomPortion); + rect.Height -= (int)(DockArea.Height * DockBottomPortion); } return rect; @@ -898,10 +896,10 @@ private int GetDockWindowSize(DockState dockState) if (dockState == DockState.DockLeft || dockState == DockState.DockRight) { int width = ClientRectangle.Width - DockPadding.Left - DockPadding.Right; - int dockLeftSize = m_dockLeftPortion >= 1 ? (int) m_dockLeftPortion : (int) (width * m_dockLeftPortion); + int dockLeftSize = m_dockLeftPortion >= 1 ? (int)m_dockLeftPortion : (int)(width * m_dockLeftPortion); int dockRightSize = m_dockRightPortion >= 1 - ? (int) m_dockRightPortion - : (int) (width * m_dockRightPortion); + ? (int)m_dockRightPortion + : (int)(width * m_dockRightPortion); if (dockLeftSize < MeasurePane.MinSize) { @@ -924,10 +922,10 @@ private int GetDockWindowSize(DockState dockState) else if (dockState == DockState.DockTop || dockState == DockState.DockBottom) { int height = ClientRectangle.Height - DockPadding.Top - DockPadding.Bottom; - int dockTopSize = m_dockTopPortion >= 1 ? (int) m_dockTopPortion : (int) (height * m_dockTopPortion); + int dockTopSize = m_dockTopPortion >= 1 ? (int)m_dockTopPortion : (int)(height * m_dockTopPortion); int dockBottomSize = m_dockBottomPortion >= 1 - ? (int) m_dockBottomPortion - : (int) (height * m_dockBottomPortion); + ? (int)m_dockBottomPortion + : (int)(height * m_dockBottomPortion); if (dockTopSize < MeasurePane.MinSize) { @@ -1052,7 +1050,7 @@ private void UpdateWindowRegion_FullDocumentArea() private void UpdateWindowRegion_EmptyDocumentArea() { Rectangle rect = DocumentWindowBounds; - SetRegion(new Rectangle[] {rect}); + SetRegion(new Rectangle[] { rect }); } private void UpdateWindowRegion_ClipContent() @@ -1199,21 +1197,12 @@ private void DummyControl_Paint(object sender, PaintEventArgs e) protected virtual void OnContentAdded(DockContentEventArgs e) { - EventHandler handler = (EventHandler) Events[ContentAddedEvent]; - if (handler != null) - { - handler(this, e); - } + ((EventHandler)Events[ContentAddedEvent])?.Invoke(this, e); } protected virtual void OnContentRemoved(DockContentEventArgs e) { - EventHandler handler = - (EventHandler) Events[ContentRemovedEvent]; - if (handler != null) - { - handler(this, e); - } + ((EventHandler)Events[ContentRemovedEvent])?.Invoke(this, e); } } } \ No newline at end of file diff --git a/src/WinFormsUI/Docking/FloatWindow.cs b/src/WinFormsUI/Docking/FloatWindow.cs index 033df661..e341137a 100644 --- a/src/WinFormsUI/Docking/FloatWindow.cs +++ b/src/WinFormsUI/Docking/FloatWindow.cs @@ -1,10 +1,7 @@ using System; -using System.Collections; +using System.Diagnostics.CodeAnalysis; using System.Drawing; using System.Windows.Forms; -using System.Runtime.InteropServices; -using System.Security.Permissions; -using System.Diagnostics.CodeAnalysis; namespace WeifenLuo.WinFormsUI.Docking { @@ -223,7 +220,6 @@ protected override void SetBoundsCore(int x, int y, int width, int height, Bound base.SetBoundsCore(x, y, width, height, specified); } - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] protected override void WndProc(ref Message m) { if (m.Msg == (int) Win32.Msgs.WM_NCLBUTTONDOWN) diff --git a/src/WinFormsUI/Properties/AssemblyInfo.cs b/src/WinFormsUI/Properties/AssemblyInfo.cs deleted file mode 100644 index 9e46aa01..00000000 --- a/src/WinFormsUI/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Diagnostics.CodeAnalysis; - -[assembly: AssemblyTitle("DockPanel Suite for .Net 2.0")] -[assembly: AssemblyDescription(".Net Docking Library for Windows Forms")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Weifen Luo")] -[assembly: AssemblyProduct("DockPanel Suite")] -[assembly: AssemblyCopyright("Copyright © Weifen Luo 2007")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: CLSCompliant(true)] - -[assembly: ComVisible(false)] - -[assembly: Guid("9d690ef9-ce19-4c69-874c-e24d8eb36aff")] - -[assembly: AssemblyVersion("2.5.0.*")] -[assembly: AssemblyFileVersion("2.5.0.0")] - -[module: - SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "namespace", - Target = "WeifenLuo.WinFormsUI.Docking", MessageId = "Weifen")] -[module: - SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "namespace", - Target = "WeifenLuo.WinFormsUI.Docking", MessageId = "Luo")] -[module: - SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", - Target = "WeifenLuo.WinFormsUI.Docking.Strings.resources", MessageId = "Weifen")] -[module: - SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", - Target = "WeifenLuo.WinFormsUI.Docking.Strings.resources", MessageId = "Luo")] -[module: - SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", - Target = "WeifenLuo.WinFormsUI.Docking.Strings.resources", MessageId = "Dockable")] \ No newline at end of file diff --git a/src/WinFormsUI/WinFormsUI.csproj b/src/WinFormsUI/WinFormsUI.csproj index faed881b..7380312e 100644 --- a/src/WinFormsUI/WinFormsUI.csproj +++ b/src/WinFormsUI/WinFormsUI.csproj @@ -1,13 +1,8 @@ - - + - Debug - AnyCPU - 9.0.30729 - 2.0 - {C75532C4-765B-418E-B09B-46D36B2ABDB1} + net8.0-windows + true Library - Properties WeifenLuo.WinFormsUI WeifenLuo.WinFormsUI.Docking true @@ -16,13 +11,6 @@ SAK SAK SAK - v4.8.1 - - - - - 3.5 - publish\ true Disk @@ -38,207 +26,87 @@ false false true + false + true + true + false + $(SolutionDir)..\bin\$(Configuration) + CA1416; - - true - full - false - ..\..\bin\Debug\ - TRACE;DEBUG - prompt - 4 - false + + False - - pdbonly - true - ..\..\bin\Release\ - TRACE - prompt - 4 - false + + True - - - - - - - - - + Component - + Component - - Form - - + Component - + Component - + Component - - - + Component - + Component - - - - Form - - - - + Component - - - - + UserControl - + Component - + Component - - - - + Component - + UserControl - + Component - + Component - + Component - - + Component - + Component - - - - Form - - - + Component - - - - + Component - - - - - - - True - True - Resources.resx - - - True - True - Strings.resx - - - - - - - Designer - ResXFileCodeGenerator - Resources.Designer.cs - - - Designer - ResXFileCodeGenerator - Strings.Designer.cs - Key.snk - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - - - \ No newline at end of file + diff --git a/src/setup/LogExpertInstaller.iss b/src/setup/LogExpertInstaller.iss index f73792a3..b02d4882 100644 --- a/src/setup/LogExpertInstaller.iss +++ b/src/setup/LogExpertInstaller.iss @@ -2,7 +2,7 @@ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define AppName "LogExpert" -#define AppVersion "1.9.0" +#define AppVersion "1.10.0" #define AppURL "https://github.com/zarunbal/LogExpert" #define AppExeName "LogExpert.exe"