├── .github ├── dependabot.yml └── workflows │ ├── dotnet-desktop-installer.yml │ └── dotnet-desktop.yml ├── .gitignore ├── CustomControls ├── ComboBoxCustomSearch.cs ├── CustomControls.csproj ├── CustomControls.xml ├── ImageButton.Designer.cs ├── ImageButton.cs └── ImageButton.resx ├── InstallerBaseWixSharp ├── #APPLICATION#.wxl ├── App.config ├── ApplicationSide │ └── WaitForProcess.cs ├── Files │ ├── Dialogs │ │ ├── AssociationsDialog.Designer.cs │ │ ├── AssociationsDialog.cs │ │ ├── AssociationsDialog.resx │ │ ├── DialogClasses │ │ │ └── FileAssociation.cs │ │ ├── ProgressDialog.Designer.cs │ │ ├── ProgressDialog.cs │ │ ├── ProgressDialog.resx │ │ ├── RunProgramDialog.Designer.cs │ │ ├── RunProgramDialog.cs │ │ └── RunProgramDialog.resx │ ├── FileResources │ │ └── replace_this_ico.ico │ ├── Localization │ │ ├── FormDialogSelectLanguage.Designer.cs │ │ ├── FormDialogSelectLanguage.cs │ │ ├── FormDialogSelectLanguage.resx │ │ ├── LocalizationAttribute.cs │ │ ├── SupportedLanguages.cs │ │ ├── TabDeliLocalization │ │ │ ├── TabDeliLocalization.cs │ │ │ └── tabdeli_messages.txt │ │ ├── WixUI_en-US.wxl │ │ └── WixUI_fi-FI.wxl │ ├── MIT.License.rtf │ ├── PInvoke │ │ └── ProcessExtensions.cs │ ├── Utilities │ │ ├── ApplicationName.ps1 │ │ └── launch.json │ ├── install_side.png │ ├── install_top.png │ └── replace_this_logo.png ├── InstallerBaseWixSharp.csproj ├── Program.cs ├── ProjectLocalizationHelper.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── Registry │ ├── CommonCalls.cs │ ├── RegistryFileAssociation.cs │ └── RegistryStarAssociation.cs └── nuget-package-logo.ico ├── LICENSE ├── PluginTemplate ├── FodyWeavers.xml ├── FodyWeavers.xsd ├── PluginTemplate.csproj ├── PluginTemplate.licenseheader ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── Resources │ ├── VPKSoft.ico │ ├── VPKSoftLogo_App.png │ └── tab_deli_localization.txt └── SamplePlugin.cs ├── README.md ├── ScriptNotepad.sln ├── ScriptNotepad.sln.DotSettings ├── ScriptNotepad.sln.licenseheader ├── ScriptNotepad ├── App.config ├── Database │ ├── DirectAccess │ │ └── CheckFluentMigrator.cs │ ├── Entity │ │ ├── Context │ │ │ └── ScriptNotepadDbContext.cs │ │ ├── Entities │ │ │ ├── CodeSnippet.cs │ │ │ ├── FileContent.cs │ │ │ ├── FileSave.cs │ │ │ ├── FileSession.cs │ │ │ ├── MiscellaneousParameter.cs │ │ │ ├── MiscellaneousTextEntry.cs │ │ │ ├── Plugin.cs │ │ │ ├── RecentFile.cs │ │ │ ├── SearchAndReplaceHistory.cs │ │ │ └── SoftwareLicense.cs │ │ ├── Enumerations │ │ │ ├── CodeSnippetLanguage.cs │ │ │ ├── MiscellaneousTextType.cs │ │ │ ├── ScriptSnippetType.cs │ │ │ ├── SearchAndReplaceSearchType.cs │ │ │ └── SearchAndReplaceType.cs │ │ ├── IEntity.cs │ │ └── Migrations │ │ │ ├── 01_InitialMigration.cs │ │ │ ├── 02_FoldSave.cs │ │ │ ├── 03_FixEmptySession.cs │ │ │ └── ExecuteDatabaseMigrate.cs │ └── Helpers │ │ └── DatabaseUtilities.cs ├── DialogForms │ ├── FormDialogQueryEncoding.Designer.cs │ ├── FormDialogQueryEncoding.cs │ ├── FormDialogQueryEncoding.resx │ ├── FormDialogQueryJumpLocation.Designer.cs │ ├── FormDialogQueryJumpLocation.cs │ ├── FormDialogQueryJumpLocation.resx │ ├── FormDialogQueryNumber.Designer.cs │ ├── FormDialogQueryNumber.cs │ ├── FormDialogQueryNumber.resx │ ├── FormDialogRenameNewFile.Designer.cs │ ├── FormDialogRenameNewFile.cs │ ├── FormDialogRenameNewFile.resx │ ├── FormDialogScriptLoad.Designer.cs │ ├── FormDialogScriptLoad.cs │ ├── FormDialogScriptLoad.resx │ ├── FormDialogSelectFileTab.Designer.cs │ ├── FormDialogSelectFileTab.cs │ └── FormDialogSelectFileTab.resx ├── Editor │ ├── EntityHelpers │ │ ├── DataHolders │ │ │ ├── DataHolderIndexer.cs │ │ │ └── FileSaveData.cs │ │ ├── FileSaveHelper.cs │ │ ├── FileSessionHelper.cs │ │ └── RecentFileHelper.cs │ └── Utility │ │ ├── AssemblyVersion.cs │ │ ├── DocumentReload.cs │ │ └── ModelHelpers │ │ ├── FileHistoryHelper.cs │ │ ├── FileSaveHelper.cs │ │ ├── FileSessionHelper.cs │ │ ├── MiscellaneousTextEntryHelper.cs │ │ ├── PluginHelper.cs │ │ └── SearchAndReplaceHistoryHelper.cs ├── FodyWeavers.xml ├── FodyWeavers.xsd ├── FormHexEdit.Designer.cs ├── FormHexEdit.cs ├── FormHexEdit.resx ├── FormMain.Designer.cs ├── FormMain.cs ├── FormMain.resx ├── Gists │ └── MessageHelper.cs ├── IOPermission │ └── FileIOPermission.cs ├── Icons │ ├── astonished.ico │ ├── notepad0.ico │ ├── notepad1.ico │ ├── notepad2.ico │ ├── notepad3.ico │ ├── notepad4.ico │ ├── notepad5.ico │ ├── notepad6.ico │ └── notepad7.ico ├── Installer │ ├── DotNetChecker.nsh │ ├── languages.ico │ ├── license.txt │ ├── make_installer.bat │ ├── setup_scriptnotepad.nsi │ └── un_icon.ico ├── Localization │ ├── ExternalLibraryLoader │ │ └── ExternalSpellChecker.cs │ ├── Forms │ │ ├── FormLocalizationHelper.Designer.cs │ │ ├── FormLocalizationHelper.cs │ │ └── FormLocalizationHelper.resx │ ├── Hunspell │ │ ├── HunspellData.cs │ │ └── HunspellDictionaryCrawler.cs │ ├── IStaticMessageProvider.cs │ ├── Messages.Designer.cs │ ├── Messages.resx │ ├── Notepad++LanguageNames.txt │ ├── SQLiteDatabase │ │ ├── CopyLang.bat │ │ └── lang.sqlite │ ├── StaticLocalizeFileDialog.cs │ ├── StaticMessageLocalizationProvider.cs │ └── StatusStripTexts.cs ├── PluginHandling │ ├── FormPluginManage.Designer.cs │ ├── FormPluginManage.cs │ ├── FormPluginManage.resx │ ├── PluginDirectoryRoaming.cs │ └── PluginInitializer.cs ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Resources │ ├── About.png │ ├── CSharp.png │ ├── Copy.png │ ├── Delete.png │ ├── Down_2.png │ ├── Erase.png │ ├── Fast-rewind.png │ ├── Find.png │ ├── History.png │ ├── New document.png │ ├── Paste.png │ ├── Play.png │ ├── Playback.png │ ├── Redo.png │ ├── Save.png │ ├── SaveAs.png │ ├── SaveWithDialog.png │ ├── Script.png │ ├── Undo.png │ ├── Up.png │ ├── arrow-down-2.png │ ├── arrow-up-2.png │ ├── arrow_left.png │ ├── arrow_right.png │ ├── astonished.png │ ├── book_next.png │ ├── book_previous.png │ ├── close_small.png │ ├── database-go.png │ ├── default.png │ ├── diff_icon.png │ ├── discard_changes.png │ ├── duplicate_lines.png │ ├── edit-cut-red.png │ ├── education-languages.png │ ├── find_replace.png │ ├── find_tab.png │ ├── folder-database.png │ ├── folder-find.png │ ├── folder-page.png │ ├── format-text-uppercase.png │ ├── jump_first.png │ ├── jump_last.png │ ├── krename.png │ ├── list-add-5.png │ ├── mark_words.png │ ├── media-playback-start.png │ ├── open_no_bom.png │ ├── open_unknown_encoding.png │ ├── paragraph.png │ ├── plugin-add.png │ ├── plugin-delete.png │ ├── plugin-error.png │ ├── plugin-go.png │ ├── preferences-plugin.png │ ├── preferences.png │ ├── print_preview.png │ ├── printer.png │ ├── reload_disk.png │ ├── save_all.png │ ├── save_all_plus.png │ ├── session-properties.png │ ├── sort_alphabet.png │ ├── spell_check.png │ ├── split_view.png │ ├── style.png │ ├── swap_view.png │ ├── tab_arrow.png │ ├── tab_strikethrough.png │ ├── textfield-rename.png │ ├── unicode.png │ ├── up_down.png │ ├── word_wrap.png │ ├── word_wrap2.png │ ├── word_wrapped.png │ ├── zoom_in.png │ └── zoom_out.png ├── ScriptNotepad.csproj ├── Settings │ ├── FormDialogCustomSpellCheckerInfo.Designer.cs │ ├── FormDialogCustomSpellCheckerInfo.cs │ ├── FormDialogCustomSpellCheckerInfo.resx │ ├── FormSettings.Designer.cs │ ├── FormSettings.cs │ ├── FormSettings.resx │ ├── Settings.cs │ ├── SettingsOld.cs │ └── XmlNotepadPlusMarks │ │ └── MarkColorsHelper.cs ├── Test │ ├── FormTestThingDialog.Designer.cs │ ├── FormTestThingDialog.cs │ ├── FormTestThingDialog.resx │ ├── FormTestThings.Designer.cs │ ├── FormTestThings.cs │ └── FormTestThings.resx ├── UtilityClasses │ ├── ApplicationHelpers │ │ └── ApplicationActivateDeactivate.cs │ ├── Assembly │ │ └── TestFileIsAssembly.cs │ ├── Clipboard │ │ └── ClipboardTextHelper.cs │ ├── CodeDom │ │ ├── CSCodeDOMScriptRunnerLines.cs │ │ ├── CSCodeDOMScriptRunnerText.cs │ │ ├── CsScriptRunnerText.cs │ │ ├── FormScript.Designer.cs │ │ ├── FormScript.cs │ │ ├── FormScript.resx │ │ ├── IScriptRunner.cs │ │ ├── RoslynGlobals.cs │ │ └── RoslynScriptRunner.cs │ ├── ColorHelpers │ │ ├── FormPickAColor.Designer.cs │ │ ├── FormPickAColor.cs │ │ └── FormPickAColor.resx │ ├── Common │ │ ├── DataToolStripMenuItem.cs │ │ └── StatusStripComboItem.cs │ ├── DateTimeUtilities │ │ └── DateTimeHelpers.cs │ ├── Encodings │ │ ├── CharacterSets │ │ │ ├── CharacterSetComboBuilder.cs │ │ │ ├── CharacterSetMenuBuilder.cs │ │ │ └── EncodingCharacterSet.cs │ │ ├── DetectEncoding.cs │ │ ├── EncodingData.cs │ │ ├── EncodingExceptionEventArgs.cs │ │ ├── EncodingHelpers.cs │ │ ├── FileEncoding.cs │ │ └── TryMakeEncoding.cs │ ├── ErrorHandling │ │ └── ErrorHandlingBase.cs │ ├── EventArguments │ │ └── MainFormSizeEventArgs.cs │ ├── ExternalProcessInteraction │ │ ├── ApplicationProcess.cs │ │ ├── CommandPromptInteraction.cs │ │ └── WindowsExplorerInteraction.cs │ ├── GraphicUtils │ │ └── FontFamilyHelpers.cs │ ├── IO │ │ ├── DirectoryCrawler.cs │ │ └── DirectoryCrawlerEventArgs.cs │ ├── Installer │ │ └── WaitForProcess.cs │ ├── Keyboard │ │ ├── KeySendList.ExcludeLicense.cs │ │ └── KeyboardHelpers.cs │ ├── KeyboardShortcutHelper │ │ └── KeyboardMultiCombination.cs │ ├── LinesAndBinary │ │ └── FileLineType.cs │ ├── MathUtils │ │ └── MathUtils.cs │ ├── MenuHelpers │ │ ├── ContextMenuStyles.cs │ │ ├── RecentFilesMenuBuilder.cs │ │ ├── TabMenuBuilder.cs │ │ └── WinFormsFormMenuBuilder.cs │ ├── MiscForms │ │ ├── FormFileDiffView.Designer.cs │ │ ├── FormFileDiffView.cs │ │ ├── FormFileDiffView.resx │ │ ├── FormSnippetRunner.Designer.cs │ │ ├── FormSnippetRunner.cs │ │ └── FormSnippetRunner.resx │ ├── Process │ │ └── ProcessElevation.cs │ ├── ProgrammingLanguages │ │ ├── ProgrammingLanguageHelper.cs │ │ └── ProgrammingLanguageMenuClickEventArgs.cs │ ├── ScintillaHelpers │ │ ├── ScintillaFold.cs │ │ └── ScintillaLines.cs │ ├── ScintillaNETUtils │ │ └── ScintillaContextMenu.cs │ ├── ScintillaUtils │ │ ├── SelectionReplace.cs │ │ └── SetStyleBraceMatch.cs │ ├── SearchAndReplace │ │ ├── FormDialogSearchReplaceProgress.Designer.cs │ │ ├── FormDialogSearchReplaceProgress.cs │ │ ├── FormDialogSearchReplaceProgress.resx │ │ ├── FormDialogSearchReplaceProgressFiles.Designer.cs │ │ ├── FormDialogSearchReplaceProgressFiles.cs │ │ ├── FormDialogSearchReplaceProgressFiles.resx │ │ ├── FormSearchAndReplace.Designer.cs │ │ ├── FormSearchAndReplace.cs │ │ ├── FormSearchAndReplace.resx │ │ ├── FormSearchResultTree.Designer.cs │ │ ├── FormSearchResultTree.cs │ │ ├── FormSearchResultTree.resx │ │ ├── Misc │ │ │ ├── HighLight.cs │ │ │ └── SearchResultTreeViewClickEventArgs.cs │ │ ├── ProgressRequestActionEventArgs.cs │ │ └── ScintillaDocumentEventArgs.cs │ ├── Session │ │ ├── FormDialogSessionManage.Designer.cs │ │ ├── FormDialogSessionManage.cs │ │ └── FormDialogSessionManage.resx │ ├── SessionHelpers │ │ ├── CloseFormUtils.cs │ │ └── SessionMenuBuilder.cs │ ├── SpellCheck │ │ └── TabbedDocumentSpellCheck.cs │ ├── StreamHelpers │ │ └── StreamStringHelpers.cs │ ├── TextManipulation │ │ ├── Base64Convert.cs │ │ ├── BaseClasses │ │ │ ├── TextLinesManipulationCommandBase.cs │ │ │ ├── TextManipulationCallbackBase.cs │ │ │ └── TextManipulationCommandBase.cs │ │ ├── DuplicateLines.cs │ │ ├── Interfaces │ │ │ ├── IMethodName.cs │ │ │ ├── ITextLinesManipulationCommand.cs │ │ │ ├── ITextManipulationCallback.cs │ │ │ └── ITextManipulationCommand.cs │ │ ├── Json │ │ │ ├── JsonMultilineConvert.cs │ │ │ └── JsonSingleLineConvert.cs │ │ ├── JsonPrettify.cs │ │ ├── ScintillaLinesToStringList.cs │ │ ├── StringHelpers.cs │ │ ├── TextSorting │ │ │ ├── FormDialogQuerySortTextStyle.Designer.cs │ │ │ ├── FormDialogQuerySortTextStyle.cs │ │ │ ├── FormDialogQuerySortTextStyle.resx │ │ │ └── SortLines.cs │ │ ├── Xml │ │ │ ├── XmlMultilineConvert.cs │ │ │ ├── XmlSingleLineConvert.cs │ │ │ └── XmlTidy.cs │ │ ├── XmlPrettify.cs │ │ └── base64 │ │ │ ├── Base64ToString.cs │ │ │ └── StringToBase64.cs │ └── TextManipulationUtils │ │ └── WordWrapToSize.cs ├── VPKSoft.ico ├── WindowsRegistry │ └── OpenWith.reg └── notepad7.ico ├── ScriptNotepadOldDatabaseEntity ├── ScriptNotepadOldDatabaseEntity.csproj └── ScriptNotepadOldDbContext.cs ├── ScriptNotepad_icon.png ├── dictionaries └── en │ ├── en_US.aff │ └── en_US.dic └── todo_list.txt /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: nuget 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | time: "03:00" 8 | open-pull-requests-limit: 10 9 | ignore: 10 | - dependency-name: FluentMigrator 11 | versions: 12 | - 3.2.15 13 | - dependency-name: FluentMigrator.Runner.SqlServerCe 14 | versions: 15 | - 3.2.15 16 | - dependency-name: FluentMigrator.Extensions.SqlServer 17 | versions: 18 | - 3.2.15 19 | - dependency-name: FluentMigrator.Runner.Oracle 20 | versions: 21 | - 3.2.15 22 | - dependency-name: FluentMigrator.Extensions.Postgres 23 | versions: 24 | - 3.2.15 25 | - dependency-name: FluentMigrator.Runner.Postgres 26 | versions: 27 | - 3.2.15 28 | - dependency-name: FluentMigrator.Runner.Hana 29 | versions: 30 | - 3.2.15 31 | - dependency-name: FluentMigrator.Runner.SqlServer 32 | versions: 33 | - 3.2.15 34 | - dependency-name: FluentMigrator.Runner.Redshift 35 | versions: 36 | - 3.2.15 37 | - dependency-name: FluentMigrator.Runner 38 | versions: 39 | - 3.2.15 40 | - dependency-name: VPKSoft.PosLib 41 | versions: 42 | - 1.0.2 43 | - dependency-name: VPKSoft.ConfLib 44 | versions: 45 | - 1.0.4 46 | - dependency-name: VPKSoft.Utils 47 | versions: 48 | - 1.0.7 49 | -------------------------------------------------------------------------------- /.github/workflows/dotnet-desktop.yml: -------------------------------------------------------------------------------- 1 | name: .NET Desktop 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | 11 | build: 12 | environment: WinformsAppBuild 13 | strategy: 14 | matrix: 15 | configuration: [Release] 16 | 17 | runs-on: windows-2022 # For a list of available runner types, refer to 18 | # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on 19 | 20 | env: 21 | Solution_Name: ScriptNotepad.sln 22 | App_Project_Directory: ScriptNotepad 23 | App_Project_Path: ScriptNotepad\ScriptNotepad.csproj 24 | 25 | steps: 26 | - name: Checkout 27 | uses: actions/checkout@v2 28 | with: 29 | fetch-depth: 0 30 | 31 | # Install the .NET 8 workload 32 | - name: Install .NET 33 | uses: actions/setup-dotnet@v4 34 | with: 35 | dotnet-version: 8.0.x 36 | 37 | # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild 38 | - name: Setup MSBuild.exe 39 | uses: microsoft/setup-msbuild@v1.1 40 | 41 | # Restore the application to populate the obj folder with RuntimeIdentifiers 42 | - name: Restore the application 43 | run: msbuild $env:App_Project_Path /t:Restore /p:Configuration=$env:Configuration 44 | env: 45 | Configuration: ${{ matrix.configuration }} 46 | 47 | # Build the ScriptNotepad project 48 | - name: Build the ScriptNotepad project 49 | run: msbuild $env:App_Project_Path /p:Configuration=$env:Configuration 50 | -------------------------------------------------------------------------------- /CustomControls/CustomControls.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | net8.0-windows 6 | 7 | Library 8 | 9 | VPKSoft 10 | ScriptNotepad Custom Controls 11 | CustomControls 12 | Custom controls for the ScriptNotepad software. 13 | Copyright © VPKSoft 2022 14 | MIT 15 | https://www.vpksoft.net/2015-03-31-13-33-28/scriptnotepad 16 | ScriptNotepad_icon.png 17 | 18 | https://github.com/VPKSoft/ScriptNotepad 19 | git 20 | custom control winforms 21 | See: https://github.com/VPKSoft/ScriptNotepad 22 | 23 | 24 | 25 | C:\Files\GitHub\ScriptNotepad\CustomControls\CustomControls.xml 26 | 27 | 28 | 29 | C:\Files\GitHub\ScriptNotepad\CustomControls\CustomControls.xml 30 | 31 | 32 | 33 | 34 | True 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /CustomControls/ImageButton.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | text/microsoft-resx 50 | 51 | 52 | 2.0 53 | 54 | 55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 56 | 57 | 58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 59 | 60 | -------------------------------------------------------------------------------- /InstallerBaseWixSharp/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /InstallerBaseWixSharp/Files/FileResources/replace_this_ico.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/InstallerBaseWixSharp/Files/FileResources/replace_this_ico.ico -------------------------------------------------------------------------------- /InstallerBaseWixSharp/Files/Localization/SupportedLanguages.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/InstallerBaseWixSharp/Files/Localization/SupportedLanguages.cs -------------------------------------------------------------------------------- /InstallerBaseWixSharp/Files/Localization/TabDeliLocalization/tabdeli_messages.txt: -------------------------------------------------------------------------------- 1 | This is the simple tab-delimited localization file. 2 | As you can see only the "[]" tags and tab delimited key-value pairs matter for the localization. 3 | The tab-delimited text can also include comments, etc. by adding a new tab-delimited field. 4 | [en-US] 5 | txtDeleteLocalApplicationData Delete application data 6 | txtDeleteApplicationDataQuery Delete application settings and other data? 7 | txtStarAssociation Add open with menu 8 | txtStarAssociationQuery Add an open with this application to the file explorer menu? 9 | txtOpenWithShellMenu Open with ScriptNotepad 10 | 11 | [fi-FI] 12 | txtDeleteLocalApplicationData Poista sovelluksen tiedot 13 | txtDeleteApplicationDataQuery Poista sovelluksen asetukset ja muut tiedot? 14 | txtStarAssociation Lisää avaa sovelluksella valikko 15 | txtStarAssociationQuery Lisää avaa tällä sovelluksella valikko resurssien hallinnan valikkoon? 16 | txtOpenWithShellMenu Avaa sovelluksella ScriptNotepad -------------------------------------------------------------------------------- /InstallerBaseWixSharp/Files/Utilities/ApplicationName.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | MIT License 3 | 4 | Copyright(c) 2020 Petteri Kautonen 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | #> 24 | 25 | $files = Get-ChildItem -Recurse ..\..\* -Include "*.cs", "*.wxl", "*.txt" -Exclude "*.Designer.cs" 26 | 27 | # English (United States);Finnish (Finland) 28 | $languages = "0x00000102;0x00000118"; # see the Files\Localization\SupportedLanguages.cs file.. 29 | 30 | $locale_running_ids = $languages -split ";" 31 | 32 | # replace the #APPLICATION# tag in the installer project with specified application name 33 | foreach ($file in $files) 34 | { 35 | Write-Output (-join("Change application name for the file: ", $file.FullName, "...")) 36 | ((Get-Content -path $file.FullName -Raw) -replace '#APPLICATION#','ScriptNotepad') | Set-Content -Path $file.FullName 37 | Write-Output (-join("File handled: ", $file.FullName, ".")) 38 | } 39 | 40 | # Enabled the specified languages in the .\Files\Localization\SupportedLanguages.cs files.. 41 | $language_enumfile_contents = (Get-Content -path ..\..\Files\Localization\SupportedLanguages.cs -Raw) 42 | 43 | # loop through the localization entries specified by the running id number.. 44 | foreach ($locale_running_id in $locale_running_ids) 45 | { 46 | # set the specified language as enabled.. 47 | $language_enumfile_contents = $language_enumfile_contents.Replace(-join($locale_running_id, ")]"), -join ($locale_running_id, ", true", ")]")) 48 | } 49 | 50 | # update the .\Files\Localization\SupportedLanguages.cs file contents.. 51 | Set-Content -path ..\..\Files\Localization\SupportedLanguages.cs -Value $language_enumfile_contents -------------------------------------------------------------------------------- /InstallerBaseWixSharp/Files/Utilities/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "type": "PowerShell", 6 | "request": "launch", 7 | "name": "PowerShell Launch (current file)", 8 | "script": "${file}", 9 | "args": [], 10 | "cwd": "${file}" 11 | }, 12 | { 13 | "type": "PowerShell", 14 | "request": "attach", 15 | "name": "PowerShell Attach to Host Process", 16 | "processId": "${command.PickPSHostProcess}", 17 | "runspaceId": 1 18 | }, 19 | { 20 | "type": "PowerShell", 21 | "request": "launch", 22 | "name": "PowerShell Interactive Session", 23 | "cwd": "${workspaceRoot}" 24 | } 25 | ] 26 | } -------------------------------------------------------------------------------- /InstallerBaseWixSharp/Files/install_side.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/InstallerBaseWixSharp/Files/install_side.png -------------------------------------------------------------------------------- /InstallerBaseWixSharp/Files/install_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/InstallerBaseWixSharp/Files/install_top.png -------------------------------------------------------------------------------- /InstallerBaseWixSharp/Files/replace_this_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/InstallerBaseWixSharp/Files/replace_this_logo.png -------------------------------------------------------------------------------- /InstallerBaseWixSharp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/InstallerBaseWixSharp/Properties/AssemblyInfo.cs -------------------------------------------------------------------------------- /InstallerBaseWixSharp/nuget-package-logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/InstallerBaseWixSharp/nuget-package-logo.ico -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Petteri Kautonen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /PluginTemplate/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /PluginTemplate/FodyWeavers.xsd: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Used to control if the On_PropertyName_Changed feature is enabled. 12 | 13 | 14 | 15 | 16 | Used to change the name of the method that fires the notify event. This is a string that accepts multiple values in a comma separated form. 17 | 18 | 19 | 20 | 21 | Used to control if equality checks should be inserted. If false, equality checking will be disabled for the project. 22 | 23 | 24 | 25 | 26 | Used to control if equality checks should use the Equals method resolved from the base class. 27 | 28 | 29 | 30 | 31 | Used to control if equality checks should use the static Equals method resolved from the base class. 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. 40 | 41 | 42 | 43 | 44 | A comma-separated list of error codes that can be safely ignored in assembly verification. 45 | 46 | 47 | 48 | 49 | 'false' to turn off automatic generation of the XML Schema file. 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /PluginTemplate/PluginTemplate.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net8.0-windows 4 | PluginTemplate 5 | VPKSoft 6 | PluginTemplate 7 | A sample plugin for the ScriptNotepad 8 | Copyright © VPKSoft 2020 9 | 1.0.3.0 10 | 1.0.3.0 11 | latest 12 | bin\$(Configuration)\ 13 | true 14 | ::XCOPY /Y "$(TargetPath)" "%25LOCALAPPDATA%25\ScriptNotepad\Plugins" true 15 | 16 | ::XCOPY /Y "$(TargetPath)" "%25LOCALAPPDATA%25\ScriptNotepad\Plugins" 17 | 18 | ::XCOPY /Y "$(TargetPath)" "%25LOCALAPPDATA%25\ScriptNotepad\Plugins" 19 | 20 | 21 | 22 | full 23 | 24 | 25 | pdbonly 26 | 27 | 28 | ::XCOPY /Y "$(TargetPath)" "%25LOCALAPPDATA%25\ScriptNotepad\Plugins" 29 | 30 | MIT 31 | https://www.vpksoft.net/2015-03-31-13-33-28/scriptnotepad 32 | ScriptNotepad_icon.png 33 | https://github.com/VPKSoft/ScriptNotepad 34 | git 35 | 1.0.3 36 | ScriptNotepad plugin template sample 37 | 38 | 39 | 40 | 41 | True 42 | True 43 | Resources.resx 44 | 45 | 46 | 47 | 48 | True 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /PluginTemplate/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using System.Reflection; 28 | using System.Runtime.CompilerServices; 29 | using System.Runtime.InteropServices; 30 | 31 | // Setting ComVisible to false makes the types in this assembly not visible 32 | // to COM components. If you need to access a type in this assembly from 33 | // COM, set the ComVisible attribute to true on that type. 34 | [assembly: ComVisible(false)] 35 | 36 | // The following GUID is for the ID of the typelib if this project is exposed to COM 37 | [assembly: Guid("d68a1d7b-390d-4f3c-b38f-3c76fb0752e1")] 38 | -------------------------------------------------------------------------------- /PluginTemplate/Resources/VPKSoft.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/PluginTemplate/Resources/VPKSoft.ico -------------------------------------------------------------------------------- /PluginTemplate/Resources/VPKSoftLogo_App.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/PluginTemplate/Resources/VPKSoftLogo_App.png -------------------------------------------------------------------------------- /PluginTemplate/Resources/tab_deli_localization.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/PluginTemplate/Resources/tab_deli_localization.txt -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ScriptNotepad 2 | A tabbed notepad/text/code software with scripting support (C#) to manipulate a file's contents. The software is based on the [Scintilla.NET](https://github.com/VPKSoft/ScintillaNET) control. 3 | 4 | ## Features 5 | * Support for multiple programming languages for code folding and highlighing. 6 | * Support for spell checking via Hunspell dictionaries. 7 | * New files are automatically saved into a SQLite database; this software doesn't ask questions while closing. 8 | * Pure C#. 9 | * Open source, well documented source dode; fork, make PR or develop further on your own. 10 | * Localizable directly from the menu for your own language. (new languages are welcome!) 11 | * Highly customizable. 12 | * Possibility to export a code file to HTML. 13 | * Small size (installer: 30MB). 14 | * Session support; you may create a session for etc. one for common files, one for SQL files and so on.. 15 | * Currently supported locales: en-US, fi-FI 16 | * Support for plug-ins as .NET assemblies. A sample plugin is included (a modifed ROT-13 algorithm - suprise!). 17 | * A difference (diff) viewer both side-byside and as a list. 18 | 19 | _The main window_ 20 | ![image](https://user-images.githubusercontent.com/40712699/59549758-fcacd000-8f6a-11e9-9cd7-d55514d91936.png) 21 | 22 | _A script window with a script template_ 23 | ![image](https://user-images.githubusercontent.com/40712699/59549877-ae98cc00-8f6c-11e9-93ec-bc7eb442a821.png) 24 | 25 | ### Thanks to 26 | * [JetBrains](https://www.jetbrains.com/?from=ScriptNotepad) for their open source license(s). 27 | * [![.NET Desktop](https://github.com/VPKSoft/ScriptNotepad/actions/workflows/dotnet-desktop.yml/badge.svg)](https://github.com/VPKSoft/ScriptNotepad/actions/workflows/dotnet-desktop.yml) 28 | 29 | 30 | [![JetBrains](http://www.vpksoft.net/site/External/JetBrains/jetbrains.svg)](https://www.jetbrains.com/?from=ScriptNotepad) 31 | 32 | ## TODO 33 | * A lot ;-) 34 | 35 | ## Download 36 | [From the releases](https://github.com/VPKSoft/ScriptNotepad/releases) 37 | -------------------------------------------------------------------------------- /ScriptNotepad.sln.DotSettings: -------------------------------------------------------------------------------- 1 |  2 | True 3 | True -------------------------------------------------------------------------------- /ScriptNotepad/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /ScriptNotepad/Database/DirectAccess/CheckFluentMigrator.cs: -------------------------------------------------------------------------------- 1 | using System.Data.SQLite; 2 | 3 | namespace ScriptNotepad.Database.DirectAccess; 4 | 5 | /// 6 | /// A class to create the VersionInfo table in case the code-first database already exists. 7 | /// 8 | internal class CheckFluentMigrator 9 | { 10 | /// 11 | /// Marks the first database migration as done. 12 | /// 13 | /// The connection string fot the SQLite database table. 14 | public static void MarkMigration(string connectionString) 15 | { 16 | using var connection = new SQLiteConnection(connectionString); 17 | 18 | connection.Open(); 19 | 20 | using SQLiteCommand command = new SQLiteCommand( 21 | "CREATE TABLE IF NOT EXISTS VersionInfo (Version INTEGER NOT NULL, AppliedOn DATETIME, Description TEXT);", 22 | connection); 23 | 24 | command.ExecuteNonQuery(); 25 | 26 | command.CommandText = string.Join(Environment.NewLine, 27 | "INSERT INTO VersionInfo (Version, AppliedOn, Description)", 28 | // ReSharper disable once StringLiteralTypo, this is a function name in the SQLite.. 29 | "SELECT 20220101103253, strftime('%Y-%m-%dT%H:%M:%S','now'), 'InitialMigration'", 30 | "WHERE NOT EXISTS(SELECT * FROM VersionInfo WHERE Version = 20220101103253)"); 31 | command.ExecuteNonQuery(); 32 | } 33 | } -------------------------------------------------------------------------------- /ScriptNotepad/Database/Entity/Entities/CodeSnippet.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | #nullable enable 28 | 29 | using System.ComponentModel.DataAnnotations.Schema; 30 | using ScriptNotepad.Database.Entity.Enumerations; 31 | 32 | namespace ScriptNotepad.Database.Entity.Entities; 33 | 34 | /// 35 | /// A class for storing code snippets into the database. 36 | /// Implements the 37 | /// 38 | /// 39 | [Table("CodeSnippets")] 40 | public class CodeSnippet: IEntity 41 | { 42 | /// 43 | /// Gets or sets the identifier for the entity. 44 | /// 45 | public int Id { get; set; } 46 | 47 | /// 48 | /// Gets or sets the script's contents. 49 | /// 50 | public string? ScriptContents { get; set; } 51 | 52 | /// 53 | /// Gets or sets the name of the script. 54 | /// 55 | public string ScriptName { get; set; } = string.Empty; 56 | 57 | /// 58 | /// Gets or sets the date and time when the script was previously modified. 59 | /// 60 | public DateTime Modified { get; set; } 61 | 62 | /// 63 | /// Gets or sets the language type of the script snippet. 64 | /// 65 | public CodeSnippetLanguage ScriptLanguage { get; set; } 66 | 67 | /// 68 | /// Gets or sets the type of the script text manipulation. 69 | /// 70 | public ScriptSnippetType ScriptTextManipulationType { get; set; } 71 | 72 | /// 73 | /// Returns a that represents this instance. 74 | /// 75 | /// A that represents this instance. 76 | public override string ToString() 77 | { 78 | return ScriptName; 79 | } 80 | } 81 | 82 | #nullable restore 83 | -------------------------------------------------------------------------------- /ScriptNotepad/Database/Entity/Entities/FileContent.cs: -------------------------------------------------------------------------------- 1 | namespace ScriptNotepad.Database.Entity.Entities 2 | { 3 | /// 4 | /// A class representing a single file contents in the database. 5 | /// Implements the 6 | /// 7 | /// 8 | public class FileContent: IEntity 9 | { 10 | /// 11 | /// Gets or sets the identifier for the entity. 12 | /// 13 | public int Id { get; set; } 14 | 15 | /// 16 | /// Gets or sets the binary contents of a file. 17 | /// 18 | public byte[] BinaryContents { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ScriptNotepad/Database/Entity/Entities/FileSession.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | #nullable enable 28 | 29 | using System.ComponentModel.DataAnnotations.Schema; 30 | 31 | namespace ScriptNotepad.Database.Entity.Entities; 32 | 33 | /// 34 | /// A class for storing session(s) into the database. 35 | /// 36 | [Table("FileSessions")] 37 | public class FileSession: IEntity 38 | { 39 | /// 40 | /// Gets or sets the identifier for the entity. 41 | /// 42 | public int Id { get; set; } 43 | 44 | /// 45 | /// Gets or sets the name of a session. 46 | /// 47 | public string? SessionName { get; set; } 48 | 49 | /// 50 | /// Gets or sets the temporary file path in case the file system is used to cache the contents 51 | /// of the entities belonging to the session. 52 | /// 53 | public string? TemporaryFilePath { get; set; } 54 | 55 | /// 56 | /// Gets or sets a value indicating whether to use the file system to store the contents of the file instead of a database BLOB. 57 | /// 58 | public bool UseFileSystemOnContents { get; set; } 59 | 60 | /// 61 | /// Returns a that represents this instance. 62 | /// 63 | public override string? ToString() 64 | { 65 | return SessionName; 66 | } 67 | } 68 | 69 | #nullable restore 70 | -------------------------------------------------------------------------------- /ScriptNotepad/Database/Entity/Entities/MiscellaneousParameter.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2022 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using System.ComponentModel.DataAnnotations.Schema; 28 | 29 | #nullable enable 30 | 31 | namespace ScriptNotepad.Database.Entity.Entities; 32 | 33 | /// 34 | /// A class for miscellaneous entries, I.e. history data entered into database. 35 | /// Implements the 36 | /// 37 | /// 38 | [Table("MiscellaneousParameters")] 39 | public class MiscellaneousParameter: IEntity 40 | { 41 | /// 42 | /// Gets or sets the identifier for the entity. 43 | /// 44 | /// The identifier. 45 | public int Id { get; set; } 46 | 47 | /// 48 | /// Gets or sets the when the entry was added to the database. 49 | /// 50 | /// The when the entry was added to the database. 51 | public DateTime Added { get; set; } 52 | 53 | /// 54 | /// Gets or sets the value. 55 | /// 56 | /// The value. 57 | public string Value { get; set; } = string.Empty; 58 | } 59 | 60 | #nullable restore 61 | -------------------------------------------------------------------------------- /ScriptNotepad/Database/Entity/Entities/MiscellaneousTextEntry.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using System.ComponentModel.DataAnnotations.Schema; 28 | using ScriptNotepad.Database.Entity.Enumerations; 29 | 30 | #nullable enable 31 | 32 | namespace ScriptNotepad.Database.Entity.Entities; 33 | 34 | /// 35 | /// A class for storing miscellaneous text data into the database. 36 | /// Implements the 37 | /// 38 | /// 39 | [Table("MiscellaneousTextEntries")] 40 | public class MiscellaneousTextEntry: IEntity 41 | { 42 | /// 43 | /// Gets or sets the identifier for the entity. 44 | /// 45 | public int Id { get; set; } 46 | 47 | /// 48 | /// Gets or sets the session identifier. 49 | /// 50 | /// The session identifier. 51 | public int SessionId { get; set; } 52 | 53 | /// 54 | /// Gets or sets the text value. 55 | /// 56 | public string TextValue { get; set; } = string.Empty; 57 | 58 | /// 59 | /// Gets or sets the type of the text. 60 | /// 61 | public MiscellaneousTextType TextType { get; set; } 62 | 63 | /// 64 | /// Gets or sets the added date and time when the entry was added or updated to the database. 65 | /// 66 | public DateTime Added { get; set; } 67 | 68 | /// 69 | /// Gets or sets the this miscellaneous text data belongs to. 70 | /// 71 | [ForeignKey(nameof(SessionId))] 72 | public virtual FileSession? Session { get; set; } 73 | 74 | /// 75 | /// Returns a that represents this instance. 76 | /// 77 | /// A that represents this instance. 78 | public override string ToString() 79 | { 80 | return TextValue; 81 | } 82 | } 83 | 84 | #nullable restore -------------------------------------------------------------------------------- /ScriptNotepad/Database/Entity/Entities/RecentFile.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | #nullable enable 28 | 29 | using System.ComponentModel.DataAnnotations.Schema; 30 | 31 | namespace ScriptNotepad.Database.Entity.Entities; 32 | 33 | /// 34 | /// A class for storing recent file data into the database. 35 | /// Implements the 36 | /// 37 | /// 38 | [Table("RecentFiles")] 39 | public class RecentFile: IEntity 40 | { 41 | /// 42 | /// Gets or sets the identifier for the entity. 43 | /// 44 | public int Id { get; set; } 45 | 46 | /// 47 | /// Gets or sets the session identifier. 48 | /// 49 | /// The session identifier. 50 | public int SessionId { get; set; } 51 | 52 | /// 53 | /// Gets or sets the full file name with path. 54 | /// 55 | public string FileNameFull { get; set; } = string.Empty; 56 | 57 | /// 58 | /// Gets or sets the file name without path. 59 | /// 60 | public string FileName { get; set; } = string.Empty; 61 | 62 | /// 63 | /// Gets or sets the full path for the file. 64 | /// 65 | public string? FilePath { get; set; } 66 | 67 | /// 68 | /// Gets or sets the date and time when the file was closed in the editor. 69 | /// 70 | public DateTime ClosedDateTime { get; set; } 71 | 72 | /// 73 | /// Gets or sets the session the recent file belongs to. 74 | /// 75 | [ForeignKey(nameof(SessionId))] 76 | public virtual FileSession? Session { get; set; } 77 | 78 | /// 79 | /// Gets or sets a string representing the encoding of the file save. 80 | /// 81 | public string EncodingAsString { get; set; } = "utf-8;65001;True;False;False"; 82 | 83 | /// 84 | /// Returns a that represents this instance. 85 | /// 86 | public override string ToString() 87 | { 88 | return FileNameFull; 89 | } 90 | } 91 | 92 | #nullable restore -------------------------------------------------------------------------------- /ScriptNotepad/Database/Entity/Entities/SoftwareLicense.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using System.ComponentModel.DataAnnotations.Schema; 28 | 29 | #nullable enable 30 | 31 | namespace ScriptNotepad.Database.Entity.Entities; 32 | 33 | /// 34 | /// A class to save the license of the software to the database. 35 | /// Implements the 36 | /// 37 | [Table("SoftwareLicenses")] 38 | public class SoftwareLicense: IEntity 39 | { 40 | /// 41 | /// Gets or sets the identifier for the entity. 42 | /// 43 | public int Id { get; set; } 44 | 45 | /// 46 | /// Gets or sets the license text. 47 | /// 48 | public string LicenseText { get; set; } = string.Empty; 49 | 50 | /// 51 | /// Gets or sets the license SPDX identifier. 52 | /// See: https://spdx.org/licenses/ 53 | /// 54 | public string LicenseSpdxIdentifier { get; set; } = string.Empty; 55 | } 56 | 57 | #nullable restore -------------------------------------------------------------------------------- /ScriptNotepad/Database/Entity/Enumerations/CodeSnippetLanguage.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | namespace ScriptNotepad.Database.Entity.Enumerations; 28 | 29 | /// 30 | /// An enumeration for a code snippet language. 31 | /// 32 | public enum CodeSnippetLanguage 33 | { 34 | /// 35 | /// The C# programming language. 36 | /// 37 | Cs, 38 | } -------------------------------------------------------------------------------- /ScriptNotepad/Database/Entity/Enumerations/MiscellaneousTextType.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using ScriptNotepad.Database.Entity.Entities; 28 | 29 | namespace ScriptNotepad.Database.Entity.Enumerations; 30 | 31 | /// 32 | /// An enumeration for the type. 33 | /// 34 | public enum MiscellaneousTextType 35 | { 36 | /// 37 | /// Indicates a path/directory in the file system. 38 | /// 39 | Path = 0, 40 | 41 | /// 42 | /// Indicates a file extension list delimited with semicolon (;); I.e. *.txt;*.cs. 43 | /// 44 | FileExtensionList = 1, 45 | 46 | /// 47 | /// The regular expression sorting within the custom sort dialog. 48 | /// 49 | RegexSorting = 2, 50 | } -------------------------------------------------------------------------------- /ScriptNotepad/Database/Entity/Enumerations/ScriptSnippetType.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | namespace ScriptNotepad.Database.Entity.Enumerations; 28 | 29 | /// 30 | /// An enumeration for the script snippet text manipulation type. 31 | /// 32 | public enum ScriptSnippetType 33 | { 34 | /// 35 | /// The text is manipulated as a single string. 36 | /// 37 | Text, 38 | 39 | /// 40 | /// The text is manipulated as a collection of lines. 41 | /// 42 | Lines, 43 | } -------------------------------------------------------------------------------- /ScriptNotepad/Database/Entity/Enumerations/SearchAndReplaceSearchType.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | namespace ScriptNotepad.Database.Entity.Enumerations; 28 | 29 | /// 30 | /// An enumeration for a text search type. 31 | /// 32 | [Flags] 33 | public enum SearchAndReplaceSearchType 34 | { 35 | /// 36 | /// A normal text search. 37 | /// 38 | Normal = 1, 39 | 40 | /// 41 | /// An extended text search. 42 | /// 43 | Extended = 2, 44 | 45 | /// 46 | /// A text search using regular expressions. 47 | /// 48 | RegularExpression = 4, 49 | 50 | /// 51 | /// The simple text search with some additional extended formatting possibilities. 52 | /// 53 | SimpleExtended = 8, 54 | 55 | /// 56 | /// All the possibilities combined. 57 | /// 58 | All = Normal | Extended | RegularExpression | SimpleExtended, 59 | } -------------------------------------------------------------------------------- /ScriptNotepad/Database/Entity/Enumerations/SearchAndReplaceType.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | namespace ScriptNotepad.Database.Entity.Enumerations; 28 | 29 | /// 30 | /// An enumeration for a type of a search. 31 | /// 32 | public enum SearchAndReplaceType 33 | { 34 | /// 35 | /// The type of the search and replace history is search. 36 | /// 37 | Search, 38 | 39 | /// 40 | /// The type of the search and replace history is replace. 41 | /// 42 | Replace, 43 | } -------------------------------------------------------------------------------- /ScriptNotepad/Database/Entity/IEntity.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | namespace ScriptNotepad.Database.Entity; 28 | 29 | /// 30 | /// An interface for an entity. 31 | /// 32 | interface IEntity 33 | { 34 | /// 35 | /// Gets or sets the identifier for the entity. 36 | /// 37 | int Id { get; set; } 38 | } -------------------------------------------------------------------------------- /ScriptNotepad/Database/Entity/Migrations/02_FoldSave.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2022 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using System; 28 | using FluentMigrator; 29 | 30 | namespace ScriptNotepad.Database.Entity.Migrations 31 | { 32 | /// 33 | /// Add a FoldSave column to the FileSave table. 34 | /// Implements the 35 | /// 36 | /// 37 | [Migration(2022_0325_17_17_49)] 38 | public class FoldSave: Migration 39 | { 40 | /// 41 | /// Collect the UP migration expressions 42 | /// 43 | /// 44 | public override void Up() 45 | { 46 | this.Alter.Table("FileSaves") 47 | .AddColumn("FoldSave").AsString().WithDefaultValue(string.Empty); 48 | } 49 | 50 | /// 51 | /// Collects the DOWN migration expressions 52 | /// 53 | /// 54 | public override void Down() 55 | { 56 | Delete.Column("FoldSave").FromTable("FileSaves"); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /ScriptNotepad/Database/Entity/Migrations/03_FixEmptySession.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2022 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using System; 28 | using FluentMigrator; 29 | 30 | namespace ScriptNotepad.Database.Entity.Migrations 31 | { 32 | /// 33 | /// Fixes the empty session bug from the database. 34 | /// Implements the 35 | /// 36 | /// 37 | [Migration(2022_0609_21_15_38)] 38 | public class FixEmptySession : Migration 39 | { 40 | /// 41 | /// Collect the UP migration expressions 42 | /// 43 | public override void Up() 44 | { 45 | Execute.Sql("DELETE FROM FileSessions WHERE SessionName IS NULL"); 46 | } 47 | 48 | /// 49 | /// Collects the DOWN migration expressions 50 | /// 51 | /// 52 | public override void Down() 53 | { 54 | // nothing to do here.. 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /ScriptNotepad/Database/Helpers/DatabaseUtilities.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2022 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using System.Linq; 28 | using ScriptNotepad.Database.Entity.Context; 29 | using ScriptNotepad.Database.Entity.Entities; 30 | 31 | namespace ScriptNotepad.Database.Helpers; 32 | 33 | /// 34 | /// Some database utilities for the . 35 | /// 36 | public static class DatabaseUtilities 37 | { 38 | /// 39 | /// Sets the miscellaneous parameter to the database. 40 | /// 41 | /// The database context. 42 | /// The value to set. 43 | /// true if the value is already set, false otherwise. 44 | public static bool SetMiscellaneousParameter(this ScriptNotepadDbContext context, string value) 45 | { 46 | if (!context.MiscellaneousParameters.Any(f => f.Value.Equals(value, StringComparison.Ordinal))) 47 | { 48 | return true; 49 | } 50 | 51 | context.MiscellaneousParameters.Add(new MiscellaneousParameter {Added = DateTime.Now, Value = value, }); 52 | context.SaveChanges(); 53 | return false; 54 | } 55 | } -------------------------------------------------------------------------------- /ScriptNotepad/Editor/EntityHelpers/DataHolders/DataHolderIndexer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ScriptNotepad.Editor.EntityHelpers.DataHolders; 4 | 5 | /// 6 | /// A class to hold a get indexer for type of . 7 | /// 8 | /// The class which is to be indexed. 9 | public class DataHolderIndexer where T: class 10 | { 11 | /// 12 | /// Gets the values for the this indexer. 13 | /// 14 | /// The values for the this indexer. 15 | private Dictionary Values { get; } = new(); 16 | 17 | /// 18 | /// Gets the with the specified key. 19 | /// 20 | /// The key. 21 | /// The instance with the specified key. 22 | public T this[int key] 23 | { 24 | get 25 | { 26 | if (!Values.ContainsKey(key)) 27 | { 28 | Values.Add(key, Activator.CreateInstance()); 29 | } 30 | 31 | return Values[key]; 32 | } 33 | } 34 | 35 | /// 36 | /// Removes the instance with a specified key. 37 | /// 38 | /// The key. 39 | public void Remove(int key) 40 | { 41 | Values.Remove(key); 42 | } 43 | } -------------------------------------------------------------------------------- /ScriptNotepad/Editor/EntityHelpers/DataHolders/FileSaveData.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using ScriptNotepad.Database.Entity.Entities; 3 | using ScriptNotepad.UtilityClasses.LinesAndBinary; 4 | 5 | namespace ScriptNotepad.Editor.EntityHelpers.DataHolders; 6 | 7 | /// 8 | /// Additional data for the entity. 9 | /// 10 | public class FileSaveData 11 | { 12 | /// 13 | /// Gets or sets the value if the property has been set once. 14 | /// 15 | public bool PreviousDbModifiedIsSet { get; set; } 16 | 17 | /// 18 | /// Gets or sets the value indicating when the file was modified in the database. 19 | /// 20 | public DateTime PreviousDbModified { get; set; } = DateTime.MinValue; 21 | 22 | /// 23 | /// Gets or sets a value indicating whether the user should be queried of to reload the changed document from the file system. 24 | /// 25 | public bool ShouldQueryDiskReload { get; set; } = true; 26 | 27 | /// 28 | /// Gets or sets the previous encodings of the file save for undo possibility. 29 | /// Redo possibility does not exist. 30 | /// 31 | public List PreviousEncodings { get; set; } = new(); 32 | 33 | /// 34 | /// A text describing the file line ending type(s) of the document. 35 | /// 36 | public string FileEndingText { get; set; } = string.Empty; 37 | 38 | /// 39 | /// Gets or sets the file line types and their descriptions. 40 | /// 41 | /// The file line types and their descriptions. 42 | public IEnumerable> FileLineTypesInternal { get; set; } = 43 | new List>(); 44 | 45 | /// 46 | /// Gets or sets the value indicating when the file was modified in the database. 47 | /// 48 | public DateTime DbModified { get; set; } = DateTime.MinValue; 49 | } -------------------------------------------------------------------------------- /ScriptNotepad/Editor/EntityHelpers/FileSessionHelper.cs: -------------------------------------------------------------------------------- 1 | #nullable enable 2 | using ScriptNotepad.Database.Entity.Entities; 3 | 4 | namespace ScriptNotepad.Editor.EntityHelpers; 5 | 6 | /// 7 | /// Helper methods for the entity. 8 | /// 9 | public static class FileSessionHelper 10 | { 11 | /// 12 | /// Generates, creates and sets a random path for the property in case the property value is null. 13 | /// 14 | /// The instance. 15 | /// The generated or already existing path for temporary files for the session. 16 | public static string? SetRandomPath(this FileSession fileSession) 17 | { 18 | if (fileSession.TemporaryFilePath == null && fileSession.UseFileSystemOnContents) 19 | { 20 | var path = Path.Combine(ApplicationDataDirectory, Path.GetRandomFileName()); 21 | if (!Directory.Exists(path)) 22 | { 23 | Directory.CreateDirectory(path); 24 | } 25 | 26 | fileSession.TemporaryFilePath = path; 27 | 28 | return path; 29 | } 30 | 31 | if (!fileSession.UseFileSystemOnContents) 32 | { 33 | fileSession.TemporaryFilePath = null; 34 | } 35 | 36 | return fileSession.TemporaryFilePath; 37 | } 38 | 39 | /// 40 | /// Gets or sets the application data directory for caching files in case the property is set to true. 41 | /// 42 | public static string ApplicationDataDirectory { get; set; } = string.Empty; 43 | } -------------------------------------------------------------------------------- /ScriptNotepad/Editor/Utility/ModelHelpers/FileSessionHelper.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using System.Linq; 28 | using ScriptNotepad.Database.Entity.Context; 29 | using ScriptNotepad.Database.Entity.Entities; 30 | using ScriptNotepad.UtilityClasses.ErrorHandling; 31 | 32 | namespace ScriptNotepad.Editor.Utility.ModelHelpers; 33 | 34 | /// 35 | /// A class to help with entities. 36 | /// Implements the 37 | /// 38 | /// 39 | public class FileSessionHelper: ErrorHandlingBase 40 | { 41 | /// 42 | /// Deletes the entire session from the database context. 43 | /// 44 | /// The session to delete. 45 | /// true if the operation was successful, false otherwise. 46 | public static bool DeleteEntireSession(FileSession session) 47 | { 48 | try 49 | { 50 | var context = ScriptNotepadDbContext.DbContext; 51 | 52 | context.FileSaves.RemoveRange(context.FileSaves.Where(f => f.Session.SessionName == session.SessionName)); 53 | context.MiscellaneousTextEntries.RemoveRange(context.MiscellaneousTextEntries.Where(f => f.Session.SessionName == session.SessionName)); 54 | context.RecentFiles.RemoveRange(context.RecentFiles.Where(f => f.Session.SessionName == session.SessionName)); 55 | 56 | session = context.FileSessions.FirstOrDefault(f => f.SessionName == session.SessionName); 57 | 58 | if (session != null) 59 | { 60 | context.FileSessions.Remove(session); 61 | } 62 | 63 | context.SaveChanges(); 64 | return true; // success.. 65 | } 66 | catch (Exception ex) 67 | { 68 | // log the exception.. 69 | ExceptionLogAction?.Invoke(ex); 70 | return false; // failure.. 71 | } 72 | } 73 | } -------------------------------------------------------------------------------- /ScriptNotepad/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /ScriptNotepad/FormHexEdit.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using System.Windows.Forms; 28 | using System.Windows.Media; 29 | using VPKSoft.LangLib; 30 | using VPKSoft.PosLib; 31 | using WpfHexaEditor.Core; 32 | 33 | namespace ScriptNotepad; 34 | 35 | /// 36 | /// A hex editor for binary files. 37 | /// 38 | /// 39 | public partial class FormHexEdit : DBLangEngineWinforms 40 | { 41 | /// 42 | /// Initializes a new instance of the class. 43 | /// 44 | public FormHexEdit() 45 | { 46 | // Add this form to be positioned.. 47 | PositionForms.Add(this, PositionCore.SizeChangeMode.MoveTopLeft); 48 | 49 | // add positioning.. 50 | PositionCore.Bind(ApplicationType.WinForms); 51 | 52 | InitializeComponent(); 53 | 54 | DBLangEngine.DBName = "lang.sqlite"; // Do the VPKSoft.LangLib == translation.. 55 | 56 | if (Utils.ShouldLocalize() != null) 57 | { 58 | DBLangEngine.InitializeLanguage("ScriptNotepad.Localization.Messages", Utils.ShouldLocalize(), false); 59 | return; // After localization don't do anything more.. 60 | } 61 | 62 | hexEditor.ForegroundSecondColor = Brushes.Blue; 63 | } 64 | 65 | private void toolStripButton1_Click(object sender, EventArgs e) 66 | { 67 | var fileDialog = new OpenFileDialog(); 68 | 69 | if (fileDialog.ShowDialog() == DialogResult.OK && File.Exists(fileDialog.FileName)) 70 | hexEditor.FileName = fileDialog.FileName; 71 | } 72 | 73 | private void toolStripButton2_Click(object sender, EventArgs e) 74 | { 75 | var fileDialog = new OpenFileDialog(); 76 | 77 | if (fileDialog.ShowDialog() == DialogResult.OK && File.Exists(fileDialog.FileName)) 78 | { 79 | hexEditor.LoadTblFile(fileDialog.FileName); 80 | hexEditor.TypeOfCharacterTable = CharacterTableType.TblFile; 81 | } 82 | } 83 | } -------------------------------------------------------------------------------- /ScriptNotepad/Icons/astonished.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Icons/astonished.ico -------------------------------------------------------------------------------- /ScriptNotepad/Icons/notepad0.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Icons/notepad0.ico -------------------------------------------------------------------------------- /ScriptNotepad/Icons/notepad1.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Icons/notepad1.ico -------------------------------------------------------------------------------- /ScriptNotepad/Icons/notepad2.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Icons/notepad2.ico -------------------------------------------------------------------------------- /ScriptNotepad/Icons/notepad3.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Icons/notepad3.ico -------------------------------------------------------------------------------- /ScriptNotepad/Icons/notepad4.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Icons/notepad4.ico -------------------------------------------------------------------------------- /ScriptNotepad/Icons/notepad5.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Icons/notepad5.ico -------------------------------------------------------------------------------- /ScriptNotepad/Icons/notepad6.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Icons/notepad6.ico -------------------------------------------------------------------------------- /ScriptNotepad/Icons/notepad7.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Icons/notepad7.ico -------------------------------------------------------------------------------- /ScriptNotepad/Installer/languages.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Installer/languages.ico -------------------------------------------------------------------------------- /ScriptNotepad/Installer/license.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright(c) 2019 Petteri Kautonen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /ScriptNotepad/Installer/make_installer.bat: -------------------------------------------------------------------------------- 1 | :: MIT License 2 | :: 3 | :: Copyright(c) 2019 Petteri Kautonen 4 | :: 5 | :: Permission is hereby granted, free of charge, to any person obtaining a copy 6 | :: of this software and associated documentation files (the "Software"), to deal 7 | :: in the Software without restriction, including without limitation the rights 8 | :: to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | :: copies of the Software, and to permit persons to whom the Software is 10 | :: furnished to do so, subject to the following conditions: 11 | :: 12 | :: The above copyright notice and this permission notice shall be included in all 13 | :: copies or substantial portions of the Software. 14 | :: 15 | :: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | :: IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | :: FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | :: AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | :: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | :: OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | :: SOFTWARE. 22 | 23 | del ..\bin\Release\*.pdb 24 | del ..\bin\Release\*.xml 25 | ::del ..\bin\Release\*.config 26 | "c:\Program Files (x86)\NSIS\makensisw.exe" .\setup_scriptnotepad.nsi 27 | pause 28 | 29 | -------------------------------------------------------------------------------- /ScriptNotepad/Installer/un_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Installer/un_icon.ico -------------------------------------------------------------------------------- /ScriptNotepad/Localization/Forms/FormLocalizationHelper.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ScriptNotepad.Localization.Forms 2 | { 3 | partial class FormLocalizationHelper 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.lbNotification = new System.Windows.Forms.Label(); 32 | this.SuspendLayout(); 33 | // 34 | // lbNotification 35 | // 36 | this.lbNotification.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 37 | | System.Windows.Forms.AnchorStyles.Left) 38 | | System.Windows.Forms.AnchorStyles.Right))); 39 | this.lbNotification.Font = new System.Drawing.Font("Microsoft Sans Serif", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 40 | this.lbNotification.Location = new System.Drawing.Point(12, 9); 41 | this.lbNotification.Name = "lbNotification"; 42 | this.lbNotification.Size = new System.Drawing.Size(390, 148); 43 | this.lbNotification.TabIndex = 0; 44 | this.lbNotification.Text = "This form is not intented to ever be visible."; 45 | // 46 | // FormLocalizationHelper 47 | // 48 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 49 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 50 | this.ClientSize = new System.Drawing.Size(414, 166); 51 | this.Controls.Add(this.lbNotification); 52 | this.Name = "FormLocalizationHelper"; 53 | this.Text = "FormLocalizationHelper"; 54 | this.ResumeLayout(false); 55 | 56 | } 57 | 58 | #endregion 59 | 60 | private System.Windows.Forms.Label lbNotification; 61 | } 62 | } -------------------------------------------------------------------------------- /ScriptNotepad/Localization/IStaticMessageProvider.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2022 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using VPKSoft.LangLib; 28 | 29 | namespace ScriptNotepad.Localization; 30 | 31 | /// 32 | /// An interface providing access to the messages. 33 | /// 34 | public interface IStaticMessageProvider 35 | { 36 | /// 37 | /// Gets the message by the specified name localized to the current software culture setting. 38 | /// 39 | /// Name of the message. 40 | /// The default message to fall back into if a localized message was not found. 41 | /// A localized value for the specified message name. 42 | string GetMessage(string messageName, string defaultMessage); 43 | } -------------------------------------------------------------------------------- /ScriptNotepad/Localization/Notepad++LanguageNames.txt: -------------------------------------------------------------------------------- 1 | "Normal text", "Normal text file" 2 | "PHP", "PHP Hypertext Preprocessor file" 3 | "C", "C source file" 4 | "C++", "C++ source file" 5 | "C#", "C# source file" 6 | "Objective-C", "Objective-C source file" 7 | "Java", "Java source file" 8 | "RC", "Windows Resource file" 9 | "HTML", "Hyper Text Markup Language file" 10 | "XML", "eXtensible Markup Language file" 11 | "Makefile", "Makefile" 12 | "Pascal", "Pascal source file" 13 | "Batch", "Batch file" 14 | "ini", "MS ini file" 15 | "NFO", "MSDOS Style/ASCII Art" 16 | "udf", "User Defined language file" 17 | "ASP", "Active Server Pages script file" 18 | "SQL", "Structured Query Language file" 19 | "Visual Basic", "Visual Basic file" 20 | "JavaScript", "JavaScript file" 21 | "CSS", "Cascade Style Sheets File" 22 | "Perl", "Perl source file" 23 | "Python", "Python file" 24 | "Lua", "Lua source File" 25 | "TeX", "TeX file" 26 | "Fortran free form", "Fortran free form source file" 27 | "Shell", "Unix script file" 28 | "ActionScript", "Flash ActionScript file" 29 | "NSIS", "Nullsoft Scriptable Install System script file" 30 | "TCL", "Tool Command Language file" 31 | "Lisp", "List Processing language file" 32 | "Scheme", "Scheme file" 33 | "Assembly", "Assembly language source file" 34 | "Diff", "Diff file" 35 | "Properties file", "Properties file" 36 | "PostScript", "PostScript file" 37 | "Ruby", "Ruby file" 38 | "Smalltalk", "Smalltalk file" 39 | "VHDL", "VHSIC Hardware Description Language file" 40 | "KiXtart", "KiXtart file" 41 | "AutoIt", "AutoIt" 42 | "CAML", "Categorical Abstract Machine Language" 43 | "Ada", "Ada file" 44 | "Verilog", "Verilog file" 45 | "MATLAB", "MATrix LABoratory" 46 | "Haskell", "Haskell" 47 | "Inno Setup", "Inno Setup script" 48 | "Internal Search", "Internal Search" 49 | "CMake", "CMake file" 50 | "YAML", "YAML Ain't Markup Language" 51 | "COBOL", "COmmon Business Oriented Language" 52 | "Gui4Cli", "Gui4Cli file" 53 | "D", "D programming language" 54 | "PowerShell", "Windows PowerShell" 55 | "R", "R programming language" 56 | "JSP", "JavaServer Pages script file" 57 | "CoffeeScript", "CoffeeScript file" 58 | "json", "JSON file" 59 | "JavaScript", "JavaScript file" 60 | "Fortran fixed form", "Fortran fixed form source file" 61 | "BaanC", "BaanC File" 62 | "S-Record", "Motorola S-Record binary data" 63 | "Intel HEX", "Intel HEX binary data" 64 | "Tektronix extended HEX", "Tektronix extended HEX binary data" 65 | "Swift", "Swift file" 66 | "ASN.1", "Abstract Syntax Notation One file" 67 | "AviSynth", "AviSynth scripts files" 68 | "BlitzBasic", "BlitzBasic file" 69 | "PureBasic", "PureBasic file" 70 | "FreeBasic", "FreeBasic file" 71 | "Csound", "Csound file" 72 | "Erlang", "Erlang file" 73 | "ESCRIPT", "ESCRIPT file" 74 | "Forth", "Forth file" 75 | "LaTeX", "LaTeX file" 76 | "MMIXAL", "MMIXAL file" 77 | "Nimrod", "Nimrod file" 78 | "Nncrontab", "extended crontab file" 79 | "OScript", "OScript source file" 80 | "REBOL", "REBOL file" 81 | "registry", "registry file" 82 | "Rust", "Rust file" 83 | "Spice", "spice file" 84 | "txt2tags", "txt2tags file" 85 | "Visual Prolog", "Visual Prolog file" 86 | "External", "External" -------------------------------------------------------------------------------- /ScriptNotepad/Localization/SQLiteDatabase/CopyLang.bat: -------------------------------------------------------------------------------- 1 | :: MIT License 2 | :: 3 | :: Copyright(c) 2019 Petteri Kautonen 4 | :: 5 | :: Permission is hereby granted, free of charge, to any person obtaining a copy 6 | :: of this software and associated documentation files (the "Software"), to deal 7 | :: in the Software without restriction, including without limitation the rights 8 | :: to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | :: copies of the Software, and to permit persons to whom the Software is 10 | :: furnished to do so, subject to the following conditions: 11 | :: 12 | :: The above copyright notice and this permission notice shall be included in all 13 | :: copies or substantial portions of the Software. 14 | :: 15 | :: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | :: IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | :: FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | :: AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | :: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | :: OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | :: SOFTWARE. 22 | 23 | copy /y "%LOCALAPPDATA%\ScriptNotepad\lang.sqlite" .\ 24 | pause -------------------------------------------------------------------------------- /ScriptNotepad/Localization/SQLiteDatabase/lang.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Localization/SQLiteDatabase/lang.sqlite -------------------------------------------------------------------------------- /ScriptNotepad/Localization/StaticMessageLocalizationProvider.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2022 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using VPKSoft.LangLib; 28 | 29 | namespace ScriptNotepad.Localization; 30 | 31 | /// 32 | /// A class to provide static localized messages from the . 33 | /// Implements the 34 | /// 35 | /// 36 | public class StaticMessageLocalizationProvider: IStaticMessageProvider 37 | { 38 | /// 39 | /// Prevents a default instance of the class from being created. 40 | /// 41 | private StaticMessageLocalizationProvider() 42 | { 43 | Instance = this; 44 | } 45 | 46 | /// 47 | /// Gets or sets the of this class. 48 | /// 49 | /// The instance. 50 | public static StaticMessageLocalizationProvider Instance { get; set; } = new(); 51 | 52 | /// 53 | /// Gets the message by the specified name localized to the current software culture setting. 54 | /// 55 | /// Name of the message. 56 | /// The default message to fall back into if a localized message was not found. 57 | /// A localized value for the specified message name. 58 | public string GetMessage(string messageName, string defaultMessage) 59 | { 60 | return DBLangEngine.GetStatMessage(messageName, defaultMessage); 61 | } 62 | } -------------------------------------------------------------------------------- /ScriptNotepad/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using System.Runtime.InteropServices; 28 | 29 | // Setting ComVisible to false makes the types in this assembly not visible 30 | // to COM components. If you need to access a type in this assembly from 31 | // COM, set the ComVisible attribute to true on that type. 32 | [assembly: ComVisible(false)] 33 | 34 | // The following GUID is for the ID of the typelib if this project is exposed to COM 35 | [assembly: Guid("6b770702-6e99-439c-9679-61d048b3b876")] 36 | -------------------------------------------------------------------------------- /ScriptNotepad/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ScriptNotepad.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ScriptNotepad/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ScriptNotepad/Resources/About.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/About.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/CSharp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/CSharp.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/Copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/Copy.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/Delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/Delete.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/Down_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/Down_2.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/Erase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/Erase.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/Fast-rewind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/Fast-rewind.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/Find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/Find.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/History.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/History.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/New document.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/New document.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/Paste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/Paste.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/Play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/Play.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/Playback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/Playback.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/Redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/Redo.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/Save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/Save.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/SaveAs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/SaveAs.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/SaveWithDialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/SaveWithDialog.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/Script.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/Script.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/Undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/Undo.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/Up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/Up.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/arrow-down-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/arrow-down-2.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/arrow-up-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/arrow-up-2.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/arrow_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/arrow_left.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/arrow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/arrow_right.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/astonished.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/astonished.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/book_next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/book_next.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/book_previous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/book_previous.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/close_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/close_small.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/database-go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/database-go.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/default.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/diff_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/diff_icon.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/discard_changes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/discard_changes.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/duplicate_lines.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/duplicate_lines.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/edit-cut-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/edit-cut-red.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/education-languages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/education-languages.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/find_replace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/find_replace.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/find_tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/find_tab.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/folder-database.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/folder-database.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/folder-find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/folder-find.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/folder-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/folder-page.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/format-text-uppercase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/format-text-uppercase.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/jump_first.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/jump_first.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/jump_last.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/jump_last.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/krename.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/krename.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/list-add-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/list-add-5.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/mark_words.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/mark_words.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/media-playback-start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/media-playback-start.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/open_no_bom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/open_no_bom.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/open_unknown_encoding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/open_unknown_encoding.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/paragraph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/paragraph.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/plugin-add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/plugin-add.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/plugin-delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/plugin-delete.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/plugin-error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/plugin-error.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/plugin-go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/plugin-go.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/preferences-plugin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/preferences-plugin.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/preferences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/preferences.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/print_preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/print_preview.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/printer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/printer.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/reload_disk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/reload_disk.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/save_all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/save_all.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/save_all_plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/save_all_plus.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/session-properties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/session-properties.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/sort_alphabet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/sort_alphabet.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/spell_check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/spell_check.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/split_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/split_view.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/style.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/style.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/swap_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/swap_view.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/tab_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/tab_arrow.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/tab_strikethrough.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/tab_strikethrough.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/textfield-rename.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/textfield-rename.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/unicode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/unicode.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/up_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/up_down.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/word_wrap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/word_wrap.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/word_wrap2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/word_wrap2.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/word_wrapped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/word_wrapped.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/zoom_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/zoom_in.png -------------------------------------------------------------------------------- /ScriptNotepad/Resources/zoom_out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/Resources/zoom_out.png -------------------------------------------------------------------------------- /ScriptNotepad/Test/FormTestThingDialog.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ScriptNotepad.Test 2 | { 3 | partial class FormTestThingDialog 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.SuspendLayout(); 32 | // 33 | // FormTestThingDialog 34 | // 35 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 36 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 37 | this.ClientSize = new System.Drawing.Size(364, 221); 38 | this.Name = "FormTestThingDialog"; 39 | this.Text = "FormTestThingDialog"; 40 | this.ResumeLayout(false); 41 | 42 | } 43 | 44 | #endregion 45 | } 46 | } -------------------------------------------------------------------------------- /ScriptNotepad/Test/FormTestThingDialog.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using System.Windows.Forms; 28 | 29 | namespace ScriptNotepad.Test; 30 | 31 | /// 32 | /// A test dialog form for various things (...). 33 | /// 34 | /// 35 | public partial class FormTestThingDialog : Form 36 | { 37 | /// 38 | /// Initializes a new instance of the class. 39 | /// 40 | public FormTestThingDialog() 41 | { 42 | InitializeComponent(); 43 | } 44 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/Assembly/TestFileIsAssembly.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using ScriptNotepad.UtilityClasses.ErrorHandling; 28 | using System.Reflection; 29 | 30 | // (C): https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/assemblies-gac/how-to-determine-if-a-file-is-an-assembly 31 | namespace ScriptNotepad.UtilityClasses.Assembly; 32 | 33 | /// 34 | /// A class to test if an given file is a .NET Framework assembly. 35 | /// 36 | public class TestFileIsAssembly: ErrorHandlingBase 37 | { 38 | /// 39 | /// Determines whether the specified file is a .NET Framework assembly. 40 | /// 41 | /// The name of the file to test for. 42 | /// True if the file is an assembly; otherwise false. 43 | public static bool IsAssembly(string fileName) 44 | { 45 | try 46 | { 47 | AssemblyName.GetAssemblyName(fileName); 48 | return true; 49 | } 50 | catch (FileNotFoundException ex) 51 | { 52 | // log the exception.. 53 | ExceptionLogAction?.Invoke(ex); 54 | return false; 55 | } 56 | catch (BadImageFormatException ex) 57 | { 58 | // log the exception.. 59 | ExceptionLogAction?.Invoke(ex); 60 | return false; 61 | } 62 | catch (FileLoadException ex) 63 | { 64 | // log the exception.. 65 | ExceptionLogAction?.Invoke(ex); 66 | return false; 67 | } 68 | catch (Exception ex) 69 | { 70 | // log the exception.. 71 | ExceptionLogAction?.Invoke(ex); 72 | return false; 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/Clipboard/ClipboardTextHelper.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using ScriptNotepad.UtilityClasses.ErrorHandling; 28 | 29 | namespace ScriptNotepad.UtilityClasses.Clipboard; 30 | 31 | /// 32 | /// A simple class to help to set clipboard text contents. 33 | /// 34 | public class ClipboardTextHelper: ErrorHandlingBase 35 | { 36 | /// 37 | /// Set the Clipboard's contents to a given text. 38 | /// 39 | /// The text to set the clipboard's contents to. 40 | /// True if the operation was successful; otherwise false. 41 | public static bool ClipboardSetText(string text) 42 | { 43 | try 44 | { 45 | System.Windows.Forms.Clipboard.SetDataObject(text, true, 20, 150); 46 | return true; 47 | } 48 | catch (Exception ex) 49 | { 50 | // clipboard operation may fail.. 51 | ExceptionLogAction?.Invoke(ex); 52 | return false; 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/CodeDom/IScriptRunner.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2022 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using System.Collections.Generic; 28 | using System.Threading.Tasks; 29 | 30 | namespace ScriptNotepad.UtilityClasses.CodeDom; 31 | 32 | /// 33 | /// An interface for the script runner classes. 34 | /// 35 | public interface IScriptRunner 36 | { 37 | /// 38 | /// Gets or sets the C# script runner. 39 | /// 40 | /// The C# script runner. 41 | public RoslynScriptRunner ScriptRunner { get; set; } 42 | 43 | /// 44 | /// Gets or sets the base "skeleton" C# code snippet for manipulating text. 45 | /// 46 | /// The base "skeleton" C# code snippet for manipulating text. 47 | string CSharpScriptBase { get; set; } 48 | 49 | /// 50 | /// Gets or sets the C# script code. 51 | /// 52 | /// The C# script code. 53 | string ScriptCode { get; set; } 54 | 55 | /// 56 | /// Gets or sets a value indicating whether the script compile failed. 57 | /// 58 | /// true if the script compile failed; otherwise, false. 59 | bool CompileFailed { get; set; } 60 | 61 | /// 62 | /// Gets the previous compile exception. 63 | /// 64 | /// The previous compile exception. 65 | public Exception CompileException { get; set; } 66 | 67 | /// 68 | /// Executes the script. 69 | /// 70 | /// The text in some format. 71 | /// The object containing the manipulated text if the operation was successful. 72 | Task ExecuteScript(object text); 73 | 74 | /// 75 | /// Evaluates the C# script. 76 | /// 77 | /// The file contents to run the C# script against. 78 | /// A containing the file contents after the script manipulation and a boolean value indicating whether the script execution succeeded. 79 | Task Evaluate(string fileContents); 80 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/CodeDom/RoslynGlobals.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2022 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | namespace ScriptNotepad.UtilityClasses.CodeDom; 28 | 29 | /// 30 | /// A class to pass global data to Roslyn. 31 | /// 32 | /// The type for the property. 33 | public class RoslynGlobals 34 | { 35 | /// 36 | /// Gets or sets the data to pass to Roslyn. 37 | /// 38 | /// The data to pass to Roslyn. 39 | public T DataVariable { get; set; } 40 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/DateTimeUtilities/DateTimeHelpers.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | namespace ScriptNotepad.UtilityClasses.DateTimeUtilities; 28 | 29 | /// 30 | /// A helper class for . 31 | /// 32 | public static class DateTimeHelpers 33 | { 34 | /// 35 | /// Truncates the specified date time to a an accuracy of a second. 36 | /// 37 | /// The date time to truncate. 38 | /// A truncated instance. 39 | public static DateTime Truncate(this DateTime dateTime) 40 | { 41 | return new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, dateTime.Hour, dateTime.Minute, dateTime.Second, dateTime.Kind); 42 | } 43 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/Encodings/EncodingExceptionEventArgs.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | namespace ScriptNotepad.UtilityClasses.Encodings; 28 | 29 | /// 30 | /// Event arguments for the event. 31 | /// Implements the 32 | /// 33 | /// 34 | public class EncodingExceptionEventArgs : EventArgs 35 | { 36 | /// 37 | /// Gets or sets the exception which occurred. 38 | /// 39 | /// The exception. 40 | public Exception Exception { get; set; } 41 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/ErrorHandling/ErrorHandlingBase.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | namespace ScriptNotepad.UtilityClasses.ErrorHandling; 28 | 29 | /// 30 | /// A class from which a classes logging errors should be derived from. 31 | /// 32 | public class ErrorHandlingBase 33 | { 34 | /// 35 | /// Gets or sets the action to be used to log an exception. 36 | /// 37 | public static Action ExceptionLogAction { get; set; } = null; 38 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/ExternalProcessInteraction/ApplicationProcess.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using ScriptNotepad.UtilityClasses.ErrorHandling; 28 | using System.Diagnostics; 29 | using System.Windows.Forms; 30 | 31 | namespace ScriptNotepad.UtilityClasses.ExternalProcessInteraction; 32 | 33 | /// 34 | /// A class to run the current application with parameters. 35 | /// 36 | public class ApplicationProcess: ErrorHandlingBase 37 | { 38 | /// 39 | /// Executes a new instance of the current application with possible elevated permissions. 40 | /// 41 | /// If set to true try to run the process as administrator. 42 | /// The arguments to be passed to the process. 43 | /// 44 | public static bool RunApplicationProcess(bool elevated, string arguments) 45 | { 46 | try 47 | { 48 | var processStartInfo = new ProcessStartInfo() 49 | { 50 | FileName = Application.ExecutablePath, 51 | LoadUserProfile = true, 52 | Verb = elevated ? "runas" : null, // process elevation.. 53 | Arguments = arguments, 54 | }; 55 | 56 | System.Diagnostics.Process.Start(processStartInfo); 57 | 58 | return true; 59 | } 60 | catch (Exception ex) 61 | { 62 | // log the exception if the action has a value.. 63 | ExceptionLogAction?.Invoke(ex); 64 | 65 | return false; 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/GraphicUtils/FontFamilyHelpers.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using System.Drawing; 28 | using System.Windows.Forms; 29 | 30 | namespace ScriptNotepad.UtilityClasses.GraphicUtils; 31 | 32 | /// 33 | /// A class with helper methods for the class. 34 | /// 35 | public static class FontFamilyHelpers 36 | { 37 | /// 38 | /// Determines whether the given font family is fixed width (mono-space). 39 | /// 40 | /// The font family to check for. 41 | // (C): https://social.msdn.microsoft.com/Forums/windows/en-US/5b582b96-ade5-4354-99cf-3fe64cc6b53b/determining-if-font-is-monospaced?forum=winforms 42 | public static bool IsFixedWidth(this FontFamily fontFamily) 43 | { 44 | char[] measureChars = { 'i', 'a', 'Z', '%', '#', 'a', 'B', 'l', 'm', ',', '.', }; 45 | if (Form.ActiveForm != null) 46 | { 47 | using (Graphics graphics = Graphics.FromHwnd(Form.ActiveForm.Handle)) 48 | { 49 | try 50 | { 51 | using (Font font = new Font(fontFamily, 10, FontStyle.Regular, GraphicsUnit.Pixel)) 52 | { 53 | float charWidth = graphics.MeasureString("I", font).Width; 54 | foreach (var measureChar in measureChars) 55 | { 56 | // ReSharper disable once CompareOfFloatsByEqualityOperator 57 | if (graphics.MeasureString(measureChar.ToString(), font).Width != charWidth) 58 | { 59 | return false; 60 | } 61 | } 62 | } 63 | } 64 | catch 65 | { 66 | return false; 67 | } 68 | } 69 | } 70 | 71 | return true; 72 | } 73 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/IO/DirectoryCrawlerEventArgs.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | namespace ScriptNotepad.UtilityClasses.IO; 28 | 29 | /// 30 | /// Event arguments for the class. 31 | /// Implements the 32 | /// 33 | /// 34 | public class DirectoryCrawlerEventArgs: EventArgs 35 | { 36 | /// 37 | /// Gets or sets the currently found file name. 38 | /// 39 | public string FileName { get; set; } 40 | 41 | /// 42 | /// Gets or sets the currently found directory. 43 | /// 44 | public string Directory { get; set; } 45 | 46 | /// 47 | /// Gets or sets the current directory being searched. 48 | /// 49 | public string CurrentDirectory { get; set; } 50 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/MathUtils/MathUtils.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using System.Linq; 28 | 29 | namespace ScriptNotepad.UtilityClasses.MathUtils; 30 | 31 | /// 32 | /// Some mathematical utilities. 33 | /// 34 | public static class MathUtils 35 | { 36 | /// 37 | /// Determines the maximum value of the given parameters. 38 | /// 39 | /// The type of the object which maximum value to get. 40 | /// The values of type T which maximum value to get. 41 | /// T. 42 | public static T Max(params T[] values) 43 | { 44 | return values.Max(); 45 | } 46 | 47 | /// 48 | /// Determines the minimum value of the given parameters. 49 | /// 50 | /// The type of the object which minimum value to get. 51 | /// The values of type T which minimum value to get. 52 | /// T. 53 | public static T Min(params T[] values) 54 | { 55 | return values.Min(); 56 | } 57 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/MiscForms/FormSnippetRunner.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | text/microsoft-resx 50 | 51 | 52 | 2.0 53 | 54 | 55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 56 | 57 | 58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 59 | 60 | -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/Process/ProcessElevation.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using System.Security.Principal; 28 | 29 | namespace ScriptNotepad.UtilityClasses.Process; 30 | 31 | /// 32 | /// A class for detecting if the process is running elevated. 33 | /// 34 | public static class ProcessElevation 35 | { 36 | /// 37 | /// Gets a value indicating whether the current process is running with elevated privileges. 38 | /// 39 | public static bool IsElevated 40 | { 41 | // (C): https://www.cyotek.com/blog/detecting-if-an-application-is-running-as-an-elevated-process-and-spawning-a-new-process-using-elevated-permissions 42 | get => new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator); 43 | } 44 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/ProgrammingLanguages/ProgrammingLanguageMenuClickEventArgs.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using static VPKSoft.ScintillaLexers.LexerEnumerations; 28 | 29 | namespace ScriptNotepad.UtilityClasses.ProgrammingLanguages; 30 | 31 | /// 32 | /// A class for event arguments to the event. 33 | /// Implements the 34 | /// 35 | /// 36 | public class ProgrammingLanguageMenuClickEventArgs: EventArgs 37 | { 38 | /// 39 | /// Gets or sets the type of the lexer. 40 | /// 41 | public LexerType LexerType { get; set; } 42 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/ScintillaUtils/SelectionReplace.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2022 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using ScintillaNET; 28 | 29 | namespace ScriptNotepad.UtilityClasses.ScintillaUtils; 30 | 31 | /// 32 | /// An utility to change the value. 33 | /// 34 | public static class SelectionReplace 35 | { 36 | /// 37 | /// Replaces the with specified value. 38 | /// 39 | /// The scintilla. 40 | /// The value to replace the selected text with. 41 | public static void SelectionReplaceWithValue(this Scintilla scintilla, string value) 42 | { 43 | if (scintilla.SelectedText.Length > 0) 44 | { 45 | var start = scintilla.SelectionStart; 46 | var end = scintilla.SelectionEnd; 47 | var length = end - start; 48 | 49 | end = start + value.Length; 50 | 51 | scintilla.Text = scintilla.Text.Remove(start, length); 52 | scintilla.Text = scintilla.Text.Insert(start, value); 53 | scintilla.SelectionStart = start; 54 | scintilla.SelectionEnd = end; 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/ScintillaUtils/SetStyleBraceMatch.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using ScintillaNET; 28 | using ScriptNotepad.Settings; 29 | 30 | namespace ScriptNotepad.UtilityClasses.ScintillaUtils; 31 | 32 | /// 33 | /// A helper class to set the brace highlighting. 34 | /// 35 | public class SetStyleBraceMatch 36 | { 37 | /// 38 | /// Set the brace highlight style if set in the class. 39 | /// 40 | /// The class instance of which brace highlighting to set. 41 | public static void SetStyle(Scintilla scintilla) 42 | { 43 | // failure is not accepted within this class.. 44 | if (scintilla == null) 45 | { 46 | return; 47 | } 48 | 49 | // not in the settings, so do return.. 50 | if (!FormSettings.Settings.HighlightBraces) 51 | { 52 | return; 53 | } 54 | 55 | scintilla.Styles[Style.BraceLight].ForeColor = FormSettings.Settings.BraceHighlightForegroundColor; 56 | scintilla.Styles[Style.BraceLight].BackColor = FormSettings.Settings.BraceHighlightBackgroundColor; 57 | scintilla.Styles[Style.BraceBad].BackColor = FormSettings.Settings.BraceBadHighlightForegroundColor; 58 | 59 | scintilla.Styles[Style.BraceLight].Italic = FormSettings.Settings.HighlightBracesItalic; 60 | scintilla.Styles[Style.BraceLight].Bold = FormSettings.Settings.HighlightBracesBold; 61 | } 62 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/SearchAndReplace/Misc/SearchResultTreeViewClickEventArgs.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | namespace ScriptNotepad.UtilityClasses.SearchAndReplace.Misc; 28 | 29 | /// 30 | /// Event arguments for the search result form to request the application to do something with the search result. 31 | /// Implements the 32 | /// 33 | /// 34 | public class SearchResultTreeViewClickEventArgs : EventArgs 35 | { 36 | /// 37 | /// Gets or sets the search result passed by the form. 38 | /// 39 | /// The search results. 40 | public (string fileName, int lineNumber, int startLocation, int length, string lineContents, bool isFileOpen) SearchResult 41 | { 42 | get; 43 | set; 44 | } 45 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/SearchAndReplace/ProgressRequestActionEventArgs.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using VPKSoft.SearchText; 28 | 29 | namespace ScriptNotepad.UtilityClasses.SearchAndReplace; 30 | 31 | /// 32 | /// A class for the class to request an action for the next file. 33 | /// Implements the 34 | /// 35 | /// 36 | public class ProgressRequestActionEventArgs: EventArgs 37 | { 38 | /// 39 | /// Gets or sets the action to process next. 40 | /// 41 | public Action Action { get; set; } 42 | 43 | /// 44 | /// Gets or sets a value indicating whether to skip processing of the file. 45 | /// 46 | public bool SkipFile { get; set; } = false; 47 | 48 | /// 49 | /// Gets or sets the name of the file for to be processed next. 50 | /// 51 | public string FileName { get; set; } 52 | 53 | /// 54 | /// Gets or sets a value indicating whether this is canceled; 55 | /// I.e. no more processing is being done within the form instance. 56 | /// 57 | public bool Canceled { get; set; } 58 | 59 | /// 60 | /// Gets or sets the current instance of the class. 61 | /// 62 | public TextSearcherAndReplacer SearchAndReplacer { get; set; } 63 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/SearchAndReplace/ScintillaDocumentEventArgs.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using ScintillaNET; 28 | using System.Collections.Generic; 29 | 30 | namespace ScriptNotepad.UtilityClasses.SearchAndReplace; 31 | 32 | /// 33 | /// Event arguments for the search and replace dialog to be able to interact with the main form. 34 | /// 35 | /// 36 | public class ScintillaDocumentEventArgs: EventArgs 37 | { 38 | /// 39 | /// Gets or sets a value indicating whether all the open documents are requested. 40 | /// 41 | public bool RequestAllDocuments { get; set; } = false; 42 | 43 | /// 44 | /// Gets or sets the documents requested by an event. 45 | /// 46 | public List<(Scintilla scintilla, string fileName)> Documents { get; set; } = new List<(Scintilla scintilla, string fileName)>(); 47 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/SessionHelpers/CloseFormUtils.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using System.Collections.Generic; 28 | using System.Windows.Forms; 29 | 30 | namespace ScriptNotepad.UtilityClasses.SessionHelpers; 31 | 32 | /// 33 | /// A utility class to close all forms of the software in case the session is ending. 34 | /// 35 | public static class CloseFormUtils 36 | { 37 | /// 38 | /// Closes all the open forms except the given form to exclude . 39 | /// 40 | /// The Form class instance to excluded from being closed. 41 | public static void CloseOpenForms(Form excludeForm) 42 | { 43 | // create a list of forms to be closed.. 44 | List
forms = new List(); 45 | 46 | // set the contents for the lost of forms to be closed.. 47 | foreach (Form form in Application.OpenForms) 48 | { 49 | // ..with the exception o.. 50 | if (!form.Equals(excludeForm)) 51 | { 52 | forms.Add(form); 53 | } 54 | } 55 | 56 | // loop through the list of forms to be closed.. 57 | // ReSharper disable once ForCanBeConvertedToForeach 58 | for (int i = 0; i < forms.Count; i++) 59 | { 60 | // ..and close them.. 61 | forms[i].Close(); 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/StreamHelpers/StreamStringHelpers.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | namespace ScriptNotepad.UtilityClasses.StreamHelpers; 28 | 29 | /// 30 | /// A class to help with MemoryStreams and strings. 31 | /// 32 | public static class StreamStringHelpers 33 | { 34 | /// 35 | /// Returns the contents of a give as a string. 36 | /// 37 | /// The memory stream which contents to be returned as a string. 38 | /// The encoding to be used to convert a memory stream to text. 39 | /// 40 | public static string MemoryStreamToText(MemoryStream memoryStream, System.Text.Encoding encoding) 41 | { 42 | return encoding.GetString(memoryStream.ToArray()); 43 | } 44 | 45 | /// 46 | /// Converts the encoding of a given string. 47 | /// 48 | /// The encoding to convert from. 49 | /// The encoding to convert to. 50 | /// The contents which encoding should be changed. 51 | /// A string converted to the encoding . 52 | public static string ConvertEncoding(System.Text.Encoding encodingFrom, System.Text.Encoding encodingTo, string contents) 53 | { 54 | byte[] bytes = encodingFrom.GetBytes(contents); 55 | bytes = System.Text.Encoding.Convert(encodingFrom, encodingTo, bytes); 56 | return encodingTo.GetString(bytes); 57 | } 58 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/TextManipulation/Base64Convert.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2022 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using ScriptNotepad.UtilityClasses.TextManipulation.base64; 28 | 29 | namespace ScriptNotepad.UtilityClasses.TextManipulation; 30 | 31 | /// 32 | /// A class to convert base64 encoded string data. 33 | /// 34 | public static class Base64Convert 35 | { 36 | private static readonly Base64ToString Base64ToString = new(); 37 | 38 | private static readonly StringToBase64 StringToBase64 = new(); 39 | 40 | /// 41 | /// Converts the specified string value into base64 encoded data string. 42 | /// 43 | /// The value to convert. 44 | /// The specified string converted into base64 encoded data string. 45 | public static string ToBase64(this string value) 46 | { 47 | return StringToBase64.Manipulate(value); 48 | } 49 | 50 | /// 51 | /// Converts the specified base64 encoded string data into string a string value. 52 | /// 53 | /// The value to convert. 54 | /// The specified base64 encoded string data converted into string a string value. 55 | public static string FromBase64(this string value) 56 | { 57 | return Base64ToString.Manipulate(value); 58 | } 59 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/TextManipulation/BaseClasses/TextLinesManipulationCommandBase.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2022 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using System.Collections.Generic; 28 | using System.Linq; 29 | using ScriptNotepad.UtilityClasses.TextManipulation.Interfaces; 30 | 31 | namespace ScriptNotepad.UtilityClasses.TextManipulation.BaseClasses; 32 | 33 | /// 34 | /// A base class for all the simple text manipulation utility classes. 35 | /// Implements the 36 | /// 37 | /// 38 | public abstract class TextLinesManipulationCommandBase: ITextLinesManipulationCommand 39 | { 40 | /// 41 | /// Manipulates the specified text value. 42 | /// 43 | /// The lines to manipulate. 44 | /// The encoding used in the 45 | /// A string containing the manipulated text. 46 | /// 47 | /// The may contain line separator character(s). 48 | public abstract string Manipulate(IList lines, Encoding textEncoding); 49 | 50 | /// 51 | /// Determines whether the collection has new line characters at the end of the string. 52 | /// 53 | /// The lines to check for new line characters. 54 | /// bool. 55 | public static bool HasLineFeeds(IList lines) 56 | { 57 | return lines.Any(f => f.EndsWith('\n') || f.EndsWith('\r')); 58 | } 59 | 60 | /// 61 | /// Gets or sets the name of the method manipulating the text. 62 | /// 63 | /// The name of the method manipulating the text. 64 | public string MethodName { get; set; } 65 | 66 | /// 67 | /// Returns a that represents this instance. 68 | /// 69 | /// A that represents this instance. 70 | public abstract override string ToString(); 71 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/TextManipulation/BaseClasses/TextManipulationCallbackBase.cs: -------------------------------------------------------------------------------- 1 | using ScriptNotepad.UtilityClasses.TextManipulation.Interfaces; 2 | 3 | namespace ScriptNotepad.UtilityClasses.TextManipulation.BaseClasses; 4 | 5 | /// 6 | /// Class TextManipulationCallbackBase. 7 | /// Implements the 8 | /// 9 | /// 10 | public class TextManipulationCallbackBase: ITextManipulationCallback 11 | { 12 | /// 13 | /// Gets or sets the callback action. 14 | /// 15 | /// The callback action. 16 | public Action CallbackAction { get; set; } 17 | 18 | /// 19 | /// Gets or sets the name of the method manipulating the text. 20 | /// 21 | /// The name of the method manipulating the text. 22 | public string MethodName { get; set; } 23 | 24 | /// 25 | /// Returns a that represents this instance. 26 | /// 27 | /// A that represents this instance. 28 | public override string ToString() 29 | { 30 | return MethodName; 31 | } 32 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/TextManipulation/BaseClasses/TextManipulationCommandBase.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2022 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using ScintillaNET; 28 | using ScriptNotepad.UtilityClasses.TextManipulation.Interfaces; 29 | 30 | namespace ScriptNotepad.UtilityClasses.TextManipulation.BaseClasses; 31 | 32 | /// 33 | /// A base class for all the simple text manipulation utility classes. 34 | /// Implements the 35 | /// 36 | /// 37 | public abstract class TextManipulationCommandBase: ITextManipulationCommand 38 | { 39 | /// 40 | /// Manipulates the specified text value. 41 | /// 42 | /// The value to manipulate. 43 | /// A string containing the manipulated text. 44 | public abstract string Manipulate(string value); 45 | 46 | /// 47 | /// Gets or sets a value indicating whether prefer selected text of the control for the command. 48 | /// 49 | /// true if to prefer selected text of the control for the command; otherwise, false. 50 | public abstract bool PreferSelectedText { get; set; } 51 | 52 | /// 53 | /// Gets or sets the name of the method manipulating the text. 54 | /// 55 | /// The name of the method manipulating the text. 56 | public string MethodName { get; set; } 57 | 58 | /// 59 | /// Returns a that represents this instance. 60 | /// 61 | /// A that represents this instance. 62 | public abstract override string ToString(); 63 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/TextManipulation/Interfaces/IMethodName.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2022 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | namespace ScriptNotepad.UtilityClasses.TextManipulation.Interfaces; 28 | 29 | /// 30 | /// An interface with a text manipulation method name. 31 | /// 32 | public interface IMethodName 33 | { 34 | /// 35 | /// Gets or sets the name of the method manipulating the text. 36 | /// 37 | /// The name of the method manipulating the text. 38 | string MethodName { get; set; } 39 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/TextManipulation/Interfaces/ITextLinesManipulationCommand.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2022 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using System.Collections.Generic; 28 | 29 | namespace ScriptNotepad.UtilityClasses.TextManipulation.Interfaces; 30 | 31 | /// 32 | /// An interface to manipulate text with classes implementing this interface. 33 | /// 34 | interface ITextLinesManipulationCommand: IMethodName 35 | { 36 | /// 37 | /// Manipulates the specified text value. 38 | /// 39 | /// The lines to manipulate. 40 | /// The encoding used in the 41 | /// A string containing the manipulated text. 42 | /// The may contain line separator character(s). 43 | string Manipulate(IList lines, Encoding textEncoding); 44 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/TextManipulation/Interfaces/ITextManipulationCallback.cs: -------------------------------------------------------------------------------- 1 | namespace ScriptNotepad.UtilityClasses.TextManipulation.Interfaces; 2 | 3 | interface ITextManipulationCallback: IMethodName 4 | { 5 | /// 6 | /// Gets or sets the callback action. 7 | /// 8 | /// The callback action. 9 | Action CallbackAction { get; set; } 10 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/TextManipulation/Interfaces/ITextManipulationCommand.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2022 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using ScintillaNET; 28 | 29 | namespace ScriptNotepad.UtilityClasses.TextManipulation.Interfaces; 30 | 31 | /// 32 | /// An interface to manipulate text with classes implementing this interface. 33 | /// 34 | public interface ITextManipulationCommand: IMethodName 35 | { 36 | /// 37 | /// Manipulates the specified text value. 38 | /// 39 | /// The value to manipulate. 40 | /// A string containing the manipulated text. 41 | string Manipulate(string value); 42 | 43 | /// 44 | /// Gets or sets a value indicating whether prefer selected text of the control for the command. 45 | /// 46 | /// true if to prefer selected text of the control for the command; otherwise, false. 47 | bool PreferSelectedText { get; set; } 48 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/TextManipulation/Json/JsonMultilineConvert.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2022 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using Newtonsoft.Json.Linq; 28 | using ScriptNotepad.UtilityClasses.ErrorHandling; 29 | using ScriptNotepad.UtilityClasses.TextManipulation.BaseClasses; 30 | 31 | namespace ScriptNotepad.UtilityClasses.TextManipulation.Json; 32 | 33 | /// 34 | /// A class to convert single-line JSON to formatted JSON. 35 | /// Implements the 36 | /// 37 | /// 38 | public class JsonMultilineConvert: TextManipulationCommandBase 39 | { 40 | /// 41 | /// Manipulates the specified text value. 42 | /// 43 | /// The value to manipulate. 44 | /// A string containing the manipulated text. 45 | public override string Manipulate(string value) 46 | { 47 | try 48 | { 49 | var result = JToken.Parse(value).ToString(); 50 | 51 | return result; 52 | } 53 | catch (Exception ex) 54 | { 55 | ErrorHandlingBase.ExceptionLogAction?.Invoke(ex); 56 | return value; 57 | } 58 | } 59 | 60 | /// 61 | public override bool PreferSelectedText { get; set; } = false; 62 | 63 | /// 64 | /// Returns a that represents this instance. 65 | /// 66 | /// A that represents this instance. 67 | public override string ToString() 68 | { 69 | return MethodName; 70 | } 71 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/TextManipulation/Json/JsonSingleLineConvert.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2022 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using Newtonsoft.Json; 28 | using Newtonsoft.Json.Linq; 29 | using ScriptNotepad.UtilityClasses.ErrorHandling; 30 | using ScriptNotepad.UtilityClasses.TextManipulation.BaseClasses; 31 | using ScriptNotepad.UtilityClasses.TextManipulation.Interfaces; 32 | 33 | namespace ScriptNotepad.UtilityClasses.TextManipulation.Json; 34 | 35 | /// 36 | /// A class to convert formatted JSON to a single-line JSOn. 37 | /// Implements the 38 | /// 39 | /// 40 | public class JsonSingleLineConvert: TextManipulationCommandBase 41 | { 42 | /// 43 | /// Manipulates the specified text value. 44 | /// 45 | /// The value to manipulate. 46 | /// A string containing the manipulated text. 47 | public override string Manipulate(string value) 48 | { 49 | try 50 | { 51 | var result = JToken.Parse(value).ToString(Formatting.None); 52 | 53 | return result; 54 | } 55 | catch (Exception ex) 56 | { 57 | ErrorHandlingBase.ExceptionLogAction?.Invoke(ex); 58 | return value; 59 | } 60 | } 61 | 62 | /// 63 | public override bool PreferSelectedText { get; set; } = false; 64 | 65 | /// 66 | /// Returns a that represents this instance. 67 | /// 68 | /// A that represents this instance. 69 | public override string ToString() 70 | { 71 | return MethodName; 72 | } 73 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/TextManipulation/JsonPrettify.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2022 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using ScriptNotepad.UtilityClasses.TextManipulation.Json; 28 | 29 | namespace ScriptNotepad.UtilityClasses.TextManipulation; 30 | 31 | /// 32 | /// A class for Json text utilities. 33 | /// 34 | public static class JsonUtils 35 | { 36 | private static readonly JsonMultilineConvert JsonMultilineConvert = new(); 37 | 38 | private static readonly JsonSingleLineConvert JsonSingleLineConvert = new(); 39 | 40 | /// 41 | /// Prettifies a specified Json text. 42 | /// 43 | /// The value to prettify. 44 | /// Intended Json text. 45 | public static string JsonPrettify(this string value) 46 | { 47 | return JsonMultilineConvert.Manipulate(value); 48 | } 49 | 50 | /// 51 | /// Uglifies a specified Json text (he-hee). 52 | /// 53 | /// The value. 54 | /// System.String. 55 | public static string JsonUglify(this string value) 56 | { 57 | return JsonSingleLineConvert.Manipulate(value); 58 | } 59 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/TextManipulation/ScintillaLinesToStringList.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2020 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using System.Collections.Generic; 28 | using ScintillaNET; 29 | using ScriptNotepad.UtilityClasses.ErrorHandling; 30 | 31 | namespace ScriptNotepad.UtilityClasses.TextManipulation; 32 | 33 | /// 34 | /// A class to convert the collection to a list of strings. 35 | /// Implements the 36 | /// 37 | /// 38 | public class ScintillaLinesToStringList : ErrorHandlingBase 39 | { 40 | /// 41 | /// Gets the scintilla lines as string list. 42 | /// 43 | /// The class instance to get the lines from. 44 | /// A collection containing the control's lines. 45 | public static List GetScintillaLinesAsStringList(Scintilla scintilla) 46 | { 47 | List result = new List(); 48 | try 49 | { 50 | foreach (var line in scintilla.Lines) 51 | { 52 | result.Add(line.Text); 53 | } 54 | } 55 | catch (Exception ex) 56 | { 57 | // log the exception if the action has a value.. 58 | ExceptionLogAction?.Invoke(ex); 59 | } 60 | return result; 61 | } 62 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/TextManipulation/Xml/XmlMultilineConvert.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2022 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using ScriptNotepad.UtilityClasses.TextManipulation.BaseClasses; 28 | 29 | namespace ScriptNotepad.UtilityClasses.TextManipulation.Xml; 30 | 31 | /// 32 | /// A class to convert single-line XML to formatted XML. 33 | /// Implements the 34 | /// 35 | /// 36 | public class XmlMultilineConvert: TextManipulationCommandBase 37 | { 38 | /// 39 | /// Manipulates the specified text value. 40 | /// 41 | /// The value to manipulate. 42 | /// A string containing the manipulated text. 43 | public override string Manipulate(string value) 44 | { 45 | return XmlTidy.Tidy(value, true); 46 | } 47 | 48 | /// 49 | public override bool PreferSelectedText { get; set; } = false; 50 | 51 | /// 52 | /// Returns a that represents this instance. 53 | /// 54 | /// A that represents this instance. 55 | public override string ToString() 56 | { 57 | return MethodName; 58 | } 59 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/TextManipulation/Xml/XmlSingleLineConvert.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2022 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using ScriptNotepad.UtilityClasses.TextManipulation.BaseClasses; 28 | 29 | namespace ScriptNotepad.UtilityClasses.TextManipulation.Xml; 30 | 31 | /// 32 | /// A class to convert formatted XML to a single-line XML. 33 | /// Implements the 34 | /// 35 | /// 36 | public class XmlSingleLineConvert: TextManipulationCommandBase 37 | { 38 | /// 39 | /// Manipulates the specified text value. 40 | /// 41 | /// The value to manipulate. 42 | /// A string containing the manipulated text. 43 | public override string Manipulate(string value) 44 | { 45 | return XmlTidy.Tidy(value, false); 46 | } 47 | 48 | /// 49 | public override bool PreferSelectedText { get; set; } = false; 50 | 51 | /// 52 | /// Returns a that represents this instance. 53 | /// 54 | /// A that represents this instance. 55 | public override string ToString() 56 | { 57 | return MethodName; 58 | } 59 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/TextManipulation/XmlPrettify.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2022 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using ScriptNotepad.UtilityClasses.TextManipulation.Xml; 28 | 29 | namespace ScriptNotepad.UtilityClasses.TextManipulation; 30 | 31 | /// 32 | /// A class for XML text utilities. 33 | /// 34 | public static class XmlUtils 35 | { 36 | private static readonly XmlMultilineConvert XmlMultilineConvert = new(); 37 | 38 | private static readonly XmlSingleLineConvert XmlSingleLineConvert = new(); 39 | 40 | /// 41 | /// Prettifies a specified XML text. 42 | /// 43 | /// The value to prettify. 44 | /// Intended XML text. 45 | public static string XmlPrettify(this string value) 46 | { 47 | return XmlMultilineConvert.Manipulate(value); 48 | } 49 | 50 | 51 | /// 52 | /// Uglifies a specified XML text (he-hee). 53 | /// 54 | /// The value. 55 | /// System.String. 56 | public static string XmlUglify(this string value) 57 | { 58 | return XmlSingleLineConvert.Manipulate(value); 59 | } 60 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/TextManipulation/base64/Base64ToString.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2022 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using ScriptNotepad.UtilityClasses.ErrorHandling; 28 | using ScriptNotepad.UtilityClasses.TextManipulation.BaseClasses; 29 | 30 | namespace ScriptNotepad.UtilityClasses.TextManipulation.base64; 31 | 32 | /// 33 | /// A class to convert an UTF-8 encoded text data into a base64 encoded data. 34 | /// Implements the 35 | /// 36 | /// 37 | internal class Base64ToString: TextManipulationCommandBase 38 | { 39 | /// 40 | /// Manipulates the specified text value. 41 | /// 42 | /// The value to manipulate. 43 | /// A string containing the manipulated text. 44 | public override string Manipulate(string value) 45 | { 46 | try 47 | { 48 | return Convert.ToBase64String(Encoding.UTF8.GetBytes(value)); 49 | } 50 | catch (Exception ex) 51 | { 52 | ErrorHandlingBase.ExceptionLogAction?.Invoke(ex); 53 | return value; 54 | } 55 | } 56 | 57 | /// 58 | public override bool PreferSelectedText { get; set; } = true; 59 | 60 | /// 61 | /// Returns a that represents this instance. 62 | /// 63 | /// A that represents this instance. 64 | public override string ToString() 65 | { 66 | return MethodName; 67 | } 68 | } -------------------------------------------------------------------------------- /ScriptNotepad/UtilityClasses/TextManipulation/base64/StringToBase64.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | MIT License 4 | 5 | Copyright(c) 2022 Petteri Kautonen 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | #endregion 26 | 27 | using ScriptNotepad.UtilityClasses.ErrorHandling; 28 | using ScriptNotepad.UtilityClasses.TextManipulation.BaseClasses; 29 | 30 | namespace ScriptNotepad.UtilityClasses.TextManipulation.base64; 31 | 32 | /// 33 | /// A class to convert a base64 encoded data into UTF-8 encoded string. 34 | /// Implements the 35 | /// 36 | /// 37 | public class StringToBase64: TextManipulationCommandBase 38 | { 39 | /// 40 | /// Manipulates the specified text value. 41 | /// 42 | /// The value to manipulate. 43 | /// A string containing the manipulated text. 44 | public override string Manipulate(string value) 45 | { 46 | try 47 | { 48 | var bytes = Convert.FromBase64String(value); 49 | 50 | return Encoding.UTF8.GetString(bytes); 51 | } 52 | catch (Exception ex) 53 | { 54 | ErrorHandlingBase.ExceptionLogAction?.Invoke(ex); 55 | return value; 56 | } 57 | } 58 | 59 | /// 60 | public override bool PreferSelectedText { get; set; } = true; 61 | 62 | /// 63 | /// Returns a that represents this instance. 64 | /// 65 | /// A that represents this instance. 66 | public override string ToString() 67 | { 68 | return MethodName; 69 | } 70 | } -------------------------------------------------------------------------------- /ScriptNotepad/VPKSoft.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/VPKSoft.ico -------------------------------------------------------------------------------- /ScriptNotepad/WindowsRegistry/OpenWith.reg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/WindowsRegistry/OpenWith.reg -------------------------------------------------------------------------------- /ScriptNotepad/notepad7.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad/notepad7.ico -------------------------------------------------------------------------------- /ScriptNotepadOldDatabaseEntity/ScriptNotepadOldDatabaseEntity.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net5.0 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ScriptNotepad_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VPKSoft/ScriptNotepad/83eb5a1119f8ecd66f474bbf6451a11ea87638b4/ScriptNotepad_icon.png --------------------------------------------------------------------------------