public override void ProvideComponentProperties() { base.ProvideComponentProperties(); // Add properties and set the default value; base.ComponentMetaData.OutputCollection.RemoveAll(); // - filename IDTSCustomProperty90 filenameProperty = base.ComponentMetaData.CustomPropertyCollection.New(); filenameProperty.Name = Const_FileName_AttributeName; filenameProperty.State = DTSPersistState.PS_PERSISTASCDATA; filenameProperty.UITypeEditor = "System.Windows.Forms.Design.FileNameEditor, System.Design, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; filenameProperty.Value = ""; // - Xml Root Tag IDTSCustomProperty90 xmlRootProperty = base.ComponentMetaData.CustomPropertyCollection.New(); xmlRootProperty.Name = Const_XmlRootTag_AttributeName; xmlRootProperty.State = DTSPersistState.PS_PERSISTASCDATA; xmlRootProperty.Value = "XmlDestination"; // - Xml Row Tag IDTSCustomProperty90 xmlRowProperty = base.ComponentMetaData.CustomPropertyCollection.New(); xmlRowProperty.Name = Const_XmlRowTag_AttributeName; xmlRowProperty.State = DTSPersistState.PS_PERSISTASCDATA; xmlRowProperty.Value = "DataRow"; // - Do we output number of rows into the Xml file IDTSCustomProperty90 xmlDoOutputNbOfRows = base.ComponentMetaData.CustomPropertyCollection.New(); xmlDoOutputNbOfRows.Name = Const_OutputNbOfRows_AttributeName; xmlDoOutputNbOfRows.State = DTSPersistState.PS_PERSISTASCDATA; xmlDoOutputNbOfRows.Value = true; // - Xml Nummber of Row Tag IDTSCustomProperty90 xmlNbRowProperty = base.ComponentMetaData.CustomPropertyCollection.New(); xmlNbRowProperty.Name = Const_XmlNbOfRowsTag_AttributeName; xmlNbRowProperty.State = DTSPersistState.PS_PERSISTASCDATA; xmlNbRowProperty.Value = "NumberOfRows"; }
"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe" /u $(TargetName) "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe" /i $(TargetPath) copy $(TargetPath) "C:\Program Files\Microsoft SQL Server\90\DTS\PipelineComponents"
public override DTSValidationStatus Validate() { bool cancel = false; this.FileName = this.ComponentMetaData.CustomPropertyCollection[Const_FileName_AttributeName].Value.ToString(); ; this.Xml_RootTag = (string)this.ComponentMetaData.CustomPropertyCollection[Const_XmlRootTag_AttributeName].Value; this.Xml_RowTag = (string)this.ComponentMetaData.CustomPropertyCollection[Const_XmlRowTag_AttributeName].Value; this.DoOutputNumberOfRows = (bool)this.ComponentMetaData.CustomPropertyCollection[Const_OutputNbOfRows_AttributeName].Value; this.Xml_NbOfRowsTag = (string)this.ComponentMetaData.CustomPropertyCollection[Const_XmlNbOfRowsTag_AttributeName].Value; DTSValidationStatus status = base.Validate(); if( status == DTSValidationStatus.VS_ISVALID) { if (this.FileName.Length == 0) { this.ComponentMetaData.FireError(0,ComponentMetaData.Name,Resource.FilenameNotSet,string.Empty,0,out cancel); return DTSValidationStatus.VS_ISBROKEN; } if (this.Xml_RootTag.Length == 0) { this.ComponentMetaData.FireError(0, ComponentMetaData.Name, Resource.XmlRootTagNotSet, string.Empty, 0, out cancel); return DTSValidationStatus.VS_ISBROKEN; } if (this.Xml_RowTag.Length == 0) { this.ComponentMetaData.FireError(0, ComponentMetaData.Name, Resource.XmlRowTagNotSet, string.Empty, 0, out cancel); return DTSValidationStatus.VS_ISBROKEN; } if (this.Xml_NbOfRowsTag.Length == 0) { this.ComponentMetaData.FireError(0, ComponentMetaData.Name, Resource.XmlNbRowsTagNotSet, string.Empty, 0, out cancel); return DTSValidationStatus.VS_ISBROKEN; } } return DTSValidationStatus.VS_ISVALID; }
void FireError ( int ErrorCode, /* code erreur propre notre composant */ string SubComponent, /* nom du composant qui lve lerreur */ string Description, /* Une description afficher */ string HelpFile, int HelpContext, ref bool pbCancel /* Spcifie si ldition du composant est annule */