Show / Hide Table of Contents

Interface IReadOnlyAttribute

A read-only AML attribute

Namespace: Innovator.Client
Assembly: Innovator.Client.dll
Syntax
public interface IReadOnlyAttribute

Properties

| Improve this Doc View Source

Exists

Returns true if this element actually exists in the underlying AML, otherwise, returns false to indicate that the element is just a null placeholder put in place to reduce unnecessary null reference checks

Declaration
bool Exists { get; }
Property Value
Type Description
System.Boolean

true if this element actually exists, false otherwise

| Improve this Doc View Source

Name

Get the local XML name of the attribute

Declaration
string Name { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Value

Get the string value of the attribute

Declaration
string Value { get; }
Property Value
Type Description
System.String

Methods

| Improve this Doc View Source

AsBoolean()

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

Declaration
bool ? AsBoolean()
Returns
Type Description
System.Nullable<System.Boolean>

A System.Boolean or null if the value is empty

Exceptions
Type Condition
System.InvalidCastException

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

| Improve this Doc View Source

AsBoolean(Boolean)

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

Declaration
bool AsBoolean(bool defaultValue)
Parameters
Type Name Description
System.Boolean defaultValue

The default value to return if the value is empty

Returns
Type Description
System.Boolean

A System.Boolean or defaultValue if the value is empty

Exceptions
Type Condition
System.InvalidCastException

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

| 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

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

| Improve this Doc View Source

AsDouble()

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

Declaration
double ? AsDouble()
Returns
Type Description
System.Nullable<System.Double>

A System.Double or null if the value is empty

Exceptions
Type Condition
System.InvalidCastException

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

| Improve this Doc View Source

AsDouble(Double)

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

Declaration
double AsDouble(double defaultValue)
Parameters
Type Name Description
System.Double defaultValue

The default value to return if the value is empty

Returns
Type Description
System.Double

A System.Double or defaultValue if the value is empty

Exceptions
Type Condition
System.InvalidCastException

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

| Improve this Doc View Source

AsGuid()

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

Declaration
Guid? AsGuid()
Returns
Type Description
System.Nullable<System.Guid>

A System.Guid or null if the value is empty

Exceptions
Type Condition
System.InvalidCastException

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

| Improve this Doc View Source

AsGuid(Guid)

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

Declaration
Guid AsGuid(Guid defaultValue)
Parameters
Type Name Description
System.Guid defaultValue

The default value to return if the value is empty

Returns
Type Description
System.Guid

A System.Guid or defaultValue if the value is empty

Exceptions
Type Condition
System.InvalidCastException

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

| Improve this Doc View Source

AsInt()

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

Declaration
int ? AsInt()
Returns
Type Description
System.Nullable<System.Int32>

A System.Int32 or null if the value is empty

Exceptions
Type Condition
System.InvalidCastException

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

| Improve this Doc View Source

AsInt(Int32)

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

Declaration
int AsInt(int defaultValue)
Parameters
Type Name Description
System.Int32 defaultValue

The default value to return if the value is empty

Returns
Type Description
System.Int32

A System.Int32 or defaultValue if the value is empty

Exceptions
Type Condition
System.InvalidCastException

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

| Improve this Doc View Source

AsLong()

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

Declaration
long ? AsLong()
Returns
Type Description
System.Nullable<System.Int64>

A System.Int64 or null if the value is empty

Exceptions
Type Condition
System.InvalidCastException

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

| Improve this Doc View Source

AsLong(Int64)

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

Declaration
long AsLong(long defaultValue)
Parameters
Type Name Description
System.Int64 defaultValue

The default value to return if the value is empty

Returns
Type Description
System.Int64

A System.Int64 or defaultValue if the value is empty

Exceptions
Type Condition
System.InvalidCastException

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

| Improve this Doc View Source

AsString(String)

Value converted to a System.String using the defaultValue if null.

Declaration
string AsString(string defaultValue)
Parameters
Type Name Description
System.String defaultValue

The default value to return if the value is empty

Returns
Type Description
System.String

A System.String or defaultValue if the value is empty

Extension Methods

ItemExtensions.HasValue(IReadOnlyAttribute)
  • Improve this Doc
  • View Source
Back to top Copyright © 2015-2017 Microsoft
Generated by DocFX