├── .gitignore
├── LICENSE
├── README.md
├── screenshots
├── ClassicHighlighting.png
├── Dark.png
├── HighlightingLoaders.png
├── HighlightingManager.png
├── HighlightingManager.vsdx
├── HighlightingManagerV2.png
├── Light.png
├── More
│ ├── Dark_LightHighlighting.png
│ ├── Light_DarkHighlighting.png
│ └── Solution.png
├── ThemedHighlightingManager.png
├── Themes.png
├── TrueBlue_Dark.png
├── TrueBlue_Light.png
├── VS2019_Dark.png
├── icons
│ ├── desk-lamp-dark.ico
│ ├── desk-lamp-dark.svg
│ ├── desk-lamp-dark_128x.png
│ ├── desk-lamp-dark_16x.png
│ ├── desk-lamp-dark_256x.png
│ ├── desk-lamp-dark_32x.png
│ ├── desk-lamp-dark_48x.png
│ ├── desk-lamp-dark_64x.png
│ ├── desk-lamp-light.ico
│ ├── desk-lamp-light.svg
│ ├── desk-lamp_128x.png
│ ├── desk-lamp_16x.png
│ ├── desk-lamp_256x.png
│ ├── desk-lamp_32x.png
│ ├── desk-lamp_48x.png
│ └── desk-lamp_64x.png
└── xshtd_objects.png
└── source
├── CleanAll.bat
├── Components
├── ServiceLocator
│ ├── ServiceContainer.cs
│ ├── ServiceInjector.cs
│ └── ServiceLocator.csproj
└── Settings
│ ├── Settings
│ ├── AssemblyInfo.cs
│ ├── Interfaces
│ │ ├── IOptions.cs
│ │ ├── IOptionsPanel.cs
│ │ ├── IProfile.cs
│ │ ├── ISettingsManager.cs
│ │ └── IViewPosSizeModel.cs
│ ├── Internal
│ │ └── SettingsManagerImpl.cs
│ ├── ProgramSettings
│ │ ├── LanguageCollection.cs
│ │ └── OptionsPanel.cs
│ ├── SerializableDictionary.cs
│ ├── Settings.csproj
│ ├── SettingsManager.cs
│ └── UserProfile
│ │ ├── IViewSize.cs
│ │ ├── LocalizabilityAttribute.cs
│ │ ├── Profile.cs
│ │ ├── ViewPosSizeModel.cs
│ │ └── ViewSize.cs
│ └── SettingsModel
│ ├── ExtensionMethods
│ └── SecureStringExtensionMethod.cs
│ ├── Interfaces
│ ├── IEngine.cs
│ ├── IOptionGroup.cs
│ └── IOptionsSchema.cs
│ ├── Models
│ ├── Engine.cs
│ ├── Factory.cs
│ ├── FileReference.cs
│ ├── OptionGroup.cs
│ ├── OptionsSchema.cs
│ └── XML
│ │ ├── Converters
│ │ ├── AlternativeDataTypeHandler.cs
│ │ ├── IAlternativeDataTypeHandler.cs
│ │ └── SecureStringHandler.cs
│ │ └── XMLLayer.cs
│ └── SettingsModel.csproj
├── HL
├── AssemblyInfo.cs
├── HL.csproj
├── HighlightingTheme
│ ├── GlobalStyle.cs
│ └── SyntaxDefinition.cs
├── Interfaces
│ ├── IHLTheme.cs
│ └── IThemedHighlightingManager.cs
├── LICENSE
├── Manager
│ ├── BusyManager.cs
│ ├── DefaultHighlightingManager.cs
│ ├── DelayLoadedHighlightingDefinition.cs
│ ├── ExtensionMethods.cs
│ ├── HLTheme.cs
│ ├── HighlightingBrush.cs
│ ├── HighlightingLoader.cs
│ ├── HighlightingThemeLoader.cs
│ ├── ThemedHighlightingManager.cs
│ ├── V1Loader.cs
│ ├── V2Loader.cs
│ ├── XmlHighlightingDefinition.cs
│ └── XshtdLoader.cs
├── Modes
│ ├── ModeV1.xsd
│ ├── ModeV2.xsd
│ └── ModeV2_htd.xsd
├── Resources
│ ├── HLResources.cs
│ ├── Light
│ │ ├── AS3.xshd
│ │ ├── ASPX.xshd
│ │ ├── Boo.xshd
│ │ ├── CPP-Mode.xshd
│ │ ├── CSS-Mode.xshd
│ │ ├── CSharp-Mode.xshd
│ │ ├── Coco-Mode.xshd
│ │ ├── DOSBATCH.xshd
│ │ ├── FSharp-Mode.xshd
│ │ ├── HLSL.xshd
│ │ ├── HTML-Mode.xshd
│ │ ├── INI.xshd
│ │ ├── Java-Mode.xshd
│ │ ├── JavaScript-Mode.xshd
│ │ ├── Log.xshd
│ │ ├── MarkDown-Mode.xshd
│ │ ├── PHP-Mode.xshd
│ │ ├── PLSQL.xshd
│ │ ├── Pascal.xshd
│ │ ├── Patch-Mode.xshd
│ │ ├── PowerShell.xshd
│ │ ├── Python-Mode.xshd
│ │ ├── Ruby.xshd
│ │ ├── TSQL-Mode.xshd
│ │ ├── TXT.xshd
│ │ ├── Tex-Mode.xshd
│ │ ├── VB-Mode.xshd
│ │ ├── XML-Mode.xshd
│ │ ├── XmlDoc.xshd
│ │ ├── scheme.xshd
│ │ ├── squirrel.xshd
│ │ └── vtl.xshd
│ └── Themes
│ │ ├── Dark.xshtd
│ │ ├── TrueBlue.xshtd
│ │ └── VS2019_Dark.xshtd
├── Xshtd
│ ├── IXshtdVisitor.cs
│ ├── XhstdThemeDefinition.cs
│ ├── XmlHighlightingThemeDefinition.cs
│ ├── XshtdColor.cs
│ ├── XshtdElement.cs
│ ├── XshtdGlobalStyle.cs
│ ├── XshtdGlobalStyles.cs
│ ├── XshtdSyntaxDefinition.cs
│ └── interfaces
│ │ ├── IFreezable.cs
│ │ ├── IHighlightingDefinitionReferenceResolver.cs
│ │ └── IHighlightingThemeDefinition.cs
└── images
│ └── icon.png
├── Readme.txt
├── TextEditLib
├── AssemblyInfo.cs
├── Extensions
│ └── HighlightCurrentLineBackgroundRenderer.cs
├── Resources
│ └── Icons
│ │ ├── Copy.ico
│ │ ├── Copy_16x.svg
│ │ ├── Cut.ico
│ │ ├── Cut_16x.svg
│ │ ├── Delete.ico
│ │ ├── Delete_16x.svg
│ │ ├── OpenFile.ico
│ │ ├── OpenFile_16x.svg
│ │ ├── Paste.ico
│ │ ├── Paste_16x.svg
│ │ ├── Redo.ico
│ │ ├── Redo_16x.svg
│ │ ├── Undo.ico
│ │ └── Undo_16x.svg
├── TextEdit.xaml
├── TextEdit.xaml.cs
├── TextEditLib.csproj
└── Themes
│ ├── DarkBrushs.xaml
│ ├── Generic.xaml
│ ├── Icons.xaml
│ ├── LightBrushs.xaml
│ └── ResourceKeys.cs
├── ThemedAvalonEditDemo.sln
└── ThemedDemo
├── App.config
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── Behaviors
└── SelectionChangedBehavior.cs
├── BindToMLib
└── MWindowLib
│ └── DarkLightBrushs.xaml
├── Converters
└── NullToVisibilityConverter.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Models
├── AppCore.cs
├── SettingDefaults.cs
└── ThemeDefinition.cs
├── ThemedDemo.csproj
└── ViewModels
├── AppLifeCycleViewModel.cs
├── AppViewModel.cs
├── Base
├── ModelBase.cs
├── RelayCommand.cs
└── ViewModelBase.cs
├── DocumentRootViewModel.cs
├── ThemeDefinitionViewModel.cs
└── ThemeViewModel.cs
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Dirkster99
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 |
--------------------------------------------------------------------------------
/screenshots/ClassicHighlighting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/ClassicHighlighting.png
--------------------------------------------------------------------------------
/screenshots/Dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/Dark.png
--------------------------------------------------------------------------------
/screenshots/HighlightingLoaders.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/HighlightingLoaders.png
--------------------------------------------------------------------------------
/screenshots/HighlightingManager.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/HighlightingManager.png
--------------------------------------------------------------------------------
/screenshots/HighlightingManager.vsdx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/HighlightingManager.vsdx
--------------------------------------------------------------------------------
/screenshots/HighlightingManagerV2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/HighlightingManagerV2.png
--------------------------------------------------------------------------------
/screenshots/Light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/Light.png
--------------------------------------------------------------------------------
/screenshots/More/Dark_LightHighlighting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/More/Dark_LightHighlighting.png
--------------------------------------------------------------------------------
/screenshots/More/Light_DarkHighlighting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/More/Light_DarkHighlighting.png
--------------------------------------------------------------------------------
/screenshots/More/Solution.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/More/Solution.png
--------------------------------------------------------------------------------
/screenshots/ThemedHighlightingManager.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/ThemedHighlightingManager.png
--------------------------------------------------------------------------------
/screenshots/Themes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/Themes.png
--------------------------------------------------------------------------------
/screenshots/TrueBlue_Dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/TrueBlue_Dark.png
--------------------------------------------------------------------------------
/screenshots/TrueBlue_Light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/TrueBlue_Light.png
--------------------------------------------------------------------------------
/screenshots/VS2019_Dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/VS2019_Dark.png
--------------------------------------------------------------------------------
/screenshots/icons/desk-lamp-dark.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/icons/desk-lamp-dark.ico
--------------------------------------------------------------------------------
/screenshots/icons/desk-lamp-dark.svg:
--------------------------------------------------------------------------------
1 |
2 |
58 |
--------------------------------------------------------------------------------
/screenshots/icons/desk-lamp-dark_128x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/icons/desk-lamp-dark_128x.png
--------------------------------------------------------------------------------
/screenshots/icons/desk-lamp-dark_16x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/icons/desk-lamp-dark_16x.png
--------------------------------------------------------------------------------
/screenshots/icons/desk-lamp-dark_256x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/icons/desk-lamp-dark_256x.png
--------------------------------------------------------------------------------
/screenshots/icons/desk-lamp-dark_32x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/icons/desk-lamp-dark_32x.png
--------------------------------------------------------------------------------
/screenshots/icons/desk-lamp-dark_48x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/icons/desk-lamp-dark_48x.png
--------------------------------------------------------------------------------
/screenshots/icons/desk-lamp-dark_64x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/icons/desk-lamp-dark_64x.png
--------------------------------------------------------------------------------
/screenshots/icons/desk-lamp-light.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/icons/desk-lamp-light.ico
--------------------------------------------------------------------------------
/screenshots/icons/desk-lamp-light.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/screenshots/icons/desk-lamp_128x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/icons/desk-lamp_128x.png
--------------------------------------------------------------------------------
/screenshots/icons/desk-lamp_16x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/icons/desk-lamp_16x.png
--------------------------------------------------------------------------------
/screenshots/icons/desk-lamp_256x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/icons/desk-lamp_256x.png
--------------------------------------------------------------------------------
/screenshots/icons/desk-lamp_32x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/icons/desk-lamp_32x.png
--------------------------------------------------------------------------------
/screenshots/icons/desk-lamp_48x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/icons/desk-lamp_48x.png
--------------------------------------------------------------------------------
/screenshots/icons/desk-lamp_64x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/icons/desk-lamp_64x.png
--------------------------------------------------------------------------------
/screenshots/xshtd_objects.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dirkster99/AvalonEditHighlightingThemes/2f124c2e5989b717c2be89106b96b658476eb6d9/screenshots/xshtd_objects.png
--------------------------------------------------------------------------------
/source/CleanAll.bat:
--------------------------------------------------------------------------------
1 | @ECHO OFF
2 | pushd "%~dp0"
3 | ECHO.
4 | ECHO.
5 | ECHO.
6 | ECHO This script deletes all temporary build files in their
7 | ECHO corresponding BIN and OBJ Folder contained in the following projects
8 | ECHO.
9 | ECHO Apps\ThemedDemo
10 | ECHO HL
11 | ECHO TextEditLib
12 | ECHO.
13 | ECHO Components\ServiceLocator
14 | ECHO Components\Settings\Settings
15 | ECHO Components\Settings\SettingsModel
16 | ECHO.
17 | REM Ask the user if hes really sure to continue beyond this point XXXXXXXX
18 | set /p choice=Are you sure to continue (Y/N)?
19 | if not '%choice%'=='Y' Goto EndOfBatch
20 | REM Script does not continue unless user types 'Y' in upper case letter
21 | ECHO.
22 | ECHO XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
23 | ECHO.
24 | ECHO XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
25 | RMDIR /S /Q .\.vs
26 |
27 | ECHO.
28 | ECHO Deleting BIN and OBJ Folders in Apps\ThemedDemo
29 | ECHO.
30 | RMDIR /S /Q .\Apps\ThemedDemo\bin
31 | RMDIR /S /Q .\Apps\ThemedDemo\obj
32 | ECHO.
33 |
34 | ECHO.
35 | ECHO Deleting BIN and OBJ Folders in HL
36 | ECHO.
37 | RMDIR /S /Q .\HL\bin
38 | RMDIR /S /Q .\HL\obj
39 | ECHO.
40 |
41 | ECHO.
42 | ECHO Deleting BIN and OBJ Folders in TextEditLib
43 | ECHO.
44 | RMDIR /S /Q .\TextEditLib\bin
45 | RMDIR /S /Q .\TextEditLib\obj
46 | ECHO.
47 |
48 |
49 | ECHO XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
50 | ECHO.
51 | ECHO Deleting BIN and OBJ Folders in Components\ServiceLocator
52 | ECHO.
53 | RMDIR /S /Q .\Components\ServiceLocator\bin
54 | RMDIR /S /Q .\Components\ServiceLocator\obj
55 | ECHO.
56 |
57 | ECHO.
58 | ECHO Deleting BIN and OBJ Folders in Components\Settings\Settings
59 | ECHO.
60 | RMDIR /S /Q .\Components\Settings\Settings\bin
61 | RMDIR /S /Q .\Components\Settings\Settings\obj
62 | ECHO.
63 |
64 | ECHO.
65 | ECHO Deleting BIN and OBJ Folders in Components\Settings\SettingsModel
66 | ECHO.
67 | RMDIR /S /Q .\Components\Settings\SettingsModel\bin
68 | RMDIR /S /Q .\Components\Settings\SettingsModel\obj
69 | ECHO.
70 |
71 | ECHO XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
72 |
73 | PAUSE
74 |
75 | :EndOfBatch
76 |
--------------------------------------------------------------------------------
/source/Components/ServiceLocator/ServiceContainer.cs:
--------------------------------------------------------------------------------
1 | namespace ServiceLocator
2 | {
3 | using System;
4 | using System.Collections.Generic;
5 |
6 | ///
7 | /// Source: http://www.codeproject.com/Articles/70223/Using-a-Service-Locator-to-Work-with-MessageBoxes
8 | ///
9 | public class ServiceContainer
10 | {
11 | #region fields
12 | public static readonly ServiceContainer Instance = new ServiceContainer();
13 |
14 | readonly Dictionary _serviceMap;
15 | readonly object _serviceMapLock;
16 | #endregion fields
17 |
18 | #region constructors
19 | ///
20 | /// Class Constructor
21 | ///
22 | private ServiceContainer()
23 | {
24 | _serviceMap = new Dictionary();
25 | _serviceMapLock = new object();
26 | }
27 | #endregion constructors
28 |
29 | #region methods
30 | public void AddService(TServiceContract implementation)
31 | where TServiceContract : class
32 | {
33 | lock (_serviceMapLock)
34 | {
35 | _serviceMap[typeof(TServiceContract)] = implementation;
36 | }
37 | }
38 |
39 | public TServiceContract GetService()
40 | where TServiceContract : class
41 | {
42 | object service;
43 | lock (_serviceMapLock)
44 | {
45 | _serviceMap.TryGetValue(typeof(TServiceContract), out service);
46 | }
47 |
48 | return service as TServiceContract;
49 | }
50 | #endregion methods
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/source/Components/ServiceLocator/ServiceInjector.cs:
--------------------------------------------------------------------------------
1 | namespace ThemedDemo
2 | {
3 | using HL.Interfaces;
4 | using HL.Manager;
5 | using MLib;
6 | using MLib.Interfaces;
7 | using ServiceLocator;
8 | using Settings;
9 | using Settings.Interfaces;
10 |
11 | ///
12 | /// Creates and initializes all services.
13 | ///
14 | public static class ServiceInjector
15 | {
16 | ///
17 | /// Loads service objects into the ServiceContainer on startup of application.
18 | ///
19 | /// Returns the current instance
20 | /// to let caller work with service container items right after creation.
21 | public static ServiceContainer InjectServices()
22 | {
23 | var appearance = AppearanceManager.GetInstance();
24 |
25 | ServiceContainer.Instance.AddService(SettingsManager.GetInstance(appearance.CreateThemeInfos()));
26 | ServiceContainer.Instance.AddService(appearance);
27 | ServiceContainer.Instance.AddService(ThemedHighlightingManager.Instance);
28 |
29 | return ServiceContainer.Instance;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/source/Components/ServiceLocator/ServiceLocator.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.0;net4.5.2
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/source/Components/Settings/Settings/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/source/Components/Settings/Settings/Interfaces/IOptions.cs:
--------------------------------------------------------------------------------
1 | namespace Settings.Interfaces
2 | {
3 | using Settings.ProgramSettings;
4 | using System.Collections.Generic;
5 |
6 | public interface IOptions
7 | {
8 | #region properties
9 | bool IsDirty { get; set; }
10 | string LanguageSelected { get; set; }
11 | bool ReloadOpenFilesOnAppStart { get; set; }
12 | string SourceFilePath { get; set; }
13 |
14 | string DefaultSourceLanguage { get; set; }
15 | string DefaultTargetLanguage { get; set; }
16 |
17 | string DefaultDefaultSourceLanguage { get; }
18 | string DefaultDefaultTargetLanguage { get; }
19 |
20 | int DefaultIconSize { get; }
21 | int IconSizeMin { get; }
22 | int IconSizeMax { get; }
23 |
24 | int DefaultFontSize { get; }
25 | int FontSizeMin { get; }
26 | int FontSizeMax { get; }
27 | #endregion properties
28 |
29 | #region methods
30 | ///
31 | /// Reset the dirty flag (e.g. after saving program options when they where edit).
32 | ///
33 | ///
34 | void SetDirtyFlag(bool flag);
35 |
36 | void SetIconSize(int size);
37 | void SetFontSize(int size);
38 | #endregion methods
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/source/Components/Settings/Settings/Interfaces/IOptionsPanel.cs:
--------------------------------------------------------------------------------
1 | namespace Settings.Interfaces
2 | {
3 | using SettingsModel.Interfaces;
4 |
5 | public interface IOptionsPanel
6 | {
7 | IEngine Options { get; }
8 | }
9 | }
--------------------------------------------------------------------------------
/source/Components/Settings/Settings/Interfaces/IProfile.cs:
--------------------------------------------------------------------------------
1 | namespace Settings.Interfaces
2 | {
3 | using Settings.UserProfile;
4 | using SettingsModel.Models;
5 | using System;
6 | using System.Collections.Generic;
7 |
8 | public interface IProfile
9 | {
10 | #region properties
11 | string GetLastActivePath();
12 | string LastActiveSolution { get; set; }
13 |
14 |
15 | string LastActiveTargetFile { get; set; }
16 |
17 | List LastActiveSourceFiles { get; set; }
18 |
19 | ///
20 | /// Gets the key name of the MainWindow item in the collection.
21 | /// Ths name can be used as key in the WindowPosSz property
22 | /// to read and write MainWindow position and size information.
23 | ///
24 | string MainWindowName { get; }
25 |
26 | ///
27 | /// Gets a collection of window position and size items.
28 | ///
29 | SerializableDictionary WindowPosSz { get; }
30 | #endregion properties
31 |
32 | #region methods
33 | ///
34 | /// Checks the MainWindow for visibility when re-starting application
35 | /// (with different screen configuration).
36 | ///
37 | ///
38 | ///
39 | void CheckSettingsOnLoad(double SystemParameters_VirtualScreenLeft, double SystemParameters_VirtualScreenTop);
40 |
41 | ///
42 | /// Updates or inserts the requested window pos size item in the collection.
43 | ///
44 | ///
45 | ///
46 | ///
47 | void UpdateInsertWindowPosSize(string windowName, ViewPosSizeModel model);
48 | #endregion methods
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/source/Components/Settings/Settings/Interfaces/ISettingsManager.cs:
--------------------------------------------------------------------------------
1 | namespace Settings.Interfaces
2 | {
3 | using Settings.ProgramSettings;
4 | using MLib.Interfaces;
5 | using System.Collections.Generic;
6 | using System.Xml.Serialization;
7 |
8 | public interface ISettingsManager : IOptionsPanel
9 | {
10 | void CheckSettingsOnLoad(double SystemParameters_VirtualScreenLeft, double SystemParameters_VirtualScreenTop);
11 |
12 | ////void LoadOptions(string settingsFileName);
13 | void LoadSessionData(string sessionDataFileName);
14 |
15 | ////bool SaveOptions(string settingsFileName, Settings.Interfaces.IOptions optionsModel);
16 | bool SaveSessionData(string sessionDataFileName, Settings.Interfaces.IProfile model);
17 |
18 | ///
19 | /// Get a list of all supported languages in Edi.
20 | ///
21 | ///
22 | IEnumerable GetSupportedLanguages();
23 |
24 | #region properties
25 | Settings.Interfaces.IProfile SessionData { get; }
26 |
27 | int IconSizeMin { get; }
28 | int IconSizeMax { get; }
29 |
30 | int FontSizeMin { get; }
31 | int FontSizeMax { get; }
32 |
33 | ///
34 | /// Gets the default icon size for the application.
35 | ///
36 | int DefaultIconSize { get; }
37 |
38 | ///
39 | /// Gets the default font size for the application.
40 | ///
41 | int DefaultFontSize { get; }
42 |
43 | ///
44 | /// Gets the default fixed font size for the application.
45 | ///
46 | int DefaultFixedFontSize { get; }
47 |
48 | ///
49 | /// Gets the internal name and Uri source for all available themes.
50 | ///
51 | [XmlIgnore]
52 | IThemeInfos Themes { get; }
53 | #endregion properties
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/source/Components/Settings/Settings/Interfaces/IViewPosSizeModel.cs:
--------------------------------------------------------------------------------
1 | namespace Settings.Interfaces
2 | {
3 | using System;
4 |
5 | public interface IViewPosSizeModel
6 | {
7 | bool DefaultConstruct { get; }
8 | double Height { get; set; }
9 | bool IsMaximized { get; set; }
10 | double Width { get; set; }
11 | double X { get; set; }
12 | double Y { get; set; }
13 |
14 | void SetValidPos(double SystemParameters_VirtualScreenLeft, double SystemParameters_VirtualScreenTop);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/source/Components/Settings/Settings/ProgramSettings/LanguageCollection.cs:
--------------------------------------------------------------------------------
1 | namespace Settings.ProgramSettings
2 | {
3 | using System;
4 |
5 | ///
6 | /// Base class for enumeration over languages (and their locale) that
7 | /// are supported with specific (non-English) button and tool tip strings.
8 | ///
9 | /// The class definition is based on BCP 47 which in turn is used to
10 | /// set the UI and thread culture (which in turn selects the correct
11 | /// string resource in MsgBox assembly).
12 | ///
13 | public class LanguageCollection
14 | {
15 | public string Language { get; set; }
16 | public string Locale { get; set; }
17 | public string Name { get; set; }
18 |
19 | ///
20 | /// Get BCP47 language tag for this language
21 | /// See also http://en.wikipedia.org/wiki/IETF_language_tag
22 | ///
23 | public string BCP47
24 | {
25 | get
26 | {
27 | if (string.IsNullOrEmpty(Locale) == false)
28 | return String.Format("{0}-{1}", Language, Locale);
29 | else
30 | return String.Format("{0}", Language);
31 | }
32 | }
33 |
34 | ///
35 | /// Get BCP47 language tag for this language
36 | /// See also http://en.wikipedia.org/wiki/IETF_language_tag
37 | ///
38 | public string DisplayName
39 | {
40 | get
41 | {
42 | return String.Format("{0} {1}", Name, BCP47);
43 | }
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/source/Components/Settings/Settings/ProgramSettings/OptionsPanel.cs:
--------------------------------------------------------------------------------
1 | namespace Settings.ProgramSettings
2 | {
3 | using Settings.Interfaces;
4 | using SettingsModel.Interfaces;
5 | using SettingsModel.Models;
6 |
7 | internal class OptionsPanel : IOptionsPanel
8 | {
9 | private IEngine mQuery = null;
10 |
11 | public OptionsPanel()
12 | {
13 | mQuery = Factory.CreateEngine();
14 | }
15 |
16 | ///
17 | /// Gets the options that used to manage program options.
18 | ///
19 | public IEngine Options
20 | {
21 | get
22 | {
23 | return mQuery;
24 | }
25 |
26 | private set
27 | {
28 | mQuery = value;
29 | }
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/source/Components/Settings/Settings/SerializableDictionary.cs:
--------------------------------------------------------------------------------
1 | namespace Settings
2 | {
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Globalization;
6 | using System.Runtime.Serialization;
7 | using System.Xml;
8 | using System.Xml.Serialization;
9 |
10 | ///
11 | /// This class represents a serializable dictionary implementation
12 | /// of the standard generic dictionary class in .Net.
13 | ///
14 | /// Source: http://www.jankowskimichal.pl/en/2010/10/serializabledictionary/
15 | ///
16 | [Serializable]
17 | public class SerializableDictionary : Dictionary, IXmlSerializable, ISerializable
18 | {
19 | #region Private Members
20 | private XmlSerializer _keySerializer;
21 | private XmlSerializer _valueSerializer;
22 | #endregion
23 |
24 | #region Constructors
25 | public SerializableDictionary()
26 | {
27 | }
28 |
29 | public SerializableDictionary(IDictionary dictionary)
30 | : base(dictionary)
31 | {
32 | }
33 |
34 | public SerializableDictionary(IEqualityComparer comparer)
35 | : base(comparer)
36 | {
37 | }
38 |
39 | public SerializableDictionary(int capacity)
40 | : base(capacity)
41 | {
42 | }
43 |
44 | public SerializableDictionary(IDictionary dictionary, IEqualityComparer comparer)
45 | : base(dictionary, comparer)
46 | {
47 | }
48 |
49 | public SerializableDictionary(int capacity, IEqualityComparer comparer)
50 | : base(capacity, comparer)
51 | {
52 | }
53 |
54 | #endregion
55 |
56 | #region Private Properties
57 | protected XmlSerializer ValueSerializer
58 | {
59 | get { return _valueSerializer ?? (_valueSerializer = new XmlSerializer(typeof(TVal))); }
60 | }
61 |
62 | private XmlSerializer KeySerializer
63 | {
64 | get { return _keySerializer ?? (_keySerializer = new XmlSerializer(typeof(TKey))); }
65 | }
66 | #endregion
67 |
68 | #region ISerializable Members
69 | protected SerializableDictionary(SerializationInfo info, StreamingContext context)
70 | {
71 | int itemCount = info.GetInt32("itemsCount");
72 | for (int i = 0; i < itemCount; i++)
73 | {
74 | KeyValuePair kvp = (KeyValuePair)info.GetValue(String.Format(CultureInfo.InvariantCulture, "Item{0}", i), typeof(KeyValuePair));
75 | Add(kvp.Key, kvp.Value);
76 | }
77 | }
78 |
79 | void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
80 | {
81 | info.AddValue("itemsCount", Count);
82 | int itemIdx = 0;
83 | foreach (KeyValuePair kvp in this)
84 | {
85 | info.AddValue(String.Format(CultureInfo.InvariantCulture, "Item{0}", itemIdx), kvp, typeof(KeyValuePair));
86 | itemIdx++;
87 | }
88 | }
89 | #endregion
90 |
91 | #region IXmlSerializable Members
92 | void IXmlSerializable.WriteXml(XmlWriter writer)
93 | {
94 | foreach (KeyValuePair kvp in this)
95 | {
96 | writer.WriteStartElement("item");
97 | writer.WriteStartElement("key");
98 | KeySerializer.Serialize(writer, kvp.Key);
99 | writer.WriteEndElement();
100 | writer.WriteStartElement("value");
101 | ValueSerializer.Serialize(writer, kvp.Value);
102 | writer.WriteEndElement();
103 | writer.WriteEndElement();
104 | }
105 | }
106 |
107 | void IXmlSerializable.ReadXml(XmlReader reader)
108 | {
109 | if (reader.IsEmptyElement)
110 | {
111 | return;
112 | }
113 | // Move past container
114 | if (reader.NodeType == XmlNodeType.Element && !reader.Read())
115 | {
116 | throw new XmlException("Error in Deserialization of SerializableDictionary");
117 | }
118 | while (reader.NodeType != XmlNodeType.EndElement)
119 | {
120 | reader.ReadStartElement("item");
121 | reader.ReadStartElement("key");
122 | TKey key = (TKey)KeySerializer.Deserialize(reader);
123 | reader.ReadEndElement();
124 | reader.ReadStartElement("value");
125 | TVal value = (TVal)ValueSerializer.Deserialize(reader);
126 | reader.ReadEndElement();
127 | reader.ReadEndElement();
128 | Add(key, value);
129 | reader.MoveToContent();
130 | }
131 | // Move past container
132 | if (reader.NodeType == XmlNodeType.EndElement)
133 | {
134 | reader.ReadEndElement();
135 | }
136 | else
137 | {
138 | throw new XmlException("Error in Deserialization of SerializableDictionary");
139 | }
140 | }
141 |
142 | System.Xml.Schema.XmlSchema IXmlSerializable.GetSchema()
143 | {
144 | return null;
145 | }
146 | #endregion
147 | }
148 | }
149 |
--------------------------------------------------------------------------------
/source/Components/Settings/Settings/Settings.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.0;net4.5.2
5 | true
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/source/Components/Settings/Settings/SettingsManager.cs:
--------------------------------------------------------------------------------
1 | namespace Settings
2 | {
3 | using MLib.Interfaces;
4 | using Settings.Interfaces;
5 | using Settings.Internal;
6 |
7 | ///
8 | /// Helper class to initialize an
9 | /// service interface.
10 | ///
11 | public sealed class SettingsManager
12 | {
13 | ///
14 | /// Hidden default constructor.
15 | ///
16 | private SettingsManager()
17 | {
18 | }
19 |
20 | ///
21 | /// Gets an instance of an object that implements the
22 | /// interface.
23 | ///
24 | ///
25 | public static ISettingsManager GetInstance(IThemeInfos themeInfos)
26 | {
27 | return new SettingsManagerImpl(themeInfos);
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/source/Components/Settings/Settings/UserProfile/IViewSize.cs:
--------------------------------------------------------------------------------
1 | namespace Settings.UserProfile
2 | {
3 | using System.Windows;
4 |
5 | ///
6 | /// Provide an interface to implement saving and loading/repositioning of Window or view.
7 | ///
8 | public interface IViewSize
9 | {
10 | //
11 | // Zusammenfassung:
12 | // Ruft die Position des linken Fensterrands im Verhältnis zum Desktop ab oder legt
13 | // diese fest.
14 | //
15 | // Rückgabewerte:
16 | // Die Position des linken Fensterrands in logischen Einheiten (1/96 Zoll).
17 | double Left { get; set; }
18 |
19 | //
20 | // Zusammenfassung:
21 | // Ruft die Position des oberen Fensterrands im Verhältnis zum Desktop ab oder legt
22 | // diese fest.
23 | //
24 | // Rückgabewerte:
25 | // Die Position des oberen Fensterrands in logischen Einheiten (1/96 ").
26 | double Top { get; set; }
27 |
28 | //
29 | // Zusammenfassung:
30 | // Ruft die Breite des Elements ab bzw. legt diese fest.
31 | //
32 | // Rückgabewerte:
33 | // Die Breite des Elements in geräteunabhängige Einheiten (1/96th inch per unit).Der
34 | // Standardwert ist System.Double.NaN.Dieser Wert muss größer oder gleich 0,0 sein.In
35 | // den Hinweisen finden Sie Informationen über obere Grenzen.
36 | double Width { get; set; }
37 |
38 | //
39 | // Zusammenfassung:
40 | // Ruft die vorgeschlagene Höhe des Elements ab oder legt diese fest.
41 | //
42 | // Rückgabewerte:
43 | // Die Höhe des Elements in geräteunabhängige Einheiten (1/96th inch per unit).Der
44 | // Standardwert ist System.Double.NaN.Dieser Wert muss größer oder gleich 0,0 sein.In
45 | // den Hinweisen finden Sie Informationen über obere Grenzen.
46 | double Height { get; set; }
47 |
48 | //
49 | // Zusammenfassung:
50 | // Ruft einen Wert ab, der angibt, ob ein Fenster wiederhergestellt, minimiert oder
51 | // maximiert ist, oder legt diesen fest.
52 | //
53 | // Rückgabewerte:
54 | // Ein System.Windows.WindowState, der bestimmt, ob ein Fenster wiederhergestellt,
55 | // minimiert oder maximiert ist.Der Standardwert ist System.Windows.WindowState.Normal
56 | // (wiederhergestellt).
57 | WindowState WindowState { get; set; }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/source/Components/Settings/Settings/UserProfile/LocalizabilityAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Settings.UserProfile
4 | {
5 | internal class LocalizabilityAttribute : Attribute
6 | {
7 | }
8 | }
--------------------------------------------------------------------------------
/source/Components/Settings/Settings/UserProfile/ViewSize.cs:
--------------------------------------------------------------------------------
1 | namespace Settings.UserProfile
2 | {
3 | // 50, 50, 800, 550
4 | public class ViewSize
5 | {
6 | public ViewSize(double x, double y, double width, double height)
7 | {
8 | X = x;
9 | Y = y;
10 | Width = width;
11 | Height = height;
12 | }
13 |
14 | public double X { get; private set; }
15 | public double Y { get; private set; }
16 | public double Width { get; private set; }
17 | public double Height { get; private set; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/source/Components/Settings/SettingsModel/ExtensionMethods/SecureStringExtensionMethod.cs:
--------------------------------------------------------------------------------
1 | namespace SettingsModel.ExtensionMethods
2 | {
3 | using System;
4 | using System.Runtime.InteropServices;
5 | using System.Security;
6 |
7 | ///
8 | /// Source: http://blogs.msdn.com/b/fpintos/archive/2009/06/12/how-to-properly-convert-securestring-to-string.aspx
9 | ///
10 | internal static class SecureStringExtensionMethod
11 | {
12 | public static string ConvertToUnsecureString(this SecureString securePassword)
13 | {
14 | if (securePassword == null)
15 | throw new ArgumentNullException("securePassword");
16 |
17 | IntPtr unmanagedString = IntPtr.Zero;
18 | try
19 | {
20 | unmanagedString = Marshal.SecureStringToGlobalAllocUnicode(securePassword);
21 | return Marshal.PtrToStringUni(unmanagedString);
22 | }
23 | finally
24 | {
25 | Marshal.ZeroFreeGlobalAllocUnicode(unmanagedString);
26 | }
27 | }
28 |
29 | public static SecureString ConvertToSecureString(this string password)
30 | {
31 | if (password == null)
32 | throw new ArgumentNullException("password");
33 |
34 | var securePassword = new SecureString();
35 | foreach (char c in password)
36 | securePassword.AppendChar(c);
37 |
38 | securePassword.MakeReadOnly();
39 | return securePassword;
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/source/Components/Settings/SettingsModel/Interfaces/IOptionsSchema.cs:
--------------------------------------------------------------------------------
1 | namespace SettingsModel.Interfaces
2 | {
3 | using SettingsModel.Models;
4 | using System;
5 | using System.Collections.Generic;
6 |
7 | ///
8 | /// Defines available schema information for 1 option.
9 | ///
10 | public interface IOptionsSchema
11 | {
12 | ///
13 | /// Gets the type of schema (list or single value)
14 | ///
15 | OptionSchemaType SchemaType { get; }
16 |
17 | ///
18 | /// Gets the name of an option.
19 | ///
20 | string OptionName { get; }
21 |
22 | ///
23 | /// Gets the type of the option being defined here.
24 | ///
25 | Type TypeOfValue { get; }
26 |
27 | ///
28 | /// Gets whether this options is optional or required.
29 | /// This is important when perisiting data and when reading
30 | /// data from persistance.
31 | ///
32 | bool IsOptional { get; }
33 |
34 | ///
35 | /// Gets the value of this option.
36 | ///
37 | object Value { get; }
38 |
39 | ///
40 | /// Gets/sets the default value of this option.
41 | ///
42 | object DefaultValue { get; }
43 |
44 | #region methods
45 | ///
46 | /// Removes the value with the specified key
47 | /// from the internal dictionary.
48 | ///
49 | /// The key of the element to remove.
50 | ///
51 | /// true if the element is successfully found and removed; otherwise, false.
52 | /// This method returns false if key is not found in
53 | /// the System.Collections.Generic.Dictionary<TKey,TValue>.
54 | ///
55 | /// Exceptions:
56 | /// System.ArgumentNullException:
57 | /// key is null.
58 | ///
59 | bool List_Remove(string key);
60 |
61 | ///
62 | /// Gets the value associated with the specified key.
63 | ///
64 | ///
65 | /// The key of the value to get.
66 | ///
67 | ///
68 | /// When this method returns, contains the value associated with the specified
69 | /// key, if the key is found; otherwise, the default value for the type of the
70 | /// value parameter. This parameter is passed uninitialized.
71 | ///
72 | ///
73 | /// true if the System.Collections.Generic.Dictionary<TKey,TValue> contains an
74 | /// element with the specified key; otherwise, false.
75 | ///
76 | /// Exceptions:
77 | /// System.ArgumentNullException:
78 | /// key is null.
79 | ///
80 | bool List_TryGetValue(string key, out object value);
81 |
82 | ///
83 | /// Sets the value of a given option in this option object.
84 | ///
85 | /// true if data actually changed (for dirty state tracking).
86 | /// Otherwise, false if requested value was already present.
87 | ///
88 | bool SetValue(object newValue);
89 |
90 | ///
91 | /// Add a list item in a list schema
92 | ///
93 | ///
94 | ///
95 | ///
96 | /// Returns true if item was succesfully added or false
97 | /// if schema is not a list schema.
98 | ///
99 | bool List_AddValue(string name, object value);
100 |
101 | ///
102 | /// Clear all items contained in a list.
103 | ///
104 | ///
105 | bool List_Clear();
106 |
107 | ///
108 | /// Gets a list of current values if this schema descripes a List.
109 | /// Return a single value schema as a list of 1 item.
110 | ///
111 | ///
112 | IEnumerable