private void DlgSelectGroups_Loaded(object sender, RoutedEventArgs e) { try { Title = PNLang.Instance.GetControlText(Name, "Contacts groups"); PNLang.Instance.ApplyControlLanguage(this); if (PNStatic.Contacts.Any(c => c.GroupID == -1)) { var gr = new _Group { Name = "(None)", ID = -1 }; var item = new PNListBoxItem(null, gr.Name, gr, gr.Name, false); item.ListBoxItemCheckChanged += item_ListBoxItemCheckChanged; lstGroups.Items.Add(item); } foreach (var cg in PNStatic.ContactGroups.Where(cg => PNStatic.Contacts.Any(c => c.GroupID == cg.ID))) { var gr = new _Group { Name = cg.Name, ID = cg.ID }; var item = new PNListBoxItem(null, gr.Name, gr, gr.Name, false); item.ListBoxItemCheckChanged += item_ListBoxItemCheckChanged; lstGroups.Items.Add(item); } } catch (Exception ex) { PNStatic.LogException(ex); } }
internal WndGetDicts(IEnumerable<DictData> list) : this() { foreach (var dc in list) { var item = new PNListBoxItem(null, dc.LangName, dc.ZipFile, false); item.ListBoxItemCheckChanged += item_ListBoxItemCheckChanged; lstDicts.Items.Add(item); } }
internal WndGetThemes(IEnumerable<ThemesUpdate> listThemes) : this() { PNSingleton.Instance.ThemesDownload = true; foreach (var th in listThemes) { var item = new PNListBoxItem(null, th.FriendlyName + " " + th.Suffix, th, false); item.ListBoxItemCheckChanged += item_ListBoxItemCheckChanged; lstThemes.Items.Add(item); } }
public WndGetPlugins(IEnumerable<PluginsUpdate> pluginsList) : this() { PNSingleton.Instance.PluginsDownload = true; var plugins = pluginsList as PluginsUpdate[] ?? pluginsList.ToArray(); foreach (var p in plugins.Where(p => p.Type == 0)) { var item = new PNListBoxItem(null, p.Name + " " + p.Suffix, p, false); item.ListBoxItemCheckChanged += item_ListBoxItemCheckChanged; lstSocial.Items.Add(item); } foreach (var p in plugins.Where(p => p.Type == 1)) { var item = new PNListBoxItem(null, p.Name + " " + p.Suffix, p, false); item.ListBoxItemCheckChanged += item_ListBoxItemCheckChanged; lstSync.Items.Add(item); } }
private void DlgSelectContacts_Loaded(object sender, RoutedEventArgs e) { try { Title = PNLang.Instance.GetControlText("lblContacts", "Contacts"); PNLang.Instance.ApplyControlLanguage(this); foreach (var c in PNStatic.Contacts) { var pti = new PNListBoxItem(null, c.Name, c, c.Name, false); pti.ListBoxItemCheckChanged += pti_ListBoxItemCheckChanged; lstContacts.Items.Add(pti); } } catch (Exception ex) { PNStatic.LogException(ex); } }
private void fillPlugins() { try { foreach (var p in PNPlugins.Instance.SocialPlugins) { var socItem = new PNListBoxItem(null, p.Name, p, _SocialPlugins.Contains(p.Name)); socItem.ListBoxItemCheckChanged += socIte_ListBoxItemCheckChanged; lstSocial.Items.Add(socItem); } foreach (var p in PNPlugins.Instance.SyncPlugins) { var syncPlugin = new PNListBoxItem(null, p.Name, p, _SyncPlugins.Contains(p.Name)); syncPlugin.ListBoxItemCheckChanged += syncPlugin_ListBoxItemCheckChanged; lstSyncPlugins.Items.Add(syncPlugin); } } catch (Exception ex) { PNStatic.LogException(ex); } }