spattewar


Hi,

One of my plan is to develop a custom task compoent to log the errors into the destination provided as paramter to the component. Now how can I restrict the use of this component in the event handler tab only. can something like this be done

Also extending this a little further, is the below thing possible

The custom component should expose custom properties which should allow the user to add the destinations for logging the errors. It will be a predefined list (window event log, text file, sql table etc) and the user will be allowed to check what all he/she wants. Then if the user has selected sql table then ask for the oledb connection and the table name, if text file is selected the ask for the path of the file.

Apology if I am asking too many questions around the same thing (error handling). There may be a better way to acheive what I am trying to acheive but then I have no idea about it. Your guidance will be of great help.

Again, Thanks a lot for helping this extra curious guy who wants to try and develope generalized compoenents if possible.

Regards,

$wapnil




Re: How to restrict a custom component to be used only in the event handler tab?

spattewar


someone....please help!

Thanks

$wapnil






Re: How to restrict a custom component to be used only in the event handler tab?

DarrenSQLIS

You wish to enforce a restriction that your task is only used inside an event handler, not in the main control flow or other containers I don't thinks this can be done effectively, as certainly at runtime you cannot get access to the package to examine the parent container. If you could then Validate would be the place to check this, and at that point it certainly has no access to the parent.

Creating properties should be simple enough and offering drop-downs is just your choice of UI technology, either a custom form, or writing some UITypeEditor controls that would be used in the default VS property grid, or both. I don't think I could adequately describe it in a post though, it is quite a wide ranging topic. If you follow the samples for writing a custom UI it should become apparent. If you have specific issues, then post back.







Re: How to restrict a custom component to be used only in the event handler tab?

spattewar

Thanks Darren,

Is there any help available for the creating UITypeEditor controls

Regards,

$wapnil





Re: How to restrict a custom component to be used only in the event handler tab?

DarrenSQLIS

UITypeEditor and usage is fully documented as part of the .Net framework. Even if you have not installed the .Net help, the MSDN site has it all for free.

You should read up on the PropertyGrid control and see what options you have. A TypeConverter may do. Try these to start with

http://msdn2.microsoft.com/en-us/library/aa302326.aspx

http://msdn2.microsoft.com/en-us/library/ayybcxe5(VS.71).aspx

http://msdn2.microsoft.com/en-us/library/53c49eck(VS.71).aspx






Re: How to restrict a custom component to be used only in the event handler tab?

spattewar

This is really very helpful.

Thanks again.

$wapnil





Re: How to restrict a custom component to be used only in the event handler tab?

Kristian Wedberg

> One of my plan is to develop a custom task compoent to log the errors into the destination provided as paramter to the component. Now how can I restrict the use of this component in the event handler tab only. can something like this be done

You only need to be a little bit sneaky to do this... There are three system variables that only appear in event handlers: System::SourceDescription, System::SourceID and System::SourceName. Simply test if one of these exists in Validate() and error if it isn't.

Cheers/Kristian