Archive

Posts Tagged ‘Contracts’

DXCore Services – Contract

June 18th, 2011 Comments off

The Contract DXCore service provides access to the registered contract providers used in the Add Contract code provider. It has only three properties:

Property name Description
AvailableContractProviders Gets an IEnumerable<ContractProvider> instance of all available contract providers in the current context.
ContractProviders Gets an IEnumerable<ContractProvider> instance of all registered contract providers.
Providers Gets an IEnumerable<ContentProvider> instance of all registered contract providers.
—–
Products: DXCore
Versions: 11.1 and up
VS IDEs: any
Updated: Jun/19/2011
ID: D092

How to add new contracts for the Add Contract code provider

February 18th, 2011 Comments off

Note, this article has been moved to the official DevExpress Support Center site. Please refer to the moved article as it might have further updates or additional comments. Thank you.

The Add Contract code provider adds conditions for validation of the active method parameters. The Extensible architecture of the DXCore allows you to add new contracts to the list of available contracts using the ContractProvider component inside your plug-in.

The sample below is a rough implementation for the suggestions registered in the DevExpress Support Center database:

  • S133903 Add Contract – Use IsNullOrWhiteSpace on contracts
  • S136474 Add Contract – Allow it to generate code for single parameter

Read more…