Closed GoogleCodeExporter closed 9 years ago
NXTBrick has nothing to do with UI, so why should we reference
Systen.Windows.Forms from it (for PaddingConverter) ?
What about:
1) Do all the UI related code in your application?
2) If you need to extend something in NXTBrick, but you don't want to modify
its source, then what about Extension Methods ???:
http://msdn.microsoft.com/en-us/library/bb383977.aspx
(just trying to understand the use case ... don't want to mess the library with
something, which is very user specific)
Original comment by andrew.k...@gmail.com
on 8 Apr 2011 at 8:49
I've got me wrong. I will try to explain the problem in greater detail. And I
think you don't need to reference SWF. Please check this scenario: Say you got
an application (Forms) and you need to update motor state using PropertyGrid
control control. Say application's user enter or selects needed settings and
applyies them to the NXTbrick. So you create something like MyNXTBrickSettings
and add a MotorA property of type NXTBrick.MotorState to it. Than you
instantiate (probably in form's Load event or similar) your settings class and
then assign it to propertyGrid's SelectedObject property to allow user access
it. This would be fine but property grid doesn't allow to expand on struct
properites. Please refer to ExpandableObjectConverter class. There are some
workarounds like an proxy class (ugly and needs a lot of work - can send a
sample). The simplest solution is not use struct for NXBrick.*State types. Is
it possible?
Original comment by krzysztof.blacha
on 8 Apr 2011 at 9:12
Turned NXT structures into classes and provided properties for them (many of
them are read-only since those are supposed to be set by framework, not by
user).
Committed in revision 1415. Will be released in version 2.1.6.
Original comment by andrew.k...@gmail.com
on 11 Apr 2011 at 8:14
Great to see your message but have one question should really SensorType and
SensorMode be readonly? And of course if I understand correctly those are
breaking changes because previously all setters were available (struct)?
Original comment by krzysztof.blacha
on 11 Apr 2011 at 9:43
The SensorValue class is used only in one method: GetSensorValue( Sensor
sensor, out SensorValues sensorValues ). So it is OK. Sensor mode/type is set
using different method SetSensorMode(), not using class.
Yep, it may break a bit. But users should not be using those structures in such
scenarios when they set fields there.
Original comment by andrew.k...@gmail.com
on 12 Apr 2011 at 8:16
Original comment by andrew.k...@gmail.com
on 28 Jul 2011 at 9:45
Original comment by andrew.k...@gmail.com
on 3 Aug 2011 at 7:52
Original issue reported on code.google.com by
krzysztof.blacha
on 29 Mar 2011 at 3:19