/// <summary> /// Gets the <c>PublishRecord</c> for the target page of the given /// context. /// </summary> /// <param name="key"></param> /// <param name="context">The <c>TransitionContext</c> to get the <c>PublishRecord</c> for.</param> /// <param name="publisher">The <c>ContentPublisher</c></param> /// <param name="addIfNotPresent">If <b>true</b> adds a new <b>PublishRecord</b> /// to the internal collection for the given context.</param> /// <returns>The <c>PublishRecord</c> for the target page of the given context.</returns> internal PublishRecord GetPublishRecord( string key, TransitionContext context, IContentPublisher publisher, bool addIfNotPresent) { PublishRecord pubRec = this.publishedPages[key]; if ((pubRec == null) && addIfNotPresent) { pubRec = new PublishRecord(key, context.StartState.Id, context.StartEvent, context.EndState.Id, null, null, publisher.Name); this.publishedPages.Add(key, pubRec); } return pubRec; }
/// <summary> /// Frees the resources used by the Publisher. /// </summary> public void Dispose() { if (this.contentPublisher != null) { this.contentPublisher.Dispose(); this.contentPublisher = null; } }