public static void WriteOptions() { var serializer = new JsonSerializer(); var opt = new InitialOptions(); opt.CopyCurrent(); using (StreamWriter sw = new StreamWriter(configPath)) using (JsonWriter writer = new JsonTextWriter(sw)) { serializer.Serialize(writer, opt); } }
private static void InitializeSettings() { var serializer = new JsonSerializer(); var opt = new InitialOptions(); opt.SetDefaults(); opt.MapToOptions(); using (StreamWriter sw = new StreamWriter(configPath)) using (JsonWriter writer = new JsonTextWriter(sw)) { serializer.Serialize(writer, opt); } }
private static void SetOptions() { var settings = new JsonSerializerSettings(); settings.Converters.Add(new KeyGestureConverter()); var serializer = JsonSerializer.Create(settings); var opt = new InitialOptions(); using (StreamReader sr = new StreamReader(configPath)) { opt = (InitialOptions)serializer.Deserialize(sr, typeof(InitialOptions)); opt.MapToOptions(); } }
public FlowController(ILogger <FlowController> logger, IFlowManager flowManager, IOptions <InitialOptions> optionsAccessor) { this._logger = logger; this._flowManager = flowManager; _initialOptions = optionsAccessor.Value; }