Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/284.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/design-patterns/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
降级C#6代码_C#_C# 6.0 - Fatal编程技术网

降级C#6代码

降级C#6代码,c#,c#-6.0,C#,C# 6.0,我有下面一行代码 ListBox ListBox => this.AssociatedObject; 而且=>给了我一个错误,因为我没有C#6。我想知道这段代码在C#6之前是如何实现的 如果能知道=>操作符的术语,我也会很高兴,我不知道该用谷歌搜索什么 提前感谢。这是只读属性的写入方式,因此您可以在早期版本中执行此操作: ListBox ListBox { get { return this.AssociatedObject; } } 这是写入只读属性的方式,因此您可以在早期版本中执行

我有下面一行代码

ListBox ListBox => this.AssociatedObject;
而且
=>
给了我一个错误,因为我没有C#6。我想知道这段代码在C#6之前是如何实现的

如果能知道
=>
操作符的术语,我也会很高兴,我不知道该用谷歌搜索什么


提前感谢。

这是只读属性的写入方式,因此您可以在早期版本中执行此操作:

ListBox ListBox { get { return this.AssociatedObject; } }

这是写入只读属性的方式,因此您可以在早期版本中执行此操作:

ListBox ListBox { get { return this.AssociatedObject; } }

在这种情况下,
=>
的术语被称为“表达式体”@CameronAavik当你不知道要搜索什么关键字时,你很难自己找出答案。谢谢。在这种情况下,
=>
的术语被称为“表达式体”@CameronAavik当你不知道要搜索什么关键字时,你很难自己找到答案。谢谢。