コード例 #1
0
        private void initEntries(string correct, string init, List <string> options)
        {
            Options = new List <RadioEntry>();
            foreach (string option in options)
            {
                var entry = new RadioEntry(option, option.Equals(init));
                entry.EntrySelected += handleSelectedChanged;
                Options.Add(entry);
            }

            this.correct = Options.Where(o => o.Value.Equals(correct)).FirstOrDefault();
            this.init    = Options.Where(o => o.Value.Equals(init)).FirstOrDefault();
        }
コード例 #2
0
 private void handleSelectedChanged(object sender, RadioEntry entry)
 {
     Options.ForEach(o => o.Selected = o.Equals(entry));
     ControlChanged?.Invoke(this, new ClickEvent(this, entry.Value, DateTime.Now));
 }