예제 #1
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();
        }
        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();
        }