| | 1 | | using System; |
| | 2 | |
|
| | 3 | | public interface IPlacesAndEventsSectionComponentController : IDisposable |
| | 4 | | { |
| | 5 | | /// <summary> |
| | 6 | | /// It will be triggered when the section want to request to close the ExploreV2 main menu. |
| | 7 | | /// </summary> |
| | 8 | | event Action OnCloseExploreV2; |
| | 9 | | } |
| | 10 | |
|
| | 11 | | public class PlacesAndEventsSectionComponentController : IPlacesAndEventsSectionComponentController |
| | 12 | | { |
| | 13 | | public event Action OnCloseExploreV2; |
| | 14 | |
|
| | 15 | | internal IPlacesAndEventsSectionComponentView view; |
| | 16 | | internal IEventsSubSectionComponentController eventsSubSectionComponentController; |
| | 17 | |
|
| 1 | 18 | | public PlacesAndEventsSectionComponentController(IPlacesAndEventsSectionComponentView view) |
| | 19 | | { |
| 1 | 20 | | this.view = view; |
| | 21 | |
|
| 1 | 22 | | eventsSubSectionComponentController = new EventsSubSectionComponentController( |
| | 23 | | view.currentEventsSubSectionComponentView, |
| | 24 | | new EventsAPIController()); |
| | 25 | |
|
| 1 | 26 | | eventsSubSectionComponentController.OnCloseExploreV2 += RequestExploreV2Closing; |
| 1 | 27 | | } |
| | 28 | |
|
| 0 | 29 | | private void RequestExploreV2Closing() { OnCloseExploreV2?.Invoke(); } |
| | 30 | |
|
| | 31 | | public void Dispose() |
| | 32 | | { |
| 1 | 33 | | eventsSubSectionComponentController.OnCloseExploreV2 -= RequestExploreV2Closing; |
| 1 | 34 | | eventsSubSectionComponentController.Dispose(); |
| 1 | 35 | | } |
| | 36 | | } |