public async Task <string> RenderAsync(string model) { // get all available skins SkinAccess skinAccess = new SkinAccess(); List <SelectionItem <string> > list = (from theme in skinAccess.GetHighlightJSThemeList() select new SelectionItem <string>() { Text = theme.Name, Value = theme.Name, }).ToList(); bool useDefault = PropData.GetAdditionalAttributeValue <bool>("NoDefault", false); if (useDefault) { list.Insert(0, new SelectionItem <string> { Text = this.__ResStr("default", "(Site Default)"), Tooltip = this.__ResStr("defaultTT", "Use the site defined default theme"), Value = "", }); } else if (model == null) { model = SkinAccess.GetHighlightJSDefaultSkin(); } return(await DropDownListComponent.RenderDropDownListAsync(this, model, list, "yt_yetawf_syntaxhighlighter_highlightjs")); }
public async Task <string> RenderAsync(string model) { using (ExchangeRateDataProvider dp = new ExchangeRateDataProvider()) { ExchangeRateData data = await dp.GetItemAsync(); List <SelectionItem <string> > list = (from r in data.Rates orderby r.CurrencyName select new SelectionItem <string> { Text = r.CurrencyName, Value = r.Code }).ToList(); return(await DropDownListComponent.RenderDropDownListAsync(this, model, list, "yt_yetawf_currencyconverter_country")); } }