/// <summary> /// Registers a hot key in the system. /// </summary> /// <param name="modifier">The modifiers that are associated with the hot key.</param> /// <param name="key">The key itself that is associated with the hot key.</param> public void RegisterHotKey(HotkeysData.ModifierKeys modifier, Keys key) { if (key == Keys.None) return; //allow disable hotkeys using "None" key // increment the counter. _currentId++; // register the hot key. if (!RegisterHotKey(_window.Handle, _currentId, (uint) modifier, (uint) key)) MessageBox.Show(LP.RegisterHotKeyError + " " + key + LP.AlreadyInUse); }
public CopyKey(string header, string footer, string content, HotkeysData.ModifierKeys modifier, Keys key, string orderBy, string order, string lowDpsContent, int lowDpsThreshold) { Content = content; Header = header; Footer = footer; Modifier = modifier; Key = key; OrderBy = orderBy; Order = order; LowDpsContent = lowDpsContent; LowDpsThreshold = lowDpsThreshold; }
private BasicTeraData(string resourceDirectory) { ResourceDirectory = resourceDirectory; Directory.CreateDirectory(Path.Combine(resourceDirectory, "config")); //ensure config dir is created XmlConfigurator.Configure(new Uri(Path.Combine(ResourceDirectory, "log4net.xml"))); HotkeysData = new HotkeysData(this); WindowData = new WindowData(this); EventsData = new EventsData(this); _dataForRegion = Helpers.Memoize<string, TeraData>(region => new TeraData(region)); Servers = new ServerDatabase(Path.Combine(ResourceDirectory, "data")); //handle overrides var serversOverridePath = Path.Combine(ResourceDirectory, "config/server-overrides.txt"); if (!File.Exists(serversOverridePath))//create the default file if it doesn't exist File.WriteAllText(serversOverridePath, LP.ServerOverrides ); var overriddenServers = GetServers(serversOverridePath).ToList(); Servers.AddOverrides(overriddenServers); ImageDatabase = new ImageDatabase(Path.Combine(ResourceDirectory, "img/")); Icons = new IconsDatabase(Path.Combine(ResourceDirectory, "data/")); }
internal KeyPressedEventArgs(HotkeysData.ModifierKeys modifier, Keys key) { Modifier = modifier; Key = key; }