Search Results for

    Show / Hide Table of Contents
    View Source

    Class ContentScheduleCollection

    Represents a collection of content schedules for publishing and unpublishing content.

    Inheritance
    object
    Namespace: Umbraco.Cms.Core.Models
    Assembly: Umbraco.Core.dll
    Syntax
    public class ContentScheduleCollection : IDeepCloneable
    Remarks

    The underlying storage is backed by a sorted list so that the schedule is always in order of date and duplicate dates per culture are not allowed.

    Constructors

    View Source

    ContentScheduleCollection()

    Declaration
    public ContentScheduleCollection()

    Properties

    View Source

    FullSchedule

    Returns all schedules registered

    Declaration
    public IReadOnlyList<ContentSchedule> FullSchedule { get; }
    Property Value
    Type Description
    IReadOnlyList<ContentSchedule>

    Methods

    View Source

    Add(DateTime?, DateTime?)

    Adds a new schedule for invariant content

    Declaration
    public bool Add(DateTime? releaseDate, DateTime? expireDate)
    Parameters
    Type Name Description
    DateTime? releaseDate
    DateTime? expireDate
    Returns
    Type Description
    bool
    View Source

    Add(string?, DateTime?, DateTime?)

    Adds a new schedule for a culture

    Declaration
    public bool Add(string? culture, DateTime? releaseDate, DateTime? expireDate)
    Parameters
    Type Name Description
    string culture
    DateTime? releaseDate
    DateTime? expireDate
    Returns
    Type Description
    bool

    true if successfully added, false if validation fails

    View Source

    Add(ContentSchedule)

    Add an existing schedule

    Declaration
    public void Add(ContentSchedule schedule)
    Parameters
    Type Name Description
    ContentSchedule schedule
    View Source

    AddOrUpdate(string, DateTime, ContentScheduleAction)

    Adds or updates a schedule entry for the specified culture and action.

    Declaration
    public void AddOrUpdate(string culture, DateTime dateTime, ContentScheduleAction action)
    Parameters
    Type Name Description
    string culture

    The culture for the schedule.

    DateTime dateTime

    The date and time for the scheduled action.

    ContentScheduleAction action

    The action type (release or expire).

    View Source

    Clear(string?, ContentScheduleAction, DateTime?)

    Clear all of the scheduled change type for the culture

    Declaration
    public void Clear(string? culture, ContentScheduleAction action, DateTime? date = null)
    Parameters
    Type Name Description
    string culture
    ContentScheduleAction action
    DateTime? date

    If specified, will clear all entries with dates less than or equal to the value

    View Source

    Clear(ContentScheduleAction, DateTime?)

    Clear all of the scheduled change type for invariant content

    Declaration
    public void Clear(ContentScheduleAction action, DateTime? changeDate = null)
    Parameters
    Type Name Description
    ContentScheduleAction action
    DateTime? changeDate

    If specified, will clear all entries with dates less than or equal to the value

    View Source

    ClearCollectionChangedEvents()

    Clears all CollectionChanged event handlers

    Declaration
    public void ClearCollectionChangedEvents()
    View Source

    CreateWithEntry(DateTime?, DateTime?)

    Creates a new ContentScheduleCollection with a schedule entry for invariant content.

    Declaration
    public static ContentScheduleCollection CreateWithEntry(DateTime? release, DateTime? expire)
    Parameters
    Type Name Description
    DateTime? release

    The release date, or null if no release is scheduled.

    DateTime? expire

    The expiration date, or null if no expiration is scheduled.

    Returns
    Type Description
    ContentScheduleCollection

    A new content schedule collection with the specified entry.

    View Source

    CreateWithEntry(string, DateTime?, DateTime?)

    Creates a new ContentScheduleCollection with a schedule entry for a specific culture.

    Declaration
    public static ContentScheduleCollection CreateWithEntry(string culture, DateTime? release, DateTime? expire)
    Parameters
    Type Name Description
    string culture

    The culture for the schedule.

    DateTime? release

    The release date, or null if no release is scheduled.

    DateTime? expire

    The expiration date, or null if no expiration is scheduled.

    Returns
    Type Description
    ContentScheduleCollection

    A new content schedule collection with the specified entry.

    View Source

    DeepClone()

    Creates a deep clone of the current object.

    Declaration
    public object DeepClone()
    Returns
    Type Description
    object

    A deep clone of the current object.

    View Source

    Equals(object?)

    Declaration
    public override bool Equals(object? obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    bool
    View Source

    Equals(ContentScheduleCollection?)

    Declaration
    public bool Equals(ContentScheduleCollection? other)
    Parameters
    Type Name Description
    ContentScheduleCollection other
    Returns
    Type Description
    bool
    View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    View Source

    GetPending(ContentScheduleAction, DateTime)

    Returns all pending schedules based on the date and type provided

    Declaration
    public IReadOnlyList<ContentSchedule> GetPending(ContentScheduleAction action, DateTime date)
    Parameters
    Type Name Description
    ContentScheduleAction action
    DateTime date
    Returns
    Type Description
    IReadOnlyList<ContentSchedule>
    View Source

    GetSchedule(ContentScheduleAction?)

    Gets the schedule for invariant content

    Declaration
    public IEnumerable<ContentSchedule> GetSchedule(ContentScheduleAction? action = null)
    Parameters
    Type Name Description
    ContentScheduleAction? action
    Returns
    Type Description
    IEnumerable<ContentSchedule>
    View Source

    GetSchedule(string?, ContentScheduleAction?)

    Gets the schedule for a culture

    Declaration
    public IEnumerable<ContentSchedule> GetSchedule(string? culture, ContentScheduleAction? action = null)
    Parameters
    Type Name Description
    string culture
    ContentScheduleAction? action
    Returns
    Type Description
    IEnumerable<ContentSchedule>
    View Source

    Remove(ContentSchedule)

    Remove a scheduled change

    Declaration
    public void Remove(ContentSchedule change)
    Parameters
    Type Name Description
    ContentSchedule change
    View Source

    RemoveIfExists(string, ContentScheduleAction)

    Removes a schedule entry for the specified culture and action if it exists.

    Declaration
    public void RemoveIfExists(string culture, ContentScheduleAction action)
    Parameters
    Type Name Description
    string culture

    The culture of the schedule to remove.

    ContentScheduleAction action

    The action type (release or expire) to remove.

    Events

    View Source

    CollectionChanged

    Declaration
    public event NotifyCollectionChangedEventHandler? CollectionChanged
    Event Type
    Type Description
    NotifyCollectionChangedEventHandler
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX