Ejemplo n.º 1
0
        private async Task AddFeedPlugin()
        {
            if (!NetworkInterface.GetIsNetworkAvailable())
            {
                _uiServices.Show(Resources.NoNetworkConnection, MessageLevel.Warning);
                return;
            }

            var selectedPackageInfo = _packageChooser.SelectPluginPackage();

            if (selectedPackageInfo != null)
            {
                var repository = _packageChooser.PluginRepository;
                if (repository != null)
                {
                    var package = await _packageDownloader.Download(
                        repository,
                        selectedPackageInfo.Identity);

                    if (package != null)
                    {
                        AddSelectedPluginPackage(package);
                    }
                }
            }
        }
        private async Task AddFeedPlugin()
        {
            if (!NetworkInterface.GetIsNetworkAvailable())
            {
                _uiServices.Show(Resources.NoNetworkConnection, MessageLevel.Warning);
                return;
            }

            var selectedPackageInfo = _packageChooser.SelectPluginPackage();

            if (selectedPackageInfo != null)
            {
                IPackage package = await _packageDownloader.Download(
                    selectedPackageInfo.DownloadUrl,
                    selectedPackageInfo.Id,
                    selectedPackageInfo.Version);

                if (package != null)
                {
                    AddSelectedPluginPackage(package);
                }
            }
        }