private void RestoreButtonClickHandler(object sender, RoutedEventArgs e)
        {
            var temp = new DeckNewOptions();

            viewModel.Options.Bury               = temp.Bury;
            viewModel.Options.Delays             = temp.Delays;
            viewModel.Options.EasyInterval       = temp.EasyInterval;
            viewModel.Options.GraduatingInterval = temp.GraduatingInterval;
            viewModel.Options.InitialFactor      = temp.InitialFactor;
            viewModel.Options.Order              = temp.Order;
            viewModel.Options.PerDay             = temp.PerDay;
        }
Ejemplo n.º 2
0
 public void GetOptionsToView()
 {
     try
     {
         Options.Delays             = Utils.JsonNumberArrayToString(Config.GetNamedArray("delays"));
         Options.GraduatingInterval = (int)Config.GetNamedArray("ints").GetNumberAt(0);
         Options.EasyInterval       = (int)Config.GetNamedArray("ints").GetNumberAt(1);
         Options.InitialFactor      = (int)(Config.GetNamedNumber("initialFactor") / 10);
         Options.Order  = (int)Config.GetNamedNumber("order");
         Options.PerDay = (int)Config.GetNamedNumber("perDay");
         Options.Bury   = Config.GetNamedBoolean("bury", false);
     }
     catch //If any error happen we back to default
     {
         Options = new DeckNewOptions();
     }
 }
Ejemplo n.º 3
0
 public DeckNewOptionsViewModel(JsonObject config)
 {
     this.Config = config.GetNamedObject("new");
     Options     = new DeckNewOptions();
 }