.NET中是否存在与UI无关的Point结构? [英] Is there UI-independent Point struct in .NET?
问题描述
我知道.NET中的几个 Point
结构: System.Drawing.Point
, System.Windows.Point
, Sys.UI.Point
,但它们全都位于高级UI库(GDI +,WPF,AJAX)中.我需要一个 Point
结构用于我的类库中的计算,我不想将其绑定到任何特定的UI技术..NET中是否有任何独立于UI的 Point
结构?还是我需要自己创建它?我知道那很简单,但听起来像是在重新发明轮子.
I know several Point
structs in .NET: System.Drawing.Point
, System.Windows.Point
, Sys.UI.Point
, but all of them are in high-level UI libraries (GDI+, WPF, AJAX). I need a Point
struct for calculations in my class library which I don't want to tie to any specific UI technology. Is there any UI-independent Point
struct in .NET? Or I will need to create it myself? That is simple, I know, but sounds like reinventing the wheel.
推荐答案
重新发明轮子.它将运行得更顺畅!真的,如果只是一个很小的结构,为什么要依赖大型程序集,还要引入很多其他东西呢?尤其是在诸如电话之类的约束设备上……但是,如果要获得最佳性能,请注意如何正确使用类和结构.
Reinvent the wheel. It will run smoother! Really, if it's just a tiny struct why depend on big assemblies, pulling in a lot of other stuff? Especially on constraint devices like phones... But pay attention on how to use classes and struct correctly if you want best performance.
This is a pretty good read and I sense that you want to read it dearly: Frank Savage on CLR performance.
这篇关于.NET中是否存在与UI无关的Point结构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!