這是一個非常基本的問題。get set property as a bool [] return
void Output(int output);
- >此使得一個單一輸出
bool[] Outputs { get; set; }
- >這使得多個輸出。我需要實施這個。這是一個聲明爲接口的API。
在我的課程中,我需要使用它。
我研究了這個http://msdn.microsoft.com/en-us/library/87d83y5b%28VS.80%29.aspx ...但沒有我得到和設置返回一個布爾數組的引用。
在上述連桿中,類是:
接口IPOINT { //屬性簽名: INT X { GET; 集; } int y { get; 集; }}
class Point : IPoint
{
// Fields:
private int _x;
private int _y;
// Constructor:
public Point(int x, int y)
{
_x = x;
_y = y;
}
// Property implementation:
public int x
{
get
{
return _x;
}
set
{
_x = value;
}
}
public int y
{
get
{
return _y;
}
set
{
_y = value;
}
}
}
這將是在我的案件類的聲明?
感謝您的答覆Vinay。 public interface myInterface bool [] Outputs {get;組; } void Output(int output); } class myClass:Form - >這裏我需要使用myInterface。 但myClass繼承了Form。那麼這裏會是什麼情況? ? – SLp 2010-08-16 10:41:16
您可以從一個類和多個接口繼承。所以只需在表單之後添加命令和接口名稱即可。 (myClass:Form,IMyInterface) – VinayC 2010-08-16 11:18:03