public void ReadSettings(ISettingsReader settings) { settings.EnsureKey(this.Name + ":Port", "9971"); settings.EnsureKey(this.Name + ":ChromeExtension", "mnkmaflojambglihddgpalgbfmogokfd"); int port = 0; if (!int.TryParse(settings[this.Name + ":Port"], out port)) { port = 9971; } _port = port; _chromeExtension = settings[this.Name + ":ChromeExtension"]; }
public void ReadSettings(ISettingsReader settings) { settings.EnsureKey(this.Name + ":" + JukeboxCommand.Play.ToString(), "CTRL+ALT+SHIFT+Up"); settings.EnsureKey(this.Name + ":" + JukeboxCommand.Pause.ToString(), "CTRL+ALT+SHIFT+Down"); settings.EnsureKey(this.Name + ":" + JukeboxCommand.PreviousTrack.ToString(), "CTRL+ALT+SHIFT+Left"); settings.EnsureKey(this.Name + ":" + JukeboxCommand.NextTrack.ToString(), "CTRL+ALT+SHIFT+Right"); foreach (string commandName in Enum.GetNames(typeof(JukeboxCommand))) { if (commandName == "PlayAfterPause") continue; var keys = settings[this.Name + ":" + commandName]; if (string.IsNullOrEmpty(keys)) continue; var command = (JukeboxCommand)Enum.Parse(typeof(JukeboxCommand), commandName); RegisterHotKey(keys, command); } }
public void ReadSettings(ISettingsReader settings) { settings.EnsureKey(this.Name + ":Port", "9972"); int port = 0; if (!int.TryParse(settings[this.Name + ":Port"], out port)) { port = 9972; } _remote.Port = port; }
public void ReadSettings(ISettingsReader settings) { settings.EnsureKey(this.Name + ":" + JukeboxCommand.Play.ToString(), "CTRL+ALT+SHIFT+Up"); settings.EnsureKey(this.Name + ":" + JukeboxCommand.Pause.ToString(), "CTRL+ALT+SHIFT+Down"); settings.EnsureKey(this.Name + ":" + JukeboxCommand.PreviousTrack.ToString(), "CTRL+ALT+SHIFT+Left"); settings.EnsureKey(this.Name + ":" + JukeboxCommand.NextTrack.ToString(), "CTRL+ALT+SHIFT+Right"); foreach (string commandName in Enum.GetNames(typeof(JukeboxCommand))) { if (commandName == "PlayAfterPause") { continue; } var keys = settings[this.Name + ":" + commandName]; if (string.IsNullOrEmpty(keys)) { continue; } var command = (JukeboxCommand)Enum.Parse(typeof(JukeboxCommand), commandName); RegisterHotKey(keys, command); } }
private void Setup <T>(List <T> list) where T : IName { if (_settings == null) { return; } list.ForEach((item) => { _settings.EnsureKey(item.Name + ":Activated", "no"); if (item is ISettable) { ((ISettable)item).ReadSettings(_settings); } }); }
public void ReadSettings(ISettingsReader settings) { settings.EnsureKey(this.Name + ":Port", "9972"); int port = 0; if (!int.TryParse(settings[this.Name + ":Port"], out port)) port = 9972; _remote.Port = port; }
public void ReadSettings(ISettingsReader settings) { settings.EnsureKey(this.Name + ":Port", "9971"); settings.EnsureKey(this.Name + ":ChromeExtension", "mnkmaflojambglihddgpalgbfmogokfd"); int port = 0; if (!int.TryParse(settings[this.Name + ":Port"], out port)) port = 9971; _port = port; _chromeExtension = settings[this.Name + ":ChromeExtension"]; }