|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
TItem, TData, etc? GenericsHow do I declare an object to accept a TItem?
Also where is the documentation on TItem/TData/etc? Here's the object: Public Class DataEventArgs(Of TData) Inherits EventArgs Private innerData As TData Here's the delgate which I want to pass a TItem Public Delegate Sub EventListener(ByVal Sender As Object, ByVal e As DataEventArgs(Of TItem)) <-- TItem doesn't work.
Show quote
Hide quote
"Spam Catcher" <spamhoneypot@rogers.com> schrieb: This does not work because 'TItem' does not seem to be a generic type > How do I declare an object to accept a TItem? > > Also where is the documentation on TItem/TData/etc? > > > Here's the object: > > Public Class DataEventArgs(Of TData) > Inherits EventArgs > > Private innerData As TData > > Here's the delgate which I want to pass a TItem > > Public Delegate Sub EventListener(ByVal Sender As Object, ByVal e As > DataEventArgs(Of TItem)) <-- TItem doesn't work. parameter of 'DataEventArgs(Of TData)'. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/> "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in Hi, news:Om9NxhFBHHA.204@TK2MSFTNGP04.phx.gbl: > This does not work because 'TItem' does not seem to be a generic type > parameter of 'DataEventArgs(Of TData)'. I solved the issue - I had the syntax wrong in using generics. Thanks :) Spam,
> Public Delegate Sub EventListener(ByVal Sender As Object, ByVal e As Depending on where you are trying to define EventListener you may need to > DataEventArgs(Of TItem)) <-- TItem doesn't work. make the Delegate itself generic: Public Delegate Sub EventListener(Of TItem)(ByVal sender As Object, ByVal e As DataEventArgs(Of TItem)) Although I normally use EventHandler(Of T) then pass DataEventArgs(Of TItem) as T. Public Event Something As EventHandler(Of DataEventArgs(Of Whatever)) -- Show quoteHide quoteHope this helps Jay B. Harlow ..NET Application Architect, Enthusiast, & Evangelist T.S. Bradley - http://www.tsbradley.net "Spam Catcher" <spamhoneypot@rogers.com> wrote in message news:Xns9876B4BCEE98Dusenethoneypotrogers@127.0.0.1... > How do I declare an object to accept a TItem? > > Also where is the documentation on TItem/TData/etc? > > > Here's the object: > > Public Class DataEventArgs(Of TData) > Inherits EventArgs > > Private innerData As TData > > Here's the delgate which I want to pass a TItem > > Public Delegate Sub EventListener(ByVal Sender As Object, ByVal e As > DataEventArgs(Of TItem)) <-- TItem doesn't work.
VB Controls In VB2005
difference between dataAdapter.InsertCommand/dataAdapter.SelectCom Get the value of a cell when row changes in DataGridView Has anyone managed to send email using the smtp localhost? how to create var with same name but another index? Newbie: Event with Control Array accessing data from a class event in a form remove xml file root tag Using variable names to change labels add xml validation schema in the xml file |
|||||||||||||||||||||||