问题描述
_accelerometer.ReadingChanged + = new TypedEventHandler< Accelerometer,AccelerometerReadingChangedEventArgs>(ReadingChanged);
_accelerometer.ReadingChanged += new TypedEventHandler<Accelerometer, AccelerometerReadingChangedEventArgs>(ReadingChanged);
我需要对这段代码进行解释(特别是+ =部分代码) )。
我是C#的新手,所以如果有任何我应该阅读的内容,请尽可能提供链接,但更理想的解释。
我确实知道C和C ++,但这似乎没什么用处。
I need an explanation for this piece of code (especially the += part of it).
I'm new to C# so if there is any thing that I should read up please provide links if possible but an explanation would be more desirable.
I do have knowledge of C and C++ but that doesn't seem to be of much use here.
_accelerometer是Accelerometer的一个对象
该代码应该是"//订阅加速度计ReadingChanged事件。"但是我想知道这是怎么发生的。
谢谢
_accelerometer is an object of Accelerometer
The code is supposed "// Subscribe to accelerometer ReadingChanged events." but I'd like to know how that happens exactly.
Thanks
推荐答案
事件是一种代理
这篇关于需要解释一段代码。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!