Beispiel #1
0
        public void Dispose()
        {
            var models = HotKeys.Select(hotKey =>
            {
                hotKey.UnRegister();

                return(new HotKeyModel(hotKey.Service.ServiceName, hotKey.Key, hotKey.Modifiers, hotKey.IsActive));
            });

            try
            {
                var json = JsonConvert.SerializeObject(models);

                File.WriteAllText(GetFilePath(), json);
            }
            catch
            {
                // Ignore Errors
            }
        }
Beispiel #2
0
 /// <inheritdoc />
 public override List <Tuple <VirtualKeys, Modifiers> > GetActiveHotKeys()
 {
     return(HotKeys.Select(hotKey => new Tuple <VirtualKeys, Modifiers>(hotKey.Key.Key, hotKey.Key.Modifiers)).ToList());
 }