Пример #1
0
        public void Execute()
        {
            var inputConfig = inputConfigProvider.FindConfigForName(configName);

            if (inputConfig == null)
            {
                return;
            }

            Result = zipper.Zip(inputConfig);
        }
Пример #2
0
        public void FindConfigForName_FindsConfig()
        {
            var c = new InputConfiguration {
                Name = "test"
            };
            var cc = new InputConfiguration {
                Name = "test2"
            };

            provider.Add(c);
            provider.Add(cc);
            var p = provider.FindConfigForName("test2");

            Assert.AreEqual(cc, p);
            Assert.AreNotEqual(c, p);
        }
Пример #3
0
        public void Execute()
        {
            var config = inputConfigProvider.FindConfigForName(configName);

            if (config == null)
            {
                Result = new ApiResult <Object>
                {
                    Content      = "Fail",
                    Success      = false,
                    Message      = "Fail",
                    ErrorMessage = $"Input configuration with name {configName} was not found"
                };
                return;
            }

            try
            {
                if (config.HasView)
                {
                    // TODO: Remove view folder and files and media
                }
                storageProvider.RemoveInputConfiguration(config);
                inputConfigProvider.Remove(config);
                Result = new ApiResult <Object>
                {
                    Content = "OK",
                    Success = true,
                    Message = "Ok"
                };
            }
            catch (Exception e)
            {
                Result = new ApiResult <Object>
                {
                    Success      = false,
                    Message      = "Failed to remove configuration " + configName,
                    ErrorMessage = e.Message
                };
            }
        }
Пример #4
0
        public void Execute()
        {
            var c = inputConfigProvider.FindConfigForName(configName);

            if (c != null)
            {
                Result = new ApiResult <InputConfiguration>
                {
                    Content = c,
                    Success = true,
                    Message = "Ok"
                };
                return;
            }

            Result = new ApiResult <InputConfiguration>
            {
                Success      = false,
                Message      = "Failed to get input configuration " + configName,
                ErrorMessage = "Failed to get input configuration " + configName
            };
        }