Ejemplo n.º 1
0
        private bool InitSettings()
        {
            // get settings
            var(succeededSettings, errorSettings, settings) = SettingsService.GetYadexRetirementSettings();
            if (!succeededSettings)
            {
                MessageBox.Show($"Get all setting failed. {errorSettings}", "ERROR");
                return(false);
            }

            _settings = settings;
            return(true);
        }
Ejemplo n.º 2
0
        public MsgResult <string> UpdateYadexRetirementSettings(YadexRetirementSettings settings)
        {
            try
            {
                // Save to the current file path
                File.WriteAllText(CurrentFilePath, JsonSerializer.Serialize(settings));

                return(new MsgResult <string>());
            }
            catch (Exception e)
            {
                return(new MsgResult <string>($"Error happened to delete. \n{e.Message}\n{e.StackTrace}"));
            }
        }
 public SimpleAllocationService(YadexRetirementSettings settings)
 {
     _settings = Guard.NotNull(nameof(settings), settings);
 }