private void ResolveDependencies()
        {
            var container = ServicesContainer.instance;

            m_Application     = container.Resolve <ApplicationProxy>();
            m_AssetStoreCache = container.Resolve <AssetStoreCache>();
        }
Пример #2
0
 private void ResolveDependencies(ResourceLoader resourceLoader,
                                  ExtensionManager extensionManager,
                                  SelectionProxy selection,
                                  PackageFiltering packageFiltering,
                                  PackageManagerPrefs packageManagerPrefs,
                                  PackageDatabase packageDatabase,
                                  PageManager pageManager,
                                  PackageManagerProjectSettingsProxy settingsProxy,
                                  UnityConnectProxy unityConnectProxy,
                                  ApplicationProxy applicationProxy,
                                  UpmClient upmClient,
                                  AssetStoreCachePathProxy assetStoreCachePathProxy)
 {
     m_ResourceLoader           = resourceLoader;
     m_ExtensionManager         = extensionManager;
     m_Selection                = selection;
     m_PackageFiltering         = packageFiltering;
     m_PackageManagerPrefs      = packageManagerPrefs;
     m_PackageDatabase          = packageDatabase;
     m_PageManager              = pageManager;
     m_SettingsProxy            = settingsProxy;
     m_UnityConnectProxy        = unityConnectProxy;
     m_ApplicationProxy         = applicationProxy;
     m_UpmClient                = upmClient;
     m_AssetStoreCachePathProxy = assetStoreCachePathProxy;
 }
Пример #3
0
        public void ResolveDependencies(ApplicationProxy application,
                                        SelectionProxy selection,
                                        UnityConnectProxy unityConnect,
                                        PackageFiltering packageFiltering,
                                        PackageManagerPrefs packageManagerPrefs,
                                        UpmClient upmClient,
                                        UpmRegistryClient upmRegistryClient,
                                        AssetStoreClient assetStoreClient,
                                        PackageDatabase packageDatabase,
                                        PackageManagerProjectSettingsProxy settingsProxy)
        {
            m_Application         = application;
            m_Selection           = selection;
            m_UnityConnect        = unityConnect;
            m_PackageFiltering    = packageFiltering;
            m_PackageManagerPrefs = packageManagerPrefs;
            m_UpmClient           = upmClient;
            m_UpmRegistryClient   = upmRegistryClient;
            m_AssetStoreClient    = assetStoreClient;
            m_PackageDatabase     = packageDatabase;
            m_SettingsProxy       = settingsProxy;

            foreach (var page in m_SerializedSimplePages)
            {
                page.ResolveDependencies(packageDatabase, packageFiltering);
            }
            foreach (var page in m_SerializedPaginatedPage)
            {
                page.ResolveDependencies(packageDatabase, assetStoreClient, packageFiltering, packageManagerPrefs);
            }
        }
Пример #4
0
 public RemoveFoldoutGroup(ApplicationProxy applicationProxy,
                           PackageManagerPrefs packageManagerPrefs,
                           PackageDatabase packageDatabase,
                           PageManager pageManager)
     : base(new PackageRemoveButton(applicationProxy, packageManagerPrefs, packageDatabase, pageManager), null)
 {
 }
        private void ResolveDependencies()
        {
            var container = ServicesContainer.instance;

            m_Application = container.Resolve <ApplicationProxy>();
            m_IOProxy     = container.Resolve <IOProxy>();
        }
Пример #6
0
        public static void OpenWebUrl(string onlineUrl, IPackageVersion version, ApplicationProxy applicationProxy, string analyticsEvent, Action errorCallback)
        {
            var request = UnityWebRequest.Head(onlineUrl);

            try
            {
                var operation = request.SendWebRequest();
                operation.completed += (op) =>
                {
                    if (request.responseCode >= 200 && request.responseCode < 300)
                    {
                        applicationProxy.OpenURL(onlineUrl);
                        PackageManagerWindowAnalytics.SendEvent($"{analyticsEvent}ValidUrl", version?.uniqueId);
                    }
                    else
                    {
                        errorCallback?.Invoke();
                    }
                };
            }
            catch (InvalidOperationException e)
            {
                if (e.Message != "Insecure connection not allowed")
                {
                    throw e;
                }
            }
        }
Пример #7
0
        private void ResolveDependencies()
        {
            var container = ServicesContainer.instance;

            m_ResourceLoader   = container.Resolve <ResourceLoader>();
            m_SettingsProxy    = container.Resolve <PackageManagerProjectSettingsProxy>();
            m_ApplicationProxy = container.Resolve <ApplicationProxy>();
        }
Пример #8
0
 public PackageResetButton(ApplicationProxy applicationProxy,
                           PackageDatabase packageDatabase,
                           PageManager pageManager)
 {
     m_Application     = applicationProxy;
     m_PackageDatabase = packageDatabase;
     m_PageManager     = pageManager;
 }
Пример #9
0
        private void ResolveDependencies()
        {
            var container = ServicesContainer.instance;

            m_ResourceLoader  = container.Resolve <ResourceLoader>();
            m_Application     = container.Resolve <ApplicationProxy>();
            m_PageManager     = container.Resolve <PageManager>();
            m_PackageDatabase = container.Resolve <PackageDatabase>();
        }
Пример #10
0
        private void ResolveDependencies()
        {
            var container = ServicesContainer.instance;

            m_ResourceLoader      = container.Resolve <ResourceLoader>();
            m_Application         = container.Resolve <ApplicationProxy>();
            m_PackageFiltering    = container.Resolve <PackageFiltering>();
            m_PageManager         = container.Resolve <PageManager>();
            m_AssetStoreCallQueue = container.Resolve <AssetStoreCallQueue>();
        }
Пример #11
0
        public void ResolveDependencies(ClientProxy clientProxy,
                                        ApplicationProxy applicationProxy)
        {
            m_ClientProxy      = clientProxy;
            m_ApplicationProxy = applicationProxy;

            m_GetCacheRootOperation?.ResolveDependencies(m_ClientProxy, m_ApplicationProxy);
            m_SetCacheRootOperation?.ResolveDependencies(m_ClientProxy, m_ApplicationProxy);
            m_ClearCacheRootOperation?.ResolveDependencies(m_ClientProxy, m_ApplicationProxy);
        }
Пример #12
0
 public PackageRemoveButton(ApplicationProxy applicationProxy,
                            PackageManagerPrefs packageManagerPrefs,
                            PackageDatabase packageDatabase,
                            PageManager pageManager)
 {
     m_Application         = applicationProxy;
     m_PackageManagerPrefs = packageManagerPrefs;
     m_PackageDatabase     = packageDatabase;
     m_PageManager         = pageManager;
 }
 public PackageUpdateButton(ApplicationProxy applicationProxy,
                            PackageDatabase packageDatabase,
                            PageManager pageManager,
                            bool showVersion = true)
 {
     m_Application     = applicationProxy;
     m_PackageDatabase = packageDatabase;
     m_PageManager     = pageManager;
     m_ShowVersion     = showVersion;
 }
Пример #14
0
        private void ResolveDependencies()
        {
            var container = ServicesContainer.instance;

            m_ResourceLoader            = container.Resolve <ResourceLoader>();
            m_AssetStoreCachePathProxy  = container.Resolve <AssetStoreCachePathProxy>();
            m_UpmCacheRootClient        = container.Resolve <UpmCacheRootClient>();
            m_ApplicationProxy          = container.Resolve <ApplicationProxy>();
            m_AssetStoreDownloadManager = container.Resolve <AssetStoreDownloadManager>();
            m_ClientProxy = container.Resolve <ClientProxy>();
        }
Пример #15
0
        public void ResolveDependencies(ApplicationProxy application, AssetStoreUtils assetStoreUtils, HttpClientFactory httpClientFactory, IOProxy systemIOProxy)
        {
            m_Application       = application;
            m_HttpClientFactory = httpClientFactory;
            m_IOProxy           = systemIOProxy;

            foreach (var productInfo in m_ProductInfos.Values)
            {
                productInfo.ResolveDependencies(assetStoreUtils);
            }
        }
Пример #16
0
        private void ResolveDependencies()
        {
            var container = ServicesContainer.instance;

            m_ResourceLoader      = container.Resolve <ResourceLoader>();
            m_ExtensionManager    = container.Resolve <ExtensionManager>();
            m_Application         = container.Resolve <ApplicationProxy>();
            m_PackageManagerPrefs = container.Resolve <PackageManagerPrefs>();
            m_PackageDatabase     = container.Resolve <PackageDatabase>();
            m_PageManager         = container.Resolve <PageManager>();
            m_UnityConnectProxy   = container.Resolve <UnityConnectProxy>();
        }
Пример #17
0
        private void ResolveDependencies()
        {
            var container = ServicesContainer.instance;

            m_Application = container.Resolve <ApplicationProxy>();
            m_AssetStoreDownloadManager = container.Resolve <AssetStoreDownloadManager>();
            m_AssetStoreCache           = container.Resolve <AssetStoreCache>();
            m_PackageManagerPrefs       = container.Resolve <PackageManagerPrefs>();
            m_PackageDatabase           = container.Resolve <PackageDatabase>();
            m_PageManager       = container.Resolve <PageManager>();
            m_UnityConnectProxy = container.Resolve <UnityConnectProxy>();
        }
Пример #18
0
 public void ResolveDependencies(ApplicationProxy application,
                                 UnityConnectProxy unityConnect,
                                 PackageFiltering packageFiltering,
                                 AssetStoreClient assetStoreClient,
                                 AssetStoreCache assetStoreCache,
                                 PageManager pageManager)
 {
     m_Application      = application;
     m_UnityConnect     = unityConnect;
     m_PackageFiltering = packageFiltering;
     m_AssetStoreClient = assetStoreClient;
     m_AssetStoreCache  = assetStoreCache;
     m_PageManager      = pageManager;
 }
Пример #19
0
        private void ResolveDependencies()
        {
            var container = ServicesContainer.instance;

            m_ResourceLoader            = container.Resolve <ResourceLoader>();
            m_Application               = container.Resolve <ApplicationProxy>();
            m_PackageDatabase           = container.Resolve <PackageDatabase>();
            m_PageManager               = container.Resolve <PageManager>();
            m_PackageManagerPrefs       = container.Resolve <PackageManagerPrefs>();
            m_AssetStoreClient          = container.Resolve <AssetStoreClient>();
            m_AssetStoreDownloadManager = container.Resolve <AssetStoreDownloadManager>();
            m_AssetStoreCache           = container.Resolve <AssetStoreCache>();
            m_AssetStoreCallQueue       = container.Resolve <AssetStoreCallQueue>();
            m_PackageFiltering          = container.Resolve <PackageFiltering>();
        }
Пример #20
0
 public PackageManagerWindowRoot(ResourceLoader resourceLoader,
                                 ExtensionManager extensionManager,
                                 SelectionProxy selection,
                                 PackageFiltering packageFiltering,
                                 PackageManagerPrefs packageManagerPrefs,
                                 PackageDatabase packageDatabase,
                                 PageManager pageManager,
                                 PackageManagerProjectSettingsProxy settingsProxy,
                                 UnityConnectProxy unityConnectProxy,
                                 ApplicationProxy applicationProxy,
                                 UpmClient upmClient,
                                 AssetStoreCachePathProxy assetStoreCachePathProxy)
 {
     ResolveDependencies(resourceLoader, extensionManager, selection, packageFiltering, packageManagerPrefs, packageDatabase, pageManager, settingsProxy, unityConnectProxy, applicationProxy, upmClient, assetStoreCachePathProxy);
 }
Пример #21
0
        public void ResolveDependencies(UpmCache upmCache,
                                        PackageManagerProjectSettingsProxy settingsProxy,
                                        ClientProxy clientProxy,
                                        ApplicationProxy applicationProxy)
        {
            m_UpmCache         = upmCache;
            m_SettingsProxy    = settingsProxy;
            m_ClientProxy      = clientProxy;
            m_ApplicationProxy = applicationProxy;

            m_GetRegistriesOperation?.ResolveDependencies(m_ClientProxy, m_ApplicationProxy);
            m_AddRegistryOperation?.ResolveDependencies(m_ClientProxy, m_ApplicationProxy);
            m_UpdateRegistryOperation?.ResolveDependencies(m_ClientProxy, m_ApplicationProxy);
            m_RemoveRegistryOperation?.ResolveDependencies(m_ClientProxy, m_ApplicationProxy);
        }
Пример #22
0
        private void ResolveDependencies()
        {
            var container = ServicesContainer.instance;

            m_ResourceLoader            = container.Resolve <ResourceLoader>();
            m_Application               = container.Resolve <ApplicationProxy>();
            m_UnityConnect              = container.Resolve <UnityConnectProxy>();
            m_PackageFiltering          = container.Resolve <PackageFiltering>();
            m_PackageDatabase           = container.Resolve <PackageDatabase>();
            m_PageManager               = container.Resolve <PageManager>();
            m_UpmClient                 = container.Resolve <UpmClient>();
            m_AssetStoreDownloadManager = container.Resolve <AssetStoreDownloadManager>();
            m_SettingsProxy             = container.Resolve <PackageManagerProjectSettingsProxy>();
            m_IOProxy = container.Resolve <IOProxy>();
        }
Пример #23
0
        private void ResolveDependencies()
        {
            var container = ServicesContainer.instance;

            m_ResourceLoader      = container.Resolve <ResourceLoader>();
            m_SettingsProxy       = container.Resolve <PackageManagerProjectSettingsProxy>();
            m_PackageDatabase     = container.Resolve <PackageDatabase>();
            m_PackageManagerPrefs = container.Resolve <PackageManagerPrefs>();
            m_Selection           = container.Resolve <SelectionProxy>();
            m_AssetDatabase       = container.Resolve <AssetDatabaseProxy>();
            m_Application         = container.Resolve <ApplicationProxy>();
            m_IOProxy             = container.Resolve <IOProxy>();
            m_AssetStoreCache     = container.Resolve <AssetStoreCache>();
            m_PageManager         = container.Resolve <PageManager>();
            m_UpmCache            = container.Resolve <UpmCache>();
        }
Пример #24
0
        public PackageDetailsVersionsTab(ResourceLoader resourceLoader,
                                         ApplicationProxy applicationProxyProxy,
                                         PackageManagerPrefs packageManagerPrefs,
                                         PackageDatabase packageDatabase,
                                         PageManager pageManager,
                                         PackageManagerProjectSettingsProxy settingsProxy,
                                         UpmCache upmCache,
                                         IOProxy ioProxy)
        {
            m_Id                  = k_Id;
            m_DisplayName         = L10n.Tr("Version History");
            m_ResourceLoader      = resourceLoader;
            m_ApplicationProxy    = applicationProxyProxy;
            m_PackageManagerPrefs = packageManagerPrefs;
            m_PackageDatabase     = packageDatabase;
            m_PageManager         = pageManager;
            m_SettingsProxy       = settingsProxy;
            m_UpmCache            = upmCache;
            m_IOProxy             = ioProxy;

            m_DisableIfCompiling = new ButtonDisableCondition(() => m_ApplicationProxy.isCompiling,
                                                              L10n.Tr("You need to wait until the compilation is finished to perform this action."));
            m_DisableIfInstallOrUninstallInProgress = new ButtonDisableCondition(() => m_PackageDatabase.isInstallOrUninstallInProgress,
                                                                                 L10n.Tr("You need to wait until other install or uninstall operations are finished to perform this action."));

            m_Container = new VisualElement {
                name = "versionsTab"
            };
            Add(m_Container);

            m_VersionHistoryList = new VisualElement {
                name = "versionsList"
            };
            m_Container.Add(m_VersionHistoryList);

            m_VersionsToolbar = new VisualElement {
                name = "versionsToolbar"
            };
            m_Container.Add(m_VersionsToolbar);

            m_VersionsShowOthersButton = new Button {
                name = "versionsShowAllButton", text = L10n.Tr("See other versions")
            };
            m_VersionsToolbar.Add(m_VersionsShowOthersButton);

            m_VersionsShowOthersButton.clickable.clicked += ShowOthersVersion;
        }
        public ServicesContainer()
        {
            // In the constructor we only need to worry about creating a brand new instance.
            // In the case of assembly reload, a deserialize step will automatically happen after the constructor
            // to restore all the serializable states/services and we don't need to worry about that
            m_HttpClientFactory    = new HttpClientFactory();
            m_UnityOAuthProxy      = new UnityOAuthProxy();
            m_SelectionProxy       = new SelectionProxy();
            m_AssetDatabaseProxy   = new AssetDatabaseProxy();
            m_UnityConnectProxy    = new UnityConnectProxy();
            m_ApplicationProxy     = new ApplicationProxy();
            m_EditorAnalyticsProxy = new EditorAnalyticsProxy();
            m_IOProxy       = new IOProxy();
            m_SettingsProxy = new PackageManagerProjectSettingsProxy();
            m_ClientProxy   = new ClientProxy();

            m_ResourceLoader   = new ResourceLoader();
            m_ExtensionManager = new ExtensionManager();

            m_AssetStoreCache           = new AssetStoreCache();
            m_AssetStoreClient          = new AssetStoreClient();
            m_AssetStoreOAuth           = new AssetStoreOAuth();
            m_AssetStoreUtils           = new AssetStoreUtils();
            m_AssetStoreRestAPI         = new AssetStoreRestAPI();
            m_AssetStoreDownloadManager = new AssetStoreDownloadManager();
            m_AssetStoreCallQueue       = new AssetStoreCallQueue();
            m_AssetStoreCachePathProxy  = new AssetStoreCachePathProxy();

            m_UpmCache           = new UpmCache();
            m_UpmClient          = new UpmClient();
            m_UpmRegistryClient  = new UpmRegistryClient();
            m_UpmCacheRootClient = new UpmCacheRootClient();

            m_PackageFiltering    = new PackageFiltering();
            m_PackageManagerPrefs = new PackageManagerPrefs();

            m_PackageDatabase = new PackageDatabase();
            m_PageManager     = new PageManager();

            // Since dictionaries doesn't survive through serialization, we always re-create the default registration
            m_RegisteredObjects = new Dictionary <Type, object>();
            RegisterDefaultServices();

            m_DependenciesResolved = false;
            m_InitializeState      = State.NotInitialized;
        }
        public PackageDetailsSampleItem(IPackageVersion version, Sample sample, SelectionProxy selection, AssetDatabaseProxy assetDatabase, ApplicationProxy application, IOProxy iOProxy)
        {
            m_Selection        = selection;
            m_AssetDatabase    = assetDatabase;
            m_ApplicationProxy = application;
            m_IOProxy          = iOProxy;

            m_Version         = version;
            m_Sample          = sample;
            nameLabel.text    = sample.displayName;
            nameLabel.tooltip = sample.displayName; // add tooltip for when the label text is cut off
            sizeLabel.text    = sample.size;
            descriptionLabel.SetValueWithoutNotify(sample.description);
            descriptionLabel.multiline = true;
            RefreshImportStatus();
            importButton.clickable.clicked += OnImportButtonClicked;
        }
Пример #27
0
        public PackageDetailsSamplesTab(ResourceLoader resourceLoader, PackageDatabase packageDatabase, SelectionProxy selection, AssetDatabaseProxy assetDatabase, ApplicationProxy application, IOProxy iOProxy)
        {
            m_Id              = k_Id;
            m_DisplayName     = L10n.Tr("Samples");
            m_ResourceLoader  = resourceLoader;
            m_PackageDatabase = packageDatabase;
            m_Selection       = selection;
            m_AssetDatabase   = assetDatabase;
            m_Application     = application;
            m_IOProxy         = iOProxy;

            var root = m_ResourceLoader.GetTemplate("PackageDetailsSamplesTab.uxml");

            Add(root);
            m_Cache = new VisualElementCache(root);

            RegisterCallback <GeometryChangedEvent>(OnGeometryChanged);
        }
Пример #28
0
        public void ResolveDependencies(UpmCache upmCache,
                                        IOProxy IOProxy,
                                        PackageManagerProjectSettingsProxy settingsProxy,
                                        ClientProxy clientProxy,
                                        ApplicationProxy applicationProxy)
        {
            m_UpmCache         = upmCache;
            m_IOProxy          = IOProxy;
            m_SettingsProxy    = settingsProxy;
            m_ClientProxy      = clientProxy;
            m_ApplicationProxy = applicationProxy;

            m_SearchOperation?.ResolveDependencies(m_ClientProxy, m_ApplicationProxy);
            m_SearchOfflineOperation?.ResolveDependencies(m_ClientProxy, m_ApplicationProxy);
            m_ListOperation?.ResolveDependencies(m_ClientProxy, m_ApplicationProxy);
            m_ListOfflineOperation?.ResolveDependencies(m_ClientProxy, m_ApplicationProxy);
            m_AddOperation?.ResolveDependencies(m_ClientProxy, m_ApplicationProxy);
            m_RemoveOperation?.ResolveDependencies(m_ClientProxy, m_ApplicationProxy);
            m_EmbedOperation?.ResolveDependencies(m_ClientProxy, m_ApplicationProxy);
            m_AddAndRemoveOperation?.ResolveDependencies(m_ClientProxy, m_ApplicationProxy);
        }
        public FeatureDependenciesTab(ResourceLoader resourceLoader,
                                      PackageDatabase packageDatabase,
                                      PackageManagerPrefs packageManagerPrefs,
                                      PackageManagerProjectSettingsProxy settingsProxy,
                                      ApplicationProxy applicationProxy)
        {
            m_ResourceLoader      = resourceLoader;
            m_PackageDatabase     = packageDatabase;
            m_PackageManagerPrefs = packageManagerPrefs;
            m_SettingsProxy       = settingsProxy;
            m_Application         = applicationProxy;

            m_Id          = k_Id;
            m_DisplayName = L10n.Tr("Packages Included");

            var root = m_ResourceLoader.GetTemplate("FeatureDependencies.uxml");

            Add(root);

            cache = new VisualElementCache(root);
            dependencyInfoBox.Q <Button>().clickable.clicked += () => m_Application.OpenURL($"{infoBoxUrl}/{m_Link}");
        }
        public PackageDetailsVersionHistoryItem(ResourceLoader resourceLoader,
                                                PackageDatabase packageDatabase,
                                                UpmCache upmCache,
                                                ApplicationProxy applicationProxy,
                                                IOProxy ioProxy,
                                                IPackageVersion version,
                                                bool multipleVersionsVisible,
                                                bool isLatestVersion,
                                                bool expanded,
                                                PackageToolBarRegularButton button)
        {
            m_Version          = version;
            m_PackageDatabase  = packageDatabase;
            m_UpmCache         = upmCache;
            m_ApplicationProxy = applicationProxy;
            m_IOProxy          = ioProxy;

            var root = resourceLoader.GetTemplate("PackageDetailsVersionHistoryItem.uxml");

            Add(root);
            m_Cache = new VisualElementCache(root);

            SetExpanded(expanded);
            versionHistoryItemToggle.RegisterValueChangedCallback(evt =>
            {
                SetExpanded(evt.newValue);
                onToggleChanged?.Invoke(evt.newValue);
            });

            m_Button = button;
            if (m_Button != null)
            {
                versionHistoryItemToggleRightContainer.Add(m_Button.element);
            }

            versionHistoryItemChangeLogLink.clickable.clicked += () => UpmPackageDocs.ViewUrl(UpmPackageDocs.GetChangelogUrl(m_Version), UpmPackageDocs.GetOfflineChangelog(m_IOProxy, m_Version), L10n.Tr("changelog"), "viewChangelog", m_Version, m_Version.package, m_ApplicationProxy);

            Refresh(multipleVersionsVisible, isLatestVersion);
        }