473,466 Members | 1,406 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Interface C#, 2.0

Noob question here.
I'm creating an interface with various properties, but I also want it
to include a <listof a particular object. What is the correct syntax
to do this in an interface? Thanks.

Jan 18 '07 #1
5 2511
rh******@gmail.com wrote:
I'm creating an interface with various properties, but I also want it
to include a <listof a particular object. What is the correct syntax
to do this in an interface?
An interface can only contain abstract methods and properties
not any implementation (and a field is implementation).

Arne
Jan 18 '07 #2
So I would just leave it until I create the specific class?
Arne Vajhøj wrote:
rh******@gmail.com wrote:
I'm creating an interface with various properties, but I also want it
to include a <listof a particular object. What is the correct syntax
to do this in an interface?

An interface can only contain abstract methods and properties
not any implementation (and a field is implementation).

Arne
Jan 18 '07 #3
rh******@gmail.com wrote:
Arne Vajhøj wrote:
>rh******@gmail.com wrote:
>>I'm creating an interface with various properties, but I also want it
to include a <listof a particular object. What is the correct syntax
to do this in an interface?
An interface can only contain abstract methods and properties
not any implementation (and a field is implementation).
So I would just leave it until I create the specific class?
Or use an abstract base class instead of an interface.

Arne
Jan 18 '07 #4
rh******@gmail.com wrote:
Noob question here.
I'm creating an interface with various properties, but I also want it
to include a <listof a particular object. What is the correct syntax
to do this in an interface? Thanks.
I'd advise you to write a property:

interface Foo
{
List<ParticularObjectMyList { get; }
}

-- Barry

--
http://barrkel.blogspot.com/
Jan 18 '07 #5
Barry Kelly ha scritto:
I'd advise you to write a property:
+1

Regards,
Giulio - Italy

--
Jan 18 '07 #6

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

Similar topics

4
by: Roy Pereira | last post by:
I have an application that is composed of a set of "Content" dlls and a viewer application. The viewer calls a standard set of functions that are present in all the dlls. I maintain this by...
9
by: Anon Email | last post by:
Hi people, I'm learning about header files in C++. The following is code from Bartosz Milewski: // Code const int maxStack = 16; class IStack
4
by: Doug | last post by:
I am working on an existing .NET (C Sharp) component that had a com interface that was used by a VB component. When it was originally written, it had the SSEAssemblyCom class below - minus the two...
3
by: zlst | last post by:
Many technological innovations rely upon User Interface Design to elevate their technical complexity to a usable product. Technology alone may not win user acceptance and subsequent marketability....
6
by: Alex Sedow | last post by:
Example 1 interface I { string ToString(); } public class C : I { public void f() {
20
by: Ole Hanson | last post by:
I am accessing my database through an interface, to allow future substitution of the physical datastore - hence I would like to declare in my Interface that my DAL-objects implementing the...
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 ","...
0
by: YellowFin Announcements | last post by:
Introduction Usability and relevance have been identified as the major factors preventing mass adoption of Business Intelligence applications. What we have today are traditional BI tools that...
15
by: Xah Lee | last post by:
On Java's Interface Xah Lee, 20050223 In Java the language, there's this a keyword “interface”. In a functional language, a function can be specified by its name and parameter specs....
8
by: rn5a | last post by:
Suppose I have the following class code: Imports System Imports System.Data Imports System.Data.SqlClient Public Class DBSettings Private sqlCmd As SqlCommand Private sqlConn As...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.