public ClockViewController(BedsideClock.Model.Options options) { this.options = options; textView = new UILabel { BackgroundColor = UIColor.Black, TextColor = UIColor.Green, Text = "12:00", TextAlignment = UITextAlignment.Center, UserInteractionEnabled = true, AdjustsFontSizeToFitWidth = true }; if (options.Font != null) textView.Font = UIFont.FromName(options.Font, 200); else textView.Font = textView.Font.WithSize(200); textView.AddGestureRecognizer(new UITapGestureRecognizer(ToggleNavigationBarVisibility)); Add(textView); timer = new Timer(1000); timer.AutoReset = true; timer.Elapsed += HandleElapsed; timer.Enabled = true; }
public Omdb(IDistributedCache cache, FetchService fetchService, IOptionsMonitor <Model.Options> optionsAccessor) { _cache = cache ?? throw new ArgumentNullException(nameof(cache)); _fetchService = fetchService ?? throw new ArgumentNullException(nameof(fetchService)); _options = optionsAccessor.CurrentValue ?? throw new ArgumentNullException(nameof(optionsAccessor)); }
public Model.Options GetOptions() { Model.Options options = new Model.Options { Use24Hour = use24Hour.Value, ShowSeconds = showSeconds.Value, }; if (fontGroup.Selected >= 0) { if (fontGroup.Selected < customFontNames.Count) options.Font = customFontNames[fontGroup.Selected]; else options.Font = standardFontNames[fontGroup.Selected - customFontNames.Count]; } return options; }
private static Model.Options GetCompilerOptionsFrom(XmlNode section) { var options = new Model.Options(); foreach (XmlAttribute attribute in section.Attributes) { switch (attribute.Name.ToLower()) { case "debug": options.Debug = bool.Parse(attribute.Value); break; case "autorecompilation": options.AutoRecompilation = bool.Parse(attribute.Value); break; case "allowpartiallytrustedcallers": options.AllowPartiallyTrustedCallers = bool.Parse(attribute.Value); break; case "temporarysourcefilesdirectory": options.TemporarySourceFilesDirectory = attribute.Value; break; case "savefiles": options.SaveFiles = bool.Parse(attribute.Value); break; default: throw new ConfigurationErrorsException(string.Format("Config error: Unknown attribute [{0}] in aspview config section", attribute.Name)); } } return options; }
EditContext.NotifyFieldChanged(new FieldIdentifier(Model.Options, nameof(Model.Options.MetadataAddress)));