示例#1
0
        public void AddOrUpdate_AddsWhenNewInstance()
        {
            var c = new InputConfiguration();

            provider.AddOrUpdate(c);
            Assert.AreEqual(1, provider.Configs.Count());
            Assert.AreEqual(c, provider.Configs.First());
        }
示例#2
0
        public void Execute()
        {
            try
            {
                SaveToStorage();
                CreateViewFolderIfNeeded();
                CreateMediaFolder();
                inputConfigProvider.AddOrUpdate(configuration);

                Result = new ApiResult <object>
                {
                    Content = "empty",
                    Success = true,
                    Message = "Ok"
                };
            }
            catch (Exception e)
            {
                Result = new ApiResult <object>
                {
                    Content      = "empty",
                    Success      = false,
                    Message      = "Failed to save input configuration " + configuration.Name,
                    ErrorMessage = e.Message
                };
            }
        }
示例#3
0
        private void SaveConfigurations(IEnumerable <InputConfiguration> configurations, ZipFile zip)
        {
            foreach (var configuration in configurations)
            {
                inputConfigProvider.AddOrUpdate(configuration);
                storageProvider.SaveInputConfiguration(configuration);

                if (configuration.HasView)
                {
                    SaveView(zip, appConfigProvider.AppConfig.WebRoot);
                }

                SaveMedia(zip, appConfigProvider.AppConfig.WebRoot);
            }
        }