Exemplo n.º 1
0
        public async Task PushPackage()
        {
            ShowProgress = true;
            Status       = (PublishAsUnlisted == true) ? "Publishing and unlisting package..." : "Publishing package...";
            HasError     = false;
            CanPublish   = false;

            try
            {
                await GalleryServer.PushPackage(PublishKey, _packageFilePath, _package, PublishAsUnlisted ?? false, AppendV2ApiToUrl ?? false);

                OnCompleted();
            }
            catch (Exception exception)
            {
                OnError(exception);
            }
            finally
            {
                // add the publish url to the list
                _mruSourceManager.NotifyPackageSourceAdded(PublishUrl);

                // this is to make sure the combo box doesn't goes blank after publishing
                try
                {
                    _suppressReadingApiKey = true;
                    SelectedPublishItem    = PublishUrl;
                }
                finally
                {
                    _suppressReadingApiKey = false;
                }
            }
        }
Exemplo n.º 2
0
        public void PushPackage()
        {
            PercentComplete = 0;
            ShowProgress    = true;
            Status          = "Uploading package...";
            HasError        = false;
            CanPublish      = false;

            Stream fileStream = _packageStream.Value;

            fileStream.Seek(0, SeekOrigin.Begin);

            try {
                GalleryServer.CreatePackage(PublishKey, fileStream, this, PushOnly == true ? (IPackageMetadata)null : _package);
            }
            catch (WebException e) {
                if (WebExceptionStatus.Timeout == e.Status)
                {
                    OnError(e);
                }
            }
        }