private static List <ResourceItem> PopulateResourceKeys(DataConnection connection = null) { List <ResourceItem> retVal = new List <ResourceItem>(); foreach (Menu menu in Configuration.GetInstance().Menus) { retVal.AddRange(Menu.GetResourceKeys(menu)); } foreach (Screen screen in Configuration.GetInstance().Screens) { retVal.AddRange(Screen.GetResourceKeys(screen)); } foreach (Lookup lookup in Configuration.GetInstance().Lookups) { ILookupProvider lookupDB = LookupService.GetInstance().LookupProvider; lookupDB.Connection = connection; Lookup data = data = lookupDB.GetLookupItems(lookup.Name, null); foreach (LookupItem row in data.Items) { ResourceItem key = new ResourceItem(); key.ResourceSet = String.Format("Lookup.{0}", data.Name); key.Key = row.Value; key.Value = row.Description; retVal.Add(key); } } return(retVal); }
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { //the actual list of standard items to return StandardValuesCollection list = null; ILookupProvider lookupDB = LookupService.GetInstance().LookupProvider; Lookup data = lookupDB.GetLookupItems("DOCUMENT_TYPE", null); StringCollection collection = new StringCollection(); foreach (LookupItem record in data.Items) { collection.Add(record.Value); } list = new StandardValuesCollection(collection); return(list); }