コード例 #1
0
        private void RemoveSelectedTrigger()
        {
            if (SelectedTrigger == null || string.IsNullOrEmpty(SelectedCommand))
            {
                return;
            }
            var indexToRemove = TriggerList.IndexOf(SelectedTrigger);

            availableCommands.GetAllTriggers(selectedCommand).RemoveAt(indexToRemove);
            TriggerList.RemoveAt(indexToRemove);
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
		//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);
		}
コード例 #4
0
        //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);
        }