示例#1
0
        private List <ContentTranslationVersion> GetCurrentContentTranslationVersions(Publication publication = null,
                                                                                      DateTime?creationDate   = null)
        {
            var contentTranslationVersions = new List <ContentTranslationVersion>();

            creationDate = creationDate ?? DependencyResolver.Current.GetService <IDateTimeManager>().Now();

            foreach (var contentTranslation in Translations)
            {
                var contentTranslationVersion = CreateVersion(contentTranslation, publication, creationDate);

                if (contentTranslationVersion != null)
                {
                    contentTranslationVersions.Add(contentTranslationVersion);
                }
            }

            return(contentTranslationVersions);
        }
 public int CompareTo(PublishedContentPropertyValue other)
 {
     return(Publication.CompareTo(other.Publication));
 }
 public PublishedContentPropertyValue(object value, Publication publication, ContentProperty contentProperty)
 {
     ContentProperty = contentProperty;
     Value           = value;
     Publication     = publication;
 }
 protected internal PublishedContentPropertyValue(ContentProperty property, object value, Publication publication)
 {
     ContentProperty = property;
     Publication     = publication;
     Value           = value;
 }
            public bool CreateVersion(Publication publication = null)
            {
                var contentTranslationVersion = Content.CreateVersion(this, publication);

                return(contentTranslationVersion != null);
            }
示例#6
0
        protected virtual void WriteJsonPublicationInfo(JsonWriter writer, object value, JsonSerializer serializer, Publication publication)
        {
            writer.WritePropertyName("PublicationCreationDate");
            if (publication == null)
            {
                serializer.Serialize(writer, null);
            }
            else
            {
                serializer.Serialize(writer, publication.CreationDate);
            }

            writer.WritePropertyName("PublicationStartingDate");
            if (publication == null)
            {
                serializer.Serialize(writer, null);
            }
            else
            {
                serializer.Serialize(writer, publication.StartingDate);
            }

            writer.WritePropertyName("PublicationEndingDate");
            if (publication == null)
            {
                serializer.Serialize(writer, null);
            }
            else
            {
                serializer.Serialize(writer, publication.EndingDate);
            }
        }