-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed the Base64 Image tool to use the Code editor instead of a Tex…
…t box (#532) * Changed the Base64 Image tool to use the Code editor instead of a Text box * Fixed keyboard navigation
- Loading branch information
Showing
8 changed files
with
95 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...vToys/ViewModels/Tools/EncodersDecoders/Base64ImageEncoderDecoder/MockSettingsProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#nullable enable | ||
|
||
using System; | ||
using System.Diagnostics; | ||
using DevToys.Api.Core.Settings; | ||
using DevToys.Core.Settings; | ||
|
||
namespace DevToys.ViewModels.Tools.Base64ImageEncoderDecoder | ||
{ | ||
internal class MockSettingsProvider : ISettingsProvider | ||
{ | ||
private readonly ISettingsProvider _realSettingsProvider; | ||
|
||
public event EventHandler<SettingChangedEventArgs>? SettingChanged; | ||
|
||
public MockSettingsProvider(ISettingsProvider realSettingsProvider) | ||
{ | ||
_realSettingsProvider = realSettingsProvider; | ||
} | ||
|
||
public T GetSetting<T>(SettingDefinition<T> settingDefinition) | ||
{ | ||
if (settingDefinition.Name == PredefinedSettings.TextEditorTextWrapping.Name) | ||
{ | ||
// Force to wrap the text of the code editor. | ||
Debug.Assert(typeof(T) == typeof(bool)); | ||
return (T)(object)true; | ||
} | ||
else if (settingDefinition.Name == PredefinedSettings.TextEditorLineNumbers.Name) | ||
{ | ||
// Force to hide the line numbers of the code editor. | ||
Debug.Assert(typeof(T) == typeof(bool)); | ||
return (T)(object)false; | ||
} | ||
|
||
return _realSettingsProvider.GetSetting(settingDefinition); | ||
} | ||
|
||
public void ResetSetting<T>(SettingDefinition<T> settingDefinition) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void SetSetting<T>(SettingDefinition<T> settingDefinition, T value) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters