private string DescribeProblem(ExtractionInformation extractionInformation) { //Get the Catalogue that this ExtractionInformation is descended from var descendancy = _childProvider.GetDescendancyListIfAnyFor(extractionInformation); if (descendancy != null) { var catalogue = descendancy.Parents.OfType <Catalogue>().SingleOrDefault(); if (catalogue != null) { //if we know the Catalogue extractability //ExtractionCategory.ProjectSpecific should match the Catalogue extractability.IsProjectSpecific //otherwise it's a Problem if (catalogue.IsProjectSpecific(null)) { if (extractionInformation.ExtractionCategory != ExtractionCategory.ProjectSpecific) { return("Catalogue " + catalogue + " is Project Specific Catalogue so all ExtractionCategory should be " + ExtractionCategory.ProjectSpecific); } } else if (extractionInformation.ExtractionCategory == ExtractionCategory.ProjectSpecific) { return("ExtractionCategory is only valid when the Catalogue ('" + catalogue + "') is also ProjectSpecific"); } } } return(null); }
public void OnRefreshObject(ICoreChildProvider childProvider, RefreshObjectEventArgs e) { if (_tree == null) { return; } var alwaysShowList = _tree.ModelFilter as AlwaysShowListOnlyFilter; if (_beforeModelFilter is CatalogueCollectionFilter f1) { f1.ChildProvider = childProvider; } if (_tree.ModelFilter is CatalogueCollectionFilter f2) { f2.ChildProvider = childProvider; } //someone somehow erased the pin filter? or overwrote it with another filter if (alwaysShowList == null) { return; } if (_toPin != null) { RefreshAlwaysShowList(childProvider, childProvider.GetDescendancyListIfAnyFor(_toPin)); } }
public bool Filter(object modelObject) { var cata = modelObject as Catalogue; //doesn't relate to us... but maybe we are descended from a Catalogue? if (cata == null) { var descendancy = _childProvider.GetDescendancyListIfAnyFor(modelObject); if (descendancy != null) { cata = descendancy.Parents.OfType <Catalogue>().SingleOrDefault(); } if (cata == null) { return(true); } } bool isProjectSpecific = cata.IsProjectSpecific(null); bool isExtractable = cata.GetExtractabilityStatus(null) != null && cata.GetExtractabilityStatus(null).IsExtractable; return((isExtractable && !cata.IsColdStorageDataset && !cata.IsDeprecated && !cata.IsInternalDataset && !isProjectSpecific) || ((_isColdStorage && cata.IsColdStorageDataset) || (_isDeprecated && cata.IsDeprecated) || (_isInternal && cata.IsInternalDataset) || (_isProjectSpecific && isProjectSpecific) || (_isNonExtractable && !isExtractable))); }
public void OnRefreshObject(ICoreChildProvider childProvider, RefreshObjectEventArgs e) { if(_tree == null) return; var whitelistFilter = _tree.ModelFilter as WhiteListOnlyFilter; //someone somehow erased the pin filter? or overwrote it with another filter if(whitelistFilter == null) return; if(_toPin != null) RefreshWhiteList(childProvider,childProvider.GetDescendancyListIfAnyFor(_toPin)); }
private void SetAspectGet(ICoreChildProvider childProvider) { AspectGetter = (o) => { if (o == null) { return("Null"); } var parent = childProvider.GetDescendancyListIfAnyFor(o)?.GetMostDescriptiveParent(); return(parent != null ? $"{o.ID} {o.GetType().Name} {o} ({parent})" : $"{o.ID} {o.GetType().Name} {o}"); }; _scorer = new SearchablesMatchScorer(); _scorer.TypeNames = new HashSet <string>(_masterCollection.Select(m => m.Key.GetType().Name).Distinct(), StringComparer.CurrentCultureIgnoreCase); }
public ConsoleGuiSelectOne(ICoreChildProvider coreChildProvider, IMapsDirectlyToDatabaseTable[] availableObjects) : this() { _masterCollection = availableObjects.ToDictionary(k => k, v => coreChildProvider.GetDescendancyListIfAnyFor(v)); SetAspectGet(coreChildProvider); }