Class Item
Represents an XML Item
element in an AML structure.
Inherited Members
Namespace: Innovator.Client
Assembly: Innovator.Client.dll
Syntax
public class Item : Element, ILinkedElement, ILink<ILinkedElement>, IItem, IElement, IReadOnlyItem, IReadOnlyElement, IAmlNode, IItemRef, IEquatable<IItemRef>
Constructors
| Improve this Doc View SourceItem()
Initializes a new instance of the Item class.
Declaration
protected Item()
Item(ElementFactory, Object[])
Initializes a new instance of the Item class.
Declaration
public Item(ElementFactory amlContext, params object[] content)
Parameters
Type | Name | Description |
---|---|---|
ElementFactory | amlContext | The aml context. |
System.Object[] | content | The content. |
Properties
| Improve this Doc View SourceAmlContext
Retrieve the context used for rendering primitive values
Declaration
public override ElementFactory AmlContext { get; }
Property Value
Type | Description |
---|---|
ElementFactory |
Overrides
Implements
| Improve this Doc View SourceExists
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
public override bool Exists { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
Implements
| Improve this Doc View SourceName
Local XML name of the element
Declaration
public override string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
Implements
| Improve this Doc View SourceNext
The next sibling AML element (if any)
Declaration
public override ILinkedElement Next { get; set; }
Property Value
Type | Description |
---|---|
ILinkedElement |
Overrides
| Improve this Doc View SourceParent
Retrieve the parent element
Declaration
public override IElement Parent { get; set; }
Property Value
Type | Description |
---|---|
IElement |
Overrides
Implements
Methods
| Improve this Doc View SourceAddNullItem<T>(T)
Add a strongly-typed 'null' model to list of null models by type
Declaration
public static void AddNullItem<T>(T value)where T : IReadOnlyItem
Parameters
Type | Name | Description |
---|---|---|
T | value | 'null' model instance |
Type Parameters
Name | Description |
---|---|
T | Type of item model |
Clone()
Creates a duplicate of the item object. All properties (including the ID) are preserved
Declaration
public IItem Clone()
Returns
Type | Description |
---|---|
IItem |
Implements
| Improve this Doc View SourceElements()
Retrieve all child elements
Declaration
public override IEnumerable<IElement> Elements()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IElement> |
Overrides
Implements
| Improve this Doc View SourceEquals(IItemRef)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(IItemRef other)
Parameters
Type | Name | Description |
---|---|---|
IItemRef | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
System.Boolean | true if the current object is equal to the |
Implements
Equals(Object)
Determines whether the specified System.Object, is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The System.Object to compare with this instance. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
GetNullItem<T>()
Retrieve a strongly-typed 'null' model to the list of null models by type
Declaration
public static T GetNullItem<T>()where T : IReadOnlyItem
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T | Type of item model |
Remarks
If you are looking to create a new item, see Item(Object[]) or FromXml(String, Object[]).
Examples
Say you have a nullable IReadOnlyItem variable and you want to make sure it is never null.
IReadOnlyItem parameter = null;
var item = parameter ?? Item.GetNullItem<IReadOnlyItem>()
|
Improve this Doc
View Source
Id()
The ID of the item as retrieved from either the attribute or the property
Declaration
public string Id()
Returns
Type | Description |
---|---|
System.String |
Implements
| Improve this Doc View SourceProperty(String)
Returns a reference to the property with the specified name
Declaration
public IProperty Property(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the property |
Returns
Type | Description |
---|---|
IProperty |
Implements
Remarks
If the property does not exist, a non-null object will be returned that has an Exists
member which will return false
Property(String, String)
Returns a reference to the property with the specified name and language
Declaration
public IProperty Property(string name, string lang)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the property |
System.String | lang | Language of the (multilingual) property |
Returns
Type | Description |
---|---|
IProperty |
Implements
Remarks
If the property does not exist, a non-null object will be returned that has an Exists
member which will return false
Relationships()
Returns the set of relationships associated with this item
Declaration
public IRelationships Relationships()
Returns
Type | Description |
---|---|
IRelationships |
Implements
| Improve this Doc View SourceRelationships(String)
Returns the set of relationships associated with this item of the specified type
Declaration
public IEnumerable<IItem> Relationships(string type)
Parameters
Type | Name | Description |
---|---|---|
System.String | type | Name of the ItemType for the relationships you wish to retrieve |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IItem> |
Implements
| Improve this Doc View SourceTypeName()
The type of the item as retrieved from either the attribute or the property
Declaration
public virtual string TypeName()
Returns
Type | Description |
---|---|
System.String |
Implements
Explicit Interface Implementations
| Improve this Doc View SourceIReadOnlyItem.Property(String)
Declaration
IReadOnlyProperty IReadOnlyItem.Property(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Returns
Type | Description |
---|---|
IReadOnlyProperty |
Implements
| Improve this Doc View SourceIReadOnlyItem.Property(String, String)
Declaration
IReadOnlyProperty IReadOnlyItem.Property(string name, string lang)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | |
System.String | lang |
Returns
Type | Description |
---|---|
IReadOnlyProperty |
Implements
| Improve this Doc View SourceIReadOnlyItem.Relationships()
Declaration
IEnumerable<IReadOnlyItem> IReadOnlyItem.Relationships()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IReadOnlyItem> |
Implements
| Improve this Doc View SourceIReadOnlyItem.Relationships(String)
Declaration
IEnumerable<IReadOnlyItem> IReadOnlyItem.Relationships(string type)
Parameters
Type | Name | Description |
---|---|---|
System.String | type |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IReadOnlyItem> |