The design time interface is for establishing and managing the component's metadata. The sample components are derived from the base class Microsoft.SqlServer.Dts.PipelineComponent in the Microsoft.SqlServer.PipelineHost assembly and provide the default behavior for most of the methods while hiding much of the complexity involved in writing native code custom components. Although the base class supports many methods, fortunately it also handles the implementation of most of the methods. You only need override a few of the important methods, as discussed in the following sections. ProvideComponentPropertiesThis is the method you use to set up your component and is called the first time you drop the component onto the design surface. Typically, the kinds of things you do in this method are as follows:
ReinitializeMetaDataYou use this method to provide the column-level information for the component. It is called when the Validate method returns VS_NEEDSNEWMETADATA or when the user clicks the Refresh button in the Advanced UI. When initially called, this method adds all the columns and column information. Upon subsequent calls, this method is where column metadata can be fixed if corrupted. ValidateYou use this method to verify the correctness of the column metadata and other component settings such as connection availability. It is called repeatedly during package design, and once right before the PrimeOutput/ProcessInput calls. You should never modify the column or other component metadata during this call. During validation, you should verify the following:
If validation succeeds, the component should return DTSValidationStatus.VS_ISVALID. If validation fails, the component should raise appropriate errors and warnings to alert the user to the problems and then return one of the following DTSValidationStatus values.
Note If the DelayValidation property of the Data Flow Task is set to TRUE, the designer will not call Validate on the component. Validate is only called during package execution. AcquireConnections and ReleaseConnectionsThese methods are called for every major component operation and establish and release connections. If the component uses connection managers, these methods must be implemented. If not, they are not needed and can be ignored. RegisterEventsIf your component fires any custom events, you should register them with this method. It performs the same function as the EventInfos do for custom tasks. In fact, when you register events using the RegisterEvents method, the Data Flow Task creates a corresponding EventInfos entry for the event at the task level. RegisterLogEntriesIf your component logs custom log entries, you should register them with this method. It performs the same function as the LogEntryInfos does for custom tasks. Like the preceding RegisterEvents method, this method generates a new LogEntryInfo at the Data Flow Task level. PerformUpgradeThis method is only useful when you release a new version of the component. It allows a newer version of a component to update an older version of the same component. If you release a component, and then subsequently want to add a property or output or any other change for that matter, you'll need to implement this method on the component so that it can replace previous versions seamlessly. |