获取 set 属性作为 bool[] 返回
这是一个非常基本的问题。
void Output(int output);
->这会启用一个输出
bool[] Outputs { get;放; }
->这可以实现多重输出。我需要这个的实施。这是一个声明为接口的 API。
在我的课堂上我需要使用它。
我研究了这个http://msdn.microsoft.com /en-us/library/87d83y5b%28VS.80%29.aspx...但是我没有在哪里获得获取和设置返回布尔数组的参考。
在上面的链接中,类为:
interface IPoint { // 属性签名: 整数x { 得到; 放; } 整数 { 得到; 放; } ?
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;
}
}
}
在我的例子中,类声明是什么
This is a very basic question.
void Output(int output);
-> this enables one single output
bool[] Outputs { get; set; }
-> This enables multiple output. I need the implementation of this. This is an API declared as a interface.
In my class I need to use it.
i studied this http://msdn.microsoft.com/en-us/library/87d83y5b%28VS.80%29.aspx... but no where I got reference to get and set returning a bool array.
In the above link, the class is as:
interface IPoint
{
// Property signatures:
int x
{
get;
set;
}
int y
{
get;
set;
}
}
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;
}
}
}
what will be the class declaration in my case ??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
将创建一个名为“Outputs”的属性,返回 bool 数组。这是一个快捷语法,如果您想使用更长的语法,那么它会像这样
will create a property named "Outputs" returning bool array. This is a shortcut syntax, if you wish to use longer syntax then it would go some thing like
它与 MSDN 上的示例相同,但将“
int
”替换为“bool[]
”。It's the same as the sample on MSDN, but replace "
int
" with "bool[]
".这是一个示例实现:
Here's a sample implementation: