public static ActionInfoWithDynamicImageMapCollection GetImageMaps(IEnumerable <MapAreaInfo> mapAreaInfoList, ActionInfoWithDynamicImageMapCollection actions, ReportItem reportItem) { List <ActionInfoWithDynamicImageMap> list = new List <ActionInfoWithDynamicImageMap>(); bool[] array = new bool[actions.Count]; foreach (MapAreaInfo mapAreaInfo in mapAreaInfoList) { MapAreaInfo current = mapAreaInfo; int num = MappingHelper.AddMapArea(current, actions, reportItem); if (num > -1 && !array[num]) { list.Add(((ReportElementCollectionBase <ActionInfoWithDynamicImageMap>)actions)[num]); array[num] = true; } else if (!string.IsNullOrEmpty(current.ToolTip)) { string text = default(string); ActionInfoWithDynamicImageMap actionInfoWithDynamicImageMap = MappingHelper.CreateActionInfoDynamic(reportItem, (ActionInfo)null, current.ToolTip, out text); if (actionInfoWithDynamicImageMap != null) { actionInfoWithDynamicImageMap.CreateImageMapAreaInstance(current.MapAreaShape, current.Coordinates, current.ToolTip); list.Add(actionInfoWithDynamicImageMap); } } } actions.InternalList.Clear(); actions.InternalList.AddRange(list); if (actions.Count == 0) { return(null); } return(actions); }
private static int AddMapArea(MapAreaInfo mapAreaInfo, ActionInfoWithDynamicImageMapCollection actions, ReportItem reportItem) { if (mapAreaInfo.Tag == null) { return(-1); } int num = (int)mapAreaInfo.Tag; ActionInfoWithDynamicImageMap actionInfoWithDynamicImageMap = actions.InternalList[num]; if (actionInfoWithDynamicImageMap.Actions.Count <= 0 && string.IsNullOrEmpty(mapAreaInfo.ToolTip)) { return(-1); } actionInfoWithDynamicImageMap.CreateImageMapAreaInstance(mapAreaInfo.MapAreaShape, mapAreaInfo.Coordinates, mapAreaInfo.ToolTip); return(num); }