-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FZ Editor] Layout hotkeys: add the schema element to zones-settings.…
…json (#10132)
- Loading branch information
1 parent
72da703
commit de23098
Showing
5 changed files
with
147 additions
and
0 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
58 changes: 58 additions & 0 deletions
58
src/modules/fancyzones/editor/FancyZonesEditor/Models/FastAccessKeysModel.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,58 @@ | ||
// Copyright (c) Microsoft Corporation | ||
// The Microsoft Corporation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace FancyZonesEditor.Models | ||
{ | ||
public class FastAccessKeysModel | ||
{ | ||
public static SortedDictionary<int, string> SelectedKeys { get; } = new SortedDictionary<int, string>() | ||
{ | ||
{ 0, string.Empty }, | ||
{ 1, string.Empty }, | ||
{ 2, string.Empty }, | ||
{ 3, string.Empty }, | ||
{ 4, string.Empty }, | ||
{ 5, string.Empty }, | ||
{ 6, string.Empty }, | ||
{ 7, string.Empty }, | ||
{ 8, string.Empty }, | ||
{ 9, string.Empty }, | ||
}; | ||
|
||
public FastAccessKeysModel() | ||
{ | ||
} | ||
|
||
public static void FreeKey(int key) | ||
{ | ||
if (SelectedKeys.ContainsKey(key)) | ||
{ | ||
SelectedKeys[key] = string.Empty; | ||
} | ||
} | ||
|
||
public static bool SelectKey(int key, string uuid) | ||
{ | ||
if (!SelectedKeys.ContainsKey(key)) | ||
{ | ||
return false; | ||
} | ||
|
||
SelectedKeys[key] = uuid; | ||
return true; | ||
} | ||
|
||
public static void CleanUp() | ||
{ | ||
var keys = SelectedKeys.Keys.ToList(); | ||
foreach (var key in keys) | ||
{ | ||
SelectedKeys[key] = string.Empty; | ||
} | ||
} | ||
} | ||
} |
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