コード例 #1
0
        private void publisher_Progress(object sender, EventArgs e)
        {
            PublishingEventArgs eventArgs = (PublishingEventArgs)e;

            if (eventArgs.UpperProgressBound > int.MaxValue)
            {
                prgBrPublishing.Maximum = int.MaxValue;
                prgBrPublishing.Value   = (int)(eventArgs.CurrentProgress * (int.MaxValue / eventArgs.CurrentProgress));
            }
            else
            {
                prgBrPublishing.Maximum = (int)eventArgs.UpperProgressBound;
                prgBrPublishing.Value   = (int)eventArgs.CurrentProgress;
            }
            lblProgress.Text = eventArgs.ProgressStep.ToString() + " : " + eventArgs.ProgressInfo;
            prgBrPublishing.Refresh();
            lblProgress.Refresh();
        }
コード例 #2
0
        private void StartUpdate()
        {
            PublishingEventArgs args = new PublishingEventArgs(_publish);

            if (Publishing != null)
            {
                Publishing(this, args);
            }

            _republishOnSuccess = args.RepublishOnSuccess;

            // kickoff weblog update
            // Blogger drafts don't have permalinks, therefore, we must do a full publish twice
            bool doPublish = _publish; // && (!_republishOnSuccess || !_publishingContext.Blog.ClientOptions.SupportsPostAsDraft);

            _updateWeblogAsyncOperation                  = new UpdateWeblogAsyncOperation(new BlogClientUIContextImpl(this), _publishingContext, doPublish);
            _updateWeblogAsyncOperation.Completed       += new EventHandler(_updateWeblogAsyncOperation_Completed);
            _updateWeblogAsyncOperation.Cancelled       += new EventHandler(_updateWeblogAsyncOperation_Cancelled);
            _updateWeblogAsyncOperation.Failed          += new ThreadExceptionEventHandler(_updateWeblogAsyncOperation_Failed);
            _updateWeblogAsyncOperation.ProgressUpdated += new ProgressUpdatedEventHandler(_updateWeblogAsyncOperation_ProgressUpdated);
            _updateWeblogAsyncOperation.Start();
        }
コード例 #3
0
        private void StartUpdate()
        {
            PublishingEventArgs args = new PublishingEventArgs(_publish);
            if (Publishing != null)
                Publishing(this, args);

            _republishOnSuccess = args.RepublishOnSuccess;

            // kickoff weblog update
            // Blogger drafts don't have permalinks, therefore, we must do a full publish twice
            bool doPublish = _publish; // && (!_republishOnSuccess || !_publishingContext.Blog.ClientOptions.SupportsPostAsDraft);
            _updateWeblogAsyncOperation = new UpdateWeblogAsyncOperation(new BlogClientUIContextImpl(this), _publishingContext, doPublish);
            _updateWeblogAsyncOperation.Completed += new EventHandler(_updateWeblogAsyncOperation_Completed);
            _updateWeblogAsyncOperation.Cancelled += new EventHandler(_updateWeblogAsyncOperation_Cancelled);
            _updateWeblogAsyncOperation.Failed += new ThreadExceptionEventHandler(_updateWeblogAsyncOperation_Failed);
            _updateWeblogAsyncOperation.ProgressUpdated += new ProgressUpdatedEventHandler(_updateWeblogAsyncOperation_ProgressUpdated);
            _updateWeblogAsyncOperation.Start();
        }