Esempio n. 1
0
        public static async Task <MyConfig> LoadDaemonConfig(this ISimpleConfigFile simpleConfigFile)
        {
            var config = await simpleConfigFile.ReadFile <MyConfig>(null).ConfigureAwait(false);

            if (config == null)
            {
                config = new MyConfig();
                config.ProcessInfos.Add(new SimpleProcessInfo()
                {
                    ProcessName = "FooClient", ExePath = "FooClient.exe", ExeArgs = null
                });
                config.ServiceInfo = new WindowServiceInfo()
                {
                    ServiceName = "MockService", ServicePath = "FooClientWs.exe", ServiceFriendlyName = "000-MockService"
                };
                await simpleConfigFile.SaveFile(config).ConfigureAwait(false);
            }
            return(config);
        }
        public static Task SaveFile <T>(this ISimpleConfigFile simpleConfigFile, T value) where T : ISimpleConfig
        {
            var filePath = GetDefaultConfigFilePath <T>(simpleConfigFile);

            return(simpleConfigFile.SaveFile(filePath, value));
        }
Esempio n. 3
0
 public void SaveConfig(HttpTestConfig config)
 {
     AsyncHelper.RunSync(() => SimpleConfigFile.SaveFile(config));
 }