473,395 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Define event in interface

Anyone have an example of defining a custom event (i.e custom delegate) in an
interface?
--
Anthony Yott
Nov 23 '05 #1
1 3698
you cant define delegates in interface as delegate is it self a type which is
not permitted in interface.You must declare the delegate out side interface.
This is in context of C# here u must provided delegate with the event
declaration.

public delegate void Y();
interface i{
event Y ev;
}

Vb.net allows you to define event in interface as the event declaration in
vb.net doesnot requires delegate.

Regards
Shahzad

"Anthony Yott" wrote:
Anyone have an example of defining a custom event (i.e custom delegate) in an
interface?
--
Anthony Yott

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Maneesh | last post by:
Maneesh Jun 2, 6:27 pm show options Newsgroups: comp.lang.java.programmer From: "Maneesh" <mmano...@gmail.com> - Find messages by this author Date: 2 Jun 2005 05:57:46 -0700 Local:...
3
by: Ohad Young | last post by:
Hi, I have an interface with an event. I'd like to explicitly implement the interface by a certain class. However, I received the following error: "An explicit interface implementation of an...
2
by: Alex Sedow | last post by:
Why interface-event-declaration does not support multiple declarators like event-declaration? Grammar from C# spec: variable-declarators: variable-declarator variable-declarators ","...
2
by: Nicola Garone | last post by:
Hi all I'm using VB.net. I need to define an object of type iShellFolder (since I have to call ShGetDesktopfolder API in Shell32.dll). I've created interop.Shell32.dll adding a reference to...
6
by: Charles Law | last post by:
I have a class, which implements an interface. Let's say, that the interface looks something like Public Interface IEventSinks Sub ValueChanged(sender As Object, e As ValueChangedEventArgs) Sub...
1
by: sundog2000 | last post by:
I am writing my first VB.net program and I am struggling to figure out how to attach an event to a method, when the event is part of an interface that the class implements. I have declared a...
5
by: han zhiyang | last post by:
Hi. I tried to design a custom web control which can flexibly and dynamicly let the control user ,for example the web page developer, customize its layout codes.This control derives from...
3
by: pratham | last post by:
Hi, I was seeing code of PetShop 2.0 and find is quite .. differnet design and architecture .. too much of clutter in classes .. order class using and Iorder and Iorder using an orderInfo and...
2
by: erbilkonuk | last post by:
Hi, I am very new to .NET Remoting and I try to run a simple program to subscribe to an event raised by Remoting Class. The Remoting Server initiates an instance of Remoting Class as Singleton /...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.