示例#1
0
 /// <summary>
 /// Populate this list view with custom modules, marking those saved in my settings as selected.
 /// </summary>
 /// <param name="view">The view to populate.</param>
 /// <param name="toIgnore">Keys of modules to ignore.</param>
 protected void PopulateCustomModulesListView(ListView view, List <string> toIgnore)
 {
     foreach (AvailableModule module in
              RestAPIWrapper.GetModulesHavingEmailRelationships()
              .OrderBy(i => i.module_key))
     {
         if (!toIgnore.Contains(module.module_key))
         {
             view.Items.Add(new ListViewItem
             {
                 Checked  = IsSelectedCustomModule(module),
                 Text     = module.module_key,
                 Tag      = module.module_key,
                 SubItems = { string.IsNullOrWhiteSpace(module.module_label) ?
                              module.module_key :
                              module.module_label }
             });
         }
     }
 }