void BuildAutomaticSitesGroups() { SiteGroupsList.Clear(); Dictionary <string, List <string> > sitenames = new Dictionary <string, List <string> >(); var siteutils = OnlineVideoSettings.Instance.SiteUtilsList; foreach (string name in siteutils.Keys) { Sites.SiteUtilBase site; if (siteutils.TryGetValue(name, out site)) { if (site.Settings.IsEnabled && (!site.Settings.ConfirmAge || !OnlineVideoSettings.Instance.UseAgeConfirmation || OnlineVideoSettings.Instance.AgeConfirmed)) { string key = string.IsNullOrEmpty(site.Settings.Language) ? "--" : site.Settings.Language; List <string> listForLang = null; if (!sitenames.TryGetValue(key, out listForLang)) { listForLang = new List <string>(); sitenames.Add(key, listForLang); } listForLang.Add(site.Settings.Name); } } } foreach (string aLang in sitenames.Keys.ToList().OrderBy(l => l)) { SiteGroupsList.Add(new SiteGroupViewModel(LanguageCodeLocalizedConverter.GetLanguageInUserLocale(aLang), string.Format(@"LanguageFlagsBig\{0}.png", aLang), sitenames[aLang])); } SiteGroupsList.FireChange(); }
void OnlineVideosMessageReceived(AsynchronousMessageQueue queue, SystemMessage message) { if (message.ChannelName == OnlineVideosMessaging.CHANNEL) { OnlineVideosMessaging.MessageType messageType = (OnlineVideosMessaging.MessageType)message.MessageType; switch (messageType) { case OnlineVideosMessaging.MessageType.RebuildSites: SiteGroupsList.Clear(); SitesList.Clear(); sitesListHasAllSites = false; break; } } }