interface and enum

T

Torben Madsen

I need a intereface so that i get the same structure in several arrays that
i create. I think that i need to use enum in a interface. Abstract classes
don't do the job as i need to inherit from several interfaces.
This doesn't Work.
Any ideas?

using System;
namespace well_test
{
public interface IMeassurement
{
public enum index
{
Timestamp, //= 0;
WellNo, //= 1;
WellTHP, //= 2;
WellTHT, //= 3;
WellBHP, //= 4;
WellBHT, //= 5;
SepPressure, //= 6;
SepTemp, //= 7;
SepOilLev, //= 8;
SepWaterlev, //= 9;
SepGasFlow, //= 10;
SepOilFlow, //= 11;
SepWaterFlow, //= 12;
SepOilDensity, //= 13;
WellChokePos, //= 14;
EntryStatus //= 15;
};
...........
......

Torben
 
R

Richard A. Lowe

You define the enum outside the interface, but compile it in the same
assembly (project). Then you can declare a property member of your
interface as having that enum's type:

// this might not compile as-is but you get the picture
public enum Values
{
One,Two,Three
}

public interface IFace
{
Values { get;set}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top