共用方式為


Item Property

Gets or sets the Payment object from the current collection, based upon the specified name.

Namespace:  Microsoft.CommerceServer.Runtime.Orders
Assembly:  Microsoft.CommerceServer.Runtime (in Microsoft.CommerceServer.Runtime.dll)

Syntax

'Declaration
Public Property Item ( _
    keyName As String _
) As Object
'Usage
Dim instance As Payment
Dim keyName As String
Dim value As Object

value = instance.Item(keyName)

instance.Item(keyName) = value
public Object Item[
    string keyName
] { get; set; }
public:
property Object^ Item[String^ keyName] {
    Object^ get (String^ keyName);
    void set (String^ keyName, Object^ value);
}
JScript does not support indexed properties.

Parameters

  • keyName
    Type: System..::.String
    The key name of the property to store. Cannot be nullNothingnullptra null reference (Nothing in Visual Basic).

Property Value

Type: System..::.Object
The Payment object from the current collection, based upon the specified name.
Supports weakly-typed property storage for the current instance.

Exceptions

Exception Condition
PropertyConflictException

keyName conflicts with a strongly-typed property name or the name of a dictionary key that is mapped to a strongly-typed property through the pipeline adapter mapping file (OrderPipelineMappings.xml in the default Commerce Server installation).

ArgumentNullException

keyName is nullNothingnullptra null reference (Nothing in Visual Basic).

Remarks

Returns the Payment in the collection with the specified name.

Weakly-typed properties with the same name as strongly typed properties are not allowed. For example, the base object model contains a property called BillingAddressId. You cannot set a weakly typed property into the Payment with the same name.

Payment["Amount"] = 100.00M; // This will throw a PropertyConflictException!

To support legacy Commerce Server functionality, weakly-typed property names starting with "_" (underscore) will not be written to storage. Names without underscore prefixes that are not serializable will also not be stored.

keyName is trimmed of leading and trailing white space characters before setting or getting the value.

Marshalling the indexer property is totally governed by the .NET/COM interoperability rules. If you place an object into an indexer property, you should review the .NET/COM interoperability rules to determine how the object will appear to COM-based code.

Permissions

See Also

Reference

Payment Class

Payment Members

Microsoft.CommerceServer.Runtime.Orders Namespace