/// <summary>
        /// Determines whether item is published in the current publication context.
        /// </summary>
        /// <param name="identifiableObject">The item <see cref="Tridion.ContentManager.IdentifiableObject"/>.</param>
        /// <param name="publicationTarget">The publication target <see cref="Tridion.ContentManager.CommunicationManagement.PublicationTarget"/>.</param>
        /// <returns>
        ///   <c>true</c> if item is published in current publication context, otherwise <c>false</c>.
        /// </returns>
        public static bool IsPublished(this IdentifiableObject identifiableObject, PublicationTarget publicationTarget)
        {
            if (identifiableObject != null && publicationTarget != null)
            {
                return(PublishEngine.IsPublished(identifiableObject, publicationTarget, true));
            }

            return(false);
        }
 private bool IsPublished(Page page)
 {
     if (Engine.PublishingContext.PublicationTarget != null)
     {
         return(PublishEngine.IsPublished(page, Engine.PublishingContext.PublicationTarget));
     }
     //For preview we always return true - to help debugging
     return(true);
 }
 private bool IsPublished(Page page)
 {
     //For preview we always return true - to help debugging
     return((Engine.PublishingContext?.PublicationTarget == null) || PublishEngine.IsPublished(page, Engine.PublishingContext.PublicationTarget));
 }