| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- using CronAlarm.Config;
- using Microsoft.AspNetCore.Components;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
- namespace CronAlarm.Pages
- {
- public partial class AlertSelection : IComponent
- {
- [Inject]
- private AlertConfig Config { get; set; }
- private IDictionary<string, int> SelectedOptions { get; set; } = new Dictionary<string, int>();
- public AlertSelection()
- {
- SelectedOptions["Weekdays"] = 1;
- }
- private void ToggleOption(string group, int index)
- {
- if (SelectedOptions.ContainsKey(group) && SelectedOptions[group] == index)
- {
- // set to "unselected"
- index = -1;
- }
- SelectedOptions[group] = index;
- }
- private string ActiveClass(string group, int index)
- {
- return SelectedOptions.ContainsKey(group) && SelectedOptions[group] == index ? "active" : string.Empty;
- }
- private void Save()
- {
- //this.
- }
- private void Reset()
- {
- }
- }
- }
|