private void RemoveSelectedTrigger() { if (SelectedTrigger == null || string.IsNullOrEmpty(SelectedCommand)) { return; } var indexToRemove = TriggerList.IndexOf(SelectedTrigger); availableCommands.GetAllTriggers(selectedCommand).RemoveAt(indexToRemove); TriggerList.RemoveAt(indexToRemove); }
private void SetSelectedItem() { List <Trigger> triggerList = availableCommands.GetAllTriggers(selectedCommand); bool foundFreeKey = false; foreach (Key key in Enum.GetValues(typeof(Key))) { foundFreeKey = CheckWhichKeyToUse(foundFreeKey, triggerList, key); } }
//ncrunch: no coverage start public void SaveInput(CommandList commandList, Service service) { var root = CreateMainRoot("InputCommands"); foreach (var command in commandList.GetCommands()) SetCommand(root, command, commandList.GetAllTriggers(command)); var bytes = new XmlFile(root).ToMemoryStream().ToArray(); var fileNameAndBytes = new Dictionary<string, byte[]>(); fileNameAndBytes.Add("InputCommands.xml", bytes); var metaDataCreator = new ContentMetaDataCreator(); var contentMetaData = metaDataCreator.CreateMetaDataFromInputData(bytes); service.UploadContent(contentMetaData, fileNameAndBytes); }
//ncrunch: no coverage start public void SaveInput(CommandList commandList, Service service) { var root = CreateMainRoot("InputCommands"); foreach (var command in commandList.GetCommands()) { SetCommand(root, command, commandList.GetAllTriggers(command)); } var bytes = new XmlFile(root).ToMemoryStream().ToArray(); var fileNameAndBytes = new Dictionary <string, byte[]>(); fileNameAndBytes.Add("InputCommands.xml", bytes); var metaDataCreator = new ContentMetaDataCreator(); var contentMetaData = metaDataCreator.CreateMetaDataFromInputData(bytes); service.UploadContent(contentMetaData, fileNameAndBytes); }