private IEnumerable <SplitKey> GetPossibleRemoteSettingKeys(string collectionPath, string key) { string str = collectionPath + " $" + key; string fullCollectionPath = Path.Combine(CurrentCollectionPath, collectionPath); string fullCollectionPathWithKey = Path.Combine(fullCollectionPath, key + "*"); if (remoteSettingsStorage.CollectionExists(fullCollectionPathWithKey)) { logger.LogVerbose(str + " has multiple possible values"); foreach (string item in from s in remoteSettingsStorage.GetPropertyNames(fullCollectionPathWithKey) orderby s select s) { yield return(SplitKey.CreateFromStorageName(fullCollectionPathWithKey, item)); } } yield return(new SplitKey(fullCollectionPath, key)); }
public XmlElement ToXml(XmlDocument document, string name = "HotkeyProfile") { var parent = document.CreateElement(name); var splitKey = document.CreateElement("SplitKey"); if (SplitKey != null) { splitKey.InnerText = SplitKey.ToString(); } parent.AppendChild(splitKey); var resetKey = document.CreateElement("ResetKey"); if (ResetKey != null) { resetKey.InnerText = ResetKey.ToString(); } parent.AppendChild(resetKey); var skipKey = document.CreateElement("SkipKey"); if (SkipKey != null) { skipKey.InnerText = SkipKey.ToString(); } parent.AppendChild(skipKey); var undoKey = document.CreateElement("UndoKey"); if (UndoKey != null) { undoKey.InnerText = UndoKey.ToString(); } parent.AppendChild(undoKey); var pauseKey = document.CreateElement("PauseKey"); if (PauseKey != null) { pauseKey.InnerText = PauseKey.ToString(); } parent.AppendChild(pauseKey); var toggleKey = document.CreateElement("ToggleGlobalHotkeys"); if (ToggleGlobalHotkeys != null) { toggleKey.InnerText = ToggleGlobalHotkeys.ToString(); } parent.AppendChild(toggleKey); var switchComparisonPrevious = document.CreateElement("SwitchComparisonPrevious"); if (SwitchComparisonPrevious != null) { switchComparisonPrevious.InnerText = SwitchComparisonPrevious.ToString(); } parent.AppendChild(switchComparisonPrevious); var switchComparisonNext = document.CreateElement("SwitchComparisonNext"); if (SwitchComparisonNext != null) { switchComparisonNext.InnerText = SwitchComparisonNext.ToString(); } parent.AppendChild(switchComparisonNext); CreateSetting(document, parent, "GlobalHotkeysEnabled", GlobalHotkeysEnabled); CreateSetting(document, parent, "DeactivateHotkeysForOtherPrograms", DeactivateHotkeysForOtherPrograms); CreateSetting(document, parent, "DoubleTapPrevention", DoubleTapPrevention); CreateSetting(document, parent, "HotkeyDelay", HotkeyDelay); return(parent); }