| | 1 | | using DCL.Browser; |
| | 2 | | using DCL.Providers; |
| | 3 | | using DCL.Social.Friends; |
| | 4 | | using DCL.Tasks; |
| | 5 | | using DCLServices.Lambdas.NamesService; |
| | 6 | | using DCLServices.SubscriptionsAPIService; |
| | 7 | | using SocialFeaturesAnalytics; |
| | 8 | | using System.Threading; |
| | 9 | |
|
| | 10 | | namespace DCL.MyAccount |
| | 11 | | { |
| | 12 | | public class MyAccountPlugin : IPlugin |
| | 13 | | { |
| 0 | 14 | | private readonly CancellationTokenSource cts = new (); |
| | 15 | |
|
| | 16 | | private MyAccountSectionHUDController myAccountSectionHUDController; |
| | 17 | | private MyProfileController myProfileController; |
| | 18 | | private EmailNotificationsController emailNotificationsController; |
| | 19 | | private BlockedListController blockedListController; |
| | 20 | |
|
| 0 | 21 | | public MyAccountPlugin() |
| | 22 | | { |
| 0 | 23 | | Initialize(cts.Token); |
| 0 | 24 | | } |
| | 25 | |
|
| | 26 | | private async void Initialize(CancellationToken ct) |
| | 27 | | { |
| 0 | 28 | | var myAccountSectionView = await Environment.i.serviceLocator.Get<IAddressableResourceProvider>() |
| | 29 | | .Instantiate<MyAccountSectionHUDComponentView>("MyAccountSection |
| | 30 | |
|
| 0 | 31 | | var updateEmailConfirmationHUD = await Environment.i.serviceLocator.Get<IAddressableResourceProvider>() |
| | 32 | | .Instantiate<UpdateEmailConfirmationHUDComponentView>("Upd |
| | 33 | |
|
| 0 | 34 | | ProfileAdditionalInfoValueListScriptableObject countryListProvider = await Environment.i.serviceLocator.Get< |
| | 35 | | .GetAddressable<Profil |
| | 36 | |
|
| 0 | 37 | | ProfileAdditionalInfoValueListScriptableObject genderListProvider = await Environment.i.serviceLocator.Get<I |
| | 38 | | .GetAddressable<Profile |
| | 39 | |
|
| 0 | 40 | | ProfileAdditionalInfoValueListScriptableObject sexualOrientationProvider = await Environment.i.serviceLocato |
| | 41 | | .GetAddressable< |
| | 42 | |
|
| 0 | 43 | | ProfileAdditionalInfoValueListScriptableObject employmentStatusProvider = await Environment.i.serviceLocator |
| | 44 | | .GetAddressable<P |
| | 45 | |
|
| 0 | 46 | | ProfileAdditionalInfoValueListScriptableObject relationshipStatusProvider = await Environment.i.serviceLocat |
| | 47 | | .GetAddressable |
| | 48 | |
|
| 0 | 49 | | ProfileAdditionalInfoValueListScriptableObject languageListProvider = await Environment.i.serviceLocator.Get |
| | 50 | | .GetAddressable<Profi |
| | 51 | |
|
| 0 | 52 | | ProfileAdditionalInfoValueListScriptableObject pronounListProvider = await Environment.i.serviceLocator.Get< |
| | 53 | | .GetAddressable<Profil |
| | 54 | |
|
| 0 | 55 | | var dataStore = DataStore.i; |
| | 56 | |
|
| 0 | 57 | | var userProfileWebInterfaceBridge = new UserProfileWebInterfaceBridge(); |
| | 58 | |
|
| 0 | 59 | | var socialAnalytics = new SocialAnalytics(Environment.i.platform.serviceProviders.analytics, userProfileWebI |
| | 60 | |
|
| 0 | 61 | | myAccountSectionHUDController = new MyAccountSectionHUDController( |
| | 62 | | myAccountSectionView, |
| | 63 | | dataStore); |
| | 64 | |
|
| 0 | 65 | | myProfileController = new MyProfileController( |
| | 66 | | myAccountSectionView.CurrentMyProfileView, |
| | 67 | | dataStore, |
| | 68 | | userProfileWebInterfaceBridge, |
| | 69 | | Environment.i.serviceLocator.Get<INamesService>(), |
| | 70 | | new WebInterfaceBrowserBridge(), |
| | 71 | | myAccountSectionHUDController, |
| | 72 | | KernelConfig.i, |
| | 73 | | new MyAccountAnalyticsService(Environment.i.platform.serviceProviders.analytics), |
| | 74 | | socialAnalytics, |
| | 75 | | countryListProvider, |
| | 76 | | genderListProvider, |
| | 77 | | sexualOrientationProvider, |
| | 78 | | employmentStatusProvider, |
| | 79 | | relationshipStatusProvider, |
| | 80 | | languageListProvider, |
| | 81 | | pronounListProvider); |
| | 82 | |
|
| 0 | 83 | | emailNotificationsController = new EmailNotificationsController( |
| | 84 | | myAccountSectionView.CurrentEmailNotificationsView, |
| | 85 | | updateEmailConfirmationHUD, |
| | 86 | | myAccountSectionHUDController, |
| | 87 | | dataStore, |
| | 88 | | Environment.i.serviceLocator.Get<ISubscriptionsAPIService>(), |
| | 89 | | socialAnalytics); |
| | 90 | |
|
| 0 | 91 | | blockedListController = new BlockedListController( |
| | 92 | | myAccountSectionView.CurrentBlockedListComponentView, |
| | 93 | | dataStore, |
| | 94 | | userProfileWebInterfaceBridge, |
| | 95 | | new WebInterfaceBlockedListApiBridge(), |
| | 96 | | socialAnalytics, |
| | 97 | | Environment.i.serviceLocator.Get<IFriendsController>()); |
| 0 | 98 | | } |
| | 99 | |
|
| | 100 | | public void Dispose() |
| | 101 | | { |
| 0 | 102 | | cts.SafeCancelAndDispose(); |
| 0 | 103 | | myProfileController.Dispose(); |
| 0 | 104 | | emailNotificationsController.Dispose(); |
| 0 | 105 | | myAccountSectionHUDController.Dispose(); |
| 0 | 106 | | blockedListController.Dispose(); |
| 0 | 107 | | } |
| | 108 | | } |
| | 109 | | } |