Example #1
0
        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);
                }
        }
Example #2
0
        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);
                }
        }
Example #3
0
        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();
            }
        }
Example #4
0
 public FlowController(ILogger <FlowController> logger, IFlowManager flowManager, IOptions <InitialOptions> optionsAccessor)
 {
     this._logger      = logger;
     this._flowManager = flowManager;
     _initialOptions   = optionsAccessor.Value;
 }