Show / Hide Table of Contents

Interface IReadOnlyProperty_Date

Represents a property of type date

Inherited Members
IReadOnlyElement.Attribute(String)
IReadOnlyElement.Attributes()
IReadOnlyElement.Elements()
IReadOnlyElement.AmlContext
IReadOnlyElement.Exists
IReadOnlyElement.Name
IReadOnlyElement.Parent
IReadOnlyElement.Value
IAmlNode.ToAml(XmlWriter, AmlWriterSettings)
Namespace: Innovator.Client
Assembly: Innovator.Client.dll
Syntax
public interface IReadOnlyProperty_Date : IReadOnlyProperty_Base, IReadOnlyElement, IAmlNode

Methods

| Improve this Doc View Source

AsDateTime()

Value converted to a System.Nullable<T> in the local timezone. If the value cannot be converted, an exception is thrown

Declaration
DateTime? AsDateTime()
Returns
Type Description
System.Nullable<System.DateTime>

A System.DateTime or null if the value is empty

Exceptions
Type Condition
System.InvalidCastException

If the non-empty value cannot be converted to a System.DateTime

| Improve this Doc View Source

AsDateTime(DateTime)

Value converted to a System.DateTime in the local timezone using the defaultValue if null. If the value cannot be converted, an exception is thrown

Declaration
DateTime AsDateTime(DateTime defaultValue)
Parameters
Type Name Description
System.DateTime defaultValue

The default value to return if the value is empty

Returns
Type Description
System.DateTime

A System.DateTime or defaultValue if the value is empty

Examples
// If the part was created after 2016-01-01, put the name of the creator in the description
if (comp.CreatedOn().AsDateTime(DateTime.MaxValue) > new DateTime(2016, 1, 1))
{
    edits.Property("description").Set("Created by: " + comp.CreatedById().KeyedName().Value);
}
Exceptions
Type Condition
System.InvalidCastException

If the non-empty value cannot be converted to a System.DateTime

| Improve this Doc View Source

AsDateTimeOffset()

Value converted to a System.Nullable<T> in the local timezone. If the value cannot be converted, an exception is thrown

Declaration
DateTimeOffset? AsDateTimeOffset()
Returns
Type Description
System.Nullable<System.DateTimeOffset>

A System.DateTimeOffset or null if the value is empty

Exceptions
Type Condition
System.InvalidCastException

If the non-empty value cannot be converted to a System.DateTimeOffset

| Improve this Doc View Source

AsDateTimeOffset(DateTimeOffset)

Value converted to a System.DateTimeOffset in the local timezone using the defaultValue if null. If the value cannot be converted, an exception is thrown

Declaration
DateTimeOffset AsDateTimeOffset(DateTimeOffset defaultValue)
Parameters
Type Name Description
System.DateTimeOffset defaultValue

The default value to return if the value is empty

Returns
Type Description
System.DateTimeOffset

A System.DateTimeOffset or defaultValue if the value is empty

Exceptions
Type Condition
System.InvalidCastException

If the non-empty value cannot be converted to a System.DateTimeOffset

| Improve this Doc View Source

AsDateTimeUtc()

Value converted to a System.Nullable<T> in the UTC timezone. If the value cannot be converted, an exception is thrown

Declaration
DateTime? AsDateTimeUtc()
Returns
Type Description
System.Nullable<System.DateTime>

A System.DateTime or null if the value is empty

Exceptions
Type Condition
System.InvalidCastException

If the non-empty value cannot be converted to a System.DateTime

| Improve this Doc View Source

AsDateTimeUtc(DateTime)

Value converted to a System.DateTime in the UTC timezone using the defaultValue if null. If the value cannot be converted, an exception is thrown

Declaration
DateTime AsDateTimeUtc(DateTime defaultValue)
Parameters
Type Name Description
System.DateTime defaultValue

The default value to return if the value is empty

Returns
Type Description
System.DateTime

A System.DateTime or defaultValue if the value is empty

Exceptions
Type Condition
System.InvalidCastException

If the non-empty value cannot be converted to a System.DateTime

Extension Methods

Core.Condition(IReadOnlyProperty_Base)
Core.IsNull(IReadOnlyProperty_Base)
Core.KeyedName(IReadOnlyProperty_Base)
Core.Type(IReadOnlyProperty_Base)
ItemExtensions.AsClrValue(IReadOnlyProperty_Base, Property)
ItemExtensions.ToAml(IAmlNode, AmlWriterSettings)
ItemExtensions.ToAml(IAmlNode, XmlWriter)
ItemExtensions.Element(IReadOnlyElement, String)
ItemExtensions.HasValue(IReadOnlyProperty_Base)
ItemExtensions.ToXml(IAmlNode)
ItemExtensions.CreateReader(IReadOnlyElement)
ItemExtensions.Parents(IReadOnlyElement)
ItemExtensions.ParentsAndSelf(IReadOnlyElement)
ItemExtensions.InnerText(IReadOnlyElement)
  • Improve this Doc
  • View Source
Back to top Copyright © 2015-2017 Microsoft
Generated by DocFX