|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to overload method of third party component?I have this sub, which is part of a third party component:
Private Sub Uploader1_OnProcessCompleted(ByVal sender As Object, ByVal e As System.EventArgs) Handles Uploader1.OnProcessCompleted --do something End Sub I need to pass in another parameter. I do have access to their source code but only need the modification for one app. In other words, I don't want to create a new parameter that must be used by all apps. I just need to overload for this one app. How is that done? Thanks, Brett Hi Brett,
You can't pass another parameter to that because it's an event handler. You could override the function which fires the event and change the event it fires, but this will likely break a lot of code. Where do you get the parameter from? There's probably another way to do what you require. Regards, -Adam. Brett wrote: Show quoteHide quote > I have this sub, which is part of a third party component: > > Private Sub Uploader1_OnProcessCompleted(ByVal sender As Object, ByVal e As > System.EventArgs) Handles Uploader1.OnProcessCompleted > > --do something > > End Sub > > I need to pass in another parameter. I do have access to their source code > but only need the modification for one app. In other words, I don't want to > create a new parameter that must be used by all apps. I just need to > overload for this one app. How is that done? > > Thanks, > Brett > > The process starts in a button click event.
SubmitForm(me.mcsomeclass) The above sub is where the parameter comes from. In that sub, I do this: Private Sub SubmitForm(ByVal mailClientRef As IWebmailclients.Iwebmail) Me.Uploader1.url = mailClientRef.LoginFormURL The Uploader1 component has an onComplete event: Private Sub Uploader1_OnStatusChanged(ByVal sender As System.Object, ByVal e As X5.IUploaderEvents_OnStatusChangedEvent) The above is where I need to pass in the Interface that was passed to SubmitForm(). Thanks, Brett Show quoteHide quote "Adam Goossens" <adam.gooss***@gmail.com> wrote in message news:efUKUhkQFHA.1500@TK2MSFTNGP09.phx.gbl... > Hi Brett, > > You can't pass another parameter to that because it's an event handler. > You could override the function which fires the event and change the event > it fires, but this will likely break a lot of code. > > Where do you get the parameter from? There's probably another way to do > what you require. > > Regards, > -Adam. > > Brett wrote: >> I have this sub, which is part of a third party component: >> >> Private Sub Uploader1_OnProcessCompleted(ByVal sender As Object, ByVal e >> As System.EventArgs) Handles Uploader1.OnProcessCompleted >> >> --do something >> >> End Sub >> >> I need to pass in another parameter. I do have access to their source >> code but only need the modification for one app. In other words, I don't >> want to create a new parameter that must be used by all apps. I just >> need to overload for this one app. How is that done? >> >> Thanks, >> Brett Brett,
When it is not yet there you can set it in that code as a complete new method with the same name. That is named an overloaded method. I hope this helps, Cor "Cor Ligthert" <notmyfirstn***@planet.nl> wrote in message What do you mean here? Can you show an example?news:e5Z9mtlQFHA.3544@TK2MSFTNGP12.phx.gbl... > Brett, > > When it is not yet there you can set it in that code as a complete new > method with the same name. Show quoteHide quote > > That is named an overloaded method. > > I hope this helps, > > Cor >
Why use a module instead of class?
An absence of IntelliSense in this situation Making trial version creating an array as property of a class Question about Namespaces and the Object Browser. Creating a custom log Hierarchal recordset Passing parameters to Data Adapter Adding a blank row to a datatable transparancy in vb.net |
|||||||||||||||||||||||