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;
 }
コード例 #2
0
 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;
     }));
 }
コード例 #3
0
 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>();
     }
 }
コード例 #4
0
 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>();
     }
 }
コード例 #5
0
 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>();
     }
 }
コード例 #6
0
        /*
         * 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
        }
コード例 #7
0
 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>();
     }
 }
コード例 #8
0
 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>();
     }
 }
コード例 #9
0
        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);
        }