public async Task SearchAsync(TaxonRank rank, string name) { if (Shape != null && !Breadcrumbs.ContainsKey(rank)) { Breadcrumbs.Add(Rank, Shape.Copy()); } switch (rank) { case TaxonRank.Kingdom: Shape.Kingdom = name; break; case TaxonRank.Subkingdom: Shape.Subkingdom = name; break; case TaxonRank.Infrakingdom: Shape.Infrakingdom = name; break; case TaxonRank.Phylum: Shape.Phylum = name; break; case TaxonRank.Subphylum: Shape.Subphylum = name; break; case TaxonRank.Class: Shape.Class = name; break; case TaxonRank.Subclass: Shape.Subclass = name; break; case TaxonRank.Superorder: Shape.Superorder = name; break; case TaxonRank.Order: Shape.Order = name; break; case TaxonRank.Suborder: Shape.Suborder = name; break; case TaxonRank.Family: Shape.Family = name; break; case TaxonRank.Subfamily: Shape.Subfamily = name; break; case TaxonRank.Genus: Shape.Genus = name; break; case TaxonRank.Species: Shape.Species = name; break; } Rank = rank.GetChildRank(); Breadcrumbs[rank] = Shape.Copy(); await SearchAsync(); }