// Установка отоброжаемых записей public static void SetDisplayedRecords(string componentName, List <string> recordsId) { if (AllDisplayedRecords == null) { AllDisplayedRecords = new Dictionary <string, List <string> >(); } if (DisplayedRecords == null) { DisplayedRecords = new Dictionary <string, List <string> >(); } List <string> records = recordsId?.Where(val => val != null)?.ToList(); if (!DisplayedRecords.ContainsKey(componentName)) { DisplayedRecords.Add(componentName, records); } else { DisplayedRecords[componentName] = records; } if (!AllDisplayedRecords.ContainsKey(componentName)) { AllDisplayedRecords.Add(componentName, records); } else { AllDisplayedRecords[componentName] = records; } }
// Восстановление контекста public static void RestoreContext(List <View> views) { views.ForEach(view => { view.BusObject.BusObjectComponents.ForEach(component => { SetSelectedRecord(component.BusComp.Name, AllSelectedRecords.GetValueOrDefault(component.Name)); SetDisplayedRecords(component.BusComp.Name, AllDisplayedRecords.GetValueOrDefault(component.Name)); if (AllSearchSpecifications != null) { Dictionary <string, dynamic> searchSpecifications = AllSearchSpecifications.GetValueOrDefault(component.Name); if (searchSpecifications != null) { if (searchSpecifications.ContainsKey("SearchSpecArgs")) { SetSearchSpecification(component.Name, SearchSpecTypes.SearchSpecArgs, searchSpecifications["SearchSpecArgs"]); } if (searchSpecifications.ContainsKey("SearchSpecification")) { SetSearchSpecification(component.Name, SearchSpecTypes.SearchSpecification, searchSpecifications["SearchSpecification"]); } if (searchSpecifications.ContainsKey("SearchSpecificationByParent")) { SetSearchSpecification(component.Name, SearchSpecTypes.SearchSpecificationByParent, searchSpecifications["SearchSpecificationByParent"]); } } } }); }); }
// Получение отоброжаемых записей со всех компонент public static List <string> GetAllDisplayedRecords(string componentName) => AllDisplayedRecords.GetValueOrDefault(componentName);