private void RepopulateMovedCategory(object source, ListingEventArgs e) { Category category = source as Category; if (category == null) { return; } // Remove all existing room listings from the category (non-recursive). ICollection <Listing> listingsCollection = category.GetListings(); Listing[] listingsArray = new Listing[listingsCollection.Count]; category.GetListings().CopyTo(listingsArray, 0); foreach (Listing listing in listingsArray) { if (listing is GuestRoomListing) { listing.PrimaryCategory = null; } } foreach (GuestRoomListing listing in GetGuestRoomListings(category.IdString)) // TODO: Make the maximum amount configurable. { listing.PrimaryCategory = category; } CoreManager.ServerCore.GetStandardOut().PrintDebug("Repopulated moved category \"" + category.IdString + "\" with rooms."); }
private void PopulateNewCategory(object source, ListingEventArgs e) { Category category = source as Category; foreach (GuestRoomListing listing in GetGuestRoomListings(category.IdString)) // TODO: Make the maximum amount configurable. { listing.PrimaryCategory = category; } CoreManager.ServerCore.GetStandardOut().PrintDebug("Populated new category \"" + category.IdString + "\" with rooms."); }
private void PopulateNewCategory(object source, ListingEventArgs e) { Category category = source as Category; foreach (GuestRoomListing listing in GetGuestRoomListings(category.IdString)) // TODO: Make the maximum amount configurable. { listing.PrimaryCategory = category; } CoreManager.ServerCore.GetStandardOut().PrintDebug("Populated new category \"" + category.IdString + "\" with rooms."); }
private void RepopulateMovedCategory(object source, ListingEventArgs e) { Category category = source as Category; if (category == null) return; // Remove all existing room listings from the category (non-recursive). ICollection<Listing> listingsCollection = category.GetListings(); Listing[] listingsArray = new Listing[listingsCollection.Count]; category.GetListings().CopyTo(listingsArray, 0); foreach (Listing listing in listingsArray) { if (listing is GuestRoomListing) listing.PrimaryCategory = null; } foreach (GuestRoomListing listing in GetGuestRoomListings(category.IdString)) // TODO: Make the maximum amount configurable. { listing.PrimaryCategory = category; } CoreManager.ServerCore.GetStandardOut().PrintDebug("Repopulated moved category \"" + category.IdString + "\" with rooms."); }