private static AddressAndLocationCollection getLocationsByWhitespaceTrimmedLocationName(List<AddressAndLocation> currentLocations, AddressAndLocation[] sourceLocations) { AddressAndLocationCollection result = new AddressAndLocationCollection(); var sourceLocationNames = sourceLocations.Select(loc => loc.Location.LocationName.Trim()); var locationsToSet = sourceLocationNames.Select(name => currentLocations.FirstOrDefault(loc => loc.Location.LocationName.Trim() == name)) .Where(loc => loc != null); result.CollectionContent.AddRange(locationsToSet); return result; }
internal static IEnumerable <ShortTextObject> getLocationCollectionTexts(AddressAndLocationCollection locationCollection) { return(locationCollection.GetIDSelectedArray().OrderBy(location => location.Location.LocationName) .Select(location => { var textShort = ShortTextObject.CreateDefault(); textShort.Content = location.ID; return textShort; })); }
internal static void Update_Activity_LocationCollection(Activity activity, AddressAndLocationCollection localCollection, AddressAndLocationCollection masterCollection) { if (localCollection == null) { activity.LocationCollection = AddressAndLocationCollection.CreateDefault(); localCollection = activity.LocationCollection; } localCollection.CollectionContent = masterCollection.CollectionContent; if (localCollection.OrderFilterIDList == null) { localCollection.OrderFilterIDList = new List <string>(); } }
internal static void Update_Blog_LocationCollection(Blog blog, AddressAndLocationCollection localCollection, AddressAndLocationCollection masterCollection) { if (localCollection == null) { blog.LocationCollection = AddressAndLocationCollection.CreateDefault(); localCollection = blog.LocationCollection; } localCollection.CollectionContent = masterCollection.CollectionContent; if (localCollection.OrderFilterIDList == null) { localCollection.OrderFilterIDList = new List <string>(); } }
internal static void Update_GroupContainer_LocationCollection(GroupContainer groupContainer, AddressAndLocationCollection localCollection, AddressAndLocationCollection masterCollection) { if (localCollection == null) { groupContainer.LocationCollection = AddressAndLocationCollection.CreateDefault(); localCollection = groupContainer.LocationCollection; } localCollection.CollectionContent = masterCollection.CollectionContent; if (localCollection.OrderFilterIDList == null) { localCollection.OrderFilterIDList = new List <string>(); } }
/* * internal static void Update_Category_ParentCategories(Category category, CategoryCollection localCollection, CategoryCollection masterCollection) * { * if (localCollection == null) * { * category.ParentCategories = CategoryCollection.CreateDefault(); * localCollection = category.ParentCategories; * } * localCollection.CollectionContent = masterCollection.CollectionContent; * if (localCollection.OrderFilterIDList == null) * localCollection.OrderFilterIDList = new List<string>(); * }*/ internal static void Update_TextContent_Locations(TextContent textContent, AddressAndLocationCollection localCollection, AddressAndLocationCollection masterCollection) { // TODO: Remove objects, that are no longer available in master }
internal static void Update_LocationContainer_Locations(LocationContainer locationContainer, AddressAndLocationCollection localCollection, AddressAndLocationCollection masterCollection) { localCollection.CollectionContent = masterCollection.CollectionContent; if (localCollection.OrderFilterIDList == null) { localCollection.OrderFilterIDList = new List <string>(); } }
internal static void Update_AccountModule_LocationCollection(AccountModule accountModule, AddressAndLocationCollection localCollection, AddressAndLocationCollection masterCollection) { localCollection.CollectionContent = masterCollection.CollectionContent; if (localCollection.OrderFilterIDList == null) { localCollection.OrderFilterIDList = new List <string>(); } }
internal static void Update_MapContainer_MarkerSourceLocations(MapContainer mapContainer, AddressAndLocationCollection localCollection, AddressAndLocationCollection masterCollection) { mapContainer.MapMarkers.CollectionContent.RemoveAll( marker => marker.MarkerSource == MapMarker.MarkerSourceLocationValue); return; var mapMarkersFromLocation = masterCollection.CollectionContent. Select(loc => { MapMarker marker = MapMarker.CreateDefault(); marker.Location = loc.Location; marker.MarkerSource = MapMarker.MarkerSourceLocationValue; marker.IconUrl = "../oip-additions/oip-assets/oip-images/oip-markers/OIP-marker-1.png"; marker.SetLocationTextFromLocation(loc.Location); return(marker); }).ToArray(); mapContainer.MapMarkers.CollectionContent.AddRange(mapMarkersFromLocation); }