ContactDate ContactDate ContactDate ContactDate Class

Represents an important date for a contact.

Syntax

Declaration

public sealed class ContactDatepublic sealed class ContactDatePublic NotInheritable Class ContactDate

Remarks

Here is how to use the ContactDate properties to format date strings.

Insert sentinel values

  1. Construct a Calendar.
  2. If year has a value, set year to that value, else set year to 2004 (a leap year so every day is valid).
  3. If month has a value, set month to that value, else set month to 1 (a month with every day valid).
  4. if day has a value, set day to that value (day will be set to some value automatically and we don't really care what it is so no need to explicitly set it).
  5. Get the DateTime from the Calendar.

Build up a template to format

  1. If year has a value, append "year " to the template.
  2. If month has a value, append "month " to the template.
  3. If day has a value, append "day " to the template.
  4. Construct a DateTimeFormatter with the template.
  5. Format by using the date time formatter and the DateTime retrieved from the Calendar.

Constructors summary

Initializes a new instance of a ContactDate class.

Properties summary

Gets and sets the day for an important date for a contact.

Gets and sets the description for an important date for a contact. The maximum string length for the description is 512 characters.

Gets and sets the kind of important date for a contact.

Gets and sets the month for an important date for a contact.

Gets and sets the year for an important date for a contact. This value must be convertible to a FILETIME structure.

Constructors

  • ContactDate()
    ContactDate()
    ContactDate()
    ContactDate()

    Initializes a new instance of a ContactDate class.

    public ContactDate()public ContactDate()Public Function ContactDate() As

Properties

  • Day
    Day
    Day
    Day

    Gets and sets the day for an important date for a contact.

    public IReference<uint> Day { get; set; }public IReference<uint> Day { get; set; }Public ReadWrite Property Day As IReference<uint>

    Property Value

    • The day for an important date for a contact.

  • Description
    Description
    Description
    Description

    Gets and sets the description for an important date for a contact. The maximum string length for the description is 512 characters.

    public string Description { get; set; }public string Description { get; set; }Public ReadWrite Property Description As string

    Property Value

    • string
      string
      string
      string

      The description for an important date for a contact.

  • Kind
    Kind
    Kind
    Kind

    Gets and sets the kind of important date for a contact.

    public ContactDateKind Kind { get; set; }public ContactDateKind Kind { get; set; }Public ReadWrite Property Kind As ContactDateKind

    Property Value

  • Month
    Month
    Month
    Month

    Gets and sets the month for an important date for a contact.

    public IReference<uint> Month { get; set; }public IReference<uint> Month { get; set; }Public ReadWrite Property Month As IReference<uint>

    Property Value

    • The month for an important date for a contact.

  • Year
    Year
    Year
    Year

    Gets and sets the year for an important date for a contact. This value must be convertible to a FILETIME structure.

    public IReference<int> Year { get; set; }public IReference<int> Year { get; set; }Public ReadWrite Property Year As IReference<int>

    Property Value

    • The year for an important date for a contact.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ActivatableAttribute

Details

Assembly

Windows.ApplicationModel.Contacts.dll